Instructables
Picture of Yet Another Arduino 110v Power Controller
This Instructable shows you how to build a four-gang outlet box in which each outlet is controlled via an Arduino (or any other TTL level signals).

It differs from the other relay boxes in that it uses no circuit boards and has very few parts (one chip and 4 relays).

Step 1: Assemble Materials/Review Plan

Picture of Assemble Materials/Review Plan
Wire clamps.JPG
Epoxys.JPG
Tools Needed:
Needle Nose Pliers
Wire Cutters and strippers
Screw driver
Soldering Iron
Multimeter

Materials:
Deep metal 4 gang output box and cover
Wire clamps
Two 15Amp outlets
Four 5v 10Amp relays (such as Jameco’s 843155)
A ULN2803A (such as Jameco’s 34315)
A 5volt – 500ma Wall Wart (such as Jameco’s 164101)
A length of 5-conductor wire (I used Cat5 cable)
Household current rated wire with a male three-prong connector at one end.
Miscellaneous wire and solder
5 minute epoxy
Wire Nut

Theory of Operation:
The electricity flow to each outlet of a four-outlet household current box is controlled via TTL level signals (such as the output pins of an Arduino).  Five wires are connected from the Arduino to the outlet box, four wires being connected to four Arduino output pins and the fifth to the Arduino’s ground pin.  A separate 5 volt wall-wart is used to power the outlet box (the outlet box relay activation coils will consume nearly 500 milliamps and a separate wall wart is used here so as not to stress the Arduino power supply).  The TTL control lines are wired to the inputs of the ULN2803A which can handle the relay coil current needs and also contains diodes to safely manage the back EMF produced by the relay coils when switched off.
 
NOTE: for simplicity the schematic only shows a single outlet connection.  Repeat the wires for the other three relays and other outlets, using ULN2803A Pins 3 & 16, 5 & 14, and 7 & 12.
 
Remove these adsRemove these ads by Signing Up
TerryKing3 years ago
Lots of information on Arduino power control here:

http://arduino-info.wikispaces.com/ArduinoPower

Regards, Terry King

terry@yourduino.com
maewert (author)  TerryKing3 years ago

Very nice site, Terry, and well worth the read for those new to the subject as the site you linked provides a a detailed overview and excellent descriptions of the issues involving microcontroller control of high power electrical loads.  Also the commercial boards the site features seem to have good value for the price and are worthy of consideration in home projects.

Best Wishes
Mark.

threader00010 days ago

Thanks for this great article. You mention, "Solder the signal ground wire and the wall-wart ground wire to pin 9 of the ULN2803A". The wall wart only has 2 wires (red/black). Should I solder the black to pin 9? (I assume red is positive.) Thanks.

Drdray1 made it!6 months ago

Great tutorial. I did my own variation but the arduino is powered by a transformer inside of the box. Next I'm going to install a smaller arduino so I can put a cover on it.

image.jpgimage.jpg
maewert (author)  Drdray16 months ago
Beautiful Job there!
An Ardweeny is smaller/cheaper but doesn't do its own power leveling so you'd have to use clean 5v if you want to use that. RFduino's look interesting but I haven't used them.
Best Wishes!
samf48 made it!7 months ago

Needed a remote kill-switch for my CubeX 3D Printer (which goes berserk often) for overnight builds when I'm away from the printer. I also have a network camera watching it so I can see if the build has failed. At that point, I will just remote kill the printer so it doesn't waste any more plastic. I am getting a wifi shield so I don't need a computer hooked up to the Arduino.

Nice work Maewert!

killswitch.jpg
maewert (author)  samf487 months ago

It looks like a very nice job there!

Best Wishes.

samf48 maewert6 months ago

I've got a question for you maewert. If I need the power on for a long time would it be better to wire the relays as normally closed so they don't burn out?

maewert (author)  samf486 months ago

It sure would! If the thing you are powering is most always ON and seldom ever OFF then hook up the power through the NC contact on your relay. Just remember in the code now you have to set your control pin HIGH to turn the device OFF. Good Comments in the code will help you remember this change.

Best Wishes!

SuperTech-IT7 months ago

HAHAHA!!! Love the disclaimer!

I may steal that later.

bdjumakov10 months ago
For charging try mini usb ipod charger (example link http://www.ebay.co.uk/itm/New-Mini-USB-Wall-Adapter-Charger-For-iPod-iPhone-3G-3GS-4G-4S-T5-/400551010680?pt=UK_MobilePhones_MobilePhoneAccesories_MobilePhoneDataCables_JN&hash=item5d42b36178) I just bought 2 and was looking some instructable just like yours. The case is that I want to switch lights instead of a power socket.
City Lights3 years ago
I would suggest to anyone playing with circuits that switches house main voltage to install a ARC Fault breaker at the panel or somewhere before your custom monkey business! This Is Not the same as a Ground Fault which saves You from getting electrocuted. Most electrical fires are started by Arcing. A small arc over time will carbonized where the electrical bounding has been broken or poorly made. Once carbonized, heat increases and increased heat can lead to Fire. Arc Fault Circuit Interrupters Saves Lives from Fires! ..and property and insurance hassles :) so play it safe and Happy automating!
maewert (author)  City Lights3 years ago
I was not aware of these.  Sounds like a very good idea!
I am new to all this. Would this be necessary for me to actively use this in my home?
maewert (author)  collinIT1 year ago
I'm not sure whether you are referring to the switch or to the ARC Fault breaker. Although I show you how to do this instructable, many people would probably feel more comfortable with a store-bought version like the one at Maker Shed:
http://www.makershed.com/PowerSwitch_Tail_II_p/mkps01.htm
Thanks,

Mark
Hi mark, I am refering to the ARC fault breaker. My initial question was, would I need to use the ARC fault breaker if I am using this instructable in my home.

I appreciate the link, in the interest of saving money, If I am using the store bought version would I need this ARC fault breaker?
Very much appreciated.
maewert (author)  collinIT1 year ago
I would think that the store-bought version would include the necessary safety features and therefore you would not need the ARC fault breaker, but understand I am not a home fire safety expert, etc. so be sure to do your own research!
Best Wishes
globrite1 year ago
A nice alternative is to use a Wattstopper power unit which is UL approved, has zero voltage switching and as a bonus has DC output at about 150 mA to power your controller. One such unit (B-120 EP) is available from Amazon for about $15. - Enjoy.
maewert (author)  globrite1 year ago
I can not recommend the product you identified. While I always want to identify good alternative solutions, however, I am not convinced that the product you identified is actually a suitable alternative. The product does provide 24 VDC which can be used to power other devices as you suggest but it only supports one relay whereas my solution controls four outputs using TTL logic levels.
(I also notice that you have provided twelve comments, nearly identical to twelve instructables relating to power control all on the same day which makes me suspect that you have a particular interest in promoting the particular product you identified.)
Best Wishes...
I prefer driving a Triac output optocoupler into a Triac.
Especially for things you're going to be constantly switching like stage lighting controllers etc. You just need to be sure the triacs can handle the load you're putting on them.
When running a lighting controller, the clicking of relays would be annoying, plus you get into contact arcing issues as well as mechanical wear.
Of course there are cons with triacs too, such as inductive load limitations, but for my needs, they are the better choice.
maewert (author)  SuperTech-IT1 year ago
You are absolutely right. I've had had some difficulty with using traics with CFLs :-(
The lighting controller I demonstrated was just an example and surely one would not use the circuit to flash a light as in the demonstration as the relay noise was intense (but also very satisfying ;^). For some applications an old-school relay is the simplest and best solution - but not always, as you pointed out.
But with a zero-crossig detection circuit, you could actually make your arduino DIM incandescent lights, which is really cool. Can't do that with a relay (well, maybe you could, but honestly, you'd kill the contacts in no time).
If you REALLY know what you're doing, you can even dim fluorescent lights, but you need either a really good, or slightly modified ballast.
maewert (author)  SuperTech-IT1 year ago
PWM'ing a relay in order to dim an incandescent light would be crazy indeed!
If I did use a cell phone charger, how would I do this? I am also confused with using a wall wart. Do I have to cut the end off of the cord?
maewert (author)  altoidsfreak2 years ago
You can use it either way.  Just be sure it provides the voltage and the current you need.  If you purchase a mating connector then you can plug the charger into the connector and wire the connector to the circuit.  Otherwise you can cut the connector off the charger and wire the charger directly.
Best Wishes.
ringai2 years ago
This was interesting. I might suggest, though, that you make use of relays that will handle 15Amps.

Also, the NM wire clamps should both have bushings on the inside. They run about USD$2 for a five pack at the local big box. The bushing keeps the clamped wires from chaffing against the edges of the clamp on the inside of the junction box.

Rich19532 years ago
Nice write up, and a fun way to get into power control. Also could easily be expanded. If you want to bring the power supply requirements down the relay could be replaced with a Photo-Triac
This is a type of switch to control AC current with an LED.
A solid state relay would also work. but that would be for a more permanent instillation
maewert (author)  Rich19532 years ago
Thank you.
Yes, I think you are right. I have used regular triacs (but not photo triacs but i understand the concept :-). I prefer the 'solid' on and off a relay provides at the sacrifice of reliability as the relay's physical parts wear out much sooner than the triac. I have had problems of leakage current using triacs - a CFL bulb that would flicker a little bit when it should have been OFF when under triac control.

Thanks again!

Best wishes
fluxor3 years ago
Try using a tiny cell phone charger. I did in one of my projects. They are switching supplies and are quite small, but will output 5v anywhere from 500mA to 1A depending on the unit.
Voltamps3 years ago
An excellent and well documented instructable. How about adding the script for completeness. I have done lots of electronics projects but am new to the arduino so any help with programming would be really welcome.

Many thanks.
maewert (author)  Voltamps3 years ago
Voltamps,

If I were you I would begin my using the BLINK example program that comes with the Arduino environment. It will show you how to blink an LED or to 'blink' the power outlet in our case. This will help you debug your circuit.

Other than this the code would depend on what you want to accomplish, such as turning on a lamp when an infrared beam is broken, or turning on a heater when the room gets below a certain temperature. Each of these examples would be possible but would take additional hardware.

Best Wishes.
w0rm53 years ago
Very Nice instructable, can I program the code and add it directly to the arduino? So I can work without the computer?
maewert (author)  w0rm53 years ago
Yes,  an Arduino can easily provide the signals to control the relays.  In the demo I used the PC only to program (and run) the Arduino which provided the signals.
nte2018 = uln2803. if you have some really old disk drives, sometimes they have them.