Instructables
Picture of Arduino Christmas Light Controller
relay.JPG
If you liked this instructable, consider checking out my new website www.TheSiliconJunkie.com

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


Step 2:

Picture of
Once you have all your parts i started out by testing one relay on a bread board
1. Put all the components in acourding to the scematic (image 1)
2. Open the arduino program and goto open>digital>Blink
3. Upload it to your arduino
4. Connect where it says arduino pin on the schematic to digital pin 13

if all works well then its time to multiply that by 8 on a pcb

Step 3: Making the PCB

DSC_0175.jpg
sorry this step isnt to detailed because i forgot to take pictures but heres my best

BRAIN STORM:
I started by jotting down some idea patterns on some paper heres what i came up with (image 1)

DRILL THE HOLES:
then i placed each component on the pcb and marked it on the pcb. Then i drilled all the holes
IMPORTANT: KEEP IN MIND WHICH SIDE HAS THE COMPONENTS ON IT AND WHICH SIDE HAS THE TRACES

CONNECT THE DOTS:
Once all the holes are drilled it just a simple game of connect the dots. Do this with your sharpie it must be a "Sharpie" sharpie not some no name brand because i tested 3 types of markers 2 no names and the sharpie, the no namers ink bubbled up during the etching process (not a good thing). Also make sure to color in the lines dark, and your 5 volt and GND traces a little thicker than the others.

ETCHING TIME:
Once you are done drawing your lines and are satisfied with it. Get a tuperware bowl and some etchant solution and etch your board, keeping an eye on it so it doesnt over etch. When its done take it out and clean off all the excess acid and use some nail polish remover or rubbing alcohol to clean off all the sharpie.

SOLDER IN THE COMPONENTS:
Before i started soldering i took some 800 grit sand paper and sanded down the copper a little so it was clean, that way the solder sticks to it alot better. Now just place the components and solder them in one at a time. (image 2)

WIRING:
I chose to use a "weaving" method to reduce tension on the solder joints, which so far has seemed to work great. (image 3,4)

Step 4: Wire up your display

Picture of Wire up your display
DSC_0177.jpg
DSC_0182.jpg
DSC_0188.jpg
For my display i chose these 8 trees in my yard. (image 1) You can pick what ever you want as long as the arduino can somehow be inside and warm. For me the best option was to put him in the garage. I went to home depot and bought some 5 strand sprinkler wire cause it was on sale for $24 for 500ft. (image 2). Since your setup probable woulnt be the same as mine ill just show you how wire on each plug.

1) Get 8 dead christmass lights and cut off the female plug (image 4)
2) Get all the supplies in image 5
3) Layout the cable the way you want it
4) Find where your gonna put the plug to connect the tree into and using the knife cut open the casing
5) Pull out the ground (for me its WHITE) and cut it in half, strip both ends and connect both sides of the ground to one wire on the plug using a crimp connector.
6) Do the same thing for the colored wire which is the power coming into the tree. (image 6)
7) Tape up the connectors nicely (image 7)
8) Fold the wires nicely against the cable and tape it again (image 8)

Once done it should look like image 9. Now just do that to all the trees.

Step 5: Bringing it all together

Once all the plugs are connected and you have every going to where it needs to be, we need to connect each tree to the pcb.

1) i used some wire from the dead lights to connect all the positives on the pcb (image 1)
2) get the crimp connectors and connect some onto the wires coming from the trees like (image 2) leave the white be for now
3) connect those wires to the pcb in the correct order
4) i took an old exstention cord and cut the cord off and connected one end to the 120v input on the pcb and the other to the 2 whites
5) lastly connect the arduino up to the pcb (image 3)
6) tape up those connection and store it somewhere safe
7) upload the Joy To The World code, and see if it works. if so GREAT!!!! if not, not good. if you cant figure out the problem post a comment and ill try my best at helping you.

Joy To The World code:

int tree1 = 6;
int tree2 = 7;
int tree3 = 8;
int tree4 = 9;
int tree5 = 2;
int tree6 = 3;
int tree7 = 4;
int tree8 = 5;
int s = 150;
int ds = 225;
int e = 300;
int de = 450;
int q = 600;
int dq = 900;
int h = 1200;
int dh = 1800;
int start;
int end;
int time;

void setup()
{
  pinMode(tree1, OUTPUT);
  pinMode(tree2, OUTPUT);
  pinMode(tree3, OUTPUT);
  pinMode(tree4, OUTPUT);
  pinMode(tree5, OUTPUT);
  pinMode(tree6, OUTPUT);
  pinMode(tree7, OUTPUT);
  pinMode(tree8, OUTPUT);
  digitalWrite(tree1,HIGH);
  delay(1000);
  digitalWrite(tree2,HIGH);
  delay(1000);
  digitalWrite(tree3,HIGH);
  delay(1000);
  digitalWrite(tree4,HIGH);
  delay(1000);
  digitalWrite(tree5,HIGH);
  delay(1000);
  digitalWrite(tree6,HIGH);
  delay(1000);
  digitalWrite(tree7,HIGH);
  delay(1000);
  digitalWrite(tree8,HIGH);
  delay(1000);
  digitalWrite(tree1,LOW);
  digitalWrite(tree2,LOW);
  digitalWrite(tree3,LOW);
  digitalWrite(tree4,LOW);
  digitalWrite(tree5,LOW);
  digitalWrite(tree6,LOW);
  digitalWrite(tree7,LOW);
  digitalWrite(tree8,LOW);
  Serial.begin(9600);
}

void loop()
{
  start = millis();
  digitalWrite(tree1, HIGH);
  digitalWrite(tree8, HIGH);
  delay(q);
  digitalWrite(tree1, LOW);
  digitalWrite(tree8, LOW);

  digitalWrite(tree2, HIGH);
  digitalWrite(tree7, HIGH);
  delay(de);
  digitalWrite(tree2, LOW);
  digitalWrite(tree7, LOW);

  digitalWrite(tree3, HIGH);
  digitalWrite(tree6, HIGH);
  delay(s);
  digitalWrite(tree3, LOW);
  digitalWrite(tree6, LOW);

  digitalWrite(tree4, HIGH);
  digitalWrite(tree5, HIGH);
  delay(1050);
  digitalWrite(tree4, LOW);
  digitalWrite(tree5, LOW);

  digitalWrite(tree1, HIGH);
  digitalWrite(tree8, HIGH);
  delay(s);
  digitalWrite(tree1, LOW);
  digitalWrite(tree8, LOW);

  digitalWrite(tree2, HIGH);
  digitalWrite(tree7, HIGH);
  delay(q);
  digitalWrite(tree2, LOW);
  digitalWrite(tree7, LOW);

  digitalWrite(tree3, HIGH);
  digitalWrite(tree6, HIGH);
  delay(q);
  digitalWrite(tree3, LOW);
  digitalWrite(tree6, LOW);

  digitalWrite(tree4, HIGH);
  digitalWrite(tree5, HIGH);
  delay(dq);
  digitalWrite(tree4, LOW);
  digitalWrite(tree5, LOW);

  digitalWrite(tree1, HIGH);
  digitalWrite(tree2, HIGH);
  digitalWrite(tree7, HIGH);
  digitalWrite(tree8, HIGH);
  delay(e);
  digitalWrite(tree1, LOW);
  digitalWrite(tree2, LOW);
  digitalWrite(tree7, LOW);
  digitalWrite(tree8, LOW);

  digitalWrite(tree2, HIGH);
  digitalWrite(tree3, HIGH);
  digitalWrite(tree6, HIGH);
  digitalWrite(tree7, HIGH);
  delay(dq);
  digitalWrite(tree2, LOW);
  digitalWrite(tree3, LOW);
  digitalWrite(tree6, LOW);
  digitalWrite(tree7, LOW);

  digitalWrite(tree1, HIGH);
  digitalWrite(tree2, HIGH);
  digitalWrite(tree7, HIGH);
  digitalWrite(tree8, HIGH);
  delay(e);
  digitalWrite(tree1, LOW);
  digitalWrite(tree2, LOW);
  digitalWrite(tree7, LOW);
  digitalWrite(tree8, LOW);

  digitalWrite(tree3, HIGH);
  digitalWrite(tree4, HIGH);
  digitalWrite(tree5, HIGH);
  digitalWrite(tree6, HIGH);
  delay(dq);
  digitalWrite(tree3, LOW);
  digitalWrite(tree4, LOW);
  digitalWrite(tree5, LOW);
  digitalWrite(tree6, LOW);

  digitalWrite(tree1, HIGH);
  digitalWrite(tree2, HIGH);
  digitalWrite(tree7, HIGH);
  digitalWrite(tree8, HIGH);
  delay(e);
  digitalWrite(tree1, LOW);
  digitalWrite(tree2, LOW);
  digitalWrite(tree7, LOW);
  digitalWrite(tree8, LOW);

  digitalWrite(tree1, HIGH);
  digitalWrite(tree2, HIGH);
  digitalWrite(tree3, HIGH);
  digitalWrite(tree4, HIGH);
  digitalWrite(tree5, HIGH);
  digitalWrite(tree6, HIGH);
  digitalWrite(tree7, HIGH);
  digitalWrite(tree8, HIGH);
  delay(dq);
  digitalWrite(tree1, LOW);
  digitalWrite(tree2, LOW);
  digitalWrite(tree3, LOW);
  digitalWrite(tree4, LOW);
  digitalWrite(tree5, LOW);
  digitalWrite(tree6, LOW);
  digitalWrite(tree7, LOW);
  digitalWrite(tree8, LOW);

  digitalWrite(tree8, HIGH);
  delay(e);
  digitalWrite(tree8, LOW);

  digitalWrite(tree1, HIGH);
  delay(e);
  digitalWrite(tree1, LOW);

  digitalWrite(tree7, HIGH);
  delay(e);
  digitalWrite(tree7, LOW);  

  digitalWrite(tree2, HIGH);
  delay(e);
  digitalWrite(tree2, LOW);

  digitalWrite(tree6, HIGH);
  delay(e);
  digitalWrite(tree6, LOW);

  digitalWrite(tree3, HIGH);
  delay(de);
  digitalWrite(tree3, LOW);

  digitalWrite(tree5, HIGH);
  delay(s);
  digitalWrite(tree5, LOW);
 
  digitalWrite(tree4, HIGH);
  delay(e);
  digitalWrite(tree4, LOW);
 
  digitalWrite(tree8, HIGH);
  delay(e);
  digitalWrite(tree8, LOW);

  digitalWrite(tree1, HIGH);
  delay(e);
  digitalWrite(tree1, LOW);

  digitalWrite(tree7, HIGH);
  delay(e);
  digitalWrite(tree7, LOW);  

  digitalWrite(tree2, HIGH);
  delay(e);
  digitalWrite(tree2, LOW);

  digitalWrite(tree6, HIGH);
  delay(e);
  digitalWrite(tree6, LOW);

  digitalWrite(tree3, HIGH);
  delay(de);
  digitalWrite(tree3, LOW);

  digitalWrite(tree5, HIGH);
  delay(s);
  digitalWrite(tree5, LOW);
 
  digitalWrite(tree4, HIGH);
  delay(e);
  digitalWrite(tree4, LOW);
 
  digitalWrite(tree2, HIGH);
  digitalWrite(tree7, HIGH);
  delay(e);
  digitalWrite(tree2, LOW);
  digitalWrite(tree7, LOW);
 
  digitalWrite(tree1, HIGH);
  digitalWrite(tree8, HIGH);
  delay(e);
  digitalWrite(tree1, LOW);
  digitalWrite(tree8, LOW);
 
  digitalWrite(tree2, HIGH);
  digitalWrite(tree7, HIGH);
  delay(e);
  digitalWrite(tree2, LOW);
  digitalWrite(tree7, LOW);
 
  digitalWrite(tree1, HIGH);
  digitalWrite(tree8, HIGH);
  delay(e);
  digitalWrite(tree1, LOW);
  digitalWrite(tree8, LOW);
 
  digitalWrite(tree2, HIGH);
  digitalWrite(tree7, HIGH);
  delay(75);
  digitalWrite(tree2, LOW);
  digitalWrite(tree7, LOW);
 
  digitalWrite(tree3, HIGH);
  digitalWrite(tree6, HIGH);
  delay(75);
  digitalWrite(tree3, LOW);
  digitalWrite(tree6, LOW);
 
  digitalWrite(tree4, HIGH);
  digitalWrite(tree5, HIGH);
  delay(dq);
  digitalWrite(tree4, LOW);
  digitalWrite(tree5, LOW);
 
  digitalWrite(tree4, HIGH);
  digitalWrite(tree5, HIGH);
  delay(75);
  digitalWrite(tree4, LOW);
  digitalWrite(tree5, LOW);
 
  digitalWrite(tree3, HIGH);
  digitalWrite(tree6, HIGH);
  delay(75);
  digitalWrite(tree3, LOW);
  digitalWrite(tree6, LOW);
 
  digitalWrite(tree4, HIGH);
  digitalWrite(tree5, HIGH);
  delay(e);
  digitalWrite(tree4, LOW);
  digitalWrite(tree5, LOW);
 
  digitalWrite(tree3, HIGH);
  digitalWrite(tree6, HIGH);
  delay(e);
  digitalWrite(tree3, LOW);
  digitalWrite(tree6, LOW);
 
  digitalWrite(tree4, HIGH);
  digitalWrite(tree5, HIGH);
  delay(e);
  digitalWrite(tree4, LOW);
  digitalWrite(tree5, LOW);
 
  digitalWrite(tree3, HIGH);
  digitalWrite(tree6, HIGH);
  delay(75);
  digitalWrite(tree3, LOW);
  digitalWrite(tree6, LOW);
 
  digitalWrite(tree2, HIGH);
  digitalWrite(tree7, HIGH);
  delay(75);
  digitalWrite(tree2, LOW);
  digitalWrite(tree7, LOW);
 
  digitalWrite(tree1, HIGH);
  digitalWrite(tree8, HIGH);
  delay(dq);
  digitalWrite(tree1, LOW);
  digitalWrite(tree8, LOW);
 
  digitalWrite(tree1, HIGH);
  digitalWrite(tree2, HIGH);
  digitalWrite(tree7, HIGH);
  digitalWrite(tree8, HIGH);
  delay(75);
  digitalWrite(tree1, LOW);
  digitalWrite(tree2, LOW);
  digitalWrite(tree7, LOW);
  digitalWrite(tree8, LOW);
 
  digitalWrite(tree2, HIGH);
  digitalWrite(tree3, HIGH);
  digitalWrite(tree6, HIGH);
  digitalWrite(tree7, HIGH);
  delay(75);
  digitalWrite(tree2, LOW);
  digitalWrite(tree3, LOW);
  digitalWrite(tree6, LOW);
  digitalWrite(tree7, LOW);
 
  digitalWrite(tree3, HIGH);
  digitalWrite(tree4, HIGH);
  digitalWrite(tree5, HIGH);
  digitalWrite(tree6, HIGH);
  delay(e);
  digitalWrite(tree3, LOW);
  digitalWrite(tree4, LOW);
  digitalWrite(tree5, LOW);
  digitalWrite(tree6, LOW);
 
  digitalWrite(tree1, HIGH);
  digitalWrite(tree2, HIGH);
  digitalWrite(tree3, HIGH);
  digitalWrite(tree4, HIGH);
  digitalWrite(tree5, HIGH);
  digitalWrite(tree6, HIGH);
  digitalWrite(tree7, HIGH);
  digitalWrite(tree8, HIGH);
  delay(q);
  digitalWrite(tree1, LOW);
  digitalWrite(tree2, LOW);
  digitalWrite(tree3, LOW);
  digitalWrite(tree4, LOW);
  digitalWrite(tree5, LOW);
  digitalWrite(tree6, LOW);
  digitalWrite(tree7, LOW);
  digitalWrite(tree8, LOW);
 
  digitalWrite(tree1, HIGH);
  digitalWrite(tree8, HIGH);
  delay(e);
  digitalWrite(tree1, LOW);
  digitalWrite(tree8, LOW);
 
  digitalWrite(tree2, HIGH);
  digitalWrite(tree7, HIGH);
  delay(de);
  digitalWrite(tree2, LOW);
  digitalWrite(tree7, LOW);
 
  digitalWrite(tree3, HIGH);
  digitalWrite(tree6, HIGH);
  delay(s);
  digitalWrite(tree3, LOW);
  digitalWrite(tree6, LOW);
 
  digitalWrite(tree4, HIGH);
  digitalWrite(tree5, HIGH);
  delay(e);
  digitalWrite(tree4, LOW);
  digitalWrite(tree5, LOW);
 
  digitalWrite(tree3, HIGH);
  digitalWrite(tree6, HIGH);
  delay(e);
  digitalWrite(tree3, LOW);
  digitalWrite(tree6, LOW);
 
  digitalWrite(tree2, HIGH);
  digitalWrite(tree7, HIGH);
  delay(q);
  digitalWrite(tree2, LOW);
  digitalWrite(tree7, LOW);
 
  digitalWrite(tree1, HIGH);
  digitalWrite(tree8, HIGH);
  delay(q);
  digitalWrite(tree1, LOW);
  digitalWrite(tree8, LOW);
 
  digitalWrite(tree1, HIGH);
  digitalWrite(tree2, HIGH);
  digitalWrite(tree3, HIGH);
  digitalWrite(tree4, HIGH);
  digitalWrite(tree5, HIGH);
  digitalWrite(tree6, HIGH);
  digitalWrite(tree7, HIGH);
  digitalWrite(tree8, HIGH);
  delay(h);
  digitalWrite(tree1, LOW);
  digitalWrite(tree2, LOW);
  digitalWrite(tree3, LOW);
  digitalWrite(tree4, LOW);
  digitalWrite(tree5, LOW);
  digitalWrite(tree6, LOW);
  digitalWrite(tree7, LOW);
  digitalWrite(tree8, LOW);
  delay(20000);
 
  end = millis();
  time = end - start;
  Serial.println(time);
}








