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:
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:
Notice the DIP casing doesn’t have the semi-circle moulded into one end like ICs do, so the white dot indicates pin one.
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.
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 twitter, Google+, 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.
Latest posts by John Boxall (see all)
- Tutorial – Using DS1307 and DS3231 Real-time Clock Modules with Arduino - December 1, 2014
- Tutorial – L298N Dual Motor Controller Modules and Arduino - November 25, 2014
- Tutorial – PCF8574 backpacks for LCD modules and Arduino - September 24, 2014