It's Christmas season once again and that means its time to get together with all of your friends and family to share in the joys of the holiday spirit. In past times, with all of the food, drink and merriment, it has been easy to get too lazy to get up off the couch and change the tree's lighting. Fortunately, we are living in the modern era, and this no longer needs to be a problem. With the assistance of our good friend, the Arduino and a Twitter-enabled cellphone, you can now update the tree as you slouch in a food-induced coma on the couch. Simply tweet the colors you would like to see lit and the tree will light up like Christmas magic.

Step 1: Go Get Stuff

You will need:

- (x2) Arduino Uno
- (x2) Wireless SD shield
- (x2) XBee transceivers
- 8 x 6 x 3 project enclosure
- Laser cut panel (file) ***
- (x4) sockets
- 12 awg stranded wire
- 22 awg red and black solid core wire
- (x1) Multipurpose PCB
- (x4) 9V relay (2A @ 120V)
- (x4) 2N3904 transistors
- DPDT rocker switch
- 9V battery connectors
- 9V battery
- 9V battery holder
- M-type power plug
- Lamp cord
- Wire nut (large enough to hold five 12 awg wires)
- (x4) 6-32 x 1/2"
- (x4) 4-40 x 1-1/2"
- 4-40 x 1/2"
- (x4) 6-32 nuts
- (x5) 4-40 nuts
- (x4) adhesive rubber pads (optional)
- USB A/B cable
- A computer

