Optocoupler Tutorial

An Optocoupler, also known as an Opto-isolator or Photo-coupler, is an electronic components that interconnects two separate electrical circuits by means of a light sensitive optical interface.

We know from our tutorials about Transformers that they can not only provide a step-down voltage, but they also provide “electrical isolation” between the higher voltage on the primary side and the lower voltage on the secondary side.

In other words, transformers isolate the primary input voltage from the secondary output voltage using electromagnetic coupling by means of a magnetic flux circulating within the iron laminated core.

typical 4n35 optocoupler

But we can also provide electrical isolation between an input source and an output load using just light by using a very common and valuable electronic component called an Optocoupler.

The basic design of an optocoupler consists of an LED that produces infra-red light and a semiconductor photo-sensitive device that is used to detect the emitted infra-red beam. Both the LED and photo-sensitive device are enclosed in a light-tight body or package with metal legs for the electrical connections as shown.

An optocoupler or opto-isolator consists of a light emitter, the LED and a light sensitive receiver which can be a single photo-diode, photo-transistor, photo-resistor, photo-SCR, or a photo-TRIAC with the basic operation of an optocoupler being very simple to understand.

Phototransistor Optocoupler

phototransistor optocoupler

Assume a photo-transistor device as shown. Current from the source signal passes through the input LED which emits an infra-red light whose intensity is proportional to the electrical signal.

This emitted light falls upon the base of the photo-transistor, causing it to switch-ON and conduct in a similar way to a normal bipolar transistor.

The base connection of the photo-transistor can be left open (unconnected) for maximum sensitivity to the LEDs infrared light energy or connected to ground via a suitable external high value resistor to control the switching sensitivity making it more stable and resistant to false triggering by external electrical noise or voltage transients.

When the current flowing through the LED is interrupted, the infrared emitted light is cut-off, causing the photo-transistor to cease conducting. The photo-transistor can be used to switch current in the output circuit. The spectral response of the LED and the photo-sensitive device are closely matched being separated by a transparent medium such as glass, plastic or air. Since there is no direct electrical connection between the input and output of an optocoupler, electrical isolation up to 10kV is achieved.

Optocouplers are available in four general types, each one having an infra-red LED source but with different photo-sensitive devices. The four optocouplers are called the: Photo-transistor, Photo-darlington, Photo-SCR and Photo-triac as shown below.

Optocoupler Types

optocoupler types


The photo-transistor and photo-darlington devices are mainly for use in DC circuits while the photo-SCR and photo-triac allow AC powered circuits to be controlled. There are many other kinds of source-sensor combinations, such as LED-photodiode, LED-LASER, lamp-photoresistor pairs, reflective and slotted optocouplers.

Simple homemade optocouplers can be constructed by using individual components. An Led and a photo-transistor are inserted into a rigid plastic tube or encased in heat-shrinkable tubing as shown. The advantage of this home-made optocoupler is that tubing can be cut to any length you want and even bent around corners. Obviously, tubing with a reflective inner would be more efficient than dark black tubing.

Home-made Optocoupler

home made optocoupler

Optocoupler Applications

Optocouplers and opto-isolators can be used on their own, or to switch a range of other larger electronic devices such as transistors and triacs providing the required electrical isolation between a lower voltage control signal and the higher voltage or current output signal. Common applications for optocouplers include microprocessor input/output switching, DC and AC power control, PC communications, signal isolation and power supply regulation which suffer from current ground loops, etc. The electrical signal being transmitted can be either analogue (linear) or digital (pulses).

In this application, the optocoupler is used to detect the operation of the switch or another type of digital input signal. This is useful if the switch or signal being detected is within an electrically noisy environment. The output can be used to operate an external circuit, light or as an input to a PC or microprocessor.

An Optotransistor DC Switch

optotransistor switch


As well as detecting DC signals and data, Opto-triac isolators are also available which allow AC powered equipment and mains lamps to be controlled. Opto-coupled triacs such as the MOC 3020, have voltage ratings of about 400 volts making them ideal for direct mains connection and a maximum current of about 100mA. For higher powered loads, the opto-triac may be used to provide the gate pulse to another larger triac via a current limiting resistor as shown.

Triac Optocoupler Application

triac optocoupler application


This type of optocoupler configuration forms the basis of a very simple solid state relay application which can be used to control any AC mains powered load such as lamps and motors. Also unlike a thyristor (SCR), a triac is capable of conducting in both halves of the mains AC cycle with zero-crossing detection allowing the load to receive full power without the heavy inrush currents when switching inductive loads.

Optocouplers and Opto-isolators are great electronic devices that allow devices such as power transistors and triacs to be controlled from a PC’s output port, digital switch or from a low voltage data signal such as that from a logic gate. The main advantage of opto-couplers is their high electrical isolation between the input and output terminals allowing relatively small digital signals to control much large AC voltages, currents and power.

An optocoupler can be used with both DC and AC signals with optocouplers utilizing a SCR (thyristor) or triac as the photo-detecting device are primarily designed for AC power-control applications. The main advantage of photo-SCRs and photo-triacs is the complete isolation from any noise or voltage spikes present on the AC power supply line as well as zero-crossing detection of the sinusoidal waveform which reduces switching and inrush currents protecting any power semiconductors used from thermal stress and shock.


Join the conversation!

Error! Please fill all fields.

What's the Answer *

  • g

    How this circuit should be modified in order to have microcontroller trigger the optocoupler? Apparently you can not just connect the left part of the circuit to microcontroller pin as microcontroller provides only 1V on pin high, when 4N25 requires at least 1.3V?

  • R

    I’m new to circuitry but not soldering and need alittle help plz. My Gamepad operates at 2.6vdc, i want to install 5-10 / 3mm slow flash LEDs(3.2-3.6v 20/30mA) with a on/off switch but a dc booster frys the Gamepad PCB board over time, maybe feedback or voltage spikes. I came across a phototransistor/photocoupler from a DVD player, i thought this might help me isolate with my Gamepad project voltage but know sure the circuit i need. any help would be appreciated I’m a newbie. I try to reuse old electronic parts I’ve salvaged.

  • R

    This is an easy to understand article about optocoupler. Very well done. A couple of suggestions:

    * The description about what exactly photo-darlington, photo-SCR and photo-TRIAC are doing is a bit short. A little more detail would be helpful.
    * “The base connection of the photo-transistor can be left open for maximum sensitivity”. Sensitivity to what? Also wouldn’t leaving it open lead to more unpredictable switching?
    * A very helpful circuit would be one that takes a 5V input (like from an Arduino/RP) and switches a highpower OpAmp. There are shields available with relays but something that uses a power opamp (to switch for instance 24V/25A) with an Optocoupler would be rather helpful.

  • j
    jatin gogna

    1 want to know about the 6 pin smd component q306 which is used for led display .is it optocoupler ?

  • N

    I am using mains ac voltage 220v as input to a opto coupler 2501 by 2 resistor in series and a 1n4007 diode in parallel with opto and the other end connected to a micro with a 10k ohm pullup resistor inorder to 5v pulse 20ms,but after a few months opto does not work and destroy.please help me?
    as how i can remove spikes in ac input?

  • E

    i am interested in electronics circuit.

  • A

    Good one

  • L

    need a help

  • A

    hello sir/madam
    i need a circuit diagram of touch button for using in elevator/lift instead of mechanical switch( our working voltage is 24v dc)
    thanking you

  • N

    hellow Sir/ Mam.
    I need circuit diagram tabular column for phototransistor as a switch

Looking for the latest from TI?