PN Junction & Diode Models
The first semiconductor device. Learn PN-junction formation, diffusion and the depletion region, built-in potential, forward and reverse bias, the Shockley diode equation and ideality factor, thermal voltage, temperature coefficient (−2 mV/°C), junction and diffusion capacitance, reverse recovery, leakage and breakdown (avalanche and Zener), diode models (ideal, constant-drop, piecewise-linear, exponential, small-signal r_d), load-line analysis and datasheet parameters — with Python computing the I–V relationship, dynamic resistance and an exact operating point.
Join P-type and N-type silicon and you get a one-way valve for current: the diode. Its exponential I–V law also underlies transistors, temperature sensors, bandgap references and log amplifiers.
Choosing the right diode model — ideal, 0.7 V drop, or full exponential — for each calculation is a key skill.
An analogy
A PN junction is like a hill between two valleys: electrons on the N side must climb the built-in potential to cross. Forward bias lowers the hill so crowds flow over (exponentially more as it gets lower); reverse bias raises it so almost nobody crosses.
Forming the junction
At the junction, electrons diffuse from N to P and holes from P to N, leaving behind fixed ionised dopants: a depletion region with no free carriers and an electric field. Equilibrium is reached when this field (built-in potential ≈ 0.6–0.9 V in silicon) balances diffusion. The depletion region widens under reverse bias and shrinks under forward bias.
Diode models
Pick the simplest model that answers the question:
- Ideal switch — short when forward, open when reverse (logic of rectifiers)
- Constant drop — 0.7 V (Si), 0.3 V (Schottky/Ge) when conducting
- Piecewise linear — V_γ plus series resistance r_on (power diodes at high current)
- Exponential (Shockley) — accurate DC analysis, SPICE
- Small-signal — r_d = nV_T/I_D in parallel with junction/diffusion capacitance
Reverse characteristics
Reverse current is tiny (I_S plus generation leakage, pA–µA) but doubles roughly every 10 °C. At the breakdown voltage the current rises sharply: Zener tunnelling (heavily doped, < 5 V, negative tempco) or avalanche multiplication (> 5 V, positive tempco). Normal diodes must stay below their rated reverse voltage (V_RRM, PIV).
Dynamic behaviour
Junction capacitance C_j (depletion) dominates in reverse bias — varactors exploit it. Diffusion capacitance (stored minority charge) dominates in forward bias; when switched off, this charge must be removed, causing reverse-recovery current and time t_rr — a major loss source in switching converters (use fast/ultrafast, Schottky or SiC diodes). Datasheet parameters: V_F at I_F, I_R at V_R, V_RRM, I_F(AV), I_FSM (surge), t_rr, C_j, thermal resistance.
Formulas
- Shockley equation:
I_D = I_S·(e^(V_D/nV_T) − 1) - Forward voltage:
V_D = nV_T·ln(I_D/I_S + 1); ΔV_D ≈ 60 mV per decade of current (n = 1) - Built-in potential:
V_bi = V_T·ln(N_A·N_D/n_i²) - Dynamic resistance:
r_d = nV_T/I_D (≈ 26 Ω at 1 mA) - Junction capacitance:
C_j = C_j0/(1 + V_R/V_bi)^m - Temperature coefficient:
dV_D/dT ≈ −2 mV/°C; I_S doubles every ~5 °C
Worked example: Voltage at 20 mA
Given: V_D = 0.655 V at 1 mA, n = 1
Find: V_D at 20 mA.
- ΔV = V_T ln 20 = 77 mV
Answer: 0.732 V
Worked example: Small-signal resistance
Given: I_D = 2 mA, n = 1
Find: r_d.
- 25.85 mV/2 mA
Answer: 12.9 Ω
Worked example: Built-in potential
Given: N_A = 10¹⁷, N_D = 10¹⁶, n_i = 10¹⁰
Find: V_bi.
- 0.02585 × ln(10³³/10²⁰)
Answer: 0.774 V
Diode circuit and load line
+5 V ──[R 1k]──┬──►|── GND Load line: I = (5 − V_D)/1 kΩ
V_D (anode→cathode) Diode: I = I_S(e^(V_D/V_T) − 1)
Operating point = intersection ≈ 0.69 V, 4.31 mAGraphically, the diode's exponential curve crosses the resistor's straight load line at the operating point. Numerically, a few iterations of the diode equation converge to the same answer.
I–V, dynamic resistance and operating point
import math
# Diode equation: I-V curve, dynamic resistance, temperature coefficient, and a load-line solution
Is, n, VT = 1e-14, 1.0, 0.02585
for Id in (1e-4, 1e-3, 1e-2):
Vd = n * VT * math.log(Id / Is + 1)
print(f"Id = {Id*1e3:5.1f} mA: Vd = {Vd:.3f} V, rd = {n*VT/Id:.2f} ohm")
print(f"a decade of current changes Vd by {n*VT*math.log(10)*1000:.1f} mV")
# Solve 5 V source, 1 kohm resistor, diode (iteration on the load line)
Vs, R = 5.0, 1000.0
Vd = 0.7
for _ in range(20):
Id = (Vs - Vd) / R
Vd = n * VT * math.log(Id / Is + 1)
print(f"operating point: Vd = {Vd:.4f} V, Id = {(Vs-Vd)/R*1e3:.3f} mA")
print(f"constant-drop model (0.7 V) gives {(Vs-0.7)/R*1e3:.2f} mA ({((Vs-0.7)/R-(Vs-Vd)/R)/((Vs-Vd)/R)*100:.1f}% error)")
print(f"temperature: Vd falls ~2 mV/C -> at 75 C about {Vd-0.002*50:.3f} V")
# Id = 0.1 mA: Vd = 0.595 V, rd = 258.50 ohm
# Id = 1.0 mA: Vd = 0.655 V, rd = 25.85 ohm
# Id = 10.0 mA: Vd = 0.714 V, rd = 2.58 ohm
# a decade of current changes Vd by 59.5 mV
# operating point: Vd = 0.6925 V, Id = 4.308 mA
# constant-drop model (0.7 V) gives 4.30 mA (-0.2% error)
# temperature: Vd falls ~2 mV/C -> at 75 C about 0.592 VA 100× change in current moves the diode voltage by only 120 mV — which is why the constant-drop (0.7 V) model works well for bias calculations (0.2% error here). For small signals, however, the diode behaves like a resistor r_d = V_T/I_D, just 26 Ω at 1 mA.
Common mistakes
- Wrong: Using 0.7 V for Schottky diodes. — Right: Schottky ≈ 0.2–0.45 V; check the datasheet curve.
- Wrong: Ignoring reverse recovery in fast switching. — Right: Use fast/ultrafast/Schottky/SiC diodes.
- Wrong: Forgetting leakage grows with temperature. — Right: Budget µA-level leakage at hot conditions.
Applications
- Rectification: Power supplies and signal detectors.
- Protection: Reverse-polarity and flyback diodes.
- Temperature sensing: −2 mV/°C diode thermometers.
- Log converters: Exponential I–V in log amplifiers.
Key takeaways
- I = I_S(e^(V/nV_T) − 1); 60 mV per decade.
- Use constant-drop for bias, r_d = V_T/I for small signals.
- −2 mV/°C; leakage doubles ~10 °C.
- Capacitance and reverse recovery limit speed.
Going further
- SPICE diode model: IS, N, RS, CJO, TT, BV parameters.
- High-injection effects: Ideality rising toward 2.
- ΔV_BE thermometry: Basis of on-chip temperature sensors.