Introduction: Automated Plug-In Appliances
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!!)
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
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
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.
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
17 Comments
13 years ago on Introduction
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.
Reply 12 years ago on Introduction
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.
13 years ago on Introduction
Using PWM with a incandescent bulb is probably not a good idea if you want it to last long! You could dim it with fixed resistors on different relays or solid-state switching devices, yes. You would use ONE SPST relay for power, and ONE SPDT relay for the dimmer, connected in conjunction with the appropriate resistor. Or you could go fancy and but a digital potentiometer from Maxim, for example.
Reply 12 years ago on Introduction
The latest dimmer packs used in theaters all use PWM sinewave dimmers. quiet as a mouse with no crap on the mains. All they do is PWM the power, and then filter to make it smooth.
Reply 13 years ago on Introduction
Okay, I'm so use to working with DC. With the fixed resistors I would need a different resistor and relay for every varying light level. I also know that it would generate a lot of heat. I'm going to check out the digital pots. I'm trying to get into home automation and seeing that it's probably a lot easier to just buy ready made modules.
12 years ago on Step 2
what number gauge should I use?
13 years ago on Introduction
I don't get it. After you make this thing how do you control it (specifics)?
13 years ago on Introduction
I purchased a Solid State relay pretty cheap from China off of ebay and got the other parts from the hardware store.
Reply 13 years ago on Introduction
Very nice. I should have used solid state instead of this giant, noisy relay haha
13 years ago on Introduction
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.
Reply 13 years ago on Introduction
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.
13 years ago on Introduction
Personally, I do my high voltage safety the other way around. "Always keep the device plugged in". It keeps you on your toes, and lets you know when you made a mistake. ;-)
13 years ago on Introduction
what relays would you suggest for uk 240V 13A ac power and 3-5V trigger Voltage form arduino
13 years ago on Introduction
Just a note, 120VAC is no where near high voltage ;) But still deadly.
13 years ago on Introduction
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.
14 years ago on Introduction
NC is normally closed NO is normally open
14 years ago on Introduction
NC means normally closed "connected" NO means normally closed "not connected"