1-40 of 94Next »
eartaker10 months ago
Awesome, If you go to do this again you can save money and time by buying the 8 relay board on amazon for $12... I got tired of making my own relay boards... Code works awesome.
sotm eartaker9 months ago
Please provide the link?
mrv777 sotm9 months ago

I'm guessing he is referencing this one:

http://www.amazon.com/Kootek-Channel-Module-Arduino-Raspberry/dp/B00C8O9KHA

Dumb-Brit9 months ago
Hi
In the fashion of the Brits, we're ages behind in this sort of stuff but it is something I would love to have a play with. As I am a complete nooooob in all of this stuff, can I ask a silly question and hopefully get an answer? In part 3 making a pcb, there is a picture of the pcb fully soldered, any chance of putting labels on which soldered part represents which component? I'm having a hard time working out what the schematic should actually look like in reference to the top (if that makes sense). Cheers, Rob
MDheliMech1 year ago
After seeing another instructable similar to this I learned about the sainsmart relay modules. Everything is put together and it's cheaper than DIY.
sotm MDheliMech9 months ago
Please provide the link.
MDheliMech sotm9 months ago
The website is sainsmart.com and look for relay boards. I did however end up following this instructable rather than buying the pre made board because I wanted the experience. I did not however do the Copper board I used pre drilled breadboard and soldered the components together. It worked for the most part however I had some difficulty with my seeed studio music shield that I couldn't seem to work out
sotm9 months ago
How did you connect 8 relays to only the 6 outputs the Arduino has?
MDheliMech sotm9 months ago
I am by no means an arduino expert. I can tell you from my experience arduino has more than 6 outputs. It has something more like 14 digital pins however I don't remember exactly. 2 of them I never use. Pin 0 and 1 are the comm pins. The rest if the digital pins I believe are 3 to 13 which can be digital in or out. There are 6 analog I/O pins which I normally use for inputs. I have experience with the arduino uno, nano, and pro mini, which all have this same configuration. The best bet would be to check out the arduino website to be sure.
jimdsouza10 months ago
Can I solder instead of etching? The voltage supply in my country is 220V 50Hz. Will the solder take so much current?
JKPieGuy10 months ago
Just wondering, instead of using crimps and vinyl electrical tape, why didn't you use wire nuts? They do make wire nuts that are designed to withstand the harshness of the outdoors.
MDheliMech11 months ago
Did you bring power in to your relays from 1 power outlet (wall socket) or multiple? Is there a problem running that many lights on one circuit?
MDheliMech1 year ago
Here is my setup so far. Arduino nano controlling LEDs which represent the relays, also controlling an Arduino UNO with an mp3 shield
13, 3:19 AM.jpg
MDheliMech1 year ago
In order to figure out delays for my project I used audacity. It is a free audio editor that allows you to see a point in a song down to the millisecond. Find two points where you want events to happen and subtract one from the other. That will be the delay.
MDheliMech1 year ago
Thank you for this tutorial. I am in the breadboard stage of my build. I will be using the relay circuit with an arduino as you demonstrated. My variation however uses an MP3 player that is also controlled by the arduino. This allows for the music and the light sequence to be played in sync every time. Unfortunately because I want events to happen at specific times I have to write the delays out in the sketch as you did. I will also have multiple songs each with its own individual sequence. I hope to include pics and videos soon.
espongy1 year ago
Hi! Was the 120 volts based on your socket voltage? What if we have 220V? Thanks!
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)  PoisonMondo1 year ago
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.
JLeith1 year ago
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
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?
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
Blakamiss482 years ago
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
Also used vixen to create the sequencing.
rpdthree2 years ago
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)  rpdthree2 years ago
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.
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.
pclever2 years ago
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)  pclever2 years ago
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.
pclever2 years ago
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)  pclever2 years ago
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.
dcopeland12 years ago
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.
donphipps2 years ago
Is there a way to hook up to computer va USB port, i am looking for a way to make light blink to music.
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)  blangston12 years ago
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.
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)  donphipps2 years ago
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.
EdDruino2 years ago
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
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)  psychodot54153 years ago
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
I finished and published. Check out http://www.instructables.com/id/Arduino-Christmas-Light-With-Music-Sync/. Thanks for your help.
1-40 of 94Next »