Arduino Christmas Light Controller

 by dany32412
FeaturedContest Winner
DSC_0169.jpg
relay.JPG
You've probably seen all those videos where people make there christmas lights dance to music, you think to your self wow that looks realy cool.... i could never do that. WELL... you can the idea is actually quite simple.
WHATS A RELAY?
a relay is a component that can be used to control large amounts of voltage or current with just a small voltage, it does this by using that small voltage (5 volts in our case) to create a magnetic feild that will pull a switch type object to connect the larger current (120 volts in our case). Image 2 is a diagram on how a relay works





 
Remove these adsRemove these ads by Signing Up

Step 1: Supplies

• 1x Arduino
• 1x Protoshield/ breadboard
8x 5v DC relays »»»  search.digikey.com/scripts/DkSearch/dksus.dll
• 8x 1N4004 diodes »»» search.digikey.com/scripts/DkSearch/dksus.dll
• 8x 2N2222 transistors »»» search.digikey.com/scripts/DkSearch/dksus.dll
• 8x 1K (Brown,Black,Red) ohm resistor (radio shack)
• 1x double/single sided PCB (radioshack)
• 1x sharpie
• 16x nuts and bolts (discuss size later)
• 8x dead sets of lights (for there male plugs)
• 500 ft of 5 strand cable
• a set of connector things
• some wire and some other stuff that you should have
• a place to display your light show
• and a some what knowledge of making pcb's

LETS BEGIN SHALL WE


1-40 of 80Next »
espongy says: May 6, 2013. 1:32 AM
Hi! Was the 120 volts based on your socket voltage? What if we have 220V? Thanks!
PoisonMondo says: Dec 29, 2012. 3:11 PM
Your project is fantastic but i was looking to do it with a different song and i was wondering if there was any particular way you worked out the delays? (maybe a push button you tap to the beat and records the delay?)
dany32412 (author) in reply to PoisonMondoJan 1, 2013. 9:37 AM
I took a sort of brute force and ignorance approach. I simply sat down and played the song, and wrote out all the delays by hand. The down side to this is that i really can't play the music through speaker or something, so all i did was overlay it onto the video.
JLeith says: Dec 18, 2012. 11:59 AM
Hello dany32412,

I'm 100% new to Arduino world but I would like to enhance my Christmas yard display I have been building the display for 30 yrs and now that I have retirement time I thought I would look into making the display a little more active.
I like your project for Christmas Light Controller and the addition of the Vixen Software.
I’m not sure which Arduino you used ?
When I look at the Arduino UNO it indicts 6 outputs and your project uses 8 ports ? unless I’m reading the spec sheet wrong.
I have just entered the world of programming a PIC for a baseball scoreboard and now I have time to look into the world of Arduino.
John
spfiregoalie says: Sep 26, 2012. 11:20 AM
Hopefully someone will still this even though its been awhile. I'm trying to hook up some christmas lights to my arduino using your same circuit schematics. When I hook it up on the breadboard the relay clicks for when the blinks should occur but the lights do not blink or go on at all. Any ideas for what's going on?
Roshy10 in reply to spfiregoalieDec 13, 2012. 2:20 PM
sorry for the late reply.Do the lights light up when you short the terminals you connected to the relay, If they don't then they are not powered correctly, if they do then there is a problem with the relay/relay board
Blakamiss48 says: Aug 24, 2012. 3:13 PM
Just want to say thanks! Followed your design and worked great. Set this up last Christmas(2011) to go with our christmas display.

Boards and wires picture
http://i.imgur.com/3kqOE.jpg

Video of the light show
https://www.facebook.com/v/10151069334010611
Blakamiss48 in reply to Blakamiss48Aug 24, 2012. 3:15 PM
Also used vixen to create the sequencing.
rpdthree says: Jan 23, 2012. 3:20 PM
Out of curiosity, have you thought of ways to dim the lights? I am fairly new to the Arduino platform and electrical engineering in general, but would it be possible to use some sort of digital potentiometer instad of the relays?

If not, do you have an ideas on how to easily dim the lights?
dany32412 (author) in reply to rpdthreeJan 23, 2012. 7:24 PM
I would say that you can't dim incandescent bulbs (like the ones i used), but you could probably dim the new LED ones. You could swap out the relays for some high powered transistors, and send some PWM (Pulse Width Modulation) signals to it. I'm not sure if that would work or not, but theoretically it should. If anyone knows more about this, or can disprove me, please post.
rhoaste in reply to dany32412Feb 21, 2012. 3:00 AM
Yes, you can dim lights as well as LEDs by using PWM. The only thing intrinsic to this project that would require a rethink is that relays aren't suited for driving PWM circuits. You would have to consider solid state switching options using something like a transistor or FET. For switching higher voltages it's a good idea to use opto-isolation to the uC.
pclever says: Dec 12, 2011. 3:31 PM
Hello, I didn't use the resistors on my pcb and everything works well unless there is more than 3 relays on. Can the arduiono only power 3 relays, or did I need the resistors?
dany32412 (author) in reply to pcleverDec 13, 2011. 11:50 AM
I would recommend putting the relays on a seperate power source, and just control that feed with a transistor. That's what the board was intended for, but i was stupid, and just got the 5v from the arduino's regulator. Goodwill will have plenty of extra "wall warts", just make sure it's rated for minimum 1A. Hope this helps.
pclever says: Dec 12, 2011. 6:53 PM
Sorry, I found out that if I add more voltage it fixes the problem, but now the arduino is getting very hot. Is this a problem?
dany32412 (author) in reply to pcleverDec 13, 2011. 11:47 AM
yes, that is a problem. Sorry back then i was stupid, and should have ran the relays off of a seperate power supply. The regulator on the arduino can only handle about 500mA of current.
dcopeland1 says: Dec 2, 2011. 7:57 PM
One thing you have to pay attention to is the 120 volts that comes from your house is a RMS voltage. Never hook up the ground on your AC to an earth ground. Go through your common as this is where your current comes from. Your voltage is on your potential side. I would also make sure the gate is rated high enough so that if there is a spike in your voltage it will send it to the ground thus dropping your voltage to zero.
donphipps says: Oct 28, 2011. 2:08 PM
Is there a way to hook up to computer va USB port, i am looking for a way to make light blink to music.
blangston1 in reply to donphippsNov 29, 2011. 11:09 PM
Just thought I'd pipe in here. Vixen, an open source software that sequences audio to digital events, will pipe it's output directly through an arduino (connected via USB.) I am planning to use this to run my Christmas light show as I have a spare desktop to run the program in the garage. In this type of setup, the code on the arduino only tells it what it needs to know to become the generic plug-in for vixen and doesn't actually contain code for the sequence, so this wouldn't work if you wanted a standalone.

Beyond the arduino outputs, everything should be the same as dany's setup. Then your songs/light shows are only limited to your patience with the sequencer.

Unfortunately, like you, I am still in the production phase and don't have a finished product to show such as dany's. I am as far as running some test LEDs with the sequence on a bread board, so theoretically, I'll build the board with the relays and be good to go...

http://www.youtube.com/watch?v=bucQrRSpv7Y
dany32412 (author) in reply to blangston1Nov 30, 2011. 2:12 PM
WWWWOOOOWWW!!!!! That's awesome. Thanks blangston1 for introducing me to Vixen. I think i might put the lights up again this year, but this time use vixen to sync the music with the lights (my old process was very inefficient). You could probably put an xbee on a computer, sending all the data to remote controller box out in the yard. Then just run some speaker wire from your computer to a speaker, and boom your set. I might note that i have had issues with the arduino sometimes getting too cold, and actually getting kinda buggy. To solve that problem I'll probably have have to make a climate controlled box with a heating coil and some insulation. Once again, thanks for showing us Vixen, and i hope all goes well with your project.
blangston1 in reply to dany32412Nov 30, 2011. 3:47 PM
No problem! I'm glad you think it might work for your setup.

I like your idea about the xbee and the climate controlled box. However, part of the deal in getting my wife on board with turning our house into a musical light show involved committing to a budget of practically $0, so I'm working with only components that I already have. But thanks for the tip about the temp of the arduino. I realized that my crawlspace door in the floor of my guest room closet is within a few feet from the nearest crawlspace vent to the front yard. I think I'll set up the whole operation in my climate controlled ;-) guest room, and run the cables beyond the relay through the crawlspace to the front yard.

I also plan on using an FM transmitter to play my music. A buddy that's helping me with some of the wiring work told me that the range of the common dashboard mp3 player transmitters can be boosted by simply soldering a longer wire to their antenna on the cb and coiling around a rod. I guess we'll see if that actually works or not.

Let me know if you can't find the vixen plug-in code for the arduino, and good luck to you too!
dany32412 (author) in reply to donphippsOct 29, 2011. 11:37 AM
You could possibly connect a little microphone and make VU type of a thing. You know how djs have those meters that show the.... beat in the music. (i dont really know what it shows) Other than that, i probably could help you. Try posting on the arduino forum.
EdDruino says: Nov 15, 2011. 3:46 PM
this is my version of your pcb, it's a grate project and i will make it for this christmas! nice itable!!
craciun_pcb.jpg
psychodot5415 says: Jun 4, 2011. 10:10 PM
Nice job. I am combining your idea with a portion of one of the Daft Punk projects -- the part that takes input from a stereo mini plug to the Arduino's analog in 0. My question concerns the PCB. I see that you made separate
traces for the power source to the relays and connected them together with wire. Was there a reason you didn't connect the wire once and combine all the power in traces to the relays into one long trace? PCB overheat?
dany32412 (author) in reply to psychodot5415Jun 22, 2011. 8:54 PM
Sorry i didn't message you earlier, but it was actually a pcb design flaw. When i made the pcb i wasn't thinking, so instead of making a new board i just jumped them with wires. It made me mad, cause now it's pretty ugly.... but what are you gonna do. If i were you i would just jump them using copper traces, you shouldn't have any problems. Good luck
psychodot5415 in reply to dany32412Aug 12, 2011. 5:36 PM
I finished and published. Check out http://www.instructables.com/id/Arduino-Christmas-Light-With-Music-Sync/. Thanks for your help.
izziwbr says: May 27, 2011. 10:36 AM
the lights turn on and off like a VU Meter, or the programming was done by listening to music?
pso24 says: Dec 11, 2010. 2:02 PM
What is the purpose of the transistor in this circuit?
dany32412 (author) in reply to pso24Dec 11, 2010. 8:26 PM
It serves as a way to switch the relay on and off, and a Arduino protection circuit.
moose517 says: Dec 5, 2010. 1:39 PM
@tbonz247, i would assume since the orange wire is what powers that tree, it doesn't need to continue down the line. The white needs to as its the common ground for them all.
dany32412 (author) in reply to moose517Dec 5, 2010. 4:47 PM
yep, exactly
dany32412 (author) says: Nov 28, 2010. 11:23 AM
check to make sure that your power leads arn't fliped on the pcb.
led235 says: Nov 18, 2010. 2:41 PM
Hi, i have the whole schematic set up according to your drawing in step 2, I cannot get my lights to blink, the arduino works, but the lights do not blink, they are just solid on. when i unplug the 5 volt supply, the lights turn out.

Could there be a mistake in your drawing? I know i may have messed up somewhere, but what is your opinion.
Thanks for your help!
dany32412 (author) in reply to led235Nov 19, 2010. 4:55 PM
Make sure your transistors are in the right way, if there in backwards, then they would probably cause the lights to stay on. The relay's coil doesn't have any polarity so the only cause could be the transistors. Hope this helps, tell me what happens.
led235 in reply to dany32412Nov 27, 2010. 7:11 PM
I put a brand new transistor in the circuit in the other direction, and the same thing happened. could i just use my outputs on my arduino to make the relay work and just ignore the transistor and resistor and just have the arduino connected to the relay coil?
thanks, sorry it took so long to get back to you.
dany32412 (author) in reply to led235Nov 28, 2010. 11:22 AM
if your going to do that then i would use a seperater 7805 power regulator, and put a heat sync on it. That way the arduino's on baord regulator doesnt get ruined.
Defaultio says: Dec 23, 2009. 1:06 PM
I made my circuits but there was a problem- the relays would make a small click but they would not complete their circuit. After tinkering, I found out that if I take the resistor out and bring the Arduino pin directly to the transistor then it would work. Can I just take out the resistor and it will work safely?
dany32412 (author) in reply to DefaultioDec 23, 2009. 2:53 PM
do you have the pins set as outputs on the arduino sketch?
led235 in reply to dany32412Nov 18, 2010. 2:40 PM
Hi, i have the whole schematic set up according to your drawing in step 2, I cannot get my lights to blink, the arduino works, but the lights do not blink, they are just solid on. when i unplug the 5 volt supply, the lights turn out.

Could there be a mistake in your drawing? I know i may have messed up somewhere, but what is your opinion.
Thanks for your help!
tbonz247 says: Oct 5, 2010. 10:26 AM
in image 5... what did u do with the other orange wire... the side not crimped...
lane29 says: Aug 10, 2010. 11:41 PM
you could find a serial led driver and then you yould not need anything but the relays
1-40 of 80Next »
Pro

Get More Out of Instructables

Already have an Account?

close

PDF Downloads
As a Pro member, you will gain access to download any Instructable in the PDF format. You also have the ability to customize your PDF download.

Upgrade to Pro today!