When a computer must control an external device -specially when the device is powered by AC voltage - the computer must be
electrically isolated from the external device to prevent possible damage to the computer, when something goes wrong with the external device.
The simplest way to do this is to use a transformer. However, by relaying short control pulses or high freguency signals, an optocoupler works best.
The circuit featured here uses a comparator following the phototransistor. The comparator has a TTL compatible output. Potentiometer P1 varies the threshold level of the comparator.
Parts Placement Layout
Electronic Circuits volume 1.0 - Circuit Nr. 18
The complete data of the electronic circuit described above can be found in the following book and is available from Amazon.com.
Click on the image to view the book.