*** If you don't have a laser cutter, you can use a cutting service like Ponoko or print out the file and use it as a cutting guide for making the panel with more traditional tools.
Very interesting project. I started to do something like this with battery powered xmas lights, freebasic. twidge, and the parallel port, but had other projects to work on. .
could you put in the arduino code.<br>
See step 16
(I'm posting this separately from the other comment so that the resulting threads are separate.)<br><br>As a side note, take a look at the &quot;ADC and digital I/O line support&quot; section of the XBee manual. The XBee could drive the transistors directly, making the Arduinos in this project entirely superfluous. The PC-side program would simply have to place the units into API mode and send the appropriate Dx commands. <br><br>Although if your PC doesn't have a UART (I see in the photo that it's a modern Mac), then using an Arduino as a USB-to-serial converter is a practical, albeit expensive, way to do it.<br><br>However, that's all splitting hairs. The project works, it's very well documented, and the photos are clear and plentiful. Nice writeup!
I'm concerned that the lack of snubber diodes on the relay coils means bad things for the drive transistors and potentially the Arduino itself.<br><br>Relay coils, like all coils, are inductive. When you place voltage across a coil, current starts flowing through it, building up a magnetic field in the coil. When you remove the source of current, that magnetic field tries to collapse, but the energy in the field has to go somewhere. It forces the current to continue flowing until the field is dissipated, raising the voltage if necessary. This effect is how switchmode power supplies work.<br><br>If you've turned on the current with a transistor, then when you turn the transistor off again, the voltage will spike until the transistor conducts anyway, damaging the transistor. Your circuit might endure a thousand on-off cycles before anything obviously bad happens, or it might smoke right away. When the transistor fails, the rest of the energy might get dumped into the Arduino.<br><br>To prevent this, put diodes in parallel with the relay coils, but orient them so that they're not normally conducting. When the coil de-energizes, the inductive kick is opposite in polarity, and it will flow harmlessly through the bypass diode, rather than beating up the transistor. It's essential to provide this free-wheeling diode on every relay or solenoid coil! Motors exhibit the same effect, btw.
I love it! You should probably put a 1k ohm resistor limiting the current to the base of each transistor.
hey everyone post your tree's twitter handle so i can wake up on xmas and turn all your lights off/on/nutty
Awesome project, looks really neat and professional. Ive wanted to do something like this for years, but never thought of twitter integration. Truly ingenious, and much beyond my abilities, very good work. <br><br>However being an electrician, I just want to warn you of a few things. Your connections on the receptacles need a stak-on connector because their stranded (although that will work fine assuming no strands are moving around) but my major concern is the lack of a ground. Sure Christmas lights don't have them, but you never know what could happen, and I strongly recommend installing one. Or install receptacles that don't have a ground prong. And because your plugs are polarity specific, check your lines coming in. 110v on a neutral will destroy (sometimes violently) some equipment (as I learned when I modified a string of LED lights to fit in a non polarized plug, not pretty) Also, because you have 20A T-Slot receptacles, an your relays are only good for 2A, I recommend a 2A fuse for each plug, just to protect your kick ass project :) <br><br>I was also wondering why you opted for a 9V battery instead of an actual power supply such as a wal wart? It wouldn't be hard to place the transformer inside of the project box and connect 110v to it in there, so you still only have a lamp cord. <br><br>But Very good instructable. You covered every step thoroughly and made it easy for anyone to build this (which I'll be doing soon :)) keep the good ideas flowing and stay safe this Christmas.
<strong>@bobrigewitch</strong>&nbsp; When someone states that they have credentials in a certain area, it implies that the information they give is accurate and truthful. Since your post contains incorrect advice regarding electricity, I am compelled to respond to set the record straight.<br> <br> I happen to be an electronics engineer with electrical certification and 26 years in the industry. I will be as brief as possible, and will discuss only three of the assertions.<br> <br> <strong>Ground</strong> - Your &quot;major concern&quot; with the project not having a ground is unfounded. Many appliances and consumer goods do NOT have a ground, toaster, coffee maker, shaver, vacuum cleaner etc. As you pointed out, the Christmas lights have no ground - there is absolutely no benefit or added safety from including a ground. Since you &quot;strongly recommend installing one&quot;, please explain why.<br> <br> Do you know why the ground pin is longer than the two flat blades on a 3-prong plug? It's so that the equipment's safety (ground) is last to be disconnected when unplugged.<br> <br> <strong>Polarity</strong> - You stated &quot;110v on a neutral will destroy...some equipment...&quot;&nbsp;&nbsp;&nbsp;<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; <strong>***</strong>&nbsp; This is 100% dead WRONG&nbsp; <strong>***</strong> &nbsp;&nbsp;<br> There would not be a single piece of electrical equipment that would be harmed by having its neutral and &quot;hot&quot; terminals interchanged. With Alternating Current (AC) the polarity of plus-minus or positive-negative, is swapped back and forth 60 times per second. The only reason one terminal is designated as &quot;neutral&quot; is because it is electrically attached to ground at the distribution source that provides power to the building. The purpose of &quot;bonding out&quot; the neutral like that is purely for safety. Outlets/plugs with the larger slot/pin is to preserve this safety feature by creating a polarity scheme. For instance, a light fixture would have the shell of the socket connected to neutral in case someone's fingers touched the metal threads on the base of a lightbulb, in case the power was still on while changing it. Not all electrical devices make use of the polarity feature (it's optional) and you'll still see many plugs with same-sized blades. Polarised plugs are becoming almost the standard now, but that has more to do with plug fabrication reasons rather than the product's electrical requirement.<br> <br> <strong>Fuses</strong> - I do agree that 2A fuses would be handy for each outlet, but the reason is entirely for the protection of the 2A relays, NOT because of the capacity of the outlets. Again, MANY household items do not contain fuses (toaster, vacuum, lamps), but many electronic devices do in order to protect ultra-sensitive circuitry, but those are not replaceable by the user.<br> <br> My apologies for the long post, but people need accurate information when dealing with electricity.<br> <br> VERY nice instructable by the way - well thought out and well documented with excellent pictures. A pleasure indeed.&nbsp;&nbsp; ~Dave
I thank you for your criticism, I guess I wasn't clear enough on a few things, allow me to explain. <br><br>Ground - My concern with ground is that some appliances use a 3 prong plug, and those appliances have a ground because the engineer who designed it felt it should have one, and since his plugs have a 3 prong receptacle, it is possible that these grounded appliances would be plugged into this unit, therefore there should be a ground to accommodate for these circumstances. <br><br>Polarity - I agree 110v on the neutral and 110v on the hot will result in 0v potential, however incorrect polarity would mean there would be 110v on the neutral and 0v on the hot, resulting in 110v that is reverse bias. They design polarized plugs (one blade wider than the other) because some equipment can be harmed from this situation. <br><br>Fuses - your right, they would be more for the protection of the relays, however that directly corresponds to the load that can be placed on the relays. My idea was just &quot;2A Protection&quot;<br><br>I am new to this site and just thought I'd help. Also next time allow me time to defend myself instead of bashing my knowledge Dave. Merry Christmas. <br><br>
Actually, in AC, polarity doesn't matter to the circuit.&nbsp; AC is constantly switching polarity.&nbsp; The best way to describe it is to use the physics concept of &quot;frame of reference&quot;.&nbsp; A person's body is usually grounded.&nbsp; This means any voltages are relative to, or referenced to, ground.&nbsp; This means that to us it seems neutral is 0 volts and hot switches back and forth between 110 and -110 volts.&nbsp; The appliance is not referenced to anything, so to it, one wire is 110 volts higher than the other, and then they switch with each other.&nbsp; It doesn't know which is hot and which is neutral.<br> <br> The polarized plug is just for people's safety.&nbsp; Since people are referenced to ground, neutral is safe at 0 volts to us while hot is dangerous at between +110 and -110 volts.&nbsp; This way, engineers can make sure it is much harder for people to come into contact with hot wire than the neutral one since they know which will be zero volts relative to the user.
I guess your right there. Thanks for the clarification. Although my 'why' is wrong being sure of correct polarity still isn't a bad idea.
It totally says that this was submitted by radioshack on the great create website!
Very nice!
Sweet project as usual. I'm curious, why 2 arduinos and python rather than an ethernet shield or wifi shield. Also, thanks for using alot of easily accessible RadioShack parts. I'm kinda thinking that's why 2 arduino and a computer.
I tried to stick with easily accessible Radioshack parts ;-)

About This Instructable




Bio: My name is Randy and I founded the Instructables Design Studio. I'm also the author of the books 'Simple Bots,' and '62 Projects to ... More »
More by randofo:Custom Print Kimono Mad Scientist Extension Cord DIY Life-Sized Cardboard Cutout 
Add instructable to: