Want to toggle a power outlet between on or off with your computer? How about doing it with a remote? Sounds nice - I know. But the best is that you can make it all, and this will tell you how...

"Why would I want to turn a power outlet on or even OFF with my computer...?"

Ever stub your toe getting out of bed to pee in the wee (tehe) hours of the morning? Enjoy mood lighting? Hell, maybe you just want to be a dweeb like me? This will make your life a little more easy, and if it doesn't do that it'll still make you super-swanky.

The great thing about this project is that it's not limited to a light - this is a computer controlled POWER OUTLET. So long as you're using a simple house-hold appliance this project is for you.

What makes this even cooler is that you can control 8 things with your parallel port (there are 8 data pins). So if turning a light on and off isn't enough for you then you can, potentially, turn your room into a TECHNO DANCE BAR!... or not.

You have to understand, before you try any of this, that I'm not responsible if you get injured; if any of your property is damaged, or if you get shocked - lighting your clothes on fire and turning you into a screaming human candle - I'm not responsible. So, please, be careful and pay close attention to any details... it'll save you a lot of annoyance and tribulation.

Mistakes only happen because of the unknown or overlooked... the closer you pay attention to what you're doing the less likely you'll be to make a stupid mistake. I know this because I am the master of stupid mistakes.

You're going to need a few things...

Step 1: Relay...

This is the heart of the beast - the actual hardware to control the outlet.

My version is in a nice little case that I scrounged from my father's junk pile... I've got a kitty cat, and I think 120V 50AMP adds up to just a little over 9 cat lifes, so it's better safe than sorry with this thing.

The main part is a special "relay". You can pick these up on ebay for pretty cheap - you could try your local electronics store, but I honestly doubt you'll have much luck. None the less - you'll need it.

So, let's do an inventory of what you'll need for this part:
- Tools
- Utility Knife
- Soldering Iron
- Solder
- Electrical Insulating Tape
- Items
- Opto Relay Model # (480D10-12)
- Extension Cord, 4ft(You'll be cutting this, so it shouldn't be your dad's/friend's/neighbour's or something)
- Safe (non-conductive) housing for the relay
- Parallel Port cable'

Ok, that's pretty much it. You can see I used some fancy eye-couplings for mine (or whatever they're called)... that's where the soldering iron comes in handy - but you'll also need it to re-attach one of the power lines on the extension cord when you cut it.

1. Simply take your extension cord and cut it - keep in mind when you're doing this that where you cut is where the relay will be placed and housed. So if you need some distance to get to the outlet, cut it towards the other end. I didn't consider that when I made mine, but I got lucky.

Now, figure out which line of the two cables you cut is the lead(positive) and which is the negative. The relay is marked which connects to which, but if you don't know anything about power outlets or extension cords this may be tricky. Good luck! :P

2. Take your eye-couplings and soldering them to the ends of the wire and crimp them so they don't come lose. Don't solder up the other wire (in my photo you can see it has black tape on it for safety) - you'll need to keep those unjoined if you want to put it in a case.

3. You'll want to refer to a guide about your parallel cable, or just test it with a current tester (to determine which pin is 1). Here's a link to the wikipedia entry on parallel ports.

This is really important - all of the software I've made is configured to run on pin 1. I should mention, again, that there are 8 pins on the parallel port to control a relay with... that means 8 unique items to control... if you don't mind buying 8 relays :P

4. So you've got your hardware done and you need to test it, right? Ok - that's good. I got to that point to, I used this great program. The webpage is in German, so uhh... here's the direct link for download.

Once you've determined that you've got a good connection and it's turning your appliance on/off you'll want to head down to the last step to check out the software I had made to control this. If you're having trouble following these steps at this point, please - PLEASE leave a comment.

If you're ready to kick this instructable into TURBO CHARGE then head on to the next step.

I love improvement, and I'm a fan of criticism. So I'll update the instructable as I get suggestions or complaints. If you notice I did anything dangerous or stupid, don't hesitate to mention it - you could be saving someone a lot of trouble.

Here's a video I made a few months ago when I was still "debugging" the relay. Hopefully it will give you some insight into the simplicity of this project, or any questions you have.

Step 2: Over drive!

So you're ready to turn this instructable up a notch, eh? In that case, you're on the best step. This will turn your project into a swank mobile. You'll go from a slouching geek in a computer chair shouting in elation, "LOOK WHAT I CAN DO!" to Neo, from The Matrix.

I pinky promise.

Start out by picking up a Xbox Media Remote - I don't mean the Xbox360, I mean that big black box which, if ever pressed, could be used to save your life - maybe even take a bullet.

Once you get your remote (I got mine for $14CAD from a pawn shop) you'll need to do an inventory check again - for this mod we'll need the following:
- Tools
- Soldering Iron
- Solder
- Insulating Electrical Tape
- Items
- Xbox Remote Recieving Unit
- USB cable (once again, this will be cut... so make sure you're OKAY with that.)

1. Start by popping the back off of the reciever - you'll be using your knife for this. This is really difficult, so take your time and try not to cut yourself. Remember, the more careful you are the less you'll dent and cut the reciever - which is a better looking final result.

I can't stress how hard this was for me, but I took my time and I only have a single, small, dent in the side of my reciever.

2. Once you get the cover off of the reciever you'll see some chips and stuff. Hopefully you were careful - otherwise yours may not exactly be in pristine condition...

On the reciever you'll see pins, below a chip, for the plug, which is on the other side. Going from left to right, they are as follows:
0. Ground
0. Red
0. White
0. Green
0. Yellow
0. Black
0. Ground

They're not actually colored or labled - that's the wires from your USB cable which will be attaching there.

3. You'll notice there's no yellow on your USB cable, that's because it's a strange creation of Microsoft. Don't worry, just continue carefully soldering your wires.

Once they're all attached and you're ready to test it, head down to RedCl0ud's webpage and pick up his drivers. There's also the original guide there as well, which may be more useful than mine.

Step 3: Wrap Up

Hopefully you've got all the information you need to complete this project... however, if you don't - I'll give you the information I had when I made all of my parts.

I really welcome comments and criticism, so please don't hesistate to speak your mind.

Before I go and wrap this up, I have a little beef I want to clear up - if you're not interested, just skip past the italic text...

When I realized I needed custom control software for this project I did what only seemed rational, I logged on the mIRC channel #C on irc.freenode.net. All I met there was pretentious jerks who just wanted to stroke their own egos. It was horrible - I'm not exaggerating. The only favor they did me was mentioning Rent-A-Coder, and even that was done snidely.

Rent-A-Coder is a great utility for people who want to make projects, or want to concentrate on something other than programming - it's difficult enough without that insanity. It was really easy to use, and I definitely give kudos to the designer of it. Didn't cost me much, either!

So, to wrap it up - here's the software and external links I promised.

Parallel Relay Control (Command line based) Big thanks to Agustin Derregibus, my very cooperative programmer. Source included!
Parallel Relay Controller (Uses hotkey "numpad 9" to toggle pin 1 on the parallel port on/off) Included is the source, icon, and original PNG (which I made). Big thanks to my buddy Jake Kramer who made this on short notice for me!
Relais Timer (German, scroll to the bottom for the download link) (for debugging your paralell port relay, if you need it)
Original (This is the instructable that inspired my project)
RedCl0ud's Place (Has all the drivers and information you need to make the remote)

Hope you enjoyed! This is my FIRST instructable!
If you'd like to see more photos, please visit my Flickr.
<p>Neat but why not do it from your phone from anywhere in the world like this:</p><p>http://www.controlanything.com/Relay/Device/R15PL_WIFI</p>
A nice and safe 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.
hello sir, i am test my parallel port power with connect a LED with it . but when i try to off the LED with relais timer ,unable to switch off and on from the software and the LED is always on
Just a little safety info to add on to your really cool instructable. I think it's important to note that with AC power it's a common misconception that there is a positive and negative line. The truth is that AC(Alternating Current) only has a hot and a neutral wire(There should also be a ground wire, but that's really only a safety precaution added in the last 30 years or so. Ground and Neutral are always linked somewhere if only by a very long stretch of earth.) as the current changes polarity from positive to negative and back to positive 60 times per second(60 Hz) in the United States and 50 times per second(50 Hz) for most of the rest of the world as I understand. This next part is important... If you put the relay on the neutral wire, even when the switch is turned off, the hot wire will still have juice, and anyone or anything that is grounded (you'd be surprised at what types of flooring serve as a ground, and yes wood is an electrical conductor if a poor one at that) when it comes into contact with the hot wire will be electrocuted. Unfortunately this is a common mistake with DIY electricians installing new lighting circuits in their homes, and people die every year because someone switched the neutral wire instead of the hot wire. It's another common misconception that if you only touch one wire at a time a hot circuit cannot electrocute you. This is true only with DC circuits. To be electrocuted by an AC circuit you only need to touch the hot wire (and usually be grounded depending on the voltage. High Voltage, like in the lines on those tall steel towers, creates a static field and can electrocute something without a ground. Wow that's more than a little off topic). The point is, there are safety precautions to be observed when working with electricity.
So it would be better if the relay was put in a grounded box?
Hi. I tried downloading the softwares you used from the page on the last step, but the links seemed to be broken (Parallel Relay Control, and Parallel Relay Controller). Would really appreciate if I can get the files. Thanks for this nice instructable.
I have to say using Rent-A-Coder was genius. The links in this page (Parallel Relay Control, and Parallel Relay Controller) seem to be broken tho, do you have an alternative host?
I'm going to try this with voice activated controls
Voice activation never works right. You tell your computer to turn the lamp off and your garage opens. I've been using a program called "PuppetMaster" for my Smartphone - connects to my computer via bluetooth. It's very good.
You can use VAC (Voice Activated Command), but if you have Win 7 just use the built in Windows Speech Recognition. Win7's WSR is on par with dragon, and like all of the other Voice control programmes, you will have to train it to your voice. I use it everyday to run most of my house, and once I had gotten 3 to 4 hours of voice training in it performed with about 97% accuracy.
So theres a programming language called auto hotkey With that, I can watch a rectangle of pixels, and due to what it sees, it can automatically do keystrokes or mouse clicks. <br><br>My question to you, if how quickly the device will respond to your program's controls.<br><br>My plan: I have LED Christmas lights set up in my room. If i plug them into this (different strands on different ports) I could *potentially* set up a mic near a speaker and, via auto hotkey, watch the input volume, turning on and off certain strands according to the music volume.<br><br>This is all relying upon the fact that the devise reacts in near-real-time. Any recommendations are greatly appreciated.
Hey, Great instructable! heres a question for ya ; could you use the program mentioned to run an appliance for 5 minutes every 2 hours ?? im interested in how complex the cycles can be activated/deactivated and at what rate Thanks!!! good job
It may be stupid question but as I am not familiar with those stuffs but interested how this works. How can you controll multiple electronics using one relay? I mean I saw just one connection point in the relay you used in project?
AC power is not "positive" and "negative" it is "hot" (power) and "ground".
&quot;Hot&quot;, &quot;Neutral&quot; and &quot;Ground&quot;<br />
You're not pedantic, Dave; you're precise!
Dude you can get that relay for like $10.00 off ebay and 120v will not kill you if you just tap it happened to me lots it will just give you a jerk. @40 will kill you!
&nbsp;thats why 240 countries have earth wires.&nbsp;
Is there any way to do this wirelessly? I'd rather not have wires going out to the living room.<br />
hey! you have same relays i sell!&nbsp;:P opto22 ftw :D<br />btw i used once and i saw that 3 and 4 (powerup for relay)&nbsp;has destroyed mounts for screwing it xD i soldered cables inside :P<br />
okay great Instructable one question if you hook up pin 1 to the relay which id your return wire
I'm not sure offhand, but if you use that german/dutch/whatever software I link to in my instructable... then you can debug which pin it is :)
Are there any relays that can be brought on jaycar.com.au or dse.com.au that could be used for this project. Also what voltage can the project range from?
Project can be practically any voltage DEPENDING on your relay. I didn't check the sites but I can tell you that you'll have to pick your relay depending on the project. Basically all the relay does it take one circuit (computer, for example) and turn on another when voltage applied. Some relays are designed to withstand minimal voltages on the relay side, others can handle very high voltages. If your project is just a lamp you can check the amp rating on it and buy your relay based on that. The one I listed in my project is pretty heavy duty (which is why I paid $40 for it... smaller ones are only $10!). If you're thrifty you can scrounge working relays from old cars, washers, lots of stuff.
on the Parallel port conection do you conect 1 or 2 wires and if your computer does not have a pinter port could you use a Parallel Port Adapter like <a rel="nofollow" href="http://www.newegg.com/Product/Product.aspx?Item=N82E16812240004">this</a>to go from usb to parallel<br/>
Didn't check your link, but if you look up in the comments someone else had the same question about the using a Parallel Port adapter - should be fine. You want to hook ONE of any of the output pins on the parallel port to your relay.
I've been searching and searching for a way to use a USB cable instead of a parallel port cable (mainly because my laptop does not have a parallel port). Is this possible? and if so, how could it be done?
You can use a parallel port USB adapter - basically just a parallel port you can plug into your USB port and windows will emulate all the come (parallel) port stuff for you. They're pretty slick in concept but a lot of times the drivers are pretty poorly coded. Check out ebay and stuff, they're really cheap (so no huge loss if the drivers suck on the product you buy). I've been getting a lot of feedback on this project over the last few months. It's really out dated and there are a lot of products on the market now to make this stuff not only more safe but much more flexible - like controlling your entire house with existing power lines. Maybe I'll do an updated Instructable so keep an eye out over the next few months.
awesome! thanks a lot stephen_A that's just the answer i was looking for. Truth is, the experiment i had in mind is starting to become expensive, i am not new to computer programming but i am some-what to hands-on hardware development and circuitry (which is why i figured id start with something simple like this). I've been trying to bridge the gap between computer programming and computer engineering with little success (few modded xbox360's and ps3's, nothing spectacular yet). <strong>ANYWAY</strong> let me get to my point, this experiment you wrote up <strong>is great</strong>, i love it, but in my case..i think i am better off buying an adapter from &quot;insteon&quot; instead of investing what little money i have in a project I'll probably find a way to mess up (lol I'm just hatin on myself today).<br/><br/>Again, thanks for your time! I'll be sure to keep up with your posts<br/>
Any news on your progress? I'm still looking at the Insteon stuff. :)
i dodnt get it to work ive search evey thing my pin are hoked up correct but it dont works help
Where'd you get your relay from? Could be busted. How'd you check your wires? May be miswired.
can you wire a relay which is powered from the 5v from usb and once the computer turns on the 5v to the usb is there turning on the relay which turns on the power could this work?
Yeap, but that'd be boring.
euhm, not to be anoying, but the website isn't german but dutch, if you call belgians or people from the netherlands dutch they will become very angry because of ww2 and stuff, so dutch, not german
i mean not dutch but german, if you call them german they become angry
where is the bit that tells you what wires from the parrarell port to connect, all it shows is you cutting a wire and some rubbish about an xbox remote can you please upload the details on what wires to connect to the relay.
You can find the wire schematics for parallel ports on wikipedia - because all parallel port wires are packed a little differently you're going to have to find the wires yourself. They're sometimes color coded. The best way is to use Relais to turn on a specific port and then use a LED or multi-meter to find the wire which is hot (enabled). It's tedius, but it's the only way to be thorough.
"I'm gonna unplug this because my cat's coming in, I don't want him to die." Hahaha. That made me laugh out loud. Extremely well written tutorial, great video (except for the bad lighting in the dark corner), and very thorough explanation of everything.
WARNING!Direct connection by relay can burn your PC like mine! New circuit: Turn Outlet ON and OFF:
your not a bum
You know, I can't stand it when someone embelishes their own accomplishments on the internet... You sir are NOT the.. " the master of stupid mistakes" Because... I am the UNDISPUTED master of stupid mistakes :>
Nice instuctable, most 1st instuctables are stupid.
Thanks, Dave. I just wish someone would make a stained glass instructable. I've done a couple of things which are instructable worthy in the last few months - maybe I'll get enough gumption to illustrate them.
Hey, uhmm that website you linked is not German, it's Dutch. i just figured i'll let you know ;)
I'm tempted to say, "Oh, they're all foreign to me!" but I know I'll get flamed to no end... so thanks! lol
There actually pretty similar, but Dutch has a few more english kindof words, and i think it's easier.
Es aconsejable utulizar transistores para evitar sobre cargas en el pueto LPT:<br/><a rel="nofollow" href="http://www.misionrg.com.ar/feria.htm">http://www.misionrg.com.ar/feria.htm</a><br/>
cool but id just use these <a rel="nofollow" href="http://www.yourcablestore.com/Remote-Controlled-Wireless-AC-Power-Outlet-Single-Pack_p_14-170.html">http://www.yourcablestore.com/Remote-Controlled-Wireless-AC-Power-Outlet-Single-Pack_p_14-170.html</a><br/>
That wouldn't be computer controlled, unless you made a simple IR output with <a rel="nofollow" href="http://www.lirc.org/">LIRC</a>. You'd be sparing yourself the chance of being electrocuted - but what fun would that be?<br/><br/>Besides, I could no longer gurantee you would be Neo from The Matrix.<br/><br/>

About This Instructable




More by Stephen_A:VW Beetle Gauge Upgrade Computer Controlled Power Switch 
Add instructable to: