A photocoupler (also known as an optoisolator or optocoupler) is a semiconductor component that transfers electrical signals between two isolated circuits using light, completely breaking the galvanic path to protect sensitive low-voltage logic from high-voltage transients. In a real circuit, it changes the architecture by allowing a 3.3V microcontroller to safely switch or monitor a noisy 24V industrial motor drive or a 240V AC mains load without the two sides sharing a common ground reference. By converting electrons to photons and back to electrons across a physical gap, the device ensures that a catastrophic voltage spike on the mains side cannot physically travel to the logic side.

Core Specifications and Common Photocoupler ICs

Selecting the right photocoupler requires matching the internal light-emitting diode (LED) and the photodetector type to your signal requirements. A standard transistor-output optoisolator is fine for slow on/off switching, but high-speed digital buses require logic-gate or avalanche-photodiode outputs. According to the Vishay Optocoupler Portfolio, matching the Current Transfer Ratio (CTR) and bandwidth to your application is the primary driver of component selection.

Part Number Output Type Typical CTR Bandwidth Isolation Voltage Primary Application
PC817 (Rank C) Phototransistor 200% - 400% ~80 kHz 5,000 Vrms General I/O, SMPS feedback
6N137 Logic Gate (Open Collector) N/A (mA/mA) 10 MHz 5,000 Vrms High-speed digital, MIDI
MOC3021 Random-Phase Triac N/A (Trigger) AC Mains 5,000 Vrms AC switching, phase control
HCPL-3120 Gate Driver (Push-Pull) N/A (Drive) 25 MHz 1,414 Vpeak IGBT/MOSFET gate driving
H11AA1 Phototransistor (Dual LED) 20% - 100% ~50 kHz 5,300 Vrms AC zero-cross detection
Bench Note: Never substitute a standard transistor optocoupler (like the PC817) for a digital logic isolator (like the 6N137) on a UART or SPI bus. The phototransistor's Miller capacitance will round off the square waves, causing severe data corruption above 20 kbps.

The Math: Calculating CTR and Sizing the Input Resistor

The most critical parameter in a standard photocoupler is the Current Transfer Ratio (CTR), defined as the ratio of the output collector current ($I_C$) to the input forward current ($I_F$), expressed as a percentage. If you push 5mA through the input LED and get 5mA out of the phototransistor, the CTR is 100%.

Formula: CTR = ($I_C$ / $I_F$) × 100

Let us walk through a real-world sizing example. You need to interface a 24V DC industrial PLC signal to a 3.3V ESP32 GPIO pin using a PC817 (Rank C). The ESP32 pin is configured as an input with an internal pull-up, and the PC817 will pull the pin to ground when the 24V signal is active.

Step 1: Size the Input Resistor ($R_{IN}$)
The PC817 datasheet specifies a typical forward voltage ($V_F$) of 1.2V at 5mA. We will target $I_F$ = 5mA to balance power dissipation with adequate output drive.
$R_{IN} = (V_{CC} - V_F) / I_F$
$R_{IN} = (24V - 1.2V) / 0.005A = 4,560\Omega$
Select the nearest standard E12 value: 4.7 kΩ.
Actual $I_F = (24 - 1.2) / 4700 = 4.85mA$.

Step 2: Account for CTR and Sizing the Output Pull-Up
The PC817 'C' rank guarantees a minimum CTR of 200% at $I_F$ = 5mA.
$I_C = 4.85mA \times 2.0 = 9.7mA$.
To pull the 3.3V ESP32 pin low, the optocoupler must sink the current flowing through the pull-up resistor. Assuming a 10 kΩ internal pull-up, the current is only 0.33mA, which the 9.7mA capacity easily handles, driving the transistor deep into saturation ($V_{CE(sat)} \approx 0.2V$).

The End-of-Life CTR Gotcha: Photocoupler LEDs degrade over time and at elevated temperatures. A 2024 Texas Instruments Isolation Guide notes that optical isolators suffer from long-term LED wear-out. At 85°C ambient, the CTR drops by roughly 30%. After 10 years of continuous operation, the CTR may fall to 50% of its initial minimum. Always design your output stage to function reliably at half the datasheet's minimum CTR to ensure the circuit still works a decade from now.

