Optocoupler Tutorial for Beginners

An optocoupler (or opto-isolator) is a component that transfer signals between circuits using light. In this guide, you’ll learn how they work and how you can use one in your own projects.

Typical optocoupler package and symbol

Optocouplers are very useful when you need to isolate different sections of a circuit, for example in power supply circuits to transfer signals between high-voltage and low-voltage areas, preventing damage to sensitive components.

They are also commonly used in microcontroller circuits, as they help protect inputs and outputs from voltage spikes and electrical noise. And in sensor circuits to avoid that a noisy processing circuit adds noise to the sensor reading.

How Do Optocouplers Work?

Inside the optocoupler

Inside an optocoupler, there are two main components:

  • Light-Emitting Diode (LED): On the input side, you have an LED that converts the input electrical signal into light. When current flows through the LED, it emits light, typically infrared, proportional to the electrical signal.
  • Photodetector: On the output side, you have a photodetector, for example a phototransistor, that is responsible for detecting the light emitted by the LED on the input side.

When the LED is on, it emits infrared light that is detected by the phototransistor. This causes the phototransistor to “turn on,” allowing current to flow through its collector-emitter path. Thus, it acts like a closed switch in this state.

When the LED is off, the phototransistor does not receive light and remains in the “off” state, preventing current flow, similar to an open switch.

Types of Optocouplers

Optocouplers can be categorized based on their internal components, which define how they handle the output signal and what type of applications they are best suited for.

The most common types of optocoupler are:

  • Phototransistor
  • Darlington
  • Photo-SCR
  • Photo-triac optocouplers

Phototransistor Optocoupler

Phototransistor optocouplers are the most widely used type. Here, the photodetector is a phototransistor that turns on and off based on the light emitted by the internal LED. When the LED is on, the light activates the phototransistor, allowing current to flow in the output circuit.

Darlington Optocoupler

A variation of the standard optocoupler is the Darlington optocoupler. Inside this device, two transistors are connected in a Darlington pair. This gives you a higher current gain and sensitivity, which is useful when you need the output current to be significantly higher than what a single phototransistor can provide.

Darlington phototransistor optocouplers are often used in low-power control circuits, where a small input current controls a much larger output load.

Darlington Optocoupler

Photo-SCR Optocoupler

These optocouplers are designed for high-power applications. In these devices, the light from the LED triggers a photo-SCR, which then switches the output circuit on or off. SCRs are capable of handling large currents and voltages, making photo-SCR optocouplers ideal for controlling power in AC and DC systems.

Photo-scr Optocoupler

Photo-triac Optocoupler

This device is similar to photo-SCR optocouplers but it is specifically designed for switching AC loads. In this case, the light from the LED triggers a photo-triac, which can then conduct current in both directions (AC current). This optocoupler is often used in applications where an AC load needs to be controlled, such as in light dimmers or heating systems.

Photo-triac Optocoupler

Optocoupler Example: Isolating A Motor Circuit From Your Arduino

Sometimes you need to control a high current from a microcontroller circuit, such as an Arduino. Although it’s possible to do with a transistor, using an optocoupler is safer as it ensures that there is no noise or high-voltage spikes coming from the high-current circuit.

In the example below, an Arduino Uno controls a DC motor via an optocoupler. From the Arduino’s point of view, it is only controlling a simple LED. But the LED inside the optocoupler triggers the internal phototransistor, which then allows voltage to reach the gate of the nMOSFET, powering the motor.

As you can see below, there is a resistor at the input of the optocoupler to control the current flowing through the internal LED. In this example, a 190Ω resistor keeps 20 mA in the input of the PC817 optocoupler, this considering the Arduino’s pin 5V supply and the LED’s 1.2V drop.

It’s important to note that while optocouplers are excellent for isolating and transmitting signals, they differ from solid-state relays, which are designed to switch larger loads.

This means the internal transistors of optocouplers cannot handle high-power devices, such as motors. Instead, you have to use another switching device (the MOSFET in the example above) that is controlled by the the output of the optocoupler.

Questions?

Do you have any questions about Optocouplers or any feedback you want to share? Let me know in the comments below!

More Electronic Components Tutorials

Leave a Comment