Optocouplers, also called optoisolators, turn up in many kinds of electronic equipment whenever a signal must pass from one circuit to another without an electrical connection between them. They are widely used, yet their operation can seem mysterious when a circuit stops behaving as expected. Can you test one? How do you know whether it is working properly? The information usually passes through an infrared LED, whose behavior on a multimeter may differ from that of a conventional LED. What should you do when that happens? Let’s take a closer look.

The growth of semiconductor technology made optocouplers a useful alternative to relays and transformers, particularly in digital applications. They can transfer signals quickly while preserving the input waveform as faithfully as possible at the output. A relay cannot transfer an analog signal, and transformers have limitations with certain frequencies and unusual waveforms. Optocouplers proved valuable when circuits needed substantial voltage-level differences, when data transmission called for isolation from particular kinds of noise, or when a low-voltage logic signal had to control a high-current AC load in an industrial setting. In short, they provide a way for a low-power control signal to switch a load with galvanic isolation.

104DAx900y900.jpg
Infrared optical links brought security and reliability to electronic circuits operating at separate supply levels.

An optocoupler can come in many physical forms, but its basic principle remains the same. An infrared LED, made from gallium arsenide, transmits the signal optically to a detector. The detector captures the light and converts it into an electrical signal with levels corresponding to those emitted by the LED. The detector’s design determines how it responds to the LED’s input and what function the optocoupler can perform.

104DBx900y900.jpg
The detector can be almost any type of device, but the emitter is always an infrared LED.

If the receiver is a phototransistor, the device can transfer analog signals such as audio or video. A photodiode or photo-SCR can instead act as an electrically isolated, controlled rectifier. Detectors also include devices such as a Triac for AC applications, and even logic gates. The emitter, however, remains an infrared LED or an array of them.

104DCx900y900.jpg
A classic slotted optocoupler, designed to work with toothed wheels.
104DEx900y900.jpg
Reflective optocouplers are widely used in robotics.

Optocouplers come in a surprising variety of packages. One familiar example in line-following robots is the CNY70, which works by reflection. Another popular design is U-shaped: rather than detecting reflected light, it responds when an object interrupts a beam that is normally detected. The third video demonstrates a test with this type. The most familiar package looks like a conventional integrated circuit but has fewer pins on each side—often two or three per side. Some versions combine several optocouplers in a single package, with up to eight pins on each side, or four individual optocouplers in total.

104E0x900y900.jpg
A simple optocoupler can also be found in a multi-device package.

How to check whether an optocoupler works

Don’t feel out of your depth if you’re unsure where to start or which parameters to check. Testing an optocoupler takes some care, but the basic checks are straightforward and require only simple tools. For a proper test, remove the device from the circuit first. Begin with a visual inspection: look for burn marks, cracks, or other physical damage. Packages that look like integrated circuits can sometimes split open when they fail, which makes diagnosis easier. If the body looks intact, start with a basic static test. Use a multimeter’s diode-test setting if it is digital, or the R × 1 range if it is analog, and probe the pins until you locate the LED. Remember that this is not a conventional LED, so the reading may look unusual.

Once you have identified and checked the LED, you can test whether its signal reaches the detector. For this, you’ll need two multimeters and a few leads with alligator clips. Keeping four test probes in place with only two hands can be awkward, so a couple of leads and some clipped-off resistor leads can help. With the LED identified, use one instrument to drive the emitter and the other to check the receiver or detector for a response.

These checks are usually enough to establish whether an optocoupler works, without searching for its datasheet. But there are exceptions: a device can pass out-of-circuit measurements and still fail in its application. A leakage current from the emitter to the detector may produce readings that appear correct, even though the isolation between the two sides is compromised. That’s why static tests should be supplemented with a dynamic test at operating voltage, which checks both the devices’ operation and the isolation between them.

Move on to a dynamic test

You might wonder why not simply replace this inexpensive component instead of spending time testing it. But when you don’t have a replacement—and can’t get one for several days—a dynamic test is worth doing. First identify the device and its part number, then find its datasheet. Search online for the part number and look for a PDF explaining the component’s internal design and specifications. With that information in hand, you can decide how to test it.

104E1x900y900.jpg
When testing an optocoupler dynamically, keep its datasheet close at hand.

Start by checking the LED specifications in the datasheet. Don’t confuse absolute maximum ratings with the recommended operating values: staying within suitable limits is important for reliable operation and a long service life. As an example, consider the widely used, inexpensive PC817. This classic analog optocoupler has an infrared LED emitter and a phototransistor detector. Its output is available at the collector and emitter, where variations in the LED’s light intensity can be recovered proportionally and with electrical isolation.

The PC817’s absolute maximum forward LED current is 50 mA. Running it at that limit could destroy the device within minutes: an absolute maximum is not a safe operating value. There are two ways to find an appropriate operating current. One is to examine the datasheet’s curves and identify the values within the safe operating area (SOA), the region beneath the dotted line in the graph. The example shows that an LED current of 5 mA, 10 mA, or a little more can be used across the phototransistor’s voltage range. At 20 mA of LED current, however, you can’t use 6 V across the phototransistor; even 5 V would be close to the unsafe region.

104E2x900y900.jpg
Basic performance curves are worth understanding.

The current transfer ratio, or CTR, graph also tells an important part of the story. In this PC817 model, with 5 V across the transistor, the CTR reaches its highest percentage when the LED’s forward current (If) is between 10 mA and 20 mA. What does CTR mean? A CTR of 100% represents a one-to-one current ratio: each milliamp through the emitter LED corresponds to one milliamp in the output phototransistor’s collector-emitter circuit. For example, at a collector-emitter voltage (Vce) of 5 V, the PC817’s CTR reaches 100% at a little over 2 mA of LED current, allowing a little over 2 mA to be recovered at the output. If the CTR rises to 200% at 5 mA of LED current, the output current can reach 10 mA. Other PC817 models can have a CTR as high as 600%. These figures help you determine the LED current needed for safe operation and how the output will respond to each milliamp of input current.

104E3x900y900.jpg
Analog optocouplers can be found in most switching power supplies.

A dynamic test is another way to check an optocoupler, in addition to multimeter measurements. For a basic functional test, there’s no need to measure whether the transfer ratio is perfectly linear over the full range of LED current; that’s a design concern for another time. The first step is to confirm that the emitter LED works. Then use the calculations from the article about LEDs to choose a current-limiting resistor. Ideally, use a variable control to explore the SOA and observe the output changes in the PC817’s collector-emitter circuit. With a 5 V test supply for the LED circuit, a 180-ohm minimum resistance gives If ≤ 27 mA, while a maximum of 1,000 ohms gives a forward LED current of at least 1 mA. A fixed 180-ohm resistor in series with a 1 kΩ potentiometer makes a suitable starting setup.

For a final check, you can use a simple LED and resistor in the detector circuit. The aim is to confirm that changes in the emitter LED current produce corresponding changes in the output phototransistor’s collector-emitter current. Once you know the phototransistor’s pinout, connect it much like a conventional transistor; the internal phototransistor will control the LED in the test circuit.

As we’ve seen, identifying an optocoupler’s essential components isn’t an impossible task reserved for experts. A multimeter can help you locate the photodiode, and then you can test the emitter and move on to dynamic checks with familiar components. Measure currents and compare what happens in practice with what the theory predicts. We hope the explanations and demonstrations have made this once-mysterious corner of electronics easier to understand.

PC817