3 Channel Arduino Powered Christmas Light Controller!

by Robot Lover in Circuits > Arduino

25353 Views, 62 Favorites, 0 Comments

3 Channel Arduino Powered Christmas Light Controller!

SDC11732.JPG
For Christmas this year, I wanted to make a really cool project but didn't quite know what to make. As I was getting the Christmas lights out to decorate, there was an old busted Christmas light timer. I took it apart and looked around at the low-voltage circuit. Before this I had never experimented with AC circuits. I decided instead of hacking the timer to just make a whole new circuit, thus starting the AC electronics hobbyist side of me. And here it is, the 3 channel arduino powered Christmas light controller!


CAUTION!! If you decide to build this project you must be CAREFUL! This project is built with AC voltage which CAN BE DEADLY! If you have never worked with AC before, please get supervision from someone that has. Instructables and/or myself are NOT responsible for any injuries caused by the misuse of this project.


If you need any help or perhaps a more detailed description of the schematic, leave a comment.





Tools, Materials and Skills

SDC11626.JPG
SDC11685.JPG
SDC11704.JPG
SDC11630.JPG
SDC11632.JPG
SDC11628.JPG
SDC11627.JPG
SDC11625.JPG
SDC11607.JPG
SDC11634.JPG
SDC11666.JPG
For this project you will need the following tools, materials and skills:

TOOLS:

Soldering iron- you can get one of these for cheap at radioshack or online

Solder- can also be bought at radioshack

Wire cutters and wire strippers- radioshack has them

Something to mark with- I used a sharpie

Sand-paper




MATERIALS:

3, 5 volt relays- I bought mine at radioshack but they can also be bought for cheap online

3, 1N914 diodes

3, NPN transistors- I used 2n3904 but 2n2222 will also work.

Solid and Stranded core Wire- radioshack

Perforated board A.K.A. proto-board- radioshack

male and female header pins- online

Arduino microcontroller- I used an UNO but older versions will also work. You can buy them online and at some radioshacks

Electrical Cord- radioshack or home-improvement store

Electrical outlets- home improvement store or radioshack

electrical tape




SKILLS:

For this project you will have to know how to do the following:

Solder

Read schematics

Work with AC volatge

Have basic knowledge of electronic circuits

how to program and arduino

Make the Shield for the Arduino

SDC11609.JPG
SDC11611.JPG
SDC11612.JPG
SDC11614.JPG
SDC11617.JPG
SDC11619.JPG
SDC11620.JPG
SDC11635.JPG
SDC11637.JPG
SDC11639.JPG
SDC11643.JPG
SDC11647.JPG
SDC11654.JPG
SDC11652.JPG
SDC11665.JPG
SDC11667.JPG
SDC11668.JPG
SDC11713.JPG
This project will have two circuit boards, one that goes on top of the arduino like a shield and one that connects the relays to the arduino through wires. To make the shield, take a piece of proto-board and mark it with a pencil or sharpie so it lines up with the arduino. After you mark it, score it with an x-acto knife. After you have scored it 5 or 10 times snap it at the scored line. Take a piece of your sand paper and stick it to a block of wood. Sand the edges of the board to make it neater. Push the leads in the header pins so they are flush with the plastic, then solder them to the board. Cut a row of 5 female header pins and solder them somewhere on the board. connect them to 5v, GND, digital pin 13, digital pin 12 and digital pin 11.  Continue to the next step.

Make the Relay Board

christmaslightcontroller.jpg
SDC11687.JPG
SDC11688.JPG
SDC11689.JPG
SDC11692.JPG
SDC11693.JPG
SDC11696.JPG
SDC11700.JPG
SDC11708.JPG
SDC11680.JPG
SDC11714.JPG
Following the schematic above, solder your relays, transistors and jumper wires onto the board. Solder a diode between the coil leads of each relay. Solder all of the 5 volt lines together ultimately coming down to a single stranded core wire. Also, solder a stranded core wire to each of the base's of the transistor. Finally, connect all of the emitters together and solder a stranded core wire to the connected emitters. These 5 stranded wires now need to be soldered to 5 header pins. This will connect to the female header pin on the shield we made on the last step. Finally, connect the hot wire of the electrical cord to the hot side on all of the outlets. Connect the neutral side to the throw of the switch in the relays. If you don't understand this explanation refer to the schematic above or leave a comment!

Program the Arduino

SDC11718.JPG
The following code will cycle through turning on each relay:

void setup() {

pinMode(13,OUTPUT);
pinMode(12,OUPTUT);
pinMode(11,OUTPUT);
}

void loop() {

digitalWrite(13,HIGH);
delay(900);
digitalWrite(13,LOW);
delay(900);
digitalWrite(12,HIGH);
delay(900);
digitalWrite(12,LOW);
delay(900);
digitalWrite(11,HIGH);
delay(900);
digitalWrite(11,LOW);
delay(900);
}