Optoelectronic Devices: LEDs, Photodiodes, Optocouplers & Solar Cells
Where electrons meet photons. Learn LEDs (bandgap and colour, forward voltage, efficiency, current drive, thermal droop), laser diodes (threshold current, drive and safety), photodiodes (photovoltaic vs photoconductive mode, responsivity, quantum efficiency, dark current, capacitance and speed), PIN and avalanche photodiodes (APDs), phototransistors, IR emitters and receivers, optocouplers (CTR, isolation voltage, speed), solar cells (I–V curve, maximum power point, fill factor) and spectral response — with Python for responsivity, a TIA output, optocoupler saturation and a solar maximum power point.
Optoelectronic devices convert between light and electrical signals: LEDs and lasers emit light, photodiodes and solar cells absorb it, and optocouplers use both to pass signals across an isolation barrier.
They appear in displays and lighting, fibre and IR communication, medical sensors (pulse oximeters), industrial safety curtains, solar power and isolated control interfaces.
An analogy
An LED is a diode where electrons 'fall' across the bandgap and release their energy as a photon of matching colour. A photodiode runs the film backwards: incoming photons knock electrons up across the gap, creating current.
LEDs
LED colour depends on the semiconductor bandgap: infrared (GaAs, ~940 nm, V_F ≈ 1.2 V), red (~1.8–2.0 V), green/blue (InGaN, ~3 V), white (blue LED + phosphor). Drive LEDs with controlled current (resistor, current source or constant-current driver), not voltage — V_F varies with temperature and part. Brightness is set by current or by PWM dimming; efficiency falls at high current and temperature (droop), so heatsinking matters for power LEDs.
Photodetectors
Choosing a detector:
- Photovoltaic mode (0 V bias) — lowest dark current and noise, for precision light measurement
- Photoconductive mode (reverse bias) — lower capacitance, faster, but more dark current
- PIN photodiode — wide intrinsic layer: low capacitance, high speed (fibre receivers)
- Avalanche photodiode (APD) — internal gain 10–100× at high bias; for weak signals (lidar)
- Phototransistor — built-in gain, slow; simple light switches and encoders
Optocouplers and isolation
An LED and photodetector in one package separated by an insulating barrier (e.g. 5 kV_rms). CTR (current transfer ratio) varies from 20% to 600%, drops with temperature and ageing, so design with margin. Transistor-output couplers are slow (µs); logic-output and high-speed couplers reach Mbps. Alternatives: digital isolators (capacitive/magnetic) for high speed and long life. Used in mains-powered SMPS feedback, industrial I/O and gate drivers.
Lasers and solar cells
Laser diodes emit coherent light above a threshold current; drive with precision constant-current sources with slow start and monitor-photodiode feedback — tiny overcurrent spikes destroy them; observe laser safety classes. Solar cells are large photodiodes operated in the fourth quadrant; I–V curves shift with irradiance (I_sc ∝ light) and temperature (V_oc falls ~2 mV/°C/cell). Maximum power point tracking (MPPT) operates panels at the knee of the curve.
Formulas
- Photon energy:
E(eV) = 1240/λ(nm) - Responsivity:
R = η·q·λ/(h·c) = η·λ(nm)/1240 (A/W) - Photocurrent:
I_ph = R·P_optical - LED series resistor:
R = (V_s − V_F)/I_F - Optocoupler:
I_C = CTR·I_F (saturate if CTR·I_F > V_CC/R_L) - Solar fill factor:
FF = P_max/(V_oc·I_sc)
Worked example: LED colour from bandgap
Given: E_g = 1.9 eV
Find: λ.
- 1240/1.9
Answer: 653 nm (red)
Worked example: Photodiode signal
Given: R = 0.5 A/W, P = 2 µW, R_f = 1 MΩ
Find: V_out.
- I = 1 µA
- × 1 MΩ
Answer: 1.0 V
Worked example: Optocoupler margin
Given: CTR_min 50%, I_F 2 mA, R_L 10 kΩ, 3.3 V
Find: Saturates?
- I_C = 1 mA available
- Needed 0.33 mA
Answer: Yes, 3× margin
Photodiode with transimpedance amplifier
┌────[R_f 100k]────┐
│ ∥C_f │
light ─► ┌─◄─┐ │ │
│PD │ ├──(−)╲ │
└───┘ │ ╲ op-amp ────┴──── V_out = I_ph·R_f
GND ───────────┴──(+)╱
photoconductive mode: cathode can be reverse-biased for speedThe op-amp holds the photodiode at 0 V (virtual ground) and converts its current to voltage with gain R_f — the transimpedance amplifier. C_f keeps it stable given the photodiode's capacitance.
Responsivity, TIA, optocoupler and solar MPP
import math
# Photodiode responsivity and TIA output, LED efficiency, optocoupler CTR, solar cell
q, h, c = 1.602e-19, 6.626e-34, 3e8
wl, QE = 850e-9, 0.8
R = QE * q * wl / (h * c)
P = 10e-6 # 10 uW incident
Iph = R * P
print(f"responsivity at 850 nm: {R:.3f} A/W, photocurrent {Iph*1e6:.2f} uA")
Rf = 100e3
print(f"TIA with 100k feedback: Vout = {Iph*Rf:.3f} V")
# Optocoupler: CTR 100% at IF = 5 mA, pull-up 4.7k to 5 V
CTR, IF = 1.0, 5e-3
Ic = CTR * IF
print(f"opto collector current {Ic*1e3:.1f} mA available; needed for saturation with 4.7k: {5/4.7e3*1e3:.2f} mA -> saturated")
# Solar cell: Isc = 3 A, Voc = 0.6 V, ideality n = 1.3; find maximum power point numerically
Isc, Voc, n, VT = 3.0, 0.6, 1.3, 0.02585
Is = Isc / (math.exp(Voc / (n * VT)) - 1)
best = max(((V, V * (Isc - Is * (math.exp(V / (n * VT)) - 1))) for V in [i * 0.001 for i in range(600)]), key=lambda t: t[1])
print(f"solar cell MPP: V = {best[0]:.3f} V, P = {best[1]:.3f} W, fill factor {best[1]/(Isc*Voc):.2f}")
# responsivity at 850 nm: 0.548 A/W, photocurrent 5.48 uA
# TIA with 100k feedback: Vout = 0.548 V
# opto collector current 5.0 mA available; needed for saturation with 4.7k: 1.06 mA -> saturated
# solar cell MPP: V = 0.507 V, P = 1.425 W, fill factor 0.79A silicon photodiode at 850 nm converts 10 µW of light into 5.5 µA; a 100 kΩ TIA turns that into 0.55 V. The optocoupler can supply 5 mA but only 1.06 mA is needed to saturate its output against the 4.7 kΩ pull-up — plenty of margin even as CTR degrades with age. The solar cell delivers most power at about 0.51 V, not at V_oc — hence MPPT controllers.
Common mistakes
- Wrong: Driving LEDs directly from a voltage source. — Right: Control current with a resistor or driver.
- Wrong: Designing with typical CTR. — Right: Use minimum CTR over temperature and lifetime.
- Wrong: Ignoring photodiode capacitance in TIAs. — Right: Add feedback capacitance for stability.
Applications
- Pulse oximetry: Red/IR LEDs and photodiodes measure SpO₂.
- Fibre communication: Laser diodes and PIN/APD receivers.
- Isolated I/O: Optocouplers across mains barriers.
- Solar energy: PV panels with MPPT converters.
Key takeaways
- E = 1240/λ; LEDs need current control.
- Photocurrent = R·P; TIA converts to voltage.
- Optocouplers: design with minimum CTR.
- Solar: operate at the maximum power point.
Going further
- Photodiode noise: Shot noise and NEP.
- Lock-in detection: Recovering signals buried in noise.
- MPPT algorithms: Perturb-and-observe, incremental conductance.