Introduction: Smart Relay Power Box(SiriProxy Compatible)
If you have ever wanted to control high voltages/currents with an Arduino, setup up a complicated light timer, or even have Siri turn on a Lamp. Then this is an instructable for you! In this instructable in a few simple steps we will build a self-powered smart relay (Arduino style) power box. This box will allow you to safely switch high voltages/currents and since it contains an Arduino compatible board you can program it as you see fit, or even connect it to SiriProxy. Then you just plug it in, and off it goes! Now let’s build it!
Project Box - similar to a 6x2x3, (http://www.radioshack.com/product/index.jsp?productId=2062282)
Smart Relay Board - http://www.sparkyswidgets.com/Products/Store/Details/tabid/81/ProductID/1/Default.aspx
BlueSmirf - bluetooth module http://www.sparkfun.com/products/582
Power switch - Similar to this will work fine (http://www.radioshack.com/product/index.jsp?productId=3118987)
Replacement power cord - something like this from Lowes, HD, Ace (http://tinyurl.com/72n7yqe)
Cable strain relief - Mouser part# 836-1200(http://tinyurl.com/7tlpkaw)
Snap in power plug(x4) - Mouser part# 693-4300.0703(http://tinyurl.com/7pb57h8)
transformer - pretty much any will work as long as it can supply enough for the relays (http://www.radioshack.com/product/index.jsp?productId=2102494)
diodes(x4) - 1n4004, any recitifing diode should work (the 1n400x line is good for the application, http://tinyurl.com/6qen2pg)
capacitor - 220uF electrolytic cap jsut to help keep things clean on the DC output side of the transformer Mouser part# 667-ECA-1HM221(http://tinyurl.com/7ylc8al)
extra wire(14awg) - this can be from the power cord just cut an extra bit off, (we need some for Neutral, Hot, and Ground)
Heat shrink - If you can get color coded great, if not your average Radioshack black stuff will work fine
Crimp connectors - Your standard automotive style crimp connectors for 14awg(male and female, blue colored ones)
3/32 drill bit
9/16 drill bit
Dremel - we'll use this to clean up our rough opening for the sockets and switch
Screwdrivers - a set of tech type screwdrivers should do fine(standard and philips)
Pliers/Wire Cutters - the strain relief can be difficult to push in, pliers make this much easier
Soldering Iron - A decent soldering iron with some good solder
Some better super glue than I used :)
Our main steps:
1)Build small unregulated power supply(the relay board has regulators)
2)Prepare enclosure(cut openings, pre fit switch and sockets, mount power cord)
3)Initial wiring of mains wires, wire to switch, preparation of unions, test switch and Vout of transformer
4)final wiring, soldering of union joints, heat shrinking, wiring of lv relay board power
5)wifi/bt/xbee module, then close it up and test it out
Step 1: Build DC Power Supply
Using the transformer, diodes and capacitor we are going to make a 12v unregulated power supply to provide a 12v DC source from the mains power cord. Since unregulated power supplies can vary quite a bit we used a 50v capacitor to make sure we have plenty of margin as this transformer was observed producing around 27v peak to peak with no load.
The basic steps to build this DC power supply are:
1)Create the bridge rectifier - Using the 4 diodes we will create the rectifier that will turn the AC current into DC and supply us with a fairly steady DC positive Voltage. Images 2,4,5 depict the layout and components needed for this portion. Notice the direction of the diodes and how half of the rectifier is tucked under the transformer. Placement of this portion should allow the transformer to sit on top of it and expose the positive half(as shown in main image). this allows for easy connection of the transformer secondary to our rectifier and help save some space(image 7). You can use the diode leads to make the rectifiers connection on the bottom side of the board(image 8)
2)Mount transformer- mount the transformer above the rectifier making sure the SECONDARY is on the rectifier side, solder the tabs on the under side to hold the transformer in place. now is a good timer to wire the secondary to the rectifier. And you can even add a couple short pieces of the 14/16awg wire on the PRIMARY side, we will need these later to wire the switch,sockets,relays.
3)Place Capacitor- Place the capacitor and use its leads to wire into the positive and negative rails (the long lead is + on the cap), then solder it into place.
4)make the final connections to the negative(ground) and positive rails of the rectifier (here we used a 3 pin connector but you can hard wire a DC power plug, or even straight to the relay board input).
Step 2: Prepare Enclosure
This step is pretty straight forward; we will locate our holes and make them :)
We need two 1"x1" square cutouts for the snap in sockets; these should be located in the middle of the enclosure towards the top. I drilled a few small holes around the perimeter and finished the cutout with a sharp exacto knife, but needed a bit of touch up the dremel.
After we finished the socket cutouts its time to drill a couple 9/16 holes one for the power cord and one for the power switch.
The location of these is fairly important as we need to skirt by the transformer, and still wire our Load IN and Out from the switch. As shown in the images we placed them inline on the left of the box with the switch on the inside of the transformer.
Now we need to drill our 9/16 starter hole and finish it with the dremel to match our power switch size (You could use a 7/8 I believe to accomplish this in a single task). As before the location should match up with the power cord and transformer to give us enough room for a decent wiring job.
An easy way to drill these larger holes is to only apply enough pressure to lightly drill; a sharp bit will try and grab which can make it difficult. Also a drill press with a fixture would make this extremely easy lol.
Once our holes are finished we can put the strain relief on the power cable and crimp with the pliers. If you are using the power cord wire as our extra wiring, you will want to make sure to cut our extra off now. Inserting the strain relief can be quite difficult, especially with the larger awg wire. If you find it too hard you can trim a slight bit off the hole, but I recommend using the 9/16 as it makes a really nice stable fit.
The last part of this step is to mount the power supply and relay board to the enclosure base. Then general layout we chose is shown in the last picture and gives enough spacing to fit our switch and sockets in. Once they are located mark the holes and drill them with a 3/32 drill bit. We used standard pcb mounting screws to moun the boards down, you may have to adjust the drill size for your available hardware.
Step 3: Initial HV Wiring
This is another straight forward step, we are going to pre wire the HV top end and get some of our feeder wires ready. All this step(and the next step) really involves is:
1) Pre cutting our jumper wires(shown in the first image.
2) Trim our Power Cord inputs and place a connector on the Load In(HOT) and feed it into the switch.
3) Cut the Neutral on the Power Cord to fit on the switch(like the HOT) then place a connector on the Neutral and a feed line for both sockets and the transformer.
4) Place a connector on the Ground plus a single feed line for the other socket, these will go straight to the sockets.
Now is a good time to pre wire the bottom end too, this doesnt require much more then tying the relays input(HOT) to the transformer HOT and making a short jumper that will plug into the output on the power switch. Then we can just tie the neutral bus togther in the next step right before we do our final wiring.
As you can see there isnt much involved, but this step is important to ensure our box will be safe to operate. By placing heat shrink over all the connections and having lightly soldered connections will ensure that no shorting will occur and that the HV lines wont work themselves free!
Step 4: Final Wiring
This step is really just an extension of the previous one, and is straight forward as well. All we really need to do in this step is to finish the HV wiring. As shown in the first picture we have the top and bottom ends pre wired and ready to take heat shrink and final connection to each other.
In the 2nd image we attached the neutral bus and placed a female connector on the HOT lead which will connect to the switch output.(the switch will allow us to kill power from the switch back) The bottom end is wired so that the transformer and both load in(s) on the relay board are tied to a small jumper that will be connected to the power switch. The neutral connects only to the transformer on the bottom end.
After the ends are connected, we can prepare our HOT leads from the relays to the sockets. These should be long enough to make final assembly easy enough, but not too long to cram everything together. (These are shown connect to sockets in image 3) Once these leads are ready we can wire up each of the sockets. I made a few different lenghts untill I found one that was long enough to get an ISP plug on to perform programming(you can also use a usbtoserial Rx-Tx,Tx-Rx,DTR-Reset, just as it were an arduino mini or such)
Bringing our Neutral and ground leads in first and finally wiring in the HOTs. This part can be a bit difficult with the tight spaces but with proper offsets (one side cables up, the other down slightly) makes this part easier. After our sockets are wired we can finish off the HV wiring by tying the socket HOTs into our relay boards open Load pins as shown in images 4,5,6.
At this point you can pretty much program it how you want and let it go, but we'll add a bluetooth module(could be wifi, xbee whatever) in the next step before we close it up.
Step 5: Wireless and Closing It Up!
This step is the easiest really, since I intend to use this with SiriProxy and its going to be pretty close to the server I decided to take a bluetooth module and put it in. This will expose a comport on the SiriProxy server that I can connect to and tell Siri to use! There are many many ways that one could communicate with this box this is just one!
I just plugged the BlueSmirf Gold into the Rx,Tx,Vcc,GND pins that are available on the relayboard. its that easy, besides tucking it out of the way :) The relayboard also breaks out a number of analog and digital pins in case someone wants to add sensors or attach external relays, etc...
Now all you have to do it close it up and test it out!
I hope you enjoyed this instructable and found it useful!!
Please visit our website for more projects, ideas and products!