Microcontrollers are widely used for controlling transistors and relays. Transistors and relays are used for actuating or (energizing) equipment with a higher voltage than an MCU can handle. For example, fans, lights, television, door locks, furnaces, and appliances can be automated using an MCU. However, most operate at higher voltages than the voltage tolerances designated in an MCU’s Input/Output (I/O) specification. Several board manufacturers use microcontrollers that usually operate in the range of 3 V DC to -5 V DC. When high voltage equipment is controlled by (and electrically connected to) an MCU, the high voltage equipment produces back EMF headed towards the MCU’s circuit and adds noise to the signals. These noisy signals can cause circuits to malfunction or cause permanent damage.
Another major challenge is protecting sensitive circuits from the risk of receiving electrical surges. High voltage equipment, powered by a high voltage source, can initiate an electrical surge. If a sensitive circuit is exposed to an electrical surge, the components can burn up immediately. This means an electrical surge can “let out the magic smoke in engineering slang.”
To reject back EMF, noise, and electrical surges from entering an MCU circuit, optocouplers are often used. Optocouplers create a safe connection between high voltage equipment and microcontrollers with complete electrical insulation. Suppose the high voltage circuit induces an electrical surge. In that case, the surge remains only on the output side of the optocoupler, and the circuit at the input side remains safe and unaffected, as both sides are electrically isolated. Optocouplers are also called photodiodes, optoisolators, photocouplers, photo relays, and optical isolators.
Internal view of a phototransistor-based optocoupler
Phototransistor-based optocouplers contain Infrared Emitting Diodes (IRED) on the input side and a phototransistor on the output side. Both sides are optically connected, and there is no electrical connection between the input and output sides. The IRED turns on when a voltage signal is passed on the input side. The light that the IRED emits then falls on the receiving phototransistor, resulting in current flow through the phototransistor’s collector and emitter.

How to make optocouplers at home
Although many optocouplers are relatively cheap and readily available online, they can be developed at home using an LED, a light-dependent resistor, and an opaque tube, perhaps made with duct tape.

The phototransistor and LED are inserted inside the tube, facing each other. Tightly enclose the tube so that an external light source cannot affect the phototransistor. It is recommended to use an internally reflective tube, however, as a non-reflective tube might absorb LED light, affecting the efficiency of the optocoupler. This simple design can be used in hobby projects, functioning quite well as a standard optocoupler.
References
http://www.cel.com/pdf/appnotes/an3020.pdf
https://www.autodesk.com/products/eagle/blog/how-an-optocoupler-works/
Leave a Reply