Decoration Series Using Arduino With LEDs | Arduino Project

Home » Coding » Decoration Series Using Arduino With LEDs | Arduino Project

Introduction

In this Arduino tutorial, we will learn to make a Decoration Series using Arduino Uno R3 with LEDs. In this project, the LEDs of five different colours will blink simultaneously after a particular period of time.

This project can be used for various festivals for decoration purposes like Diwali, Christmas, New year, etc.

The components can be purchased online or from any electronics centre for physical projects.

For the online projects, the TinkerCad website can be used.

 

Supplies

To do this Decoration Series using Arduino with LEDs, we will require the following components:

Components

Circuit Diagram

Decoration Series Using LEDs With Arduino | Arduino Project

Steps To Create Decoration Series Using Arduino with LEDs

Step 1: Gather all the components on the Digital Board or Physical Table.

Step 2: Place all three LEDs on BreadBoard.

Step 3: Connect the Anode part of the LEDs to the Arduino using three coloured wires to pin numbers 12,9,7,4 and 1 of Arduino, respectively.

Step 4: Connect the cathode part of all three LEDs to the grounding of the Arduino Uno using black coloured wire.

Step 5: The circuit is ready, input the source code and switch on the Arduino to run it.

Source Code

void setup()
{
pinMode(12, OUTPUT);
pinMode(9, OUTPUT);
pinMode(7, OUTPUT);
pinMode(4, OUTPUT);
pinMode(1, OUTPUT);
}
void loop()
{
digitalWrite(12, HIGH);
delay(100);
digitalWrite(12, LOW);
digitalWrite(9, HIGH);
delay(100);
digitalWrite(9, LOW);
digitalWrite(7, HIGH);
delay(100);
digitalWrite(7, LOW);
digitalWrite(4, HIGH);
delay(100);
digitalWrite(4, LOW);
digitalWrite(1, HIGH);
delay(100);
digitalWrite(1, LOW);

}

Explanation of the Code

We need to input the code to make the Decoration Series using Arduino with LEDs.

For this, we have used two functions, namely, setup() and loop().

The setup function is used to declare from which LED pin number we are producing the output.

In the loop function, we are producing the output as high for each pin number for some amount of time using the delay function. And thereafter, making it low.

The delay will fix the time period till which the LED will glow. The time is in milliseconds.

Output

We will get the following output on the successful completion of the Decoration Series using Arduino with LEDs project.

Decoration Series Using Arduino

The LEDs will glow as per the delay function, just one after the other.

 

More Arduino Projects>>>

You May Also Like To Create…

0 Comments

Submit a Comment

Your email address will not be published. Required fields are marked *