loading
The title may sound a little daunting, but this is probably one of the most simple instructables you could make. Here I will show you how to switch on and off appliances such as TV's, lamps, Christmas lights, or anything that plugs into an AC wall jack, with a microcontroller or any other computerized source.

WARNING: When creating this device, you will be dealing with ~120V AC. This is considered HIGH VOLTAGE, which as many know, can be lethal. Be careful when working with high voltage; NEVER work on this when it is plugged in. Make sure all connections are how they should be, and verify that they are fully insulated and won't short each other out, or you could cause a fire. Also, be aware of what is going on around you, be alert, and never work on with high voltage if you feel you can't devote enough concentration towards what you are doing. And lastly, if you ever have to service the connections inside this device, ALWAYS unplug it before doing so.

Step 1: Theory

Basically, all you need for a low-power microcontroller or any form of computer to switch high-voltage is either a relay or an SCR (solid-state type switching device).

Step 2: The Stuff You'll Need

  • Control Source (Computer, microcontroller, etc.)
  • 120V Relay (Look for one with a LOW trigger voltage that matches that of your control source's voltage levels. AKA TTL (5V) for most microcontrollers, RS-232 (~3-12V) for computers' COM port outputs.
  • Extension Cord
  • Enclosure (his is IMPERATIVE to keep the high-voltage components away from anything and everything. 120V AC is considered HIGH VOLTAGE)
  • Diode (Rated at 120V AC or higher).
  • TIP120 Transistor
  • 1K-Ohm Resistor
  • Wire (Be sure to use a heavy gauge for the 120V AC connections. If you use wire that is too small, you are risking setting your house on fire!!)

IMPORTANT:

If the relay you use has a trigger voltage higher than what your control source can drive, you'll need a transistor or another relay to trigger the large 120V AC relay. In my case, I chose to use a smaller relay.

Step 3: Assembly

The schematic showing the whole setup is below.

IMPORTANT: The relays are shown in the ON position (my mistake). Make sure to wire it so that the circuits are left OPEN normally, and CLOSED when the relays are activated. Also, any wires that cross over each other but do not have a black dot at the intersection means they are NOT connected. Don't connect those wires together or you will blow your wall jack in your house!!

Tips:

  • In the areas marked "NC", that means "No Connection" for all you who don't know
  • The ~120V AC Input is simply the wall jack side of the extension cord
  • The ~120V output is simply the socket(s) side of the extension cord
  • The diode connected to the low voltage relay is sometimes included INSIDE the relay, but in this case I simply accidentally drew it inside
  • The small red boxes inside each relay represent the coils

The reason we need to use a TIP120 transistor is because your average microcontroller or computer cannot drive > 40ma max. The low voltage relay needs more current in order to activate.

Here are seven easy steps to make this adapter:

1. Cut the extension cord in half, splice the ends, then tin them with a soldering iron
2. Drill two openings in the enclosure to insert the ends of the extension cord in
3. Make all connections, using heat shrink tubing if necessary for the relay circuit
4. Make all connections for the transistor circuit
--> This can be made on an external (outside of the relay enclosure) breadboard, or PCB (Printed/Perforated Circuit Board)
5. Secure the relays, if necessary (everything fit snug in mine so I just closed the lid and it all fit)
6. Run GND and CONTROL lines out from enclosure (these connect to the computer/microcontroller)
7. Close the enclosure

Step 4: Controlling Appliances, Lights, Etc.

This is the easiest step of the whole process. Just connect the CONTROL wire to the digital output of the control source, and give it a HIGH signal. According to the design, power will be driven to the load(s) connected to the socket(s) on the extension cord when the CONTROL line is driven high. To turn the appliance(s) OFF, bring the line LOW.

You might ask, "Why would I build this? What's the point?" Well, there are many many many uses for this, but to list a few...

  • Cut down energy costs through human presence detection
  • Reduce annual costs due to unnecessary phantom power draw
  • Cool home automation
  • Parental control of home entertainment systems (TV, videogames, etc.)
  • Halloween prop animation
  • Animated holiday lights
How would I triggered another computer to turn on? I have a server I would like to make this for but the power switch is a momentary push button. Holding the button down longer than a few seconds will cause it to shut down. I guess what I'm trying to find out is if the relay used is one that will return to its original state. Kinda like a momentary push button.
Not sure if this will help, but on some computers I have used, the computer will power itself up when power is connected. An even easier way would be to configure the server to automatically hibernate/sleep, and use the 'wake on LAN' function on the network card. That way, when the server is not being used, it automatically goes into a low-power state, but is easy to access when needed. The only drawback to this would be the fact that you can't use the computers alias/network name to refer to it, as the computer does not broadcast its status when it is in standby.
what number gauge should I use?
 I don't get it. After you make this thing how do you control it (specifics)?
I purchased a Solid State relay&nbsp; pretty cheap from China off of ebay and got the other parts from the hardware store. <br />
Very nice. I should have used solid state instead of this giant, noisy relay haha<br />
Any particular reason you chose relays over a triac or pair of SCRs? If you used a triac, I think you should be able to accomplish PWM, although it's a little complicated and requires synchronizing your PWM signal with the AC line phase. But, PWM with relays means clicky sounds and can't approach the frequencies you'd need to dim lights etc.<br />
Yea, I was hoping to do it that way, but I couldn't find any schematics online of that type of circuit, and these relays were readily available. If you have a good example schematic let me know.<br />
Personally, I do my high voltage safety the other way around. &quot;Always keep the device plugged in&quot;. It keeps you on your toes, and lets you know when you made a mistake. ;-)<br />
what relays would you suggest for uk 240V 13A ac power and 3-5V trigger Voltage form arduino
Just a note, 120VAC is no where near high voltage ;) But still deadly.
this ible needs some more details about how to interface with a computer or microcontroller. Labeling some more of the components in the pictures would also help.
NC is normally closed NO is normally open
NC means normally closed "connected" NO means normally closed "not connected"

About This Instructable

12,667views

49favorites

License:

More by RPisces:Room Visitor Counter with Relay Control ATX Power Supply --&gt; Cheap Bench-Top Power Supply Automated Plug-In Appliances 
Add instructable to: