Tuesday, December 2, 2014

Arduino experiments

How about some christmas lights?

Having muled Arduino kits to Uganda, I spent some time at Micro-Center looking wide eyed at all the things I can build.  Since I don't have much experience with Arduino, I engaged with my 14 year old and he and I built a christmas light controller.  Its surprisingly simple.

Basically you need something that can handle Logic.  I went for an Arduino Mega 2560 R3 .  This is where the program that will run the lights, lives.  The Arduino outputs in 5vdc or 3.3vdc.  Neither of these voltages will work and they are very limited in the amount of current draw something can have.  Here in the US we use 120VAC at 60hz.  So I need to switch that on and off.

SainSmart makes components that will do this.  Basically I need to take the 5V signal voltage from the Arduino and switch on and off 120v.  The thing I need is a relay.  I decided on switching on and off 8 different channels.  So I picked up a Solid State Relay Bank.

Wiring was simple, I took 4 standard $.59 outlets and cut their hot leg off making each outlet independent.  (Similar to making a 1/2 hot outlet that runs on a switch.)

Run a hot line to each leg of the relay bank, then run the other hot line off to the outlet.  Tie the common together and viola, switched outlet that runs on Arduino.

Need more information on how to build it?  Ask, or use this Instructable.  I didn't set mine up for music, just turn off and on.  Now my 14 year old is all into Christmas Lights because he makes them do whatever he wants.

I am going to build another one of these and show all my wiring, right now it is working perfectly but looks like a clunky prototype.

Maybe a big christmas light tree.  Then one for the house.....

The point of this post is, if you want to make things like this happen, do it.  I spent a little time on google and made it work in my kitchen.  I now have all these ideas for how to make my house more efficient using these types of controllers.