ADALM2000 Activity: Optocouplers

Objective

In this activity, you will construct an optocoupler from an infrared LED and an NPN phototransistor. You will investigate the operation of an optocoupler-based analog isolation amplifier and floating current source using integrated optocouplers.

The NPN Transistor Optocoupler

Background

An optocoupler, or optical isolator, is an electronic device designed to transfer electrical signals by emitting light across an electrical isolation barrier between its input and output. The main purpose of an optocoupler is to prevent high voltages or voltage spikes on one side of the barrier from damaging components or interfering with the transmission of signals to the other side. Commercially available optocouplers can withstand input-to-output voltages from 3 kV to 10 kV and voltage transients with speeds up to 10 kV/µs. The device generally consists of an infrared LED on one side as the input and a photodetector, such as a photodiode or phototransistor, on the other side, with an electrical isolation barrier in between, as shown in Figure 1. When the LED is off—that is, producing no light—there is no photocurrent into the base of the transistor, and it is off. When the LED has current flowing through it—producing light—and there is sufficient photocurrent into the base of the transistor, it will turn on.

Figure 1. NPN transistor optocoupler.

Construction Directions

The first step in this activity is to construct your own optocoupler using the infrared LED and NPN phototransistor supplied with the ADALP2000 Analog Parts Kit. If you are not using the parts kit for these lab activities, similar devices may be substituted, but your results may vary depending on the components selected.

Figure 2. QED123 infrared LED.
Figure 3. QSD123 infrared transistor.

First, bend the leads of both the LED and phototransistor at 90° so that when inserted into the solderless breadboard, they are facing each other and are at the same level. To keep them properly aligned and to keep out stray ambient light, it is best to use a short length of tubing or black electrical tape cut to the appropriate width to wrap around the combined LED and phototransistor, as shown in Figure 4.

Figure 4. A completed coupler.

Materials

  • ADALM2000 Active Learning Module
  • Solderless breadboard
  • Jumper wires
  • Two 2.2 kΩ resistors
  • One single op amp, such as OP27

Directions

On your solderless breadboard, construct the circuit shown in Figure 5. Notice that the NPN phototransistor is configured as a current sink with its emitter connected to ground. Note that the longer of the two leads on the phototransistor is the collector and the shorter of the two LED leads is connected to ground. Double check the component data sheets to make sure you have made the correct connections.

Figure 5. Optocoupler input-to-output characteristics circuit.

Hardware Setup

Configure the waveform generator for a 100 Hz triangle wave with 3 V amplitude peak-to-peak and 2.5 V offset. Both oscilloscope channels should be set to 1 V/div.

Procedure

Oscilloscope Channel 1 measures the voltage across resistor R1, and thus, the input current in the LED. Oscilloscope Channel 2 measures the voltage across resistor R2, and thus, the output collector current in the NPN transistor. The current transfer ratio (CTR) is simply the ratio of these two currents. The CTR is a measure of the gain, efficiency, or sensitivity of the device.

Figure 6. Optocoupler breadboard connections.
Figure 7. Optocoupler Scopy plot waveforms.

Directions

Now move the 1– input of Oscilloscope Channel 1 to ground. Then, move the 2+ input of Oscilloscope Channel 2 to the collector of the phototransistor and oscilloscope input 2– to ground.

Configure the waveform generator for a 5 kHz square wave with 5 V amplitude peak-to-peak and 2.5 V offset. Both oscilloscope channels should be set to 1 V/div.

Procedure

Scope Channel 1 now measures the input signal, and Oscilloscope Channel 2 measures the output signal. The speed of the optocoupler can be characterized by the delay between the input and output waveforms. Another measure of the device speed is the rise and fall times of the output waveform. Another method of testing the frequency response of the optocoupler is to use the Network Analyzer instrument in the Scopy software. Set the frequency sweep from 10 Hz to 100 kHz. Set the AWG amplitude to 2 V peak-to-peak and the AWG offset to 3 V, or whatever DC offset centers the output signal for your coupler circuit.

