Posted on

Serial LED blinking using Arduino

Serial LED blinking using Arduino also known as LED chaser circuit is discussed here. This project is made for getting basic ideas on Arduino programing and its applications. At the starting of any project on Arduino, beginners can easily understand the exact requirements to make a project on Arduino. Coding is the important part to blink an LED. Here, five LEDs are used to make a serial blinking LED project. We can easily make a time delay in the program by which LEDs can automatically turn on and off. We have used a loop to turn LEDs on and off. This project can be used for decoration purposes. Full program and others details of hardware are described below.

Required Components

  1. Arduino UNO.
  2. 5 LED s (Try to use different color LEDs).
  3. Connecting wires (Male to Male wires).
  4. Breadboard.
  5. Arduino IDE for programming.

It is always better to verify the schematic by some simulation software to avoid damage of components. This project is also verified by Proteus simulation software. The schematic of the Serial LED blinking using Arduino is shown in Figure 1. Here it can be seen that positive terminals of the LEDs are connected to the Arduino and negative terminals of the LEDs are connected to the common ground point.

LED Chaser Circuit
Figure 1: Proteus schematic of the serial LED blinking project.

Descriptions

The positive pins of LED s are connected with digital pins 0, 1,2,3,4 and negative pins of all LEDs are grounded. We have used a breadboard for connecting LEDs. All negative pins are commonly grounded as it is shown at the left corner in Figure 2. The connectivity of the LEDs is as follows

  1. From left to Right, Green wire is connected between digital pin 0 of the Arduino and the positive terminal of the leftmost LED.
  2. Yellow connector is connected with the second LED. The other terminal of the yellow cable is connected to digital pin 1 of the Arduino.
  3. Similarly, other LEDs are connected to digital pins 2, 3 and 4 of the Arduino board as shown in Figure 3.
Figure 2: Bread Board Connection
Figure 3: The connection of the Arduino Board.

Conclusion

This type of project is helpful for DIY decorating ideas. It can be used as an animated panel board, floating displays, etc. This project should help beginners to make an idea about the Arduino programming.

Code for Serial LED blinking using Arduino

int led1 = 0;
int led2 = 1;
int led3 = 2;
int led4 = 3;
int led5 = 4;

// the setup routine runs once when you press reset:

void setup() {                
  
// initialize the digital pin as an output.

  pinMode(led1, OUTPUT);   
  pinMode(led2, OUTPUT);  
  pinMode(led3, OUTPUT);    
  pinMode(led4, OUTPUT);
  pinMode(led5, OUTPUT);
}

// the loop routine runs over and over again forever:

void loop() {
  
  digitalWrite(led1, HIGH);     // turn the LED on (HIGH is the voltage level)
  delay(100);                              // wait for a 1second
  digitalWrite(led1, LOW);    // turn the LED off by making the voltage LOW
  digitalWrite(led2, HIGH);    // turn the LED on (HIGH is the voltage level)
  delay(100);                               // wait for a 1second
  digitalWrite(led2, LOW);      // turn the LED off by making the voltage LOW
  digitalWrite(led3, HIGH);       // turn the LED on (HIGH is the voltage level)
  delay(100);                               // wait for a 1second
  digitalWrite(led3, LOW);       // turn the LED off by making the voltage LOW
  digitalWrite(led4, HIGH);      // turn the LED on (HIGH is the voltage level)
  delay(100);                               // wait for a 1second
  digitalWrite(led4, LOW);      // turn the LED off by making the voltage LOW
  digitalWrite(led5, HIGH);      // turn the LED on (HIGH is the voltage level)
  delay(100);                                // wait for a 1second
  digitalWrite(led5, LOW);        // turn the LED off by making the voltage LOW
  digitalWrite(led5, HIGH);   // turn the LED on (HIGH is the voltage level)
  delay(100);                          // wait for a 1second 
  digitalWrite(led5, LOW);   // turn the LED off by making the voltage LOW
  digitalWrite(led4, HIGH);  // turn the LED on (HIGH is the voltage level)
  delay(100);                         // wait for a 1second
  digitalWrite(led4, LOW);  // turn the LED off by making the voltage LOW
  digitalWrite(led3, HIGH);  // turn the LED on (HIGH is the voltage level)
  delay(100);                          // wait for a 1second
  digitalWrite(led3, LOW);    // turn the LED off by making the voltage LOW
  digitalWrite(led2, HIGH);  // turn the LED on (HIGH is the voltage level)
  delay(100);                    // wait for a 1second 
  digitalWrite(led2, LOW);   // turn the LED off by making the voltage LOW
  digitalWrite(led1, HIGH);  // turn the LED on (HIGH is the voltage level)
  delay(100);                         // wait for a 1second
  digitalWrite(led1, LOW);   // turn the LED off by making the voltage LOW
  digitalWrite(led1, HIGH);     // turn the LED on (HIGH is the voltage level)
  delay(100);                           // wait for a 1second
  digitalWrite(led1, LOW);      // turn the LED off by making the voltage LOW
  digitalWrite(led2, HIGH);     // turn the LED on (HIGH is the voltage level)
  delay(100);                            // wait for a 1second
  digitalWrite(led2, LOW);       // turn the LED off by making the voltage LOW
  digitalWrite(led3, HIGH);      // turn the LED on (HIGH is the voltage level)
  delay(100);                      // wait for a 1second
  digitalWrite(led3, LOW);  // turn the LED off by making the voltage LOW
  delay(100);  // wait for a 1second
  digitalWrite(led5, HIGH);         // turn the LED on (HIGH is voltage level)                            
  delay(100);                             // wait for a 1second
  digitalWrite(led5, LOW);   // turn the LED off by making the voltage LOW
  digitalWrite(led4, HIGH);  // turn the LED on (HIGH is the voltage level)
  delay(100); 			// wait for a 1second
  digitalWrite(led4, LOW); 	// turn the LED off by making the voltage LOW
  digitalWrite(led3, HIGH);  // turn the LED on (HIGH is the voltage level)
  delay(100);			 // wait for a 1second
  digitalWrite(led3, LOW);  // turn the LED off by making the voltage LOW
  delay(100);			 // wait for a 1second
  digitalWrite(led1, HIGH);   // turn the LED on (HIGH is the voltage level)
  digitalWrite(led3, HIGH);  // turn the LED on (HIGH is the voltage level)
  delay(1000);		// wait for a 10second
  digitalWrite(led1, LOW);  // turn the LED off by making the voltage LOW
  digitalWrite(led5, HIGH);   // turn the LED on (HIGH is the voltage level)
  digitalWrite(led3, HIGH);  // turn the LED on (HIGH is the voltage level)
  delay(1000); 		// wait for a 10second

  digitalWrite(led1, HIGH);   // turn the LED on (HIGH is the voltage level)
  digitalWrite(led5, HIGH);  // turn the LED on (HIGH is the voltage level)
  digitalWrite(led1, LOW);  // turn the LED off by making the voltage LOW
  delay(1000);		 // wait for a 10second
  digitalWrite(led2, HIGH);   // turn the LED on (HIGH is the voltage level)
  digitalWrite(led4, HIGH);  // turn the LED on (HIGH is the voltage level)
  delay(1000);			 // wait for a 10second
  }