Where You Meet Photocouplers in Practice

While digital isolators are taking over high-speed data buses, photocouplers remain dominant in specific high-voltage and power-conversion topologies due to their low cost and robust transient immunity.

  • Switch-Mode Power Supply (SMPS) Feedback: In an offline flyback converter, the secondary-side voltage is monitored by a TL431 shunt regulator. The TL431 drives the LED of a PC817, which sits across the isolation boundary. The phototransistor on the primary side adjusts the PWM controller's feedback pin, regulating the output voltage without breaking the galvanic isolation required by safety agencies like UL and IEC.
  • AC Zero-Cross Detection: To trigger a TRIAC at the exact moment the AC sine wave crosses 0V (minimizing electromagnetic interference), designers use the H11AA1. This part contains two back-to-back LEDs, allowing it to conduct on both the positive and negative half-cycles of the 120V/240V AC mains, generating a clean pulse train for a microcontroller interrupt.
  • MIDI Interfaces: The Musical Instrument Digital Interface (MIDI) standard explicitly mandates optical isolation to prevent ground loops between amplifiers and synthesizers. The 6N138 or PC900 is typically used to isolate the 5mA current-loop data stream running at 31.25 kbps.
  • Gate Driving in Motor Inverters: In variable frequency drives (VFDs), the low-voltage microcontroller must switch high-side IGBTs floating at 400V DC. Gate-drive optocouplers like the HCPL-3120 provide the necessary 2A peak drive current while withstanding the massive common-mode transient voltages ($dV/dt$) generated during switching.

Common Confusions: Optoisolators vs. Digital Isolators and SSRs

When sourcing parts for isolation, builders frequently confuse discrete photocouplers with modern digital isolators and solid-state relays. Understanding the physical mechanism dictates which part you should buy.

Feature Photocoupler (Optical) Digital Isolator (Capacitive/Magnetic) Solid State Relay (SSR)
Coupling Mechanism Light (LED to Photodetector) RF across SiO2 barrier or Magnetic coil Internal Optocoupler + Power TRIAC/MOSFET
Speed / Bandwidth Low to Medium (kHz to low MHz) Very High (100 Mbps to 1 Gbps) N/A (Slow switching, zero-cross dependent)
Aging / Wear-out Yes (LED lumen depreciation) No (Solid-state dielectric) Yes (Internal LED degrades)
Power Transfer Signal only (mA range) Signal only (mA range) Load power (Amps to tens of Amps)
Typical Part Example PC817, 6N137 Si8662, ISO7721 G3MB-202P, Fotek SSR-25DA

Choose a Photocoupler when: You need a low-cost, low-speed signal isolation solution, or you are designing an analog feedback loop (like an SMPS) where the linear transfer characteristics of a phototransistor are required. They are also preferred in extremely high-noise environments where capacitive digital isolators might suffer from common-mode transient immunity (CMTI) false triggering.

Choose a Digital Isolator when: You are routing high-speed digital protocols (USB, SPI, RS-485, I2S) across an isolation boundary. Parts like the Silicon Labs Si8662 or Texas Instruments ISO7721 do not suffer from CTR degradation, consume less static power, and easily handle 100+ Mbps data rates with picosecond jitter.

Choose an SSR when: You need to switch a high-power AC or DC load (like a 1500W heating element or a 5A DC motor) directly from a microcontroller pin. An SSR is essentially a complete power-switching module that already contains a photocoupler internally to handle the logic-to-mains isolation.

Frequently Asked Questions

Can I use a photocoupler to isolate an analog audio signal?
Standard digital optoisolators are terrible for linear analog signals due to severe non-linearity and temperature drift in the CTR. If you must isolate analog signals optically, you need a specialized linear optocoupler like the Vishay IL300, which uses a feedback photodiode to linearize the output, or you should pivot to an analog isolation amplifier (like the TI AMC1301).

Do I need a reverse-bias diode across the photocoupler input?
If you are driving the input LED directly from an AC source or a long inductive cable that might ring, yes. Most optocoupler LEDs have a reverse breakdown voltage ($V_R$) of only 5V to 6V. A standard 1N4148 signal diode placed in inverse-parallel across the input pins will clamp negative voltage spikes and prevent the internal LED from suffering avalanche breakdown.