My wife and I have wanted to create our own lights-set-to-music show for the last few holiday seasons.  Inspired by the two Instructables below, we decided to finally get started this year and decorate our RV.  We wanted an all-in-one controller (lights AND music) but didn't need it to be controllable over the internet, making it a little different than the other two Instructables.

Video to come!

Sources I've Used:

Arduino Christmas Light Controller
xmas-box: Arduino/ioBridge internet controlled Christas lights and music show

Solid State Relays (SSRs) Using TRIACs:

Step 1: Parts You'll Need

SSR Supplies ($7):
MOC3031 Optocoupler (8)

Light Controller Supplies ($61):
Arduino Duemilanove

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)

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)

<p>Do I need the xmas_box.pde?</p>
<p>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.</p>
<p>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.</p><p>Thanks so much for your help!</p>
No, any should work.
I finally managed to find the one I wanted. Thanks! :)
<p>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?</p><p>Thank you!</p>
<p>I'll update the link. You can always search for the part number... they still carry the exact one I used:</p><p><a href="http://www.mouser.com/ProductDetail/Fairchild-Semiconductor/MOC3031M/?qs=%2fha2pyFadujIJrssNVyvKNIB657%252bTv5UEASdJzdz6GMX19NiyCZC1w%3d%3d" rel="nofollow">http://www.mouser.com/ProductDetail/Fairchild-Semi...</a></p><p>Yes, the numbers in parentheses is the number needed (though read through the Instructable because you might want more).</p>
This is pretty cool light controller. I am sharing this on my blog rdgraham.com for my share a post Sunday.
Hi, I'm a newbie and I bet this must be obvious but which MOC3031 do I choose? <br> <br>I have pictures below of the options.
Just wanted to say thank you and thank Lady Ada. Followed the directions with a few exceptions (bought the SSR's built) and this works perfectly. My kids are going to go nuts. Many thanks. I can't wait until the next project. The Barron Fourier and Kings of Leon
I am somewhat new to this hobby, &amp; wanted to started with a slightly smaller version of this project, namely setting up my christmas tree lights (on a prelit tree) to flash to music played on speakers. I was hoping you could tell me how I could alter your project to work (if it's even possible), what items I would need from your list, etc. Also, I wanted to know, if I were to successfully make my idea a reality, is it still possible to set my lights back to run normally, without the arduino &amp; such attached? I hope you can help me! Thanks!
It's possible with no modification - instead of plugging an FM transmitter into the music shield, just plug in powered speakers (such as those made for computers). To make your lights run &quot;normally&quot; you could just unplug them and plug them into a power strip. You could also leave everything plugged into the controller but re-flash the Arduino with a new program that just leaves the lights on constantly. If you wanted to do that, you could flash Christmas_Lights_2010_Channel_Test.pde from Step 6 but change the loop to read: <br><br>void loop() {<br> for (int i = 0; i &lt; channelsLength; i++) {<br> digitalWrite(channels[i], HIGH);<br> Serial.println(i);<br> Serial.print(&quot;On&quot;);<br> }
Great work! Looks Awesome!
Got my lights up last weekend and finished hooking up the lighting controller today. I still need to play around with the code a bit but at least everything is up and working.
I was messing around with the settings... I think I'll probably put them back to the old settings.<br> <br> <a href="http://www.youtube.com/watch?v=JdZwBIdWHvA&feature=youtu.be" rel="nofollow">http://www.youtube.com/watch?v=JdZwBIdWHvA&amp;feature=youtu.be</a><br> <br> <br> <br>
Okay, I must be doing something wrong. I built the circuit using the larger Triacs (4A 400V) and for some reason the lights just don't blink. They just stay lit. On every channel just on never off. I've tried the test sketch with the same results. Lights on, never off. Is it possible I've mis-wired something? Is the pin layout on the larger Triacs different than the ones you used? The Christmas Sketch loops through the SD card nicely and plays all of the songs, but no joy on the lights. Any ideas where I screwed-up?<br><br>Thanks!
I am having the same issue with my board. All the channels but one stay on. Did you ever get yours figured out? (I used the same parts as the MRedmon)
Have you tested the AC side with a multimeter? Can you post photos (especially close-ups of the triacs and optocouplers)? What happens if you (safely) short pins 4 and 6 of the optocoupler?
Sorry... I meant short pins 5 and 6 of the optocoupler. I forgot that the order goes: 6 4 5
Here are the images (Warning: 18 megapixel)<br>Front:<br>http://www.redlightning.net/front.jpg<br>Back:<br>http://www.redlightning.net/back.jpg<br><br>The pins on my optocoupler are thus (Mouser lists the one in your how-to as obsolete):<br>1 6<br>2 5<br>3 4<br><br>Datasheet is here:<br>http://html.alldatasheet.com/html-pdf/53864/FAIRCHILD/MOC3031M/407/1/MOC3031M.html<br><br>Given that, which pins should I short?<br>
The photos look good... I don't see anything questionable. You could short pins 4 on your optocouplers to check that the high voltage side is working correctly. If it isn't then I'd try turning one of the TRIACs around (swap the pins going to the optocoupler and out to the lights but keep the gate pin going to the optocoupler).
Hmm... that sucks. The 4A triacs should be controlled the exact same way as the ones I used. Can you post photos of the circuit (front/back)? The first thing I would do is check and see what the voltage is between ground and the Arduino outputs for each channel (a mis-wire could lead to voltage being applied across the channels at all times, regardless of which channels are being turned on/off on the Arduino). You could also run the following program (untested):<br><br>int channels[]={6,7,8,15,16,17,18,19};<br>int channelsLength = 8; <br><br>void setup() {<br>Serial.begin(9600);<br>for (int i = 0; i &lt; channelsLength; i++) <br> pinMode(channels[i], INPUT); <br>}<br><br>void loop() { <br>for (int i = 0; i&lt; channelsLength; i++) {<br> int channel = channels[i];<br> int sensorValue = digitalRead(channels[i]);<br> Serial.print(&quot;Channel &quot;);<br> Serial.print(channel);<br> Serial.print(&quot; reads &quot;);<br> Serial.print(sensorValue);<br> Serial.print(&quot;. &quot;);<br> Serial.print(10, BYTE);<br> delay(1000);<br>}<br>}
I found a pinout for the 4A triacs. From left to right counting the pins, pin 3 is the gate. I had at first wired pin 2 to the optocoupler thinking it was the gate. I've gone through and resoldered the triacs making pin 3 go to the optocouplers. However now nothing turns on.<br><br>I've attached images of the front and back of the pcb.<br>I added a third ground wire since my plug used the third gound. <br>So I've also added an extra wire block to handle the extra ground wire.<br>I also ran the plugs for the lights to actual outlet plugs.<br>The four plugs fit nicely in a four gang box and the green common ground from all of the plugs goes to the new ground block.<br><br>The common wire for the plugs is red and that goes to the wire block where the plug is attached. The black wires all run to the gang box to connect each single plug socket.<br><br>Thanks for the assist.<br><br>Steve
I can't see any reason why it shouldn't be working. Have you been able to determine whether the optoisolators are switching correctly? What happens if you (safely) short pins 4 and 6? Is there voltage between neutral and the A1 of each TRIAC? Do both pins 1 (A1) and 3 (G) connect to the optoisolators? Is there voltage between pin 2 (A2) and neutral? After having it plugged in for a while and then unplugging it, is there a component that feels hot?
Sorry... I meant short pins 5 and 6 of the optocoupler. I forgot that the order goes: 6 4 5
I had a thought as I was checking things with the multimeter. Is it possible that the circuit just isn't sending enough of voltage to trigger the Triacs? Since I used the upgraded ones you mentioned and not the ones you first used to build with, that is about the only thing that makes sense. I tried to look at the specs pdf at mouser but I get a file not found error. So I'm wondering if that is what the problem is. When you measure the trigger voltage what do you get for a reading?<br><br>
Datasheet:<br>http://www.st.com/internet/com/TECHNICAL_RESOURCES/TECHNICAL_LITERATURE/DATASHEET/CD00001570.pdf<br><br>Minimum trigger voltage for the Z0405 TRIAC is 1.3v so I don't think you should have a problem there (the Arduino is operating at 5v).
High resolution copies of the above two images:<br><br><a href="http://www.mattsphotogallery.com/gallery3/var/albums/2011-12-13%2019.40.46.jpg?m=1323835103" rel="nofollow">http://www.mattsphotogallery.com/gallery3/var/albums/2011-12-13%2019.40.46.jpg?m=1323835103</a><br><br><a href="http://www.mattsphotogallery.com/gallery3/var/albums/2011-12-13%2019.40.59.jpg?m=1323835103" rel="nofollow">http://www.mattsphotogallery.com/gallery3/var/albums/2011-12-13%2019.40.59.jpg?m=1323835103</a><br>
Just to be certain, I measured it... I saw a max of 4.7v on my multimeter.
It may or may not help the two people having problems but as a test I have hooked up one of the 4A TRIACs as an example in a breadboard to make sure everything is working as expected (and it does). I've attached 2 photos and the video of it working can be found at:<br> <a href="http://www.youtube.com/watch?v=Hu9v9kodvyk" rel="nofollow">http://www.youtube.com/watch?v=Hu9v9kodvyk</a><br>
High resolution copies of the above two images:<br> <br> <a href="http://www.mattsphotogallery.com/gallery3/var/albums/2011-12-13%2019.40.46.jpg?m=1323835103" rel="nofollow">http://www.mattsphotogallery.com/gallery3/var/albums/2011-12-13%2019.40.46.jpg?m=1323835103</a><br> <br> <a href="http://www.mattsphotogallery.com/gallery3/var/albums/2011-12-13%2019.40.59.jpg?m=1323835103" rel="nofollow">http://www.mattsphotogallery.com/gallery3/var/albums/2011-12-13%2019.40.59.jpg?m=1323835103</a><br>
Hi Matt,<br><br>This project is great. I would like to apply it to lighting just our indoor Christmas tree. I'm a newbie so I'm not sure how to streamline the project. If I were to use just 3-4 sets of lights, what would I cut out as far as other parts? Thanks so much for any advice you can offer.
Instead of getting 8 of each of the following you could get 3-4 (as many sets of channels as you would like):<br><br>MOC3031 Optocoupler<br>Z0103 TRIAC<br>Both resistors mentioned above<br><br>You could also do away with the fm transmitter and hook up a powered speaker instead.<br><br>In Christmas_Lights_2010.pde change the following:<br><br>int channels[]={6,7,8,15,16,17,18,19};<br>int channelsLength = 8;<br><br>to:<br><br>int channels[]={16,17,18,19}; // or other 3-4 inputs that you want to use<br>int channelsLength = 4; // or 3 if you only want 3 channels
Thanks so much for your quick response. I'm still gathering parts. So if I end up with 4 channels, is that 10 wire terminals?<br><br>And one more rookie question: can I substitute a different optocoupler for the ones you specified above? That part seems to be on backorder for the suppliers I looked at.<br><br>Thanks again.
You sure can. Any optocoupler that can be triggered by 5V or less with 20mA of current or less and can handle the AC at whatever voltage you are using (110/220/etc) will work, I believe. Of course, if you want the same one, Mouser has them in-stock: <br><br>http://www.mouser.com/Search/ProductDetail.aspx?R=512-MOC3031-M
ok I am not an electronics guy but I am trying. Where is the FM transmitter connected.....for the life of me I don't see it. Also could you use the same connection for a simple jack and then plug the output into speakers? <br> <br>thanks
In the upper-right photo in Step 1 you can see a headphone/speaker cable plugged into the jack that the FM transmitter would plug into (it's black and rectangular). You could also plug in speakers to it (you'd probably need amplified speakers).
MRedmon, I was wondering if there were a way to add 1 normally open pushbutton switch to advance to the next song on the SD card. For example lets say that I have 15 songs on the card and I want to listen to the 7th song, as it is setup right now I woulld have to listen to the first 6 songs to get to the one I want, I think it would be nice if I could just push a button 6 times to advance through the first 6 tunes and play the 7th tune, the one i want to hear and see at that moment. <br> Also would there be a way to add some sort of potentiometer to the circuit to adjust the sensitivity? Like attach it to the common ground wire or something. <br> Sorry to keep bugging you about this but I think we could make this thing really cool (not that it's not now), I think I have some good ideas but I just have no idea on how to implement them.
I don't see why you couldn't do that... I haven't gotten back into the Arduino frame of mind just yet but glancing at the code make it seem like you could connect D0/D1 (can't be used if you are using serial communication like in my example sketch) or D9 to the normally open push button switch.<br><br>I don't see any reason why you couldn't replace the 1.5K resistor from A0 to R7 with a potentiometer. Maybe a 6k pot? You might just have to experiment. It could probably be done in software somehow, too.... perhaps another push button to switch between a given number of preset sensitivity levels (though you are limited in the number of inputs available... you'd have to give up serial communications or add a shift register if you wanted 2 push button switches... but with a shift register you could a LOT more channels).
Buddy , lets check out your design again,<br>why did you draw connectors as common between two triacs?<br>i can not understand ! let me know about your imaged , or i would show other ways to you , then you may love to make it better.<br>mojarab@hotmail.com
I don't understand the exact reason why these work... I put them together from different projects and built them as diagrammed. And they work.
I have a quick question.<br>My question is do i have to make a new program for every song it does or does it manualy sync the music with the light.please help me because I'm thinking about making one for the holidays. Also will this work with my solid state relays that have a input of 3 to 8 volts and a controll of 120 volts. Thanks for the help, ps, iam only 14 so keep it in easy to uder stand terms.
You don't have to program it for every song... it will &quot;analyze&quot; the wav file and control everything from there. I see no reason why your SSRs shouldn't work. That is exactly what I'm using (I just am building SSRs from discrete components).
I was wondering if there was going to be any code improvements for this year?<br><br>Could the Arduino possibly do a fast Fourier transform on the WAV file then control different channels to turn on and off depending on the WAVE file frequency? What I mean is a set of lights turning on and off with the &quot;high&quot; notes of the song, and another with the &quot;low&quot; notes or bass? Could there be different patterns depending on the &quot;volume&quot; of the song?<br><br>I think you've done great work so far. Thanks!
I've essentially not thought about the project at all since last Christmas. Once Halloween is over, I plan to get everything back out and start working on it again. I have no idea about doing Fourier transforms on the Arduino but I'd be willing to give any code you want to submit a try.
MRedmon, I am pleased to announce that I have fixed my problem and it is working quite nicely. The problems came from the way I was converting the music files. If you are interested I have uploaded a new video onto the YouTube, the link is<br> http://www.youtube.com/watch?v=cepyTHrfWQg<br> and the video is named Christmas Light Controller 3. I think for next Christmas I am going to have to get a cardboard Santa and his 8 reindeer and have a different light for each of the reindeer, might look pretty cool but I won't know till then.
That's great! I can't wait to see what the display looks like next year!
I put the controller back together and tested everything. It's working great with the new code I posted today on Step 6 of the Instructable. Let me know if you have any questions.<br><br>I haven't implemented any of my ideas for changing the controller (Step 9) but purchased higher-powered triacs and am starting to design the circuit board I'm going to etch. It'll have 10 channels.
I tried using the new code (Christmas_Lights_2010.pde) and all i get is the lights all come on and nothing else. <br>I did use your test code and it and my box are both working perfectly you got any suggestions on where i might have messed up? Thanks
My first thought is that the wire connected to A0 must not be connected right. Maybe the connection is not strong enough or maybe it's in the wrong spot? Since you had it working before, maybe the connection broke. I had a problem this season with everything randomly turning off and refusing to start up again... it turned out to be a solder connection that had broken off and was only held in place by the force of the wire. Re-soldered it and everything worked great.

About This Instructable




More by MRedmon:Making a Light Box, Version 2Christmas Lights to Music Using ArduinoTurn Your 12V DC or 85-265V AC Fluorescent Light To LED - Part 2 (External Appearance)
Add instructable to: