You are on page 1of 8

Home Sign Up!

Browse Community Submit


All

Art

Craft

Food

Games

Green

Home

Kids

Life

Music

Offbeat

Outdoors

Pets

Photo

Ride

Science

Tech

Yet Another Arduino 110v Power Controller


by maewert on May 18, 2010

Table of Contents
Yet Another Arduino 110v Power Controller . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

Intro: Yet Another Arduino 110v Power Controller . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

Step 1: Assemble Materials/Review Plan . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

Step 2: Obligatory Warning . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

Step 3: Wiring the AC portion of the outlet box . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

Step 4: Relay Connections . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

Step 5: Connecting the logic circuits . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

Step 6: Final Assembly . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

Step 7: Alternatives . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

Related Instructables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

Comments . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

http://www.instructables.com/id/Yet-Another-Arduino-110v-Power-Controller/

Author:maewert
Aerospace engineer

Intro: 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


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 Jamecos 843155)
A ULN2803A (such as Jamecos 34315)
A 5volt 500ma Wall Wart (such as Jamecos 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 Arduinos 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 &

http://www.instructables.com/id/Yet-Another-Arduino-110v-Power-Controller/

14, and 7 & 12.

Step 2: Obligatory Warning


Warnings:
Household current can be dangerous to your equipment, both electrical and biological! Having control and power wire in the same enclosure can expose the connected
circuit to damaging voltages in the event of part failures. I make no claims or warranties, etc, you assume all of the risk should you attempt this build. Those attempting
this build are either knowledgeable or foolish, or as in my case, a little bit of both.

http://www.instructables.com/id/Yet-Another-Arduino-110v-Power-Controller/

Step 3: Wiring the AC portion of the outlet box


In US household wiring, the green wire is ground, the white wire is return, and the black wire carries the power.
I begin by breaking off the four metal tabs attached to the outlets. These tabs are used to secure the outputs in a different enclosure and are not used for the metal
enclosure. The tabs have a little crease in them which helps the user remove them. Remove the 4 tabs from each of the outputs by bending them with the needle nose
pliers until they break off.
Next cut the connecting bar on the gold colored contacts. This bar allows the power to flow to both outlets whenever one outlet is connected and since our relays will
power each separately we must cut this connecting bar or both outlets will receive power if either outlet is enabled.
Next add a small wire connecting the white terminals of the two outlets together. In my case I used a four inch piece of 12 gauge solid copper wire. I do this by striping
and attaching the white wire to one of the outlets silver terminals, then attaching the outlets to the metal faceplate such that the white wire is between the two outlets.
This holds the outlets in their final position so that I can bend the white wire to the other outlet terminal and still be able to screw the wire to the terminal.
Next add a small wire connecting the ground terminals of the two outlets together just like we did for the white wires above.

http://www.instructables.com/id/Yet-Another-Arduino-110v-Power-Controller/

Step 4: Relay Connections


I mix up a small amount of quick-set epoxy and I then epoxy the four relays to the backs of the AC outlets.
You may also epoxy the ULN2803A to a clear area on one of the relays. Be careful to remember the parts orientation so you know which pin is pin 1, etc.
Be sure to wait until the epoxy is fully cured before proceeding. I waited 24 hours myself.
I then attached a black wire from the relays Normally Open (N/O) output pin to the gold outlet terminals. I did this by first attaching the wire to the outlet terminal
and bending the wire into position so that the wire touches the terminal with no strain on the wire or the relay pin, then I solder the wire to the relay pin. I used solid 12
gauge wire to make these connections. You can use 14 gauge wires also which should be less stiff and easier to work with.
Next attach an 8 inch piece of black wire to each of the relays common pin. You can epoxy this wire to the outlet case as well to relieve the strain of the wire on the
relay terminal pin. Again, wait until the epoxy cures before proceeding. (As you can see from my pictures, throwing caution to the wind I did not provide this strain relief.)
Next prepare the metal box by knocking out two of the punch out holes and installing the wire clamps. Feed the 3 prong male plug through one of the clamps and attach
the green ground wire to the ground wire on the outlets. Now attach the white wire to the other accessible silver terminal of the outlets. Using a large wire nut attach
the four back wires to the black wire of the 3 prong plus. (Again I did not follow my own advice as I didn't use a wire nut, I soldered the wires together and used electrical
tape to wrap up my soldierng mess.)

http://www.instructables.com/id/Yet-Another-Arduino-110v-Power-Controller/

At this point you may use a generous amount of electrical tape to cover up any exposed wire which carries AC household current. If you choose not to perform this step
you can easily get bitten by the electricity should the 3 prong plug get plugged in while the box is not closed up. I did not do this here since I wanted to keep everything
exposed for the project pictures.

Step 5: Connecting the logic circuits


Feed the wall wart power cord and the 5 strand wire through the second wire clamp on the metal outlet box. I used some spare Cat5 wire I had which contains 8
conductors and I cut the ones I didnt need.
Solder the signal ground wire and the wall-wart ground wire to pin 9 of the ULN2803A.
Solder the +5volts wall wart wire to pin10 of the ULN2803A.
Solder the four control signals to pins 1, 3, 5 and 7 of the ULN2803A.
Solder one side of the relay coils to ULN2803A pin 10 (5 volt DC power). I did this by running a single wire from pin 10 to the relays in serial.
Solder the other side of each relay coil to pins 18, 16, 14, and 12..
Next connect the 5 conductor wires to the Arduino pins. The ground wire must connect to the Arduino ground. The four other pins connect to the digital output pins of the
Arduino. Leaving the three prong plug unplugged, you can plug in the wall wart into a household outlet and use the Arduino BLINK program to test the circuit and to
match the control wires to the outlets. You should be able to hear the relay click off and on when the output pin blinks.

http://www.instructables.com/id/Yet-Another-Arduino-110v-Power-Controller/

Step 6: Final Assembly


Assemble the box and tighten down all of the wire clamps, etc.
I like to use an ohm meter to ensure there is no connectivity between the signal wires and the AC lines. With the 3 prong plug unplugged, connect an ohm meter to one
of the three prongs and ensure it has no connectivity with any of the control and ground signals in both relay states (i.e. all relays deactivated and all relays activated).
Repeat for the other two prongs of the three prong connector. Check also that there is no connectivity between the three prong connector wires. If all checks out you
should be ready for a live test.
Plug the three prong connector into house wiring and actuate the relays. If you heard the familiar clicking of relays and no smoke was released and no sparks were
generated then good deal. Now you may plug four electronic devices into the outlets and test to ensure that each one can be individually controlled.
Demo video at: http://www.youtube.com/watch?v=jNFfdMJ17v4

Step 7: Alternatives
If you use a wall wart as I did, you may consider using a 6 volt version. There is a 1.4 voltage drop through the ULN2803A and this will therefore provide the relay coils
with 3.6 volts, which is just over the relays requirements (3.5 volts needed to pull in the relay). I was attempting to stick with the 5 volt source since it *could* be
common with the Arduino 5 volt power supply. The 5 volt power works, but 6 volts would pull the relays in rather soundly and might be a better solution.
I did not actually like the idea of a wall wart. I would have preferred to use the Arduino power itself or to include a small 5v DC power supply inside the metal enclosure. I
was not certain that the Arduino power supply could spare almost 400 ma of current and I could not find a small enough transformer to fit in the metal case. Maybe some
of you will have better luck.

Related Instructables

Quiz-O-Tron
3000: Arduino
quiz contestant
lockout system
by RoysterBot

Ardu-pong! the
Arduino based
pong console by Arduino Traffic
Light Controller
kyle brinkerhoff
w/Remote
Control by Auger
Duval

How to build an
Arduino WiFi
4x4 with
Android
Controller by
bkimmons

Arduino:
Making a set of
traffic lights by
unknowndomain

http://www.instructables.com/id/Yet-Another-Arduino-110v-Power-Controller/

SMS controlled
Wireless
Irrigation
System by
mhkabir

Comments
7 comments

Add Comment

Voltamps says:

Jan 14, 2011. 5:23 PM REPLY


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 says:

Jan 15, 2011. 12:52 PM REPLY

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.

City Lights says:

Nov 30, 2010. 3:41 PM REPLY


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 says:

Dec 1, 2010. 5:44 AM REPLY

I was not aware of these. Sounds like a very good idea!

w0rm5 says:

Nov 13, 2010. 2:04 PM REPLY

Very Nice instructable, can I program the code and add it directly to the arduino? So I can work without the computer?

maewert says:

Nov 14, 2010. 12:56 PM REPLY


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.

Computothought says:
nte2018 = uln2803. if you have some really old disk drives, sometimes they have them.

http://www.instructables.com/id/Yet-Another-Arduino-110v-Power-Controller/

May 19, 2010. 9:29 PM REPLY

You might also like