Arduino Easy Smart Home Series: LED Light Chaser(For Decor)

Arduino Easy Smart Home Series: Colored LED Light Chaser

Get ready to make your LEDs dance! 🎉 This project shows how to create a colorful LED light chaser using Arduino. Perfect for beginners, hobbyists, and smart home enthusiasts who want to add vibrant lighting effects to their home setup.

Table of Contents

  • Introduction
  • Required Hardware
  • Arduino IDE Setup
  • Wiring the Components
  • Arduino Code
  • How It Works
  • Testing Your Project
  • Advanced Modifications
  • Common Issues and Troubleshooting
  • Learning Insights
  • Conclusion

1. Introduction

This project introduces a colorful LED light chaser for Arduino-based smart home setups. The project allows you to control multiple LEDs in sequence to create smooth chasing effects. You can use either single-color LEDs or RGB LEDs to get dynamic lighting patterns. It is ideal for beginners learning microcontroller programming and smart home lighting concepts, while also being fun for experienced makers looking to decorate rooms or create mood lighting.

2. Required Hardware

  • Arduino UNO (Approx. $25)
  • 8 Single-color LEDs or 4 RGB LEDs (Approx. $10)
  • Resistors 220Ω / 330Ω (Approx. $5)
  • Jumper Wires (Approx. $5)
  • Breadboard (Approx. $10)
  • USB Cable for Arduino (Approx. $5)
  • Arduino IDE installed on your PC

3. Arduino IDE Setup

  1. Download and install the latest Arduino IDE from the official Arduino website.
  2. Connect your Arduino board to the PC using a USB cable.
  3. Open Arduino IDE, select your board type and COM port under Tools > Board and Tools > Port.

4. Wiring the Components

Proper wiring is essential to prevent LED damage and ensure the light chaser works smoothly. Follow the steps below:

  • Connect each LED anode to Arduino digital pins 2 to 9 (or 2 to 5 for RGB LEDs for each color channel) using appropriate resistors (220Ω for single-color, 330Ω for RGB).
  • Connect all LED cathodes to GND on the Arduino.
  • Double-check all connections before powering the board.

5. Arduino Code

Upload this code to your Arduino/Wemos to see multiple LED chasing effects:

// Arduino Easy Smart Home Series: LED Light Chaser with 10 Styles

const int numLEDs = 8;
int ledPins[] = {2,3,4,5,6,7,8,9};
int style = 0;

void setup() {
  for(int i=0;i=0;i--){
    digitalWrite(ledPins[i],HIGH);
    delay(100);
    digitalWrite(ledPins[i],LOW);
  }
}

// 3. Ping Pong
void style3(){
  style1();
  style2();
}

// 4. Alternating LEDs
void style4(){
  for(int i=0;i=0;i--){
    digitalWrite(ledPins[i],HIGH);
    digitalWrite(ledPins[numLEDs-1-i],HIGH);
    delay(150);
    digitalWrite(ledPins[i],LOW);
    digitalWrite(ledPins[numLEDs-1-i],LOW);
  }
}

// 9. Knight Rider
void style9(){
  for(int i=0;i0) digitalWrite(ledPins[i-1],LOW);
    delay(100);
  }
  for(int i=numLEDs-2;i>0;i--){
    digitalWrite(ledPins[i],HIGH);
    digitalWrite(ledPins[i+1],LOW);
    delay(100);
  }
}

// 10. Running Rainbow (requires RGB LEDs)
int redPins[] = {2,3,4};
int greenPins[] = {5,6,7};
int bluePins[] = {8,9,10};

void style10(){
  for(int i=0;i<3;i++){
    digitalWrite(redPins[i],HIGH); delay(100); digitalWrite(redPins[i],LOW);
    digitalWrite(greenPins[i],HIGH); delay(100); digitalWrite(greenPins[i],LOW);
    digitalWrite(bluePins[i],HIGH); delay(100); digitalWrite(bluePins[i],LOW);
  }
}

6. How It Works

The Arduino sequentially powers each LED on the digital pins, creating a chasing effect. In the RGB version, the Arduino cycles through red, green, and blue channels to produce colorful moving patterns. Delays between LED transitions control the speed of the chase, and loops allow continuous repetition of the pattern. This project demonstrates basic output control, timing, and sequencing in microcontroller programming.

7. Testing Your Project

  1. Upload the code to the Arduino board.
  2. Power the Arduino via USB or external power source and watch the LEDs chase forward and backward.
  3. Adjust delay values in the code to change the speed of the chasing effect.

8. Advanced Modifications

  • Use RGB LEDs and mix colors for smooth rainbow effects.
  • Integrate push buttons or sensors to trigger LED patterns dynamically.
  • Connect to WiFi using ESP8266/ESP32 for smart home lighting control via mobile app.

9. Common Issues and Troubleshooting

  • LED not lighting up – Check resistor and pin connections.
  • Flickering LEDs – Ensure proper GND connections and stable power supply.
  • Incorrect color in RGB LEDs – Verify RGB pin mapping and resistor values.

10. Learning Insights

  • Understanding how to control multiple outputs with loops and arrays.
  • Basic timing and delays in microcontroller programming.
  • Practical RGB LED color mixing and pattern creation.
  • Introduction to smart home lighting automation concepts.

11. Conclusion

This Colored LED Chaser project is an excellent starting point for beginners and hobbyists in the Arduino Easy Smart Home Series. It combines fun, learning, and practical application, allowing makers to experiment with sequences, colors, and advanced smart home integration. Keep experimenting and building new patterns to fully explore Arduino's potential in home automation!

By Kaushal Haladi

Comments

Popular Posts