Optocoupler Tutorial

An Optocoupler, 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 (or step-up) 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 and this is achieved using the magnetic flux circulating within their laminated iron 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, also known as an Opto-isolator, 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 infra-red 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 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 home made opto-couplers 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, for example one from an Arduino or micro-controller, and a much higher voltage or mains current output signal.

Common applications for opto-couplers 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.

  • K

    I have recently added a battery motor (MY1016 @ 24 VDC) to my cheap bicycle and not unhappy of using for 6 months. The control unit RKI 9012 uses mosfets and are frequently getting shorted due to swift changes in throttling. Pl suggest an opto isolator based DIY(I am 82 and 60 years from tubes to chip travel) which I can assemble at home. The 6 layer smd soldering is really night marish and so far 3 times I have changes the output mosfets. I am sure your suggession of a circuit which can drive a 350 W motor,which is rigged for a higher level of drain like 500 W ,with a single layer bred board will run it for a LONGER RELIABLE period. Thanks SIR pl help an old man Namasthe

  • S
    Shobhit Srivastava

    The topic is explained perfectly such that there is no doubt left.I mostly prefer to use this site for the electronics topics,as It sounds good place for me to study.!!
    thank u

  • R

    Hi, I have a wireless remote that operates a home ventilation system. On this remote there is a push button which can increase the speed of the system for a certain period of time (press it once = 15 min., press it twice = 30 min.). Now I want this push button to be operated by the light switch (230V) in the restroom by using an opto-coupler prefering the opto-coupler giving one 0.5 – 1 second pulse, regardless how long the light is on, when the light is switched on. Does anybody have an idea what to use and how to make this circuit? Thanks Ronald.

  • m

    what is the working of 4n35 optoisolator in eye directive wheelchair

  • A
    Abdul Hameed Bhatti

    I want to drive a triac in both AC half cycles ie triggering the triac in +ve half cycle as well as in -ve half cycle with a +ve digital signal pulse.
    Please help to resolve, may it be achievable by using optocoupler having IR LED, diac and triac.

  • A
    Amar Gonzales

    is the number matters on a 4 pin optocoupler or all 4 pin optocoupler the same?

  • N


  • James

    A most enlightening article! I wish there was more like this. I am a bit confused on one point. You mention transistor-opto’s are good for DC circuits and triac-opto’s are good for AC circuits. But what about hybrids? For instance, what about isolating DC input from AC output. 3v DC to switch a circuit on and off by way of anode cathode pins and on the collector emitter side, turning on/off, say a 24v AC circuit. Since on the AC side, current is actually flowing in both directions, you would want a triac-opto, but you mention in one of the comments that it will stay on once activated (not a good switch)! With a transistor-opto, the maximum Collector – Emitter voltage output is often 30V but the maximum Emitter to Collector voltage is always low, say 5-6V. Since AC is flowing in both direction, isn’t allowing 30v to flow from emitter to collector bad for the opto? What opto should one use in these hybrid cases?

    • T
      Tony Walton

      You’re right that a triac stays switched on irrespective of the signal in its gate until the current through it falls to zero (actually to its hold current, typically tens of mA), but don’t forget that an AC voltage drops to zero twice in every cycle. So if there’s no signal on its gate the triac will switch off when the AC cycle reaches zero volts. There’s a tutorial on triacs and SCRs.

    • Wayne Storr

      Opto-couplers are used to isolate the input circuit from the output circuit as stated. The input control supply can be either DC or AC and the output switching circuit can be either DC or AC, thus there are four different types of opto-coupler circuit. The most common use of an opto-coupler is a low DC control voltage switching a higher mains AC voltage as shown in the tutorial.

  • N

    I want know , that how can we drive a Power N CHANNEL MOSFET thru a OPTOCOUPLER ?
    Kindly revert at earliest

  • D
    Dinesh kumar


Looking for the latest from TI?