How to Make LED's Light Show

by STEAM-DIY in Circuits > Arduino

20 Views, 0 Favorites, 0 Comments

How to Make LED's Light Show

light show.png

Introduction

In this project, you will learn how to create a simple yet mesmerizing LED light show using an Arduino Uno. The project will demonstrate how to control multiple LEDs in a sequence to create visual patterns. This is a great way to get started with Arduino programming and learn about digital outputs, basic electronics, and circuit design.

Supplies

  1. Arduino Uno board
  2. Breadboard
  3. 6 LEDs (any color)
  4. 6 Resistors (220 ohm)
  5. Jumper wires
  6. USB cable for Arduino
  7. Computer with Arduino IDE installed


  1. Setting Up the Hardware:
  2. Place the LEDs on the breadboard. Ensure the cathode (shorter leg) of each LED is connected to the negative (ground) rail of the breadboard.
  3. Connect the anodes (longer legs) of the LEDs to digital pins 2 through 7 of the Arduino using jumper wires.
  4. Place a 220-ohm resistor in series with each LED between the anode and the jumper wire to protect the LED from excess current.
  5. Connect the ground rail of the breadboard to one of the ground (GND) pins of the Arduino.
  6. Connecting Power:
  7. Connect the positive rail of the breadboard to the 5V pin on the Arduino.
  8. Connect the Arduino to your computer using a USB cable.
  9. Coding the Light Show:
  10. Open the Arduino IDE on your computer.
  11. Write a program that sequentially turns the LEDs on and off to create a light show pattern. Here's an example code to get started:

cpp

Copy code

// Define the LED pins

int ledPins[] = {2, 3, 4, 5, 6, 7};

int numOfLeds = 6;


void setup() {

// Initialize each pin as an OUTPUT

for (int i = 0; i < numOfLeds; i++) {

pinMode(ledPins[i], OUTPUT);

}

}


void loop() {

// Turn on and off each LED in sequence

for (int i = 0; i < numOfLeds; i++) {

digitalWrite(ledPins[i], HIGH); // Turn LED on

delay(200); // Wait for 200ms

digitalWrite(ledPins[i], LOW); // Turn LED off

}


// Reverse the order

for (int i = numOfLeds - 1; i >= 0; i--) {

digitalWrite(ledPins[i], HIGH); // Turn LED on

delay(200); // Wait for 200ms

digitalWrite(ledPins[i], LOW); // Turn LED off

}

}

  1. Uploading the Code:
  2. Verify the code to check for errors.
  3. Select the correct board and port from the 'Tools' menu in the Arduino IDE.
  4. Upload the code to the Arduino board.
  5. Running the Light Show:
  6. After the upload is complete, the LEDs will start lighting up in a sequential pattern.
  7. You can modify the delay time and the sequence in the code to create different light show patterns.
  8. Experimenting:
  9. Try changing the order in which the LEDs light up, adjust the delays, or add more LEDs to create more complex patterns.
  10. You can also explore using different colors of LEDs to make the show more vibrant.




For more info click here ,

https://youtube.com/@steam-diy?si=_Q8Lc5tdx_b8241o

subscribe please, thanks