Skip to content
LumenaryAcademy
Electronics 65 min

Semiconductors and diodes

How a pinch of impurity turns silicon into a one-way valve for current, and what engineers build with it.

Code tested · 6AI-draftedAwaiting review by an electrical engineer

Your guides: Chloe · The Physicist, Margaret · The Bench Engineer, Gideon · The Design Reviewer

MotivationH

A valve for electrons

Everything in the Circuits level was linear: double the voltage and the current doubles too, which is what made nodal analysis and phasors so powerful. But linear parts alone could not charge your phone. The power arriving at a charger alternates, pushing current one way and then the other fifty or sixty times a second, while a battery needs current in one direction only. Something must let current through one way and block it the other way: an electrical one-way valve.

That valve is the diode, and it is made of a semiconductor, usually silicon. The same material also makes the transistors of the next lesson, LEDs, photodiodes and solar cells. This lesson starts with why silicon behaves as it does, builds the p–n junction, and then puts diodes to work.

Along the way you will meet your first nonlinear circuit equation, one with an exponential in it that no algebra can untangle, and solve it the way circuit simulators do: with Newton's method.

IntuitionH

Conductors, insulators and semiconductors

In a metal such as copper, about 8.5×10228.5 \times 10^{22} electrons in every cubic centimetre roam freely, so its resistivity is a tiny 1.7×10−6 Ω cm1.7 \times 10^{-6}\ \Omega\,\text{cm}. In an insulator such as glass, every electron is held in a chemical bond and essentially none are free at room temperature: 1012 Ω cm10^{12}\ \Omega\,\text{cm} and more.

A semiconductor sits in between. In a silicon crystal each atom shares its four outer electrons in bonds with four neighbours, so a perfect crystal at absolute zero is an insulator. But the energy needed to break an electron free, the band gap EgE_g, is modest: 1.12 electronvolts for silicon, against several electronvolts for good insulators. At room temperature the random thermal jostling of the crystal frees a few electrons: about 101010^{10} per cubic centimetre, out of 5×10225 \times 10^{22} silicon atoms. That is one free electron for every five trillion atoms, enough to conduct a little, and very sensitive to temperature and to impurities.

Definition— Electron, hole, intrinsic carrier density

When a bond breaks, it leaves a free electron (charge −q-q, with q=1.602×10−19q = 1.602 \times 10^{-19} C) and a vacancy in the bond. A neighbouring bonded electron can hop into the vacancy, which moves the vacancy the other way. The moving vacancy behaves exactly like a mobile particle of charge +q+q, and is called a hole. In pure (intrinsic) silicon, electrons and holes are created in pairs, so their densities are equal: n=p=nin = p = n_i, the intrinsic carrier density, about 1010 cm−310^{10}\ \text{cm}^{-3} at 300 K.

Analogy, not a formal construction

Picture a row of theatre seats, all full except one. When the person beside the empty seat shifts into it, the gap moves one seat the other way. Watch for a while and you could describe everything by following the one gap instead of the hundred people. A hole is that gap: a bookkeeping device so convenient that engineers treat it as a particle with its own charge and mobility.

Both carriers drift in an electric field, holes with the field and electrons against it, and both contribute current in the same direction. How easily each moves is its mobility μ\mu: in lightly doped silicon about 1350 cm2/(V s)1350\ \text{cm}^2/(\text{V s}) for electrons and 480480 for holes. The conductivity is σ=q(nμn+pμp)\sigma = q(n\mu_n + p\mu_p), and the resistivity is ρ=1/σ\rho = 1/\sigma.

DefinitionsH

Doping: n-type and p-type

The useful trick is doping: adding impurities on purpose. A phosphorus atom has five outer electrons; four go into bonds and the fifth is free at room temperature, so each phosphorus atom donates an electron and is left as a fixed positive ion. That is n-type silicon, with electrons as the majority carriers. A boron atom has only three, so it accepts an electron from a neighbouring bond, creating a mobile hole and becoming a fixed negative ion: p-type silicon, with holes as majority carriers.

Theorem— Mass-action law

In silicon in thermal equilibrium, whatever the doping, the product of the electron and hole densities is fixed by the material and temperature: np=ni2.np = n_i^2. With a donor density ND≫niN_D \gg n_i, nearly every donor is ionised, so n≈NDn \approx N_D and the minority hole density is p≈ni2/NDp \approx n_i^2 / N_D.

