Multiple LEDs with Different Delays

475 views

Introduction

In recent years, light-emitting diodes (LEDs) have become a popular lighting solution for a wide range of applications. They are efficient, long-lasting, and highly versatile, making them an ideal choice for everything from household lighting to commercial displays. One fascinating use of LEDs is to create patterns with multiple lights, with each LED turning on at a different time delay.

In this article, we will explore the concept of “Multiple LEDs With Different Delays” and its potential applications

Light-Emitting-Diode-LED
Light-Emitting-Diode-LED

Hardware Components

You’ll need the following hardware components to get started:

ComponentsValueQty
Arduino UNO1
USB Cable Type A to B1
DC Power for Arduino1
LED3
Resistor220ΩΩ1
Breadboard1
Jumper Wires1

LED-Pinout

LED-Pinout
LED-Pinout

LEDs Circuit

Make connections according to the circuit diagram given below.

Multiple LEDs With Different Delays With Arduino Circuit
Multiple LEDs With Different Delays With Arduino Circuit

Wiring / Connections

ArduinoLEDS
GNDGND
D9BLUE LED +
D10GREEN LED +
D11RED LED +

Installing Arduino IDE

First, you need to install Arduino IDE Software from its official website Arduino. Here is a simple step-by-step guide on “How to install Arduino IDE“.

Code

Now copy the following code and upload it to Arduino IDE Software.

#define Blink_LED_1 11
#define Blink_LED_2 10
#define Blink_LED_3 9
void setup()
{
  Serial.begin(9600);
  pinMode(Blink_LED_1, OUTPUT);
  pinMode(Blink_LED_2, OUTPUT);
  pinMode(Blink_LED_3, OUTPUT);

}

void loop()
{
  digitalWrite(Blink_LED_1, HIGH);
  digitalWrite(Blink_LED_2, LOW);
  digitalWrite(Blink_LED_3, LOW);
  Serial.println("LED_1 ON");
  delay(3000);
  digitalWrite(Blink_LED_1, LOW);
  digitalWrite(Blink_LED_2, HIGH);
  digitalWrite(Blink_LED_3, LOW);
  Serial.println("LED_2 ON");
  delay(2000);
  digitalWrite(Blink_LED_1, LOW);
  digitalWrite(Blink_LED_2, LOW);
  digitalWrite(Blink_LED_3, HIGH);
  Serial.println("LED_3 ON");
  delay(1000);
}

Code Explanation

This is an Arduino code that defines the pins for three LEDs (Blink_LED_1, Blink_LED_2, and Blink_LED_3) and sets them as outputs in the setup function. In the loop function, the code turns on one LED at a time and prints a message to the serial monitor indicating which LED is currently on. The delay function is used to specify the amount of time each LED remains on before turning off and moving to the next LED. The first LED (Blink_LED_1) is turned on for three seconds, then turned off and the second LED (Blink_LED_2) is turned on for two seconds. Finally, the third LED (Blink_LED_3) is turned on for one second before the cycle repeats itself. The code creates a blinking pattern with the three LEDs that changes every few seconds, which can be useful in a wide range of applications, such as lighting displays or warning signals.

Applications

  • Mood lighting: Multiple LEDs with different delays can create a unique and calming ambiance in a room.
  • Signaling: LEDs with different delay intervals can be used to create a signaling system for different purposes.
  • Animation: LEDs with different delays can be used to create simple animations, such as a moving dot or a bouncing ball.
  • Educational tool: Multiple LEDs with different delays can be used as an educational tool to teach about time, intervals, and basic programming concepts.
  • Decorative lighting: LEDs with different delays can be used to create interesting and decorative lighting displays for various occasions such as weddings, parties, or holidays.

Conclusion

Multiple LEDs with different delays offer a unique and creative way to create visually stunning displays. With the ability to customize the timing of each LED, the possibilities for creating stunning light patterns are endless. Whether used for commercial displays, home lighting, or artistic installations, this technique is sure to captivate and engage viewers.