TExcelTAD

LEDs and Photodiodes

A PN junction can turn current into light and light into current. A light-emitting diode (LED) does the first: electrons and holes recombining in the junction give off photons whose energy is set by the band gap. A photodiode does the second: absorbed photons create electron-hole pairs that the junction's field sweeps out as a current. Together they make indicator lights, displays, illumination, remote controls, optical encoders, smoke detectors, pulse oximeters, fibre links and optocouplers. This lesson designs an LED driver and a photodiode receiver, the two circuits behind all of them.

+- VS 5 V R300 Ohm red LED VF 2.07 V 10 mA LED driver: R = (VS - VF)/I +- VB 0 or 5 V light RL10 kOhm vout PD photodiode, reverse biased: vout = Iph RL

LEDs: colour and forward voltage

In a direct-gap semiconductor such as GaAs, AlGaInP or InGaN, a recombining electron gives most of its energy to a photon of energy close to the band gap (Semiconductors for Circuit Designers):

Ephoton=hcλ⟺λ [nm]≈1240E [eV]E_\text{photon} = \frac{hc}{\lambda} \quad\Longleftrightarrow\quad \lambda\ [\text{nm}] \approx \frac{1240}{E\ [\text{eV}]}

So the colour decides the gap and the gap roughly decides the forward voltage. Typical values at 1010 to 20 mA20\ \text{mA} (they vary between manufacturers and with current):

LED Material λ\lambda VFV_F
infrared GaAs, AlGaAs 850850 to 940 nm940\ \text{nm} 1.21.2 to 1.5 V1.5\ \text{V}
red, orange, yellow AlGaInP 590590 to 640 nm640\ \text{nm} 1.81.8 to 2.2 V2.2\ \text{V}
green (true green), blue InGaN 460460 to 530 nm530\ \text{nm} 2.82.8 to 3.4 V3.4\ \text{V}
white blue InGaN + yellow phosphor broad 2.82.8 to 3.4 V3.4\ \text{V}

Blue and green InGaN LEDs drop more than their photon energy because of extra resistance and band offsets in their structure. White LEDs are blue LEDs whose light is partly converted by a phosphor.

The I-V curve is a steep Shockley exponential, just shifted to a higher voltage: a few tens of millivolts change the current by a factor of ten, and VFV_F falls by about 2 mV/K2\ \text{mV/K} as the LED warms. An LED must therefore be driven by a current, not a voltage. The simplest current source is a series resistor:

R=VS−VFIF,PR=IF2R,ηdriver=VFVSR = \frac{V_S - V_F}{I_F}, \qquad P_R = I_F^2 R, \qquad \eta_\text{driver} = \frac{V_F}{V_S}

The driver efficiency is the fraction of supply power that reaches the LED; the rest heats the resistor. For high-power LEDs, use a constant-current regulator or a switching LED driver instead (An Introduction to Switching Regulators). Brightness is set by current; dimming is usually done by PWM (switching the full current on and off fast) so that the colour stays constant.

LED efficiency has two parts: the wall-plug efficiency (optical watts out per electrical watt in, roughly 30 to 60 % for good white power LEDs in 2026, depending on drive current and colour temperature; lower for green and amber, the "green gap", while deep-red AlGaInP parts are among the most efficient), and the luminous efficacy in lumens per watt, which weights the light by the eye's sensitivity. Most of the rest becomes heat in the junction, which is why power LEDs need heat sinks: their light output and lifetime fall as the junction gets hotter.

Worked example: an LED resistor

Given: a red LED with VF≈2.0 VV_F \approx 2.0\ \text{V} at 10 mA10\ \text{mA}, driven from a 5 V5\ \text{V} rail and from a 3.3 V3.3\ \text{V} microcontroller pin.

Find: the resistor for 10 mA10\ \text{mA}, its power, and the driver efficiency; repeat for a blue LED (VF≈3.1 VV_F \approx 3.1\ \text{V}).

Solve:

R5 V=5 V−2.0 V10 mA=300 Ω,PR=(10 mA)2⋅300 Ω=30 mW,η=2.05=40 %R3.3 V=1.3 V10 mA=130 Ωblue at 3.3 V:R=0.2 V10 mA=20 Ω\begin{aligned} R_{5\ \text{V}} &= \frac{5\ \text{V} - 2.0\ \text{V}}{10\ \text{mA}} = 300\ \Omega, \quad P_R = (10\ \text{mA})^2 \cdot 300\ \Omega = 30\ \text{mW}, \quad \eta = \frac{2.0}{5} = 40\ \% \\ R_{3.3\ \text{V}} &= \frac{1.3\ \text{V}}{10\ \text{mA}} = 130\ \Omega \\ \text{blue at } 3.3\ \text{V:} \quad R &= \frac{0.2\ \text{V}}{10\ \text{mA}} = 20\ \Omega \end{aligned}

