Power Electronic Tips

Power Electronic News, Editorial, Video and Resources

  • Products
    • Power Supplies
    • AC-DC
    • DC-DC
    • MOSFETS
    • Power Management
    • Battery Management
    • RF Power
    • Resistors
    • Capacitors
    • Magnetics
    • Transformers
  • Applications
    • LED Lighting
    • Rack Mount
    • Wireless
  • Tools
    • Simulation
  • Podcasts
  • Suppliers
    • TI E2E Community Power Management
    • TI Reference Designs
  • Industry Experts
    • Editor’s Blog
    • Digital Issues
  • Video
    • TI Power Videos
  • DesignFast

Why use optocouplers in electronics?

January 25, 2019 By Janet Heath Leave a Comment

Optocouplers not only protect sensitive circuits but enable an engineer to design a variety of hardware applications. Optocouplers can avoid a great deal of cost in replacing components by protecting them. However, optocouplers are more sophisticated than fuses.  Optocouplers also make it convenient to control the connection between two circuits by connecting and disconnecting them via an optocoupler. Optocouplers are extensively used in electronics, electrical, and communications systems.

How to protect sensitive circuits from high voltages

Optocouplers are often used to reject back EMF, noise, and electrical surges from entering an MCU circuit. Optocouplers create a safe connection between high voltage equipment and microcontrollers with a means of complete electrical insulation. In case the high voltage circuit induces an electrical surge, the surge remains only on the output side of the optocoupler, and the circuit at input side remains safe and unaffected, as both sides are electrically isolated. Optocouplers are also called photodiodes, optoisolators, photocouplers, and optical isolators.

A standard optocoupler such as PC817 supports up to 5 kV of input-output isolation voltage. [i] Most electronic components operate below 10 V, and if a lighting surge enters the system, it can induce voltages up to 10 KV – which is enough to fry electronic components at once. Some commercial-scale optocouplers can withstand up to 10 KV of Input-output isolation voltage which are used for protection against lightning strikes. [ii]

Replacing burned components on a Printed Circuit Board (PCB) can be highly inconvenient. However, optocouplers can be used for securing expensive components. In case of a malfunction, the optocoupler burns and rest of the circuit is not affected. Optocouplers are not directly soldered on the circuit; instead they are placed in an Integrated Chip (IC) socket so they can always be replaced easily if burned.

For a detailed explanation of the internal workings of an optocoupler and how to build your own using an LED and photodiode, see an earlier post called Protecting an MCU: Build your Own Optocoupler.

Why aren’t ground levels on an optocoupler’s input and output side connected?

The circuits at the side where the optocoupler’s Input/Output (I/O) are located are meant to be protected from possible risks on either side. Although the term “ground level” voltage sounds like it is always 0 V, this is not necessarily the case. The ground level of a 5 V source and a 220 VAC source can be quite different; the ground voltages observed by the 5 V source do not need to be same as that of the 220 VAC. In such cases, connecting the ground planes from different sources can be hazardous. Even if the 220 VAC is stepped down and rectified to 5 VDC, it is still not recommended to connect ground level from both sides to each other. Doing so can produce electrical glitches, which is why the ground levels of both I/O sides of an optocoupler are always kept electrically disconnected. For detailed information on how common points and their paths are usually connected, read Bill Schweber’s article “How should grounds and commons be connected to each other?” 

Impedance matching: problem-solving with optocouplers

In many communication circuits it is essential to establish matching impedances between several components. A mismatch can result in inappropriate output. However, optocouplers can be used for signal transmission without requiring impedance matching on both sides, which is why optocouplers are widely used in high speed telecommunications equipment. According to Janet Heath, “In an ideal world, the signal energy coming out of a pin would travel through PCB traces and be wholly absorbed by the load. However, if energy is not completely soaked up by the load (receiver), residual energy can get reflected back through the PCB trace, reaching the original source of the energy at the output pin (driver).“[iii] Photodiode-based optocouplers like the Toshiba TLP2719 photocoupler can support signal speeds up to 1Mbps.  High-speed optocouplers have a data transmission rate of up to 50 Mbps.[iv]

Using optocouplers for sensing zero crossing of AC sources

Sensing zero-crossing of AC mains is essential in many applications. For example, a typical Power Factor Correction System measures the difference in angles between the Real Power and Reactive Power (both components of total power). The difference between real and reactive power is measured by monitoring something called the “zero crossing” of voltage and current waves.  “Zero-crossing” is a term commonly used in electronics, acoustics, math, and image processing. Zero crossing denotes the location where a wave form cuts across it’s coordinate axis (i.e., if you graphed the wave form). Zero crossings also indicate when a waveform, expressed as a mathematical function, will switch from positive to negative and back again. Note that some frequency testing circuits work on the principle of monitoring zero-crossings in AC source waveforms. [v]

Optocouplers can be used for sensing zero-crossing of AC Power mains. The response time of an optocoupler is mere nanoseconds; it turns on and off speedily at zero-crossings. By using a rectifier and filter on AC mains, digital signals can be obtained from the optocoupler.[vi] Using RC filters, the output waveform can be varied as needed.

Figure 1: Circuit diagram of AC Mains Monitoring with an optocoupler. The AC input is rectified and filtered before signaling the IRED of the optocoupler. (Source: ON Semiconductor )

Switching devices with optocouplers

Optocouplers are used as a safe barrier between microcontroller’s digital output and external components that need to be controlled.

Figure 2: Circuit diagram showing a connection between PIC16F877A microcontroller (U2) and PC817C optocoupler (U1). The optocoupler is being used for switching an LED (D1). Transistors and relays can be used for switching loads with comparatively high voltages. (Source: Author)

The digital output of the microcontroller in Figure 3 initiates a 5 VDC (digital) signal which is used for switching the IRED in an optocoupler (U1). The output pins of the microcontroller and the IRED in the optocoupler can support a limited flow of current; therefore, it is recommended to use a current limiting resistor between the microcontroller’s output and the optocoupler’s input. As the IRED turns on, the infrared light falls on the phototransistor, which actuates (energizes) the phototransistor, after which the current starts flowing between the collector and emitter pins. The phototransistor’s collector and emitter support limited current flow. If a device with higher current specifications needs to be controlled, then a transistor can be used to amplify an optocoupler’s output.

The switching device’s ground is not connected with the common ground on the microcontroller’s circuit, since it could result in noise leakage headed towards the microcontroller.

Reading input signals with optocouplers

Optocouplers can be used for safely reading levels as logic 0 and logic 1 from any source. For instance, the voltages from a transformerless power supply may contain noise. In such situations, if the input signal is directly connected with the microcontroller, the noise from the input signal can affect the way the microcontroller functions. Similarly, in case a microcontroller’s input is accidently exposed to an electrical surge, the microcontroller is immediately destroyed (i.e., it burns or “lets out the magic smoke.”) However, using an optocoupler between a microcontroller and an input signal is like an insurance policy and can prevent such accidents.[vii]

Figure 3: Circuit diagram showing a connection between a Microchip PIC16F877A microcontroller (U2 above) and PC817C optocoupler (U1 above). The optocoupler is being used for reading a digital signal. (Source: Author)

Conclusion

Optocouplers not only protect sensitive circuits but enable an engineer to design a variety of hardware applications. Using an optocoupler saves a great deal of cost on replacing components and makes it convenient to control the connection between two circuits by connecting/disconnecting an optocoupler. Optocouplers are extensively used in electronic, electrical, and communications systems.

 

[i] http://www.sharp-world.com/products/device/lineup/data/pdf/datasheet/pc817xnnsz_e.pdf

[ii] https://en.wikipedia.org/wiki/Opto-isolator

[iii](Heath, 2018)

[iv] https://www.mouser.com/Optoelectronics/Optocouplers-Photocouplers/High-Speed-Optocouplers/_/N-6zsft/

[v] https://ieeexplore.ieee.org/abstract/document/6717944

[vi] https://www.onsemi.com/pub/Collateral/AN-3001.pdf.pdf

[vii] https://hackaday.com/2018/05/09/optocouplers-defending-your-microcontroller-midi-and-a-hot-tip-for-speed/

You may also like:

  • VOT8024AM and VOT8121AM optocouplers
    Optocouplers offer 800 V off-state voltage in flat SOP-4 package
  • optocouplers
    Optocouplers, Part 2: Parameters and applications

  • Optocouplers, Part 1: Principles and usefulness
  • fuses
    Fuses for power protection, Part 2

  • Fuses for power protection, Part 1

Filed Under: FAQ, Featured Tagged With: basics, FAQ, mouserelectronics, onsemiconductor

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.

DesignFast

Component Selection Made Simple.

Try it Today
design fast globle

Subscribe to our Newsletter

The Power Electronic eNewsletter delivers breaking electronic and power component news, resources, product innovations and more.

Subscribe today

Forum for Electronics

Covering Microcontrollers, DSP, Networking, Analog and Digital Design, RF, Power Electronics, PCB Routing and much more

EDABoard: Forum for electronics

Follow us on Twitter

Tweets by PowerElectrTips

EE World Online Network

  • DesignFast
  • EE World Online
  • EDA Board Forums
  • Electro Tech Online Forums
  • Connector Tips
  • Microcontroller Tips
  • Analog IC Tips
  • Sensor Tips
  • Test and Measurement Tips
  • Wire and Cable Tips

Power Electronic Tips

  • Subscribe to our newsletter
  • Advertise with us
  • Contact us
  • About us
Follow us on Twitter@PowerElectrTips
Add us on FacebookEE World Online

Copyright © 2019 · WTWH Media LLC and its licensors. All rights reserved.
The material on this site may not be reproduced, distributed, transmitted, cached or otherwise used, except with the prior written permission of WTWH Media.

Privacy Policy