yet another arduino 110v power controller

Upload: buditux

Post on 07-Mar-2016

18 views

Category:

Documents


0 download

DESCRIPTION

Yet Another Arduino 110v Power Controller, Home Automation

TRANSCRIPT

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

    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 Controllerby maewert on May 18, 2010

    Table of Contents

    Yet Another Arduino 110v Power Controller . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1

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

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

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

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

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

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

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

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

    Related Instructables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7

    Comments . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8

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

    Author:maewertAerospace engineer

    Intro: Yet Another Arduino 110v Power ControllerThis 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 PlanTools Needed:Needle Nose PliersWire Cutters and strippersScrew driverSoldering IronMultimeter

    Materials:Deep metal 4 gang output box and coverWire clampsTwo 15Amp outletsFour 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 solder5 minute epoxyWire 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 areconnected 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-wartis 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 theArduino 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 safelymanage 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 WarningWarnings:Household current can be dangerous to your equipment, both electrical and biological! Having control and power wire in the same enclosure can expose the connectedcircuit 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 attemptingthis 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 boxIn 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 metalenclosure. 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 nosepliers 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 willpower 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 stripingand 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 ConnectionsI 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 terminaland 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 12gauge 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 therelay 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 attachthe 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 attachthe 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 electricaltape 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 stepyou 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 everythingexposed for the project pictures.

    Step 5: Connecting the logic circuitsFeed 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 8conductors 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 theArduino. 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 tomatch 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 AssemblyAssemble 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 oneof 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 youshould 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 weregenerated 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: AlternativesIf 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 coilswith 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* becommon 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. Iwas 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 someof you will have better luck.

    Related Instructables

    Quiz-O-Tron3000: Arduinoquiz contestantlockout systemby RoysterBot

    Ardu-pong! theArduino basedpong console bykyle brinkerhoff

    Arduino TrafficLight Controllerw/RemoteControl by AugerDuval

    How to build anArduino WiFi4x4 withAndroidController bybkimmons

    Arduino:Making a set oftraffic lights byunknowndomain

    SMS controlledWirelessIrrigationSystem bymhkabir

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

    Comments7 comments Add Comment

    Voltamps says: Jan 14, 2011. 5:23 PM REPLYAn excellent and well documented instructable. How about adding the script for completeness. I have done lots of electronics projects but am new to thearduino so any help with programming would be really welcome.

    Many thanks.

    maewert says: Jan 15, 2011. 12:52 PM REPLYVoltamps,

    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 aheater 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 REPLYI would suggest to anyone playing with circuits that switches house main voltage to install a ARC Fault breaker at the panel or somewhere before yourcustom monkey business! This Is Not the same as a Ground Fault which saves You from getting electrocuted. Most electrical fires are started by Arcing. Asmall arc over time will carbonized where the electrical bounding has been broken or poorly made. Once carbonized, heat increases and increased heat canlead 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 REPLYI was not aware of these. Sounds like a very good idea!

    w0rm5 says: Nov 13, 2010. 2:04 PM REPLYVery 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 REPLYYes, 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 providedthe signals.

    Computothought says: May 19, 2010. 9:29 PM REPLYnte2018 = uln2803. if you have some really old disk drives, sometimes they have them.