Parallel Port Control Circuit "The Safer Design" +5-12V (external) | +----------------+-----+------+ | | | | | | / R3: | Controlled | | \ 1k +---+ Device | | / 8 Circuit Parallel | | | Relay 8 | | Port | D1: --- --- Coil 8 | | __________ | 1N4001 / \ \LED/ 8 | | R1: |* | | (use UF 1-7) /___\ \ / +---+ | | D(x) --1k---|1 Opto- 5|-+ | --- | v----O-+ | | Isolator | | | | ^----O---+ GND --------|2 4|-+ +-----+------+ Relay |__________| | | Switch CNY17 or | R2: |C/ 4N25 | 4.7K |/ T1: (NPN) +--\/\/\/\/---| BC547A/B or 2N2222A B|\ (pins=c-b-e on mine) |E\| | ground (external) | | | |--Left Section--|-------Middle Section/Control Circuit-------| Right | | | Description: Left Section: The Parallel Port is electrically separated by the Opto-Isolator from the rest of the circuit. Using this design, something would have to severly short out or arc the Opto-Isolator to damage the parallel port. This also helps protect the parallel port from hot plugging and plugging the wires in backwards. The Opto-Isolator does not have a resistor in front of its LED, so the 1000ohm resistor on its pin1 is mandatory. Middle Section: This is the Control Circuit. The Opto-Isolator turns it on and off and protects it from any potential damage from the Parallel Port side (hot plugging and the LED protects against backwards plugging). The relay offers a higher degree of protection from any "problems" on the Device Circuit (Right Side). The Control Circuit requires a separate 12 volt power supply. This can come from the computer's internal power supply (if it isn't already overloaded) or a separate power supply. If a wall wart is used as the external power supply, a voltage regulator to clean up its power. If the wall wart is unregulated, put a meter on it FIRST and MAKE SURE it won't overload the Control Circuit. When the Relay Coil opens (power to it is removed), the coil will discharge back EMF and damage the circuit. Diode D1 must be there to catch and prevent this. The Control Circuit is not designed to handle heavy loads (100mA or less). It could probably handle multiple LED's, small lights, and tiny motors (just because you can put something there doesn't mean that you should). For anything heavier, put the device in the Right Section on the other side of the Relay Coil. Right Section: This is the device that is going to be controlled. The relay has a fairly high degree of isolation protecting the Control Circuit (Middle Section) from many "problem" situations. The device that is going to be controlled has its own power source (DC or AC with amps rating depending on the relay) and uses the Relay Switch as a standard on/off switch. ----- Circuit Notes: WARNING: Messing with the Parallel Port (or any port for that matter) can be potentially destructive. For experimenting, pick up a cheap I/O card that can easily be replaced. Be sure to disable the serial/parallel controls on the motherboard in the BIOS if the I/O card causes conflicts. ALWAYS have a resistor before the LED part of the Opto-Isolator (Left Section). Transistors BC547A and BC547B are essentially identical. Diode D1 1N4007 can be 1N4001-1N4007. 1N4007 is the heavier more preferred version. Diode D1 should be "Ultra Fast" rated to help protect the transistor against back EMF by the relay coil. LED+R3 is optional but nice to see if the circuit is on. Pick your favorite color for it. Diode D1 and LED+R3 are "across" the relay coil. The relay input coil is 12V for this circuit. There are many different types of relay output switches. Choose one that is appropriate for whatever is being controlled. The relay is a Single Pole/Single Throw (SPST) relay in this example. A Single Pole/Double Throw (SPDT) relay can also be used by just not connecting the extra pin. SPDT would be a good choice if the controlled device is supposed to stay on and the computer is supposed to turn it off (essentially inverted logic for this example). The Relay Coil should be connected to the Collector pin of the transistor. This keeps the relay before the transistor and keeps things from blowing up. A warning about Parallel Port inputs: From what I've seen, you DO NOT apply power to these like a typical input. I have measured voltages coming out of all of the input pins. Putting two voltages head to head will blow something. If you want to trigger the input, you short the pin to ground. ----- Opto-Isolator Internals LED shines on Photo-Transistor allowing current to flow. Current should be 100mA or less. Voltage can be 5-24V. If the voltage is changed in this circuit, some of the resistors may also need changing. ----------------------------- 1--|---- |------------|--6 | | | | | \---/ \ | ------ | | \ / \ | | / C | | | --- \ \| | |/ | | | | \ -- --| ---|--5 | | \| B |\ | 2--|---- -- | V E | | --------|--4 3--|--NC | -----------------------------