Diagram or Logic To Input 220 Volts to Parallel Port - Programmers Heaven

#### Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

# Diagram or Logic To Input 220 Volts to Parallel Port

Posts: 7Member
Gud am guyz,
Could pls help me to design or just give the logic to
intercept a relay of 220 Volts from AC to a paralle port.
Im trying to verify whether a bulb is on using 220 Volts signal
and inputting this to a parallel port so that i would manipulate it using my PC
Tanks a lot
bye the way, im doing a simple prototype project
Home based wiring system interfacing/controlling it using my
PC

• Posts: 93Member
: Gud am guyz,
: Could pls help me to design or just give the logic to
: intercept a relay of 220 Volts from AC to a paralle port.
: Im trying to verify whether a bulb is on using 220 Volts signal
: and inputting this to a parallel port so that i would manipulate it using my PC
: Tanks a lot
: bye the way, im doing a simple prototype project
: Home based wiring system interfacing/controlling it using my
: PC
:
:

Hi again xcoder!

I poked around a little and although there are many sites that offer ideas on controlling stuff from the parallel port, I didn't find any that offered how to interface hi-voltage to the input port. This site has a lot of info on output, and a little on input:

http://www.hut.fi/Misc/Electronics/circuits/parallel_output.html

I suggest you try this:

[code]

V+ (5V)
|
+--////--+
| 1k
|
R1 1 ----------- 5 |
-------////--+-|>|--| Opto- |-----+--------D(3)
| | Isolator | Parallel
220v in | +--| |--------------GND Port
-----+-////--+ | 2 ----------- 4
| R2 | CNY 17 or
| | 4N25
+---------------+
[/code]

This is kinda like their output circuit turned around backward to isolate the 220v from the input.

The diode is any small signal rectifier - 1N914, 1N4001, etc.

To get peak current of about 15ma through the optoisolator LED, R1 should be about 1.414 * 220 / 0.01 = 31108 ohms. A 33k should work fine. It should be rated at 2 watts or more so it doesn't get to hot.

R2 keeps the noise down and reduces the reverse voltage on the diode. 4.7k at 1/2w should work.

The web site has info on how to read the state of the port. Keep in mind that the LED in the opto isolator will be "flashing" at the power main frequency when activated so you will have to read the port a couple or more times to check the status. To make the LED stay on steady when activated, connect a capacitor across it. I would guess about 4.7 uf at 10v (the LED will limit the cap voltage to about 2 1/2 volts or less.)

Good luck and have fun!

rg