Driving the LED with a Voltage-to-Current Converter

By putting the LED in the feedback loop of an op amp configured as a voltage-to-current converter, we can greatly reduce the effect of the nonlinearity of the LED.

Directions

Modify your solderless breadboard to look like the circuit shown in Figure 8. Notice that the NPN phototransistor is now configured as a current source with its collector connected to the positive 5 V power supply, Vp. This was done to show that it indeed does not matter how the voltages on the transistor terminals are configured.

Figure 8. Voltage-to-current LED drive.

Hardware Setup

Configure the waveform generator for a 100 Hz triangle wave with 3 V amplitude peak-to-peak and 2.5 V offset. Both oscilloscope channels should be set to 1 V/div.

Procedure

Repeat the same measurements you did on the simple resistor driven version of this circuit in Figure 5. Switch the AWG waveform to a square wave and remeasure the delay, rise, and fall times for inclusion in your lab report. Switch the AWG to a sine wave (same 1 kHz frequency as before) and again measure the harmonic distortion. Remember to adjust the AWG amplitude and offset to get a similar output waveform as you had in the previous circuit.

Figure 9. Voltage-to-current LED driven breadboard connections.
Figure 10. Voltage-to-current LED drive Scopy waveforms.

Analog Isolation Amplifier

To make a more linear amplifier, two matching optocouplers can be used. It is best to use integrated versions for this circuit.

The previous voltage-to-current configuration reduced the nonlinearity of the LED. If we also include a phototransistor inside the feedback loop, we can reduce the nonlinear effect of the light-to-current conversion characteristic of the phototransistor.

Materials

  • Two NPN optocouplers (see Appendix for specific device options)
  • One 0.0047 μF capacitor (472)
  • One 470 Ω resistor

Directions

Build the circuit shown in Figure 11 on your solderless breadboard. The exact wiring of the optocouplers might be different depending on which kind you use (4-pin packages or 6-pin packages, etc.). The pin numbers shown are generally standard for 4-pin packages. Be sure to consult the manufacturer’s data sheet for how to properly connect your specific device.

Figure 11. Unipolar voltage input.
Figure 12. Bipolar voltage input.

Hardware Setup

Start with the waveform generator set for a 100 Hz triangle wave with 4.8 V amplitude peak-to-peak and 2.5 V offset, as you have done for the previous two configurations. Both oscilloscope channels should be set to 1 V/div.

Procedure

Repeat the same measurements you did on the previous two versions of the circuit. Switch the AWG waveform to a square wave and remeasure the delay, rise, and fall times. Switch the AWG to a sine wave (same 1 kHz frequency as before) and again measure the harmonic distortion. Remember to adjust the AWG amplitude and offset to get a similar output waveform as you had in the previous circuits.

Questions:

1. Can you name an advantage of using optocouplers?

2. Can you name several practical applications of optocouplers?

You can find the answer at the StudentZone blog.

Об авторах

Antoniu Miclaus

Antoniu Miclaus

Antoniu Miclaus is a system applications engineer at Analog Devices, where he works on ADI academic programs, as well as embedded software for Circuits from the Lab®, QA automation, and process management. He started working at ADI in February 2017 in Cluj-Napoca, Romania. He is currently an M.Sc. student in the software engineering master’s program at Babes-Bolyai University and he has a B.Eng. in electronics and telecommunications from Technical University of Cluj-Napoca.

Doug Mercer

Doug Mercer

Doug Mercer received his B.S.E.E. degree from Rensselaer Polytechnic Institute (RPI) in 1977. Since joining Analog Devices in 1977, he has contributed directly or indirectly to more than 30 data converter products and holds 13 patents. He was appointed to the position of ADI Fellow in 1995. In 2009, he transitioned from full-time work and has continued consulting at ADI as a fellow emeritus contributing to the Active Learning Program. In 2016, he was named engineer in residence within the ECSE department at RPI.