Christmas Lights to Music Using Arduino
Intro: Christmas Lights to Music Using Arduino
Video to come!
Sources I've Used:
Instructables:
Arduino Christmas Light Controller
xmas-box: Arduino/ioBridge internet controlled Christas lights and music show
Other:
Solid State Relays (SSRs) Using TRIACs:
STEP 1: Parts You'll Need
SSR Supplies ($7):
MOC3031 Optocoupler (8)
Z0103 TRIAC (8)
Light Controller Supplies ($61):
Arduino Duemilanove
WaveShield
FM Transmitter - I made one (shown in the photos below) but any will work ($15+)
RadioShack B&M ($14):
Wire Terminals (3 packages, 12 connectors) 276-1388
Printed Circuit Board 276-147 (could use smaller)
330ohm Resistors (2x 5-packs)
150ohm Resistors (2x 5-packs)
Home Depot B&M ($25):
50 ft Landscape/Sprinkler Wire (18ga, 7 conductor) 079407238170
6' Power Cords (x8 minimum, to use the female 120v connectors)
-you may need more than 8, depending on the locations of your lights; I used 11
Clear Plastic Box (my Dollar Tree was out but HD had these for $0.87)
Miscellaneous:
Soldering Iron (I use a butane-powered BernzOmatic from Home Depot; doubles as a heat gun)
Solder (highly recommended: Soldering Paste)
Screwdrivers (philips for WaveShield, standard for wire terminals)
Wire (for WaveShield and connecting to the SSRs, I used extra breadboard jumper wires I had)
Diagonal Cutters
Wire Strippers
SD Card (any size, I used 64MB)
Electrical Tape
Power source for Arduino (I used an extra powered USB hub I had)
Hot glue gun
Wire nuts (optional)
STEP 2: SSR Board
If you like, you can also view full-size copies of my schematic and board.
I started by placing all the components on the board. When I was satisfied with how they were laid out, I started by soldering all the items to the board that didn't need extra wire (basically, everything but the ground from the Arduino and the 120v hot line). I then soldered the common grounds/hot wires. As you can see from the bottom of the board, it looks rather messy.
When finished, I tested each SSR separately by hooking up the 120v power and measuring across the neutral and each switched hot output while I put a 5v source across the Arduino side of the board.
STEP 3: Add the Arduino
If you decide to solder an FM transmitter directly to the PCB, you can add it in the extra space in the bottom left of the photo below. Otherwise, you can also plug in any generic FM transmitter.
STEP 4: Construct the WaveShield
When finished, follow the directions here to prepare songs and transfer them to your SD card. Place the card in the WaveShield when finished.
STEP 5: Connect to the SSRs
WaveShield (these can be changed but I used the defaults)
D2 - LCS
D3 - CLK
D4 - DI
D5 - LAT
First 3 SSR Channels
D6 - Channel 1
D7 - Channel 2
D8 - Channel 3
WaveShield
D10 -> LCS
WaveShield - SD Card (cannot be changed)
D11
D12
D13
Power
Gnd[0] - SSR Ground
Vu Meter
A0 - Connect to R7 (1.5K resistor) on the WaveShield to measure output from amplifier.
Remaining 5 SSR Channels
A1 = D15 - Channel 4
A2 = D16 - Channel 5
A3 = D17 - Channel 6
A4 = D18 - Channel 7
A5 = D19 - Channel 8
STEP 6: Upload Sketch and Test Everything
I used xmas_box.pde from here and set debug to true while testing everything. I plan on editing the code once I get everything set up outside but for now it works without modification.
Update 2010-06-22: I've attached a 7-zip file containing code I might have used (besides the original code from above). I'll upload new code later this year when I put the controller back together and implement some of the ideas I had for future expansion.
Update 2010-12-11: I've re-written the program using the daphc example from the WaveHC library and the VuMeter code from the xmas_box Instructable linked above. It will now play any song it finds on the WaveShield's SD card in a continuous loop. The program is Christmas_Lights_2010.pde below. I've also included Christmas_Lights_2010_Channel_Test.pde which just cycles through all 8 channels so you know that they work.
STEP 7: Put It All in a Box
I had an extra powered USB hub laying around so I decided to use that to power the Arduino. I hot glued the power adapter for the hub into place and plugged the 11th 6' extension cord (the only one not cut up) into it. I also glued the hub in place. Into the opposite side of the extension cord, I plugged in the circuit board's 120v plug. The USB cord going to the Arduino from the hub is a $1 extend-able cord from Dollar Tree but any USB cord would work.
To run the cords through the side of the tub, I used my soldering iron with the tip removed (effectively a mini heat gun) to melt away the plastic. I then used hot glue to secure the cords in place. I did this with the lights' power cords (top of the picture below) and the power cord for the board (bottom).
I finished it up by using wire nuts to connect the power going out to all the lights to the test wires I had already hooked up (adding an additional two for the 7th and 8th channels). Add the lid and you're all set. Should be waterproof-enough for me and it's protected by the front steps of my RV.
STEP 8: Hook Up Christmas Lights
You may need more than one female 120v connector per channel. I used two per channel for both my miniature trees and my reindeer (there is one on each side of a central Christmas tree).
STEP 9: Ideas for Changes
There are 3 extra pins on the Arduino available to add extra channels. I'll probably add these three next year (or go with both of the next two options).
Use higher-powered TRIACs, such as the 4A Z0405
-as long as you are using LED lights, 1A should be PLENTY
Use a shift register so that you can have more than 11 channels.
79 Comments
kldewitt87 7 years ago
kldewitt87 7 years ago
MRedmon 7 years ago
KevinP207 7 years ago
Can you use the Arduino Uno instead of the Duemilanove?
MRedmon 7 years ago
kldewitt87 8 years ago
I have finished everything and done all of the wiring. However, only 3 of my SSR channels work. Is there something I am missing? Will attach pictures if necessary.
MRedmon 7 years ago
I don't know. Did you ever get it work?
kldewitt87 7 years ago
kldewitt87 8 years ago
Do I need the xmas_box.pde?
MRedmon 7 years ago
No
ChristianL143 7 years ago
are these all 1/4 watt resistors? Just making sure.
MRedmon 7 years ago
As best as I can recall.
kldewitt87 9 years ago
Can you recommend any particular FM transmitter? I know you made yours. I just haven't quite found what I'm looking for in that way of one.
Thanks so much for your help!
MRedmon 9 years ago
kldewitt87 9 years ago
kldewitt87 9 years ago
The link for the optocoupler no longer shows anything on the website. Which one do you recommend as a substitute? Also, are the numbers in parentheses supposed to be how much of each you thing you need?
Thank you!
MRedmon 9 years ago
I'll update the link. You can always search for the part number... they still carry the exact one I used:
http://www.mouser.com/ProductDetail/Fairchild-Semi...
Yes, the numbers in parentheses is the number needed (though read through the Instructable because you might want more).
rdgrahamjr 10 years ago
Techperson_1 10 years ago
I have pictures below of the options.
dreos 10 years ago