Check: the blue LED from 3.3 V3.3\ \text{V} is a bad design: with only 0.2 V0.2\ \text{V} across the resistor, a 0.1 V0.1\ \text{V} spread in VFV_F between parts (normal) changes the current by 50 %, and a microcontroller pin's own output resistance (tens of ohms) already exceeds RR. Use the 5 V5\ \text{V} rail and a transistor switch (The BJT as a Switch), or a constant-current driver.

In Python

python · try it yourself
# LED series resistor from a 5 V and a 3.3 V rail at 10 mA, photon energy E = 1240/lambda
leds = [("infrared", 940, 1.3), ("red", 630, 2.0), ("yellow", 590, 2.1),
        ("green (InGaN)", 525, 3.0), ("blue", 465, 3.1)]
I = 10e-3
print(f"{'LED':14s} {'nm':>4s} {'E (eV)':>7s} {'VF':>5s} {'R @5V':>7s} {'R @3.3V':>8s}")
for name, lam, vf in leds:
    r5 = (5.0 - vf) / I
    r33 = (3.3 - vf) / I
    print(f"{name:14s} {lam:4d} {1240/lam:7.2f} {vf:5.1f} {r5:5.0f} R {r33:6.0f} R")

# photodiode: responsivity R = eta * lambda / 1240 (A/W), photocurrent and TIA output
eta, lam, P = 0.8, 850, 10e-6           # quantum efficiency, nm, optical power (W)
resp = eta * lam / 1240
iph = resp * P
print(f"responsivity at {lam} nm, eta = {eta}: {resp:.3f} A/W")
print(f"10 uW gives {iph*1e6:.2f} uA; a 100 kOhm transimpedance amplifier outputs {iph*100e3:.3f} V")
LED              nm  E (eV)    VF   R @5V  R @3.3V
infrared        940    1.32   1.3   370 R    200 R
red             630    1.97   2.0   300 R    130 R
yellow          590    2.10   2.1   290 R    120 R
green (InGaN)   525    2.36   3.0   200 R     30 R
blue            465    2.67   3.1   190 R     20 R
responsivity at 850 nm, eta = 0.8: 0.548 A/W
10 uW gives 5.48 uA; a 100 kOhm transimpedance amplifier outputs 0.548 V

The infrared and red rows show VFV_F close to the photon energy; the InGaN rows show the extra 0.40.4 to 0.6 V0.6\ \text{V}.

Photodiodes

A photon with more energy than the band gap, absorbed in or near the depletion region, creates an electron-hole pair; the junction's field separates them, and a photocurrent IphI_{ph} flows in the reverse direction (out of the anode through the external circuit). It is proportional to the optical power PP:

Iph=RP,R=η qλhc≈η λ [nm]1240 A/WI_{ph} = \mathcal{R} P, \qquad \mathcal{R} = \eta\,\frac{q\lambda}{hc} \approx \eta\,\frac{\lambda\ [\text{nm}]}{1240}\ \text{A/W}

where η\eta is the quantum efficiency (electrons per photon). Silicon photodiodes respond from about 400400 to 1100 nm1100\ \text{nm}, with a peak responsivity of roughly 0.50.5 to 0.65 A/W0.65\ \text{A/W} in the near infrared; InGaAs covers 900900 to 1700 nm1700\ \text{nm} for fibre links. Above 1100 nm1100\ \text{nm} silicon's photons fall short of 1.12 eV1.12\ \text{eV} and it becomes transparent.

The diode's total current is the Shockley current minus the photocurrent, I=IS(eV/(nVT)−1)−IphI = I_S(e^{V/(nV_T)} - 1) - I_{ph}. Two ways to use it:

  • Photovoltaic mode (zero bias): no applied voltage; the dark current is nearly zero, which gives the lowest noise. Short-circuited (into a transimpedance amplifier) it gives a current exactly proportional to light. Left open, it develops a voltage that grows only logarithmically with light, as a solar cell does.
  • Photoconductive mode (reverse bias): a reverse voltage widens the depletion region, which lowers the junction capacitance and speeds up the response, at the cost of a dark (leakage) current that adds noise and rises with temperature.

The speed of a photodiode feeding a load resistor is set by RLCjR_L C_j: f3dB=1/(2πRLCj)f_{3\text{dB}} = 1/(2\pi R_L C_j). A bigger RLR_L gives more volts per microampere but less bandwidth. The transimpedance amplifier (TIA) breaks this trade-off: an op-amp holds the photodiode at a virtual ground, so its capacitance barely charges, and the feedback resistor converts the current to a voltage, vout=−IphRfv_\text{out} = -I_{ph} R_f (The Ideal Op-Amp; its stability needs care, see Real Op-Amps: Gain-Bandwidth and Slew Rate).

Cross-check with SPICE: an LED and a photodiode's bandwidth

LEDR is a red-LED model written for this course (Shockley with a tiny ISI_S so that VF≈2 VV_F \approx 2\ \text{V}); DPH a small photodiode with Cj0=50 pFC_{j0} = 50\ \text{pF}. The photocurrent is a current source across the diode: 10 μA10\ \mu\text{A} DC plus 1 μA1\ \mu\text{A} AC for the bandwidth sweep. The −3 dB-3\ \text{dB} point of the 10 mV10\ \text{mV} (−40 dB-40\ \text{dB}) response is at −43.01 dB-43.01\ \text{dB}.

bash · try it yourself
cat > led.cir <<'EOF'
* red LED from 5 V through 300 Ohm; photodiode bandwidth at 0 V and 5 V reverse bias
.model LEDR D(Is=1e-19 N=2 Rs=5)
.model DPH D(Is=10p N=1.1 Rs=10 Cjo=50p M=0.5 Vj=0.7 BV=30 IBV=1u)
V1 a 0 5
R1 a k 300
D1 k 0 LEDR
* photodiode: anode at the load, cathode at the bias; photocurrent from cathode to anode
VB b 0 0
IPH b p DC 10u AC 1u
D2 p b DPH
RL p 0 10k
.control
op
echo "LED: VF = 
amp;v(k) V" let iled = (v(a) - v(k)) / 300 echo "LED current =
amp;iled A" foreach vb 0 5 alter VB dc = $vb op echo "bias $vb V: v(p) =
amp;v(p) V" ac dec 50 1k 100meg meas ac f3db when vdb(p)=-43.0103 fall=1 end .endc .end EOF ngspice -b led.cir 2>&1 | grep -E '^(LED|bias|f3db)'
LED: VF = 2.07244 V
LED current = 0.00975854 A
bias 0 V: v(p) = 0.0999967 V
f3db                =  2.943698e+05
bias 5 V: v(p) = 0.1 V
f3db                =  8.994166e+05

The LED settles at 2.07 V2.07\ \text{V} and 9.76 mA9.76\ \text{mA} (the 300 Ω300\ \Omega design assumed 2.0 V2.0\ \text{V}). The photodiode gives 10 μA⋅10 kΩ=0.1 V10\ \mu\text{A} \cdot 10\ \text{k}\Omega = 0.1\ \text{V} in both modes, but its bandwidth triples with 5 V5\ \text{V} of reverse bias: 294 kHz294\ \text{kHz} against 899 kHz899\ \text{kHz}. Check by hand: at zero bias (actually +0.1 V+0.1\ \text{V}) Cj=50/1−0.1/0.7=54 pFC_j = 50/\sqrt{1 - 0.1/0.7} = 54\ \text{pF}, giving 1/(2π⋅10 kΩ⋅54 pF)=294 kHz1/(2\pi \cdot 10\ \text{k}\Omega \cdot 54\ \text{pF}) = 294\ \text{kHz}; at −4.9 V-4.9\ \text{V}, Cj=50/8=17.7 pFC_j = 50/\sqrt{8} = 17.7\ \text{pF} and 900 kHz900\ \text{kHz}.

Interactive: the photodiode as a linear source

For small signals a photodiode is linear: a current source (the photocurrent) in parallel with its junction capacitance. That fits ee-netlist. Set C1C_1 to 54 pF54\ \text{pF} (zero bias) or 17.7 pF17.7\ \text{pF} (5 V5\ \text{V} reverse) and watch the corner move.

0.0000.0050.01010k100k1M10Mf (Hz)|V| (V)|V(p)|phasors at f = 294.0 kHz (magnitude @ phase)V(p)7.08 mV @ -44.9 degI(I1)1.00 uA @ 0.0 degI(C1)706 nA @ 45.1 degI(RL)708 nA @ -44.9 deg

At 294 kHz294\ \text{kHz} with C1=54 pFC_1 = 54\ \text{pF}, ∣V(p)∣\lvert V(p) \rvert reads 7.08 mV7.08\ \text{mV} at −44.9∘-44.9^\circ, 0.7080.708 of the low-frequency 10 mV10\ \text{mV}.

Guided lab: an LED driver and a light sensor

Hand calculation. Red LED from 5 V5\ \text{V} through 300 Ω300\ \Omega: about 10 mA10\ \text{mA}. A small silicon photodiode (a few mm2\text{mm}^2) under a desk lamp gives roughly tens of microamperes; into 10 kΩ10\ \text{k}\Omega, a few hundred millivolts.

Simulation. The SPICE deck and the lab.

What you would measure. Drive the LED from a bench supply at 5.0 V5.0\ \text{V} (current limit 30 mA30\ \text{mA}) through 300 Ω300\ \Omega; measure VFV_F and the resistor voltage: expect 1.91.9 to 2.1 V2.1\ \text{V} and 9.59.5 to 10.5 mA10.5\ \text{mA}. Swap in a blue LED: VFV_F near 3 V3\ \text{V}, current near 6.5 mA6.5\ \text{mA}. For the photodiode, connect it reverse-biased from 5 V5\ \text{V} with a 10 kΩ10\ \text{k}\Omega load as in the figure; read voutv_\text{out} in the dark (millivolts or less), under room light and under a lamp, and point the red LED at it from a few centimetres. To see the bandwidth, drive the LED with a square wave from a function generator through 300 Ω300\ \Omega and watch the photodiode's output edges on a scope: the rise time tr≈2.2RLCjt_r \approx 2.2 R_L C_j shrinks when you raise the bias from 00 to 5 V5\ \text{V}.

Hazards and safe setup. Low voltage only. Never connect an LED straight across a supply without a resistor. Do not stare into bright LEDs; high-power white, blue and infrared LEDs and laser diodes can harm the eye (infrared is invisible, so you get no warning).

Pitfalls

  • Driving an LED from a voltage. A few tens of millivolts change the current several-fold; always set the current.
  • Too little headroom for the resistor. If VS−VFV_S - V_F is small, the current depends on VFV_F tolerance and temperature.
  • Reverse voltage on LEDs. Most LEDs tolerate only about 5 V5\ \text{V} in reverse.
  • A huge photodiode load resistor. It gives volts per microampere but a bandwidth of a few kilohertz; use a TIA instead.

Practice

  1. A white LED (VF=3.0 VV_F = 3.0\ \text{V}) must run at 20 mA20\ \text{mA} from 12 V12\ \text{V}. Find RR, its power and the driver efficiency.
  2. What wavelength corresponds to a photon energy of 1.42 eV1.42\ \text{eV} (GaAs)?
  3. A photodiode with Cj=20 pFC_j = 20\ \text{pF} feeds RL=100 kΩR_L = 100\ \text{k}\Omega. What is its bandwidth?
Answer
  1. R=9 V/20 mA=450 ΩR = 9\ \text{V}/20\ \text{mA} = 450\ \Omega (E24: 470 Ω470\ \Omega, giving 19.1 mA19.1\ \text{mA}); PR=(19.1 mA)2⋅470 Ω=0.17 WP_R = (19.1\ \text{mA})^2 \cdot 470\ \Omega = 0.17\ \text{W}, so use a 0.25 W0.25\ \text{W} or larger part; η=3/12=25 %\eta = 3/12 = 25\ \%.
  2. 1240/1.42=873 nm1240/1.42 = 873\ \text{nm} (near infrared).
  3. 1/(2π⋅100 kΩ⋅20 pF)=79.6 kHz1/(2\pi \cdot 100\ \text{k}\Omega \cdot 20\ \text{pF}) = 79.6\ \text{kHz}.

Test yourself

A red LED (VF=2.0 VV_F = 2.0\ \text{V}) should carry 15 mA15\ \text{mA} from 5 V5\ \text{V}. The series resistor is…

  1. 133 Ω133\ \Omega
  2. 200 Ω200\ \Omega
  3. 333 Ω333\ \Omega
  4. 470 Ω470\ \Omega

Why must an LED be driven by a current rather than a fixed voltage?

  1. its I-V curve is a steep exponential, so a small voltage change gives a large current change
  2. LEDs only work on AC
  3. voltage changes the colour
  4. LEDs have no forward voltage

Applying reverse bias to a photodiode…

  1. stops the photocurrent
  2. lowers its junction capacitance and speeds it up, but adds dark current
  3. makes it emit light
  4. doubles its responsivity

A silicon photodiode with quantum efficiency 0.80.8 at 850 nm850\ \text{nm} has a responsivity of about…

  1. 0.08 A/W0.08\ \text{A/W}
  2. 0.55 A/W0.55\ \text{A/W}
  3. 1.2 A/W1.2\ \text{A/W}
  4. 850 A/W850\ \text{A/W}