EN

Optocouplers

Galvanic isolation of signals: calculation, CTR, types and applications

What an optocoupler is

An optocoupler (or opto-isolator) combines an infrared LED and a photodetector in one package, separated by an insulating transparent material. The signal travels as light, so there is no electrical connection between input and output: they can be at very different voltages and have separate grounds. It is used to bring 24 V or mains signals into a microcontroller, to control 230 V loads from 3.3 V logic and to break ground loops that add noise to measurements.

The CTR

In an optocoupler with a phototransistor, the output current is proportional to the input current. The ratio is called CTR (Current Transfer Ratio) and is given as a percentage:

\[ CTR = \frac{I_C}{I_F}\cdot 100\ \% \qquad R_1 = \frac{V_{in} - V_F}{I_F} \qquad R_L \ge \frac{V_{CC2} - V_{CE(sat)}}{I_F \cdot CTR_{\min} \cdot k} \]

The CTR varies a lot: between units (a PC817 ranges from 50 to 600 %, which is why it is sold sorted into groups A, B, C and D), with temperature and with current, and it decreases over the years as the LED loses emission. That is why the design uses the minimum CTR and a safety factor \(k\) of about 0.5. If the load resistor RL is too small, the phototransistor does not saturate and the output does not go low enough.

Calculator

Input (LED side)
V
V
mA
Output (phototransistor side)
V
V

24 V inputs

This is the case of PLC digital inputs: a resistor of a few kΩ, the optocoupler LED and often an indicator LED in series. It is advisable to add a diode in antiparallel with the LED (it protects against reverse polarity, since the LED only accepts about 6 V in reverse) and a resistor in parallel with the LED so that the small leakage currents of two-wire sensors do not turn it on. The IEC 61131-2 standard defines, for type 1 24 V inputs, a high level from 15 V and a low level below 5 V.

Mains voltage detection

To know whether 230 V is present in a circuit, an optocoupler with an AC input is used (two LEDs in antiparallel, such as the H11AA1 or the PC814), or a normal one with a diode in antiparallel. The resistor dissipates almost all the power and must be split into several in series, because a normal 1/4 W resistor only accepts about 200 to 250 V across it. The output is not continuous: it gives pulses at 100 Hz (50 Hz if only one half-cycle conducts) that must be filtered with a capacitor or in software. The whole mains side must be built with the proper insulation distances and without access to live parts.

Types of optocouplers

OutputExamplesSpeedUse
PhototransistorPC817, 4N35, TLP281Tens of kHzDigital inputs, feedback in switching power supplies
Photodarlington4N32, PC815Slow (kHz)High CTR with little input current
AC inputH11AA1, PC814Tens of kHzMains and zero-crossing detection
Fast logic output6N137, HCPL-2601Up to 10 Mbit/sCommunications (UART, fieldbuses), encoders
PhototriacMOC3021 (random phase), MOC3041 (zero crossing)–Triggering triacs for 230 V loads
Gate driverTLP250, HCPL-3120Fast, with peak currents of amperesIGBT and MOSFET gates in inverters
Photovoltaic / solid-state relayTLP591, PhotoMOS relaysSlowIsolated switches with no supply on the output side

Isolation

Speed

A phototransistor is slow because its base is large and has no connection to discharge it. The fall time depends mainly on the load resistor: with an RL of 100 Ω a PC817 switches in a few microseconds, with 10 kΩ in tens or hundreds. For more speed, use the smallest RL that still allows saturation, connect a resistor between base and emitter if the model brings the base out (4N35), or move to a logic-output optocoupler. For fast communications there are also capacitive or magnetic digital isolators, which exceed 100 Mbit/s.

Related: LED resistor, transistor as a switch, level shifting and PLC ladder simulator.