It holds because heat creates electron–hole pairs at a rate set by temperature alone, while they recombine at a rate proportional to npnp. So doping multiplies one carrier and suppresses the other. The crystal stays electrically neutral: every extra electron is matched by a fixed donor ion.

python
import math

q = 1.602176634e-19        # elementary charge, C
k = 1.380649e-23           # Boltzmann constant, J/K
T = 300.0                  # temperature, K
VT = k * T / q             # thermal voltage kT/q, V
ni = 1.0e10                # intrinsic carrier density of silicon at 300 K, per cm^3
mu_n, mu_p = 1350.0, 480.0 # electron and hole mobilities in lightly doped silicon, cm^2/(V s)

print(f"thermal voltage kT/q at {T:.0f} K = {VT * 1e3:.2f} mV\n")
print("donors per cm^3   electrons per cm^3   holes per cm^3   resistivity (ohm cm)")
for ND in [0.0, 1e13, 1e14, 1e15, 1e16]:
    # Charge neutrality (n = p + ND) and the mass-action law (n p = ni^2), solved together.
    n = ND / 2 + math.sqrt((ND / 2) ** 2 + ni ** 2)
    p = ni ** 2 / n
    rho = 1 / (q * (n * mu_n + p * mu_p))
    print(f"{ND:15.0e}   {n:18.3e}   {p:14.3e}   {rho:18.4g}")

# A p-n junction with NA = ND = 1e16 per cm^3 (converted to per m^3 for SI units).
eps = 11.7 * 8.8541878128e-12  # permittivity of silicon, F/m
NA = ND = 1e16 * 1e6
ni_m3 = ni * 1e6
Vbi = VT * math.log(NA * ND / ni_m3 ** 2)
print(f"\nbuilt-in potential of the junction = {Vbi:.3f} V")
for V in [0.0, -5.0, 0.5]:    # applied voltage, p side relative to n side
    W = math.sqrt(2 * eps * (Vbi - V) / q * (1 / NA + 1 / ND))
    Emax = q * NA * (W / 2) / eps  # peak field, at the metallurgical junction
    print(f"applied {V:+5.1f} V: depletion width {W * 1e6:.3f} um, peak field {Emax / 1e5:.1f} kV/cm")
Runs entirely in your browser, in an isolated worker. Nothing is sent to a server.

The second half of the program looks ahead to the junction. Keep its numbers in mind: a built-in potential of about 0.71 V, a depletion region under half a micrometre wide, and electric fields of tens of kilovolts per centimetre across it.

IntuitionH

The p–n junction

Now make one crystal that is p-type on one side and n-type on the other. Across the boundary, the metallurgical junction, holes are crowded on one side and scarce on the other, and the reverse for electrons, so they diffuse across, holes into the n side and electrons into the p side, and recombine there.

Their departure uncovers the fixed ions they left behind, negative on the p side and positive on the n side. This thin layer, emptied of mobile carriers, is the depletion region, and its charges set up a field from the n side to the p side that pushes the carriers back. Diffusion builds the field up until its push exactly balances diffusion's spread. The voltage across the region at that balance is the built-in potential, Vbi=VTln⁡NANDni2,VT=kTq≈25.85 mV at 300 K,V_{bi} = V_T \ln\frac{N_A N_D}{n_i^2}, \qquad V_T = \frac{kT}{q} \approx 25.85\ \text{mV at 300 K}, which the program above evaluated as 0.714 V for NA=ND=1016 cm−3N_A = N_D = 10^{16}\ \text{cm}^{-3}.

−−−+++p-type: holesdepletion regionn-type: electronsEanode (p)cathode (n)
A p–n junction. Left, p-type silicon with mobile holes (open circles); right, n-type with mobile electrons (dots). In the shaded depletion region the mobile carriers have gone, leaving fixed negative acceptor ions on the p side and fixed positive donor ions on the n side, whose field points from n to p. Below, the diode symbol: the triangle points in the direction conventional current flows easily, from the anode (p) to the cathode (n), marked by the bar.

