Introduction: Computer Controlled Musical Christmas Lights

About: Avid Inventor, Programmer, and founder of GyroPalm LLC.

In this Instructable, i am going to teach everyone the basic steps of how to build your own computer controlled musical Christmas lights. This setup is very simple and common. Within a few hours, you too can build your own light display for the holidays/new year!

First, lets go over how it works. A computer is connected to a micro-controller which pulses electricity into a relay circuit attached to a series of lights called "channels". Each channel when pulsed with electricity, will give power to your light source. As you choose which songs to play on your computer, you can choose what you want to display by programming your micro-controller.

Since we aim for fun and simplicity, we will be using an Arduino for our micro-controller. If you don't know what is an Arduino, then please visit this website (www.arduino.cc) and buy one online or at your local Radioshack.

Step 1: Parts and Materials

If you are a tech-savy person who can work with soldering equipments and have basic knowledge of circuitry, you will find this project easy to make. On the other hand, if you have never done any electrical work in your life, I advise you to get on Google and learn how to solder, or contact an electronics expert. This Instrutable does utilize high voltage current, therefore you are advised to use caution when working with such equipment. *I shall take no liability of any damages or injury that may occur due to this project*

Now that we're clear, lets move on. Below are a list of parts and materials that you will need:

-Arduino Duemilanove (About $30 on Amazon)

-USB Cable ($1 at any Dollar Store)

-Windows Computer (preferably a laptop)

-6 relays; rated at 5v  ($4 each at Radioshack)

-Assorted LEDs  ($3 at Radioshack)

-220-OHM Resistor for LEDs  ($3 a pack at Radioshack)

-Soldering PCB  ($5 at Radioshack)

-6 of 3-pronged female outlets  ($30 total at Walgreens; hardware isle)

-A 3-pronged male outlet  ($5 at Walgreens)

-Plastic Box enclosure  ($1 at any Dollar Store)

-Plywood  ($3 at a Hobby Store or Hardware store)

-Hot glue and hot glue sticks  (Salvaged)

-6 Common Black 1N4004 Diodes ($4 at Radioshack)

-Solder and Soldering Iron  (Salvaged)

-Scrap wires

Step 2: LED Indicators

Start out by Soldering the LED Indicators to the PCB board and associating them with the 6 channels that we are going to build.
You will need the 6 LEDs for checking your channels to see if they work.


1. First, grab 6 red wires and 1 black wire. Solder them in a row starting with the 6 wires and 1 black wire.

2. The 6 red wires lead to the positive end of your LEDs.

3. Solder the 6 resistors on the other ends of your LEDs.

4. Solder the black cable to each end of your resistors.

Check your work on the diagram below. Make sure you do not have any sloppy connections or short-circuit problems.

Step 3: Testing the LEDS

If you are eager to test your LEDs to see if your connections are successful, you may do so by connecting the pin wires to your Arduino. Follow the diagrams below if you wish to test the LEDs before proceeding to connect the relays.

Plug in the 6 pins to your Arduino along with the ground wire.
Connect your Arduino to your computer and open up the Arduino Sketch-board software. Paste the code below and run it.
If all goes well, you should see all the LEDs being lit up.


int tree1 = 13;
int tree2 = 12;
int tree3 = 11;
int tree4 = 10;
int tree5 = 9;
int tree6 = 8;

void setup() {

  pinMode(tree1, OUTPUT);
  pinMode(tree2, OUTPUT);
  pinMode(tree3, OUTPUT);
  pinMode(tree4, OUTPUT);
  pinMode(tree5, OUTPUT);
  pinMode(tree6, OUTPUT);
}

void loop() {

  digitalWrite(tree1,HIGH);
  digitalWrite(tree2,HIGH);
  digitalWrite(tree3,HIGH);
  digitalWrite(tree4,HIGH);
  digitalWrite(tree5,HIGH);
  digitalWrite(tree6,HIGH);

}

Step 4: Connecting the Relays

If you've just attempted step 3, then disconnect the Arduino from your computer and disconnect all wires from the Arduino.
To avoid damage to the Arduino and to other parts of the project, try to use electrical tape to isolate open-wires.

We are now going to solder the relays to each channel of the circuit board. Please be careful when you do so. When these connections are powered, they have high voltage dangers. Take a minute to look at the pins of your relay.

Observe the diagram closely as you solder because your relay may vary from the one shown.

Step 5: In the Box!

Once your relays are all soldered up, its time to put it in the box. Before you do anything, make sure you do not have an soldering mistakes. Hot glue the 4 corners of your PCB board to small pieces of plywood. Hot glue that plywood directly on the plastic box.

Do the same for the Arduino. Except, I recommend you use screws to secure the Arduino to a piece of plywood, then hot glue it to the plastic box enclosure. Connect the wires from the PCB to the Arduino.

(The only "free-hanging" wires should be the "high-voltage" ones which are connected to the relays.)

