While surfing i found a nice Linux Artical Where you are able to turn the lights on or off in your room from anywhere in the world via SSH its it tool c00l…
here it goes…
In this article I will walk you through making a device that controls electronic devices using your computer. This will give you a lot of power. For example, I am able to turn the lights on or off in my room from anywhere in the world via SSH. I know there are a few of these out there but mine is better. Mine doesn’t have complicated schematics with diodes resistors, 12Volt power supplies (where the hell are you suppose to get this from), and transistors. It’s simply a relay wall plug and wire. Below is the schematic. Click on the image to resize it.
What you will need:
Before you get started here is a run down of what you will need. Most of this stuff can be purchased at a local Wal-Mart or Target for a decent price.
- A Relay. part# G3MC-201PL-DC5 (the most important component)
- Light Socket
- Solder Iron
- Solder Wire
- Wall plug. Rip this off any old electrical device. and split the two wires. I used one from an blow dryer that doesn’t work.
The first thing you want to do is take the wall plug and solder one side to any of the relays load legs. Then connect the other wire of the wall plug to the socket. I put tape over the soldered leg to give it that extra hold and because when I solder the other leg it’s important not to get a short.
Now solder a wire to the next relay leg. **Don’t use an extremely thin wire like from your headphones**. Use wire that can handle 120 V AC.
Connect that wire to the other end of the socket. What you should have now is a wall plug with one end attached to one of the relay legs and the other end attached to the socket. Also you should have a wire that can handle 120V AC connected to the other side of the socket and the other relay load leg. This should form a loop. What opens and closes the loop is the relay. When the input legs receive 5 volts it closes the load legs and current flows.
Now solder two wires to the input legs of the relay. These will receive 5 volts from the parallel port and create a short in the load legs closing the circuit and allowing current to flow and thus turning on the electronic component. The circuit is now complete. Connect one wire to the 6 pin the other to the 22 pin
Make some kind of box to hold the circuit. I used the box that my relay came with from mouser.com. Below is what i put together.
Step : 6
Creating the application. Can’t get any easier than this.
LINUX CODE :
MUST HAVE THIS DLL IN THE SAME FOLDER: inpout32.dll
If something is not clear or you need some help you can send me an email at foughtnlost AT gmail.com I want everyone to get this working because in my next article I will go over on how to turn off your lights using a cell phone and fetchmail.