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 and the basic operation of an optocoupler is 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 for maximum sensitivity or connected to ground via a suitable external resistor to control the switching sensitivity making it more stable.

When the current flowing through the LED is interrupted, the infra-red 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 *

  • 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

  • g

    its nice and interesting tutorial

  • h

    how optocoupler can control much larger AC voltages

  • A

    I am using mains ac voltage 220v as input to a opto coppler 817 and the other end connected to a micro with a 10k ohm pullup resistor.
    when input is connected to 220v ,out put must be zero but its 2.7v .can you tell me why this happens and how can I get nearly zero in the out put?

    • Wayne Storr

      Vce(sat) will never be zero, but some value less than 0.5V, check datasheet. The value of Vce(sat) depends on sufficient collector current (Ic) as a result of the pull-up resistance, (10k is too high) and sufficient forward diode current (If) to illuminate the photo-diode and drive the transistor hard into saturation, again check datasheet. Another option is to use the opto’s photo-transistor to drive an external switching transistor.

Looking for the latest from TI?