Step 6: Packaging and Handling

This is the important step before you launch your miracle of wonders. First, connect all your relay wires to each pin. Connect the ground to your main power source. In other words, make a simple-circuit with the wires. Pretend the "Male 3-pronged plug" is your power-source, the 6 "female extension cords" are your "load" (or light bulb), and the "switch" are the relays.Make sure each relay is connected to a single load. If you need help, you can look at my diagram below.

A few things to take note of: Make sure your wires that you use to connect the circuit can tolerate 120v voltage. It is best to check the specifications. Be sure to wrap all wires thoroughly with electrical tape. Poke holes in the plastic box and make sure the power wires come out. Hot glue any gaps you may have.

Step 7: Wrap It Up

Once all connections are secure and everything is taped down, its time to start the show! You will need an indoor location to set up your "controller box". (Since you wouldn't want anyone messing with it)

I recommend putting the box in the garage, next to your garage door. Plug in the main power supply to your AC outlet.
Put up your house Christmas lights as you usually would, but plug all the cords into your "controller" instead of an electrical outlet.

As you see in the picture, this is my finishing design. (I put a note saying "High Voltage" to let my family be aware of voltages inside)

Step 8: Songs and Preparation

Of course what would a Computer Controlled Musical Lights be without the music? Download all your favorite MP3 songs to your computer. As long as you can play it loud on a speaker, then you're good to go.

A good setup is to bring your laptop out to your garage, hook up the USB to the Arduino, and plug in some speakers. If you have a WiFi connection on your laptop, you can go on Youtube and search up some songs like "Carol of the Bells - David Foster",  "Deck the Halls", or "God Rest Ye Merry Gentlemen" by Mannheim Steamroller.

Finally, for the programming, we will need some sort of setup to run the lights. You have two options:

-Option A:   You manually control the lights with your computer's keyboard.
-Option B:   You manually program the lights using a macro recorder and play it back automatically.


Either way, you will need to have these two programs running on your computer to communicate with your Arduino:

High Tech Christmas 1.0 (A program that I made myself to control the lights)
Arduino Sketchpad           (The Arduino's default programming software)

Make sure you have both of those programs above. If not, download them, extract the contents, and run them now!

After you have the programs, open up the Arduino Sketchpad program and upload this code to your Arduino:


int tree1 = 13;
int tree2 = 12;
int tree3 = 11;
int tree4 = 10;
int tree5 = 9;
int tree6 = 8;

int incomingByte;      // a variable to read incoming serial data into

void setup() {
  // initialize serial communication:
  Serial.begin(9600);
  // initialize the LED pin as an output:
  pinMode(tree1, OUTPUT);
  pinMode(tree2, OUTPUT);
  pinMode(tree3, OUTPUT);
  pinMode(tree4, OUTPUT);
  pinMode(tree5, OUTPUT);
  pinMode(tree6, OUTPUT);
}

void loop() {
  // see if there's incoming serial data:
  if (Serial.available() > 0) {
    // read the oldest byte in the serial buffer:
    incomingByte = Serial.read();

    if (incomingByte == 'q') {
  digitalWrite(tree1,HIGH);
  delay(150);
    digitalWrite(tree1,LOW);
    }

    if (incomingByte == 'w') {
        digitalWrite(tree2,HIGH);
        delay(150);
        digitalWrite(tree2,LOW);
    }

        if (incomingByte == 'e') {
        digitalWrite(tree3,HIGH);
        delay(150);
        digitalWrite(tree3,LOW);
    }

        if (incomingByte == 'r') {
        digitalWrite(tree4,HIGH);
        delay(150);
        digitalWrite(tree4,LOW);
    }

        if (incomingByte == 't') {
        digitalWrite(tree5,HIGH);
        delay(150);
        digitalWrite(tree5,LOW);
    }

        if (incomingByte == 'y') {
        digitalWrite(tree6,HIGH);
        delay(150);
        digitalWrite(tree6,LOW);
    }

        if (incomingByte == 's') {
        digitalWrite(tree1,HIGH);
        digitalWrite(tree2,HIGH);
        delay(150);
        digitalWrite(tree1,LOW);
        digitalWrite(tree2,LOW);
    }

        if (incomingByte == 'd') {
        digitalWrite(tree2,HIGH);
        digitalWrite(tree3,HIGH);
        delay(150);
        digitalWrite(tree2,LOW);
        digitalWrite(tree3,LOW);
    }

        if (incomingByte == 'f') {
        digitalWrite(tree3,HIGH);
        digitalWrite(tree4,HIGH);
        delay(150);
        digitalWrite(tree3,LOW);
        digitalWrite(tree4,LOW);
    }

        if (incomingByte == 'g') {
        digitalWrite(tree4,HIGH);
        digitalWrite(tree5,HIGH);
        delay(150);
        digitalWrite(tree4,LOW);
        digitalWrite(tree5,LOW);
    }

        if (incomingByte == 'h') {
        digitalWrite(tree5,HIGH);
        digitalWrite(tree6,HIGH);
        delay(150);
        digitalWrite(tree5,LOW);
        digitalWrite(tree6,LOW);
    }

        if (incomingByte == 'u') {
        digitalWrite(tree1,HIGH);
        digitalWrite(tree2,HIGH);
        digitalWrite(tree5,HIGH);
        digitalWrite(tree6,HIGH);
        delay(150);
        digitalWrite(tree1,LOW);
        digitalWrite(tree2,LOW);
        digitalWrite(tree5,LOW);
        digitalWrite(tree6,LOW);
    }

        if (incomingByte == 'i') {
        digitalWrite(tree1,HIGH);
        digitalWrite(tree2,HIGH);
        digitalWrite(tree4,HIGH);
        digitalWrite(tree5,HIGH);
        delay(150);
        digitalWrite(tree1,LOW);
        digitalWrite(tree2,LOW);
        digitalWrite(tree4,LOW);
        digitalWrite(tree5,LOW);
    }

        if (incomingByte == 'j') {
        digitalWrite(tree2,HIGH);
        digitalWrite(tree3,HIGH);
        digitalWrite(tree5,HIGH);
        digitalWrite(tree6,HIGH);
        delay(150);
        digitalWrite(tree2,LOW);
        digitalWrite(tree3,LOW);
        digitalWrite(tree5,LOW);
        digitalWrite(tree6,LOW);
    }

        if (incomingByte == 'o') {
        digitalWrite(tree5,HIGH);
        digitalWrite(tree3,HIGH);
        digitalWrite(tree4,HIGH);
        delay(150);
        digitalWrite(tree5,LOW);
        digitalWrite(tree3,LOW);
        digitalWrite(tree4,LOW);
    }

        if (incomingByte == 'p') {
        digitalWrite(tree2,HIGH);
        digitalWrite(tree3,HIGH);
        digitalWrite(tree4,HIGH);
        delay(150);
        digitalWrite(tree2,LOW);
        digitalWrite(tree3,LOW);
        digitalWrite(tree4,LOW);
    }

        if (incomingByte == 'b') {
        digitalWrite(tree1,HIGH);
        digitalWrite(tree6,HIGH);
        delay(150);
        digitalWrite(tree1,LOW);
        digitalWrite(tree6,LOW);
    }

        if (incomingByte == 'c') {
        digitalWrite(tree1,HIGH);
        digitalWrite(tree3,HIGH);
        delay(150);
        digitalWrite(tree1,LOW);
        digitalWrite(tree3,LOW);
    }

        if (incomingByte == 'v') {
        digitalWrite(tree4,HIGH);
        digitalWrite(tree6,HIGH);
        delay(150);
        digitalWrite(tree4,LOW);
        digitalWrite(tree6,LOW);
    }
        if (incomingByte == 'a') {
  digitalWrite(tree1,HIGH);
  digitalWrite(tree2,HIGH);
  digitalWrite(tree3,HIGH);
  digitalWrite(tree4,HIGH);
  digitalWrite(tree5,HIGH);
  digitalWrite(tree6,HIGH);
  delay(150);
  digitalWrite(tree1,LOW);
  digitalWrite(tree2,LOW);
  digitalWrite(tree3,LOW);
  digitalWrite(tree4,LOW);
  digitalWrite(tree5,LOW);
  digitalWrite(tree6,LOW);
    }

  }
}

Step 9: Show Time!

Steps before showtime:

1. After you have uploaded the code to your Arduino, connect your Arduino to your computer via USB.

2. Turn up your volume and speakers. Open up the song you are about to play.

3. Power up your Relays (the main AC source).

4. Open up the program called High Tech Christmas 1.0

5. Select your "Arduino's Serial port". (If you don't know what the port is, keep selecting a different port until you get it right)

6. Click "Play" on your music.

Start hitting some keys! Rock on!

Below, I've attached a picture of a keyboard with tabs of which key controls what relay (lights).

Step 10: Automation and Other Ideas

If you are a lazy person, or just don't like controlling the lights all the time, you can download another program which records whatever you type on the keyboard and plays it back.

This is called a "macro program". You can get a good program like Blue Eye Macro or Avis Macro or something like that.
Then once you've recorded your macros, look for the option to "loop" the songs + the macros so they play repeatedly.
I haven't really gotten into this yet, but I was using Blue Eye Macro this Christmas with no problem at all.

I chose to spread the word about my creation by telling my neighbors and making a small website dedicated to showing pictures, videos, and show times of my production. I would also put a commenting option to allow my visitors to share their feedback.
If you have interest in publicizing you creation, you can build a website like mine. Look Here for my example

That's about it. Hope you can make and share the joy with your friends during the holidays!

Make It Glow Challenge

Participated in the
Make It Glow Challenge