This is a simple 220V power interface circuit. This circuit used as interface for monitoring electric devices and equipments using a computer. The circuit only senses whether the device being monitored is turned off or on. The galvanic isolation between the AC main line being monitored and the interface to the computer is an important aspect of the circuit. We can use optocoupler to do the galvanic isolation. Here is the circuit:

220v power line interface with optocoupler circuit schematic

The circuit monitors the device’s AC power line directly to prevent having to modify the circuit for each device being monitored. The current that allowed to through optocoupler LED is around 0.5 mA because of R1. The D1 is used to rectify the other half of the current. The light impulses that is received by phototransistor part of the optocoupler is only around 100uA. TO maintains a smooth output current and filters out the current pulsation, this circuit uses C1. We can remove C1, when we need current pulsation. [Source: eleccircuit.com]