Education – Introduction to the Optocoupler

Hello everyone!

Today we are going to start examining Optocouplers. These are an interesting and quite convenient component, and relatively easy to implement.

First of all, what is an optocoupler?

It is a small device that allows the transmission of a signal between parts of a circuit while keeping those two parts electrically isolated. How is this so? Inside our typical optocoupler are two things – an LED and a phototransistor. When a current runs through the LED, it switches on  – at which point the phototransitor detects the light and allows another current to flow through it. And then when the LED is off, current cannot flow through the phototransistor. All the while the two currents are completely electrically isolated (when operated within their stated parameters!)

Let’s have a look at some typical optocouplers. Here are the schematic symbols for some more common units:

schematicsss

Switching DC current will flow from A to B, causing current to flow from C to D. The schematic for figure one is a simple optocoupler, consisting of the LED and the photo-transistor. However, this is not suitable for AC current, as the diode will only conduct current in one direction. For AC currents, we have an example in figure two – it has diodes positioned to allow current to flow in either polarity. Figure three is an optocoupler with a photodarlington output type. These have a much higher output gain, however can only handle lesser frequencies (that is, they need more time to switch on and off).

Physically, optocouplers can be found in the usual range of packaging, such as:

4n25

Notice the DIP casing doesn’t have the semi-circle moulded into one end like ICs do, so the white dot indicates pin one.

TO-78 (“Sputnik!”)

surface-mount SOIC-8

Some of you may be thinking “why use an optocoupler, I have a relay?” Good question. There are many reasons, including:

  • Size and weight. Relays are much larger, and heavier;
  • Solid state – no moving parts, so no metal fatigue;
  • Optocouplers are more suited to digital electronics – as they don’t have moving parts they can switch on and off much quicker than a relay;
  • Much less current required to activate than a relay coil
  • The input signal’s impedance may change, which could affect the circuit – using an optocoupler to split the signal removes this issue;

Furthermore, the optocoupler has many more interesting uses. Their property of electrical isolation between the two signals allows many things to be done. For example:

  • you might wish to detect when a telephone is ringing, in order to switch on a beacon. However you cannot just tap into the telephone line. As the ring is an AC current, this can be used with an AC-input optocoupler. Then when the line current starts (ring signal) the optocoupler can turn on the rest of your beacon circuit. Please note that you most likely need to be licensed to do such things. Have a look at the example circuits in this guide from Vishay: Vishay Optocouplers.pdf.
  • You need to send digital signals from an external device into a computer input – an optocoupler allows the signals to pass while keeping the external device electrically isolated from the computer
  • You need to switch a very large current or voltage, but with a very small input current;
  • and so on…

But as expected, the optocoupler has several parameters to be aware of. Let’s look at a data sheet for a very common optocoupler, the 4N25 – 4N25 data sheet.pdf – and turn to page two. The parameters for the input and output stages are quite simple, as they resemble those of the LED and transistor. Then there is the input to output isolation voltage – which is critical. This is the highest voltage that can usually be applied for one second that will not breach the isolation inside the optocoupler.

Side note: You may hear about optoisolators. These are generally known as optocouplers that have output isolation voltages of greater than 5000 volts; however some people regularly interchange optocouplers and optoisolators.

The next parameter of interest is the current-transfer ratio, or CTR. This is the ratio between the output current flow and the input current that caused it. Normally this is around ten to fifty percent – our 4N25 example is twenty percent at optimum input current. CTR will be at a maximum when the LED is the brightest – and not necessarily at the maximum current the LED can handle. Once the CTR is known, you can configure your circuit for an analogue response, in that the input current (due to the CTR) controls the output current.

needabench

Finally, the frequency, or bandwidth the optocoupler can accept.  Although this can be measured in microseconds, these parameters can be altered by other factors. For example, the higher the frequency of the current through the input stage, the less accurate the output stage can render the signal. The phototransistors can also be a function of the maximum bandwidth; furthermore if the optocoupler has a darlington output stage, the bandwidth can be reduced by a factor of ten. Here is an example shown on the old cathode-ray oscilloscope. I have set up a digital pulse, at varying frequencies. The upper channel on the display is the input stage, and the lower channel is the output stage:

Notice as the frequency increases, the ability of the output stage to accurately represent the input signal decreases, for example the jitter and the generally slow fall time. Therefore, especially working with high speed digital electronics, the bandwidth of your optocoupler choice does need to be taken into account.

Thus ends the introduction to optocouplers. I hope you understood and can apply what we have discussed today. In the meanwhile have fun and keep checking into tronixstuff.com. Why not follow things on twitterGoogle+, subscribe  for email updates or RSS using the links on the right-hand column? And join our friendly Google Group – dedicated to the projects and related items on this website. Sign up – it’s free, helpful to each other –  and we can all learn something.

Some information from various Isocom and Vishay data sheets and publications; various optocoupler images from element14.

The following two tabs change content below.

John Boxall

Founder, owner and managing editor of tronixstuff.com.

17 Responses to “Education – Introduction to the Optocoupler”

  1. highwar says:

    my question is ,maby anote
    telephone freq ring is 400-450 hz I have a circuit that works with optocoupler 4n25 but at the youtube link at 500 hz the optocoupler didnt work properly
    what I did is put a resistor and a capacitance at the output and it did detect ringing tone ( maby missed the first one once in 5 times)

  2. Jollino says:

    For an opto-isolator to act as a relay (ie. shorting two “external” lines), one would simply connect such lines to pins 4 and 5 (collector and emitter), and leave pin 6 (base) disconnected as the base is triggered by the LED across pins 1 and 2, correct?
    Thank you. :)

  3. loneziddik says:

    i have seen ocs with 4 pins! Whats that? And Can an oc switch 230v AC?

  4. amirhossein says:

    Thanks for your complete overview.
    I have a question , is any special application for optocouplers in chemical industry ?

  5. karamurat says:

    Thank you for this good lesson.

  6. Adams says:

    Thanks for your great tutorial concepts,keep it up.

  7. Hello, great tutorial here as well as tons of arduino tutorials, however i have a question. can i use optocoupler’s output as mikrokontroler input ? for example, optocoupler’s switch-transistor to switch arduino input either high or low.

    • John Boxall says:

      You could – however not at a high frequency. See the video at the end of this post. Treat it as you would a button with a pull-down resistor and so on. However experiment first to check for yourself.

  8. brazendan says:

    This was really helpful. I just found one of these in my cell phone’s wall charger. I am still trying to figure out exactly why it is there! It seems to be some kind of feedback from the secondary to the primary.

    Hey, can these things go bad? As in they still work, but not as well, causing my charger to put out less current? Or would it be like most semiconductors – all or nothing?

    Thanks!

Trackbacks/Pingbacks

  1. [...] z tego wynalazku można korzystać? Na blogu tronixstuff australijskiego hackera znajduje się tutorial wyjaśniający jak korzystać z optocouplera (wybaczcie wolę angielską nazwę) i jak czytać jego parametry. You can follow any responses to [...]


Leave a Reply

Receive notifications of new posts by email.

The Arduino Book

Arduino Workshop

Für unsere deutschen Freunde

Dla naszych polskich przyjaciół ...

Australian Electronics!

Buy and support Silicon Chip - Australia's only Electronics Magazine.

Use of our content…

%d bloggers like this: