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:
Remove these ads by
Signing UpStep 1: Parts You'll Need
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)














































Visit Our Store »
Go Pro Today »




void loop() {
for (int i = 0; i < channelsLength; i++) {
digitalWrite(channels[i], HIGH);
Serial.println(i);
Serial.print("On");
}
http://www.youtube.com/watch?v=JdZwBIdWHvA&feature=youtu.be
Thanks!
Front:
http://www.redlightning.net/front.jpg
Back:
http://www.redlightning.net/back.jpg
The pins on my optocoupler are thus (Mouser lists the one in your how-to as obsolete):
1 6
2 5
3 4
Datasheet is here:
http://html.alldatasheet.com/html-pdf/53864/FAIRCHILD/MOC3031M/407/1/MOC3031M.html
Given that, which pins should I short?
int channels[]={6,7,8,15,16,17,18,19};
int channelsLength = 8;
void setup() {
Serial.begin(9600);
for (int i = 0; i < channelsLength; i++)
pinMode(channels[i], INPUT);
}
void loop() {
for (int i = 0; i< channelsLength; i++) {
int channel = channels[i];
int sensorValue = digitalRead(channels[i]);
Serial.print("Channel ");
Serial.print(channel);
Serial.print(" reads ");
Serial.print(sensorValue);
Serial.print(". ");
Serial.print(10, BYTE);
delay(1000);
}
}
I've attached images of the front and back of the pcb.
I added a third ground wire since my plug used the third gound.
So I've also added an extra wire block to handle the extra ground wire.
I also ran the plugs for the lights to actual outlet plugs.
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.
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.
Thanks for the assist.
Steve
http://www.st.com/internet/com/TECHNICAL_RESOURCES/TECHNICAL_LITERATURE/DATASHEET/CD00001570.pdf
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).
http://www.mattsphotogallery.com/gallery3/var/albums/2011-12-13%2019.40.46.jpg?m=1323835103
http://www.mattsphotogallery.com/gallery3/var/albums/2011-12-13%2019.40.59.jpg?m=1323835103
http://www.youtube.com/watch?v=Hu9v9kodvyk
http://www.mattsphotogallery.com/gallery3/var/albums/2011-12-13%2019.40.46.jpg?m=1323835103
http://www.mattsphotogallery.com/gallery3/var/albums/2011-12-13%2019.40.59.jpg?m=1323835103
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.
MOC3031 Optocoupler
Z0103 TRIAC
Both resistors mentioned above
You could also do away with the fm transmitter and hook up a powered speaker instead.
In Christmas_Lights_2010.pde change the following:
int channels[]={6,7,8,15,16,17,18,19};
int channelsLength = 8;
to:
int channels[]={16,17,18,19}; // or other 3-4 inputs that you want to use
int channelsLength = 4; // or 3 if you only want 3 channels
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.
Thanks again.
http://www.mouser.com/Search/ProductDetail.aspx?R=512-MOC3031-M
thanks
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.
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 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).
why did you draw connectors as common between two triacs?
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.
mojarab@hotmail.com
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.
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 "high" notes of the song, and another with the "low" notes or bass? Could there be different patterns depending on the "volume" of the song?
I think you've done great work so far. Thanks!
http://www.youtube.com/watch?v=cepyTHrfWQg
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.
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 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