How to make a sequential led blinking circuit with Arduino Uno (Code Included)

Hello everyone,

Today, we are gonna be making a sequential led blinking circuit with Arduino Uno.
For this you require,
1.Arduino Uno r3
2.Data cable to connect Arduino with laptop or pc
3.5 LEDs (Colour of your choice)
4.1 Breadboard
5.16 male to male jumper wires
6.A 5v power source
7.Arduino IDE Software
Here’s the link to download it: https://www.arduino.cc/en/software: https://www.arduino.cc/en/software

The steps are:
1.Connect the digital GND pin of the Arduino to any of the power rail on the breadboard.
2.Next, connect the LEDs to the breadboard with the Negative (-) legs towards the left as shown in the image below: https://drive.google.com/file/d/1iscc_YgzLpZaxcdm_0SUQ4iIdt0kKOB0/view?usp=sharing
3.Now connect the Negative (-) legs of all the LEDs to the power rail on which you connected the GND pin of Arduino using jumper wires as shown in the image below: https://drive.google.com/file/d/1y81T3ZUDrg9uavvlPACR3rG5CsWOxstV/view?usp=sharing
4.Now connect the 1st LED to pin no.13, 2nd LED to pin 12, 3rd LED to pin 11, 4th LED to pin 10
and the 5th LED to pin 9 using jumper wires as shown in the video below: https://drive.google.com/file/d/1K0TiNhKACi44sPj49S1pbNBwv3niPB4J/view?usp=sharing
5.Now open the Arduino IDE software on your laptop or pc.
6.Now, you can copy and paste the code under the specified columns:
This is how the code should look:
2021-09-30

This is the code: (above the void setup)

int LED1 = 13;
int LED2 = 12;
int LED3 = 11;
int LED4 = 10;
int LED5 = 9;

Now the code in the void setup() {

pinMode(LED1, OUTPUT);
pinMode(LED2, OUTPUT);
pinMode(LED3, OUTPUT);
pinMode(LED4, OUTPUT);
pinMode(LED5, OUTPUT);
}

Now the code in the void loop() {

digitalWrite(LED1, HIGH);
delay(200);
digitalWrite(LED2, HIGH);
delay(200);
digitalWrite(LED3, HIGH);
delay(200);
digitalWrite(LED4, HIGH);
delay(200);
digitalWrite(LED5, HIGH);
delay(200);
digitalWrite(LED5, LOW);
delay(300);
digitalWrite(LED4, LOW);
delay(300);
digitalWrite(LED3, LOW);
delay(300);
digitalWrite(LED2, LOW);
delay(300);
digitalWrite(LED1, LOW);
delay(300);
}

Remember:

  1. The code is case sensitive
    2.Remember the semicolons ( ; ) after every line of code
    3.Remember the braces ( { } ) after the end of void setup and void loop section.
    4.As shown in the image which displays the code there are some lines written after slashes ( / ), they are not a part of the code.The Arduino doesn’t consider those lines, they are just for clarification.

8.After pasting the code, you can connect the Arduino to your laptop or pc using the cable provided with the Arduino.
9.Now, click the upload button and if have pasted the code correctly, you are not likely to face any errors.
image

10.Now you it on using a 9v battery with a barrel jack adaptor or in this case I have used a 5v 1A adapter.
11.If you have done everything correctly it should work like this:

13 Likes

Very well explained!
Its a great start.
Please also share the difficulties you faced during this project and also possible mistakes/errors.

Why don’t you try making an LED dice using the same setup. I think you have all the required hardware. It will be a grea learning experience. Here’s a link to such a project:

5 Likes

I’ll try for sure.
Thanks for the suggestion!

3 Likes