A voltmeter across an unconnected diode reads zero, not 0.71 V: the metal contacts develop potentials that cancel the built-in one, as conservation of energy demands. What you can do is change the barrier with an external voltage.

  • Reverse bias (the n side made positive): the applied voltage adds to the barrier. The depletion region widens (to 1.2 µm at −5-5 V in the program above) and only a tiny leakage current flows, carried by the few minority carriers that wander into the field.
  • Forward bias (the p side made positive): the applied voltage subtracts from the barrier. The depletion region narrows, and majority carriers can climb the lowered barrier in numbers that grow exponentially with the applied voltage, because their energies follow the Boltzmann distribution. Holes pour into the n side and electrons into the p side, where they recombine.
DefinitionsH

The Shockley diode equation

Definition— Shockley diode equation

The current through an ideal p–n junction diode with voltage VV across it (anode positive) is I=IS(eV/(nVT)−1),I = I_S \left( e^{V/(n V_T)} - 1 \right), where ISI_S is the saturation current (a property of the junction's area and doping, typically 10−1510^{-15} to 10−1210^{-12} A for a small silicon diode at room temperature), nn is the ideality factor (between 1 and 2; 1 for the ideal theory), and VT=kT/qV_T = kT/q is the thermal voltage.

William Shockley derived the equation in 1949 from the physics of the last section. Its consequences shape all of electronics:

  • Reverse: a few VTV_T below zero the exponential vanishes and I≈−ISI \approx -I_S, femtoamperes to nanoamperes. Real diodes leak somewhat more, and at a large enough reverse voltage they break down.
  • Forward: a few VTV_T above zero, I≈ISeV/(nVT)I \approx I_S e^{V/(nV_T)}. Because ISI_S is so small, almost nothing flows below about 0.5 V for silicon, and then the current rises so steeply that the diode looks like a fixed 0.6–0.7 V over a wide range of currents.
  • Sixty millivolts per decade: taking logarithms, V=nVTln⁡(I/IS)V = nV_T \ln(I/I_S), so multiplying the current by 10 adds nVTln⁡10≈59.5nV_T \ln 10 \approx 59.5 mV (for n=1n = 1 at 300 K). From 1 mA to 100 mA, the forward voltage rises only about 119 mV.
  • Temperature: ISI_S grows very fast with temperature, so at a fixed current the forward voltage falls, by about 2 mV per kelvin for silicon. Simple thermometers inside chips use exactly this.

For hand analysis engineers simplify, in increasing accuracy, to an ideal switch (short forward, open reverse), the constant-drop model (open below about 0.7 V, a fixed 0.7 V above it) or a piecewise-linear model (0.6 V plus a small resistance), and keep the full equation for when those are not good enough.

ComputationC

Solving a diode circuit: Newton's method versus the constant drop

Put a diode in series with a 1 kΩ resistor across a 5 V source. Kirchhoff's current law at the node between them says the current in the resistor equals the current in the diode: VS−VR=IS(eV/(nVT)−1).\frac{V_S - V}{R} = I_S\left(e^{V/(nV_T)} - 1\right). The unknown VV appears both outside and inside an exponential, so there is no formula in elementary functions for it. (There is one in terms of the Lambert W function, which only moves the problem into a special function.) But the equation is easy to solve numerically.

012345diode voltage V (volts)12345current (mA)operating point: 0.69 V, 4.31 mAload line: I = (5 V − V) / 1 kΩdiode
The graphical solution. The diode's curve (I_S = 10 fA, n = 1) is drawn to scale: on a 0–5 V axis it looks like a wall near 0.7 V. The load line is everything the source and resistor allow, from 5 mA at V = 0 to zero current at V = 5 V. The circuit settles where the two meet, at about 0.69 V and 4.31 mA.

Newton's method turns a hard equation f(V)=0f(V) = 0 into a sequence of easy ones: at the current guess, replace ff by its tangent line and jump to where the tangent crosses zero, V←V−f(V)/f′(V)V \leftarrow V - f(V)/f'(V). Lumenary Math's Numerical methods proves that near a root the number of correct digits roughly doubles at every step. Here f(V)f(V) is the KCL error, the resistor current minus the diode current, and f′(V)=−1/R−(IS/nVT) eV/(nVT)f'(V) = -1/R - (I_S/nV_T)\,e^{V/(nV_T)}.

python
import math

VT = 0.025852   # thermal voltage at 300 K, V
IS = 1e-14      # saturation current, A
N = 1.0         # ideality factor

def diode_current(v):
    return IS * (math.exp(v / (N * VT)) - 1)

def solve(VS, R, v=0.7, max_step=None, show=False):
    """Diode voltage v where the resistor current (VS - v)/R equals the diode current.

    Newton's method on f(v) = (VS - v)/R - I_diode(v), the KCL error at the diode node.
    max_step, if given, limits how far v may move in one iteration."""
    for it in range(1, 501):
        f = (VS - v) / R - diode_current(v)
        df = -1 / R - IS * math.exp(v / (N * VT)) / (N * VT)
        dv = -f / df
        if max_step is not None:
            dv = max(-max_step, min(max_step, dv))
        v += dv
        if show:
            print(f"  iteration {it}: v = {v:.9f} V, KCL error before the step = {f:+.3e} A")
        if abs(dv) < 1e-12:
            return v, it
    raise RuntimeError("no convergence")

print("5 V source, 1 kilohm resistor, starting from the constant-drop guess 0.7 V:")
v, its = solve(5.0, 1e3, show=True)
print(f"diode voltage {v:.4f} V, current {(5.0 - v) / 1e3 * 1e3:.4f} mA\n")

for start, step in [(0.0, None), (0.0, 0.1)]:
    v, its = solve(5.0, 1e3, v=start, max_step=step)
    print(f"start at {start} V, step limit {step}: {its} iterations")

print("\n source    exact V_D   exact I (mA)   constant-drop I (mA)   error")
for VS in [0.8, 1.0, 2.0, 5.0, 12.0]:
    v, _ = solve(VS, 1e3)
    exact = (VS - v) / 1e3
    approx = max(VS - 0.7, 0) / 1e3
    print(f"{VS:5.1f} V   {v:9.4f} V   {exact * 1e3:12.4f}   {approx * 1e3:20.4f}   {100 * (approx - exact) / exact:+6.1f} %")
Runs entirely in your browser, in an isolated worker. Nothing is sent to a server.

Three lessons are in the output. From a sensible guess, Newton's method converges in five steps, the error shrinking quadratically: 10−310^{-3}, 10−410^{-4}, 10−610^{-6}, 10−910^{-9}, 10−1610^{-16} amperes. From 0 V, the first tangent sends VV to 5 V, where eV/VT≈1084e^{V/V_T} \approx 10^{84}, and the method crawls back by about one VTV_T per step: 173 iterations. Limiting each step to 0.1 V cuts that to 12, and SPICE uses the same cure, limiting how far a junction voltage may move per step. Finally, the constant-drop model is excellent when the source is large compared with 0.7 V (0.2% error at 5 V) and poor when it is not (47% at 0.8 V).

Example— The same circuit in SPICE

SPICE (first released at Berkeley in 1973) solves every nonlinear circuit by writing nodal equations and applying Newton's method to them, and its diode model starts from the Shockley equation. The .model line below is the plain textbook diode we used in Python, not any manufacturer's part; the options set the temperature to 300 K (SPICE's default is 27 °C, 300.15 K) and tighten the convergence tolerance from its default of 0.1%.

spice
* Diode and resistor: the circuit the Newton solver above handles
V1 in 0 DC 5
R1 in a 1k
D1 a 0 DSMALL
* A plain textbook junction: IS = 10 fA, ideality 1, no series resistance
.model DSMALL D(IS=1e-14 N=1)
* SPICE's default temperature is 27 C; use 300 K to match the Python.
* RELTOL tightens the convergence test from its default of 0.1 %.
.options TEMP=26.85 TNOM=26.85 RELTOL=1e-6
.control
foreach vs 0.8 1 2 5 12
  alter V1 dc = $vs
  op
  let vd = v(a)
  let ma = -1000 * i(V1)
  echo "source $vs V: diode voltage $&vd V, current $&ma mA"
end
.endc
.end

ngspice prints source 5 V: diode voltage 0.692543 V, current 4.30746 mA, and for 0.8, 1, 2 and 12 V the diode voltages 0.611634, 0.629147, 0.662312 and 0.717437 V, agreeing with the Python table to every digit shown there. (SPICE reports a voltage source's current as flowing into its positive terminal, hence the minus sign in -1000 * i(V1).)

Worked examplesH

Rectifiers and smoothing

A rectifier turns alternating current into current that flows one way. A single diode in series with a load makes a half-wave rectifier: it passes the positive half-cycles and blocks the negative ones. A bridge of four diodes makes a full-wave rectifier, which steers both half-cycles through the load in the same direction, at the price of two diode drops instead of one.

12 V peak50 Hz+C2200 µFR100 ΩV out
A full-wave bridge rectifier with a smoothing capacitor. On each half-cycle two of the four diodes conduct, so current always enters the load from the + node. The capacitor charges near each peak and supplies the load in between.

A bare rectifier's output is a train of bumps. A smoothing capacitor across the load charges to each peak (minus the diode drops) while the diodes conduct, then supplies the load alone, drooping until the next peak arrives. The droop is the ripple. If the load draws a roughly constant current II and the capacitor discharges for at most the time between peaks, 1/(2f)1/(2f) for a full-wave rectifier on a supply of frequency ff, then ΔV=I Δt/C\Delta V = I\,\Delta t / C gives ΔVripple≲I2fC(full wave),IfC(half wave).\Delta V_{\text{ripple}} \lesssim \frac{I}{2fC} \quad\text{(full wave)}, \qquad \frac{I}{fC} \quad \text{(half wave)}.

timeripple
Rectifier waveforms. Dashed: the full-wave rectified input. Solid: the voltage across the smoothing capacitor, which follows each peak and droops between them. The ripple is drawn much larger than a good design allows.

Rectifiers are where an engineer reaches for the simulator, because the diodes conduct in short, intense pulses. The netlist below drives a bridge from a 12 V-peak, 50 Hz source, as a small transformer would deliver, into 2200 µF and 100 Ω. It uses a rectifier diode with plausible textbook parameters (about 0.95 V at 1 A), not a vendor model, and measures the output over the last five cycles, after the capacitor has settled.

spice
* Full-wave bridge rectifier with a smoothing capacitor
* A 12 V peak, 50 Hz source, as from a small transformer (simulation only)
VS ac1 ac2 SIN(0 12 50)
RLEAK ac2 0 10Meg
D1 ac1 pos DRECT
D2 ac2 pos DRECT
D3 0 ac1 DRECT
D4 0 ac2 DRECT
C1 pos 0 2200u
RL pos 0 100
* A rectifier diode with plausible textbook parameters (not a vendor model):
* about 0.95 V at 1 A
.model DRECT D(IS=1e-9 N=1.8 RS=0.02)
.control
tran 20u 400m 0 20u
* measure over the last five cycles, when the capacitor has settled
meas tran vmax MAX v(pos) from=300m to=400m
meas tran vmin MIN v(pos) from=300m to=400m
meas tran vavg AVG v(pos) from=300m to=400m
let isrc = abs(i(VS))
meas tran ipk MAX isrc from=300m to=400m
let ripple = vmax - vmin
let iload = vavg / 100
let estimate = iload / (2 * 50 * 2200u)
echo "ripple $&ripple V peak to peak; estimate I/(2fC) = $&estimate V"
echo "peak current drawn from the source $&ipk A, load current $&iload A"
.endc
.end

The output runs between 9.76 and 10.13 V, two diode drops of about 0.93 V below the 12 V peak, so the ripple is 0.377 V peak to peak against the estimate I/(2fC)=0.452I/(2fC) = 0.452 V. The estimate is pessimistic, as it should be: the capacitor starts recharging before the next peak, so it discharges for less than the full 10 ms. The surprise is the last line: the load draws a steady 0.099 A, but the source delivers it in pulses of up to 1.18 A, because all the charge must be replaced in the short time near each peak. Those pulses heat transformers and diodes, one reason the power supplies lesson moves on to switching converters.

Note

Rectifiers that work directly from the mains belong inside enclosed, certified power supplies built by qualified engineers. To experiment, use simulation, or a signal generator or current-limited bench supply at a few volts. Never open or modify a mains adapter: its capacitors can hold a dangerous charge even after it is unplugged.

Worked examplesH

Zener diodes

Every diode breaks down at a large enough reverse voltage. A Zener diode is made to break down at a precise Zener voltage VZV_Z, from about 2 V to a few hundred volts, where its voltage barely changes as its current changes, so it can hold a node steady. Below about 5 V, electrons tunnel straight through the very thin, heavily doped junction (the Zener effect proper); above about 6 V, carriers accelerated by the field knock further electrons loose in an avalanche. The two effects drift oppositely with temperature, so Zeners near 5–6 V drift least.

Example— A Zener shunt regulator from a 9 V battery

We want 5.1 V for a small sensor that draws up to 10 mA, from a 9 V battery. A 5.1 V Zener goes across the load, and a series resistor RR from the battery feeds both. For the Zener to regulate it must stay in breakdown, say at least 5 mA, even when the load draws its full 10 mA. So RR must pass at least 15 mA: R≤9−5.115 mA=260 Ω,R \le \frac{9 - 5.1}{15\ \text{mA}} = 260\ \Omega, and we pick the next standard value below, 240 Ω. With the load disconnected, all 3.9/240=16.253.9/240 = 16.25 mA flows through the Zener, which then dissipates 5.1×16.25 mA≈835.1 \times 16.25\ \text{mA} \approx 83 mW, comfortably inside a common 500 mW part.

Worked examplesH

LEDs, photodiodes and solar cells

When an electron and a hole recombine, the energy they release, about the band gap EgE_g, must go somewhere. In silicon it mostly becomes heat, because silicon has an indirect band gap: a recombining electron must also hand momentum to a vibration of the crystal, which makes light emission rare. In direct-gap compound semiconductors such as gallium arsenide, gallium phosphide and gallium nitride, recombination readily produces a photon with energy close to EgE_g. A photon's wavelength and energy are related by λ≈1240 nm eV/E\lambda \approx 1240\ \text{nm eV} / E.

Light-emitting diodes. A forward-biased junction in a direct-gap material is a light-emitting diode (LED), whose colour is set by the band gap: about 1.9 eV gives red near 650 nm, and indium gallium nitride at about 2.7 eV gives blue near 460 nm. White LEDs are blue ones coated with a phosphor that turns some of the blue into yellow and red. A higher band gap means a higher forward voltage: about 1.8–2.2 V for red, 2.8–3.3 V for blue and white. Efficient blue LEDs, which made LED lighting possible, earned Isamu Akasaki, Hiroshi Amano and Shuji Nakamura the 2014 Nobel Prize in Physics.

Example— An LED from a 5 V USB supply

An LED's current rises exponentially with voltage, so it must be fed a current, usually through a series resistor. A red LED drops about 2.0 V at 10 mA. From 5 V, R=(5−2.0)/10 mA=300 ΩR = (5 - 2.0)/10\ \text{mA} = 300\ \Omega; with the standard 330 Ω the current is 3.0/330≈9.13.0/330 \approx 9.1 mA. The same resistor with a blue LED (about 3.0 V) gives only about 6.1 mA: different colours need different resistors for the same brightness.

Photodiodes. Run the process backwards: a photon above the band gap, absorbed near the depletion region, creates an electron–hole pair that the junction's field sweeps apart, a current proportional to the light. A photodiode is usually reverse-biased and read by an amplifier (the operational amplifiers lesson builds one). If every photon made one pair, the responsivity would be λ/(1240 nm)\lambda/(1240\ \text{nm}) amperes per watt; a silicon photodiode converting 80% of 850 nm photons gives about 0.8×850/1240≈0.550.8 \times 850/1240 \approx 0.55 A/W, so 10 µW of light gives about 5.5 µA. Camera sensors are arrays of millions of them.

Solar cells. A solar cell is a large-area photodiode used as a source of power. Light generates a current ILI_L that flows backwards through the junction; the junction's own diode current flows forwards and subtracts from it: I=IL−IS(eV/(nVT)−1).I = I_L - I_S\left(e^{V/(nV_T)} - 1\right). Short-circuit the cell and you get ILI_L, the short-circuit current. Leave it open and the voltage rises until the diode current cancels ILI_L: the open-circuit voltage VOC=nVTln⁡(IL/IS+1)V_{OC} = nV_T \ln(I_L/I_S + 1). Neither delivers power; somewhere between them the product VIVI is largest, the maximum power point.

python
import math

VT = 0.025852      # thermal voltage at 300 K, V
IL = 9.0           # light-generated current in full sunlight, A (an illustrative cell)
IS = 1e-10         # saturation current of the cell's junction, A
N = 1.1            # ideality factor
AREA = 0.156 ** 2  # cell area, m^2 (a 156 mm square cell)
SUN = 1000.0       # standard test irradiance, W/m^2

def cell_current(v, light=1.0):
    """Current delivered to the load: the light current minus the junction's own diode current."""
    return light * IL - IS * (math.exp(v / (N * VT)) - 1)

voc = N * VT * math.log(IL / IS + 1)            # where the delivered current falls to zero
print(f"short-circuit current {IL:.2f} A, open-circuit voltage {voc:.3f} V\n")

print(" V (V)   I (A)   P (W)")
best = (0.0, 0.0, 0.0)
for i in range(0, 701):
    v = i / 1000
    current = cell_current(v)
    if current < 0:
        break
    if v * current > best[2]:
        best = (v, current, v * current)
    if i % 100 == 0 or i in (550, 600, 650):
        print(f"{v:5.2f}   {current:5.2f}   {v * current:5.2f}")

vmp, imp, pmp = best
print(f"\nmaximum power point: {vmp:.3f} V x {imp:.2f} A = {pmp:.2f} W")
print(f"fill factor = Pmp / (Voc Isc) = {pmp / (voc * IL):.3f}")
print(f"efficiency = {pmp / (SUN * AREA):.1%} of {SUN * AREA:.1f} W of sunlight")

for light in (0.5, 0.2):   # cloud: the light current falls in proportion
    voc_l = N * VT * math.log(light * IL / IS + 1)
    print(f"at {light:.0%} sun: Isc = {light * IL:.1f} A, Voc = {voc_l:.3f} V")
Runs entirely in your browser, in an isolated worker. Nothing is sent to a server.

This illustrative cell delivers 5.41 W at 0.628 V and 8.61 A: a fill factor of 0.838 (real cells, with series and shunt resistance, manage somewhat less) and an efficiency of 22.2%. At 20% sunlight the current falls fivefold, but the voltage drops only from 0.717 to 0.672 V, because it depends on the logarithm of the current. Panels string dozens of cells in series, and their inverters keep hunting for the maximum power point as the light changes, maximum power point tracking (more in Renewables and storage).

Why not much more than 22%? In 1961 Shockley and Hans Queisser showed that a single junction in sunlight cannot convert more than about a third of the energy: photons below the band gap pass straight through, and photons far above it waste their excess energy as heat. Stacking junctions with different band gaps beats that limit, which is how the record cells on the US National Laboratory of the Rockies' efficiency chart (long kept by NREL, its former name), and the cells on spacecraft, work.

ExplanationH

Diodes in professional practice

Real diodes are chosen from datasheets published by makers such as onsemi, Vishay, Nexperia, Diodes Incorporated, ROHM and Toshiba. A few families cover most needs:

  • Small-signal diodes (the 1N4148 type) switch in nanoseconds at up to a couple of hundred milliamperes. Rectifier diodes (the 1N400x family) carry an ampere or more but switch slowly: suddenly reverse-biased, they conduct backwards for microseconds while stored charge clears, the reverse-recovery time.
  • Schottky diodes, metal–semiconductor junctions, drop only about 0.2–0.4 V and store almost no charge, at the cost of more leakage; they are everywhere in low-voltage supplies.
  • Silicon carbide (SiC) and gallium nitride (GaN) devices, with band gaps near 3.3 eV, block hundreds or thousands of volts with thin, fast junctions, and have changed electric-vehicle chargers and solar inverters (Power electronics).

A datasheet gives the limits not to exceed (peak reverse voltage, forward and surge current, junction temperature) and the characteristics to design with, usually as graphs over temperature, and often a SPICE .model line like the ones in this lesson with more parameters: series resistance RS, junction capacitance CJO, transit time TT and breakdown voltage BV. Professionals design for the worst case (the hottest day, the flattest battery, the part at the edge of its tolerance) and check with simulation, then with measurement.

Common misconceptionsH

Common misconceptions

Misconception

"A silicon diode always drops 0.7 V." The forward voltage depends on the current (about 60 mV per decade), the temperature (about −2 mV per kelvin) and the part: a small diode at 10 µA may drop 0.45 V, a rectifier at full current 1 V. The constant-drop model's 0.7 V is a convenient average.

Misconception

"n-type silicon is negatively charged." Doped silicon is neutral. Each free electron in n-type silicon is balanced by a fixed positive donor ion. Only in the depletion region, where the mobile carriers have left, is there net charge.

Misconception

"An LED just needs the right voltage, so I can connect it straight to a battery of about that voltage." The current depends exponentially on the voltage, so a small mismatch, or a few degrees of warming, changes it enormously. Always set the current, with a resistor or a constant-current driver.

Misconception

"A reverse-biased diode blocks perfectly." It leaks a little, more as it warms, and it breaks down at a large enough reverse voltage. In fast circuits it also conducts backwards briefly while its stored charge recovers.

History & global context

A short history

Crystals rectified current long before anyone understood them: Ferdinand Braun saw it in 1874, Jagadish Chandra Bose used crystal detectors in his microwave experiments in Kolkata in the 1890s, and early radios used "cat's whisker" detectors. Henry Round saw light from silicon carbide in 1907, and Oleg Losev studied this first LED in the 1920s. Russell Ohl at Bell Labs found the p–n junction by accident in 1940, in a cracked silicon rod that produced a voltage when lit. Then came Shockley's theory (1949), Bell Labs' 6%-efficient silicon solar cell (1954), Nick Holonyak's red LED at General Electric (1962), and bright blue gallium nitride LEDs from Akasaki and Amano at Nagoya and Nakamura at Nichia in the early 1990s.

Exercises

Exercises

1. Semiconductors and diodes

Warm-upHuman

A silicon wafer is doped with arsenic, which (like phosphorus) has five outer electrons, at 101610^{16} atoms per cubic centimetre. Which statement is true?

Choose one

2. Semiconductors and diodes

CoreHuman

Silicon at 300 K (ni=1010 cm−3n_i = 10^{10}\ \text{cm}^{-3}) is doped with ND=1015N_D = 10^{15} donors per cubic centimetre. Using the mass-action law, how many holes are there per cubic centimetre?

3. Semiconductors and diodes

CoreHuman

An ideal diode (n=1n = 1, no series resistance) at 300 K (VT=25.852V_T = 25.852 mV) carries 1 mA at 0.620 V. Using the Shockley equation, what is its forward voltage at 100 mA, in millivolts? Round to the nearest millivolt.

4. Semiconductors and diodes

Warm-upHuman

A white LED drops 3.0 V at 15 mA. What series resistor, in ohms, sets 15 mA from a 9 V battery?

5. Semiconductors and diodes

CoreHuman

A shunt regulator uses a 5.6 V Zener diode fed from a 12 V supply through a series resistor RR. The load draws up to 20 mA, and the Zener needs at least 5 mA to stay in breakdown. What is the largest RR, in ohms, that keeps the output regulated at full load?

6. Semiconductors and diodes

CoreHuman

A full-wave bridge rectifier with a smoothing capacitor feeds a steady load, and the ripple is too large. Which changes would roughly halve the ripple? Select all that apply.

Choose all that apply

7. Semiconductors and diodes

CoreHuman

A cloud cuts the sunlight on a solar cell to 20% of full sun. Using the model I=IL−IS(eV/(nVT)−1)I = I_L - I_S(e^{V/(nV_T)} - 1) with ILI_L proportional to the light, what happens to the short-circuit current and the open-circuit voltage?

Choose one

8. Semiconductors and diodes

StretchComputational

Write diode_operating_point(vs, r, i_s=1e-14, n=1.0, vt=0.025852), which returns (v, i), the voltage across and current through a diode in series with a resistor r across a source vs, by solving vs−vr=is(ev/(nvt)−1)\frac{v_s - v}{r} = i_s\left(e^{v/(n v_t)} - 1\right) with Newton's method. It must work for reverse bias (negative vs), for small sources, and for large ones: the tests include 100 V across 10 Ω, where plain Newton from 0.7 V overflows the exponential on its first step.

Runs entirely in your browser, in an isolated worker. Nothing is sent to a server.

Further reading and resources