Linuxdoc Linux Questions
Click here to ask our community of linux experts!
Custom Search

3. Electronic Circuit

The data line of the parallel port can provide between 0 and 5 volts. Therefore, we can use this line to control a relay and let that relay control an electrical device.

Use pins 2 through 9 to get +5V

Use pins 18 through 25 as the Ground


            ____________________________________________________________
           /                                                            \
           \     13  12  11  10   9   8   7   6   5   4   3   2   1     /
            \                                                          /
             \     25  24  23  22  21  20  19  18  17  16  15  14     /
              \______________________________________________________/




                                             | Vcc for Relay
                                             |
                                             |
                                    / -------+--------| |---------|
P data              4.7K         B /  c      | 1N4002 |_|         |-------
-----------/\/\/\/\---------+-----| NPN    _____        | relay   |home device
                            |     \   e     /_\       |-|         |-------
                 LED        X      \         +--------| |---------|
P Ground                    |       |        |
----------------------------+-------+--------+
Relay Ground                                 |
---------------------------------------------+

        

Below is the key to the diagram above:

P data         parallel port data line(pin 2 to pin 9, use any)

P Ground                        parallel port ground (pin 18 to pin 25, use any)

Vcc                             depends on the type of your relay. I'm using 12VDC

Relay Ground    the ground for 12VDC

4.7k                            4.7K resistor

NPN                             C2235 NPN transistor

1N4002                  1N4002 diode

LED                             light emitting diode

relay                           a coil relay

+5 volts from parallel port will turn on the relay. Once the relay is on, the device connected to that relay will be on. When the parallel port's data line goes back to 0, it will turn off the relay, and device is off.