49ж. Electrostatics and ESD: where kilovolts come from, HBM/CDM models, how a microcontroller input is protected (diodes, TVS, resistor, layout)
In section 49а a person was a 100 pF capacitor and a discharge was a two-row table. Here: where the kilovolts on that capacitor come from, why a spark does not jump at just any voltage, how the test models of a discharge differ, and what happens inside a pin when 8 kV hits the connector. The main part is a simulation of an STM32 input with five protection variants: none, a resistor, a clamp, both, and both but badly laid out.
Pin protection practice is in section 62 (injection current 62.2, resistor 62.3, clamp 62.9), supply protection in 173, product immunity to discharge in 203.3, static at the workbench in 207.1. Here is the physics under those rules and the numbers that check it.
Foundations: the electric constant and the electron charge are CODATA 2022
from scipy.constants (scipy 1.18.1, numpy 2.3.3, image stm-ml:1). Current
waveforms of the test models are solutions of the RLC circuit equation in calc49g.py.
Discharge into an input with and without protection is ngspice 39 (image stm-lab:1,
file esd49g.cir). Chip robustness (2000 V by the body model for G431
and F103, 250 and 500 V by the charged device model) is from the datasheets,
via section 49а.6. The models of the pin, the clamp and the discharge loop are
conditional, with the parameters named in the text. There are no hardware measurements.
What it is called in the documentation
Original Meaning electrostatic discharge (ESD) a sudden flow of static charge triboelectric charging charging by contact and separation human body model (HBM) test of a finger touching a pin breakdown, Paschen's law the voltage at which a gas conducts ESD protection diode, power clamp pin diode, supply rail limiter TVS diode, clamping voltage transient suppressor, voltage it holds at a given current injection current current through the pin diodes
49ж.1 Where kilovolts come from
Two materials touched and separated — some electrons moved from one to the other. This is triboelectric charging: a sole on the floor, a sleeve on the table, a film on packaging. Charge does not appear from nothing, it is only separated; but if the separated parts are insulated from each other, it has nowhere to drain.
Voltage is set not by the charge but by the capacitance: U = Q / C. A human body is a
conductor, and it has two capacitances. Its own, like an isolated sphere of the same
volume (70 L, radius 0.256 m): 4·π·ε0·r = 28.4 pF. And the capacitance of the soles to
the floor: sole 150 cm², thickness 5 mm, εr 3 — 79.7 pF each. Standing on two
feet a person is 188 pF.
Suppose that after walking on a carpet he has collected 0.939 µC (5.86·10¹² electrons) — that is 5 kV. He lifts one foot: the capacitance drops to 108 pF, the charge stays the same, and the voltage rises to 8.68 kV. The energy has grown from 2.35 mJ to 4.08 mJ — the muscles that pulled the charges apart added it. Hence the familiar "stood up from the chair — and it snapped": a discharge happens not where the charge was collected, but where the capacitance dropped.
Spark. For charge to drain through air, breakdown is needed: a free electron must be accelerated by the field to an energy at which it knocks the next one out of a molecule, and an avalanche closes the gap. The threshold is described by Paschen's law: breakdown voltage depends on the product of pressure and gap. At atmospheric pressure the minimum is about 305 V at a gap of 11 µm; below this voltage air does not break down at any gap. A 1 mm gap breaks down at 5.03 kV, 3 mm — at 12.6 kV. The rough estimate "3 kV per millimetre" gives a 2.7 mm spark for 8 kV.
That is why a discharge from a finger is usually not felt until it reaches several kilovolts, while a chip dies from hundreds of volts — those that give neither a spark nor a snap (49ж.2).
49ж.2 Test models: body, device, discharge gun
To compare chips, the discharge is replaced by a simple circuit: a charged capacitor, a resistor and the unavoidable inductance of the wires. Different circuits describe different situations in real life.
Human body model (HBM) — a finger touches a pin: 100 pF through 1.5 kΩ. The body capacitance is much larger and the hand resistance lower, but this is the agreed way to test chips. Loop inductance is conditionally 7.5 µH.
Charged device model (CDM) — the chip itself has collected charge (slid along a tray, a pick-and-place tape, a sleeve) and touched grounded metal with one pin. The capacitance is that of the package to the surroundings, a few picofarads (conditionally 4 pF), the loop resistance is tens of ohms (conditionally 25 Ω), the inductance a few nanohenries (5 nH).
Contact discharge into a product — testing a finished device with a discharge gun: 150 pF through 330 Ω, as in 62.8. Loop inductance is conditionally 300 nH; the sharp initial peak of a real gun is not in this model, so its current is a lower estimate.
| Model | Peak current | After | Down to 10 % | Charge | Energy |
|---|---|---|---|---|---|
| body, 2 kV | 1.22 A | 18 ns | 357 ns | 200 nC | 200 µJ |
| body, 8 kV | 4.88 A | 18 ns | 357 ns | 800 nC | 3200 µJ |
| contact discharge, 8 kV | 22.9 A | 3.7 ns | 117 ns | 1200 nC | 4800 µJ |
| charged device, 250 V | 4.48 A | 0.18 ns | 0.447 ns | 1.00 nC | 0.125 µJ |
| charged device, 500 V | 8.95 A | 0.18 ns | 0.447 ns | 2.00 nC | 0.500 µJ |
Without inductance the peak would be U/R: 1.33 A for the body at 2 kV, 24.2 A for
the gun — numbers from 49а.6 and 62.8. For the body model the inductance changes almost
nothing: the RC time constant of 150 ns is much longer than the rise
time. For the charged device it changes everything: without inductance it would be
10.0 A, with it 4.48 A, but within 0.18 ns. The rate of current rise
at the start of the discharge is U/L: 0.267 A/ns for the body at 2 kV, 50.0 A/ns for the device
at 250 V.
Hence different dangers. A body-model discharge is long and energetic — it heats: it melts a diode junction, metallization, a track inside the chip. A charged device discharge carries 1600 times less energy (0.125 µJ against 200 µJ), but it is so fast that the protection diodes do not manage to take over the current, and for a fraction of a nanosecond the voltage lands on the thin gate oxide. That is why the STM32G431 has 2000 V by the body model and 250 V by the device model (49а.6): these are different properties, not one property measured two ways.
The waveform solution is a short function in calc49g.py:
def rlc_discharge(U, C, R, L, t_end, n=200001):
"""Конденсатор C, заряженный до U, разряжается в замкнутый вывод через R и L: ток i(t)."""
def rhs(t, y):
q, i = y
return [-i, (q / C - R * i) / L]
t = np.linspace(0, t_end, n)
sol = solve_ivp(rhs, (0, t_end), [C * U, 0.0], t_eval=t, method="LSODA", rtol=1e-9, atol=[1e-18, 1e-9])
return t, sol.y[1]
ngspice with the same parameters gave a peak of 4.47 A for the 250 V charged device — a difference from the solution in the third digit.
49ж.3 What is inside a pin
Every STM32 pin has two protection diodes: from the pin to the VDD rail
and from VSS to the pin. While the voltage is within the supply, both are off.
A positive discharge opens the upper diode and goes into the supply rail,
a negative one opens the lower diode, from ground. Between the rails there is one more
clamp: without it the charge dumped into VDD would lift the rail — an 8 kV discharge
brings 1200 nC, and on a 100 nF capacitor that is 12 V.
Model for ngspice (conditional, but with the same nodes): pin diodes with 1 Ω resistance, a 5.5 V rail clamp, 100 nF decoupling, 3.3 V supply. A 2 kV body-model discharge straight into the pin — what the chip must survive according to its datasheet:
- peak current into the pin 1.22 A, the pin rises to 5.57 V;
- the
VDDrail momentarily reaches 3.90 V; - 1.03 µJ goes into the chip — the remaining 200 µJ heats the 1.5 kΩ resistor of the model.
These three numbers are the yardstick for everything that follows: if in the protection variants below less current and energy reach the pin than with 2 kV by the body model, the chip is within what it was tested for.
Why negative and long currents are more dangerous. The lower pin diode is a
p-n junction in the common substrate. Current injected through it spreads
through the substrate and can turn on a parasitic four-layer structure between
VDD and VSS — latch-up. Then the supply rail is shorted inside the
chip and stays shorted until power is removed. This is the
reason for the 5 mA injection current limit (62.2) and for the advice to put a Schottky diode to ground on
analog inputs.
49ж.4 Five protection variants: simulation
The 8 kV contact discharge from 49ж.2 arrives at the connector; to the pin there is a 5 nH track (about 5 mm). The clamp (TVS) has 6 V breakdown, 0.35 Ω dynamic resistance, as in 173.3; its ground is 1 nH.
| Variant | Peak current into pin | Pin | VDD rail | Energy into chip | Relative to body model, current / energy |
|---|---|---|---|---|---|
| A: no protection | 22.8 A | 27.7 V | 8.49 V | 23.8 µJ | ×19 / ×23 |
| B: 100 Ω resistor | 17.8 A | 22.5 V | 7.96 V | 20.0 µJ | ×15 / ×19 |
| C: TVS at the connector | 6.40 A | 11.1 V | 5.13 V | 3.56 µJ | ×5.3 / ×3.4 |
| D: TVS at the connector + 100 Ω | 0.247 A | 4.35 V | 3.33 V | 0.0519 µJ | ×0.20 / ×0.050 |
| E: as D, TVS ground 20 nH | 3.14 A | 7.32 V | 3.35 V | 0.0616 µJ | ×2.6 / ×0.060 |
A. The internal diodes take the whole gun current — 19 times more than in the test, and the supply rail jumps to 8.49 V against a 4.0 V limit (62.1). Internal protection is designed for assembly, not for a finger on a connector.
B. A 100 Ω resistor means almost nothing against 8 kV: 330 Ω of the gun plus 100 Ω — the current falls only from 22.8 to 17.8 A. To bring the current down to the allowed steady injection current of 5 mA with a resistor alone, 1.6 MΩ would be needed — and the input would stop working as an input.
C. A clamp without a resistor helps less than expected. The internal diode opens at 4.0 V, and the TVS only from 6 V: until the voltage has reached the TVS breakdown, all the current goes into the chip, and after that it is shared according to the resistances. 6.40 A goes into the pin.
D. A clamp at the connector and a resistor behind it is the right circuit. The TVS holds its node at tens of volts, the resistor turns the difference between it and 4.0 V into a current of 0.247 A — five times less than in the chip test, and the energy twenty times less.
E. The same circuit, but the clamp ground is a 20 nH track (about
two centimetres) to the ground plane. The TVS node in variant D momentarily
rises to 30.0 V, in variant E to 324 V: the L·di/dt voltage on
the ground track (about 294 V) adds to the clamping voltage. The current
into the pin for that fraction of a nanosecond grows to 3.14 A — 2.6 times above the
test. The energy has hardly changed, but the current peak is dangerous for the
oxide. Up to 22.7 A passes through the clamp in both cases.
49ж.5 Clamp and resistor: how to choose
TVS working voltage — not below the highest line voltage, otherwise
it leaks and spoils the signal (62.9). Breakdown voltage is above the working one,
and the clamping voltage at the discharge current is above breakdown by
I · Rdyn: in our model 22.7 A on 0.35 Ω — about 8 V more. For a
pin with a 4.0 V limit this is a lot — so a resistor is needed behind the clamp.
Resistor. Its job is to turn the difference between the voltage on the TVS and the internal diode threshold into a small current. A hundred ohms reduces the chip current from 6.40 A (variant C) to 0.247 A (variant D). More is better for protection but worse for the signal: the resistor together with the input capacitance forms a filter, and on an ADC input it adds an error from the sampling current (62.10, 14а). For a digital input one usually puts hundreds of ohms to a few kilohms, for communication lines tens of ohms, so as not to slow down the edges.
TVS capacitance. On fast lines it matters more than anything else: 100 pF eat a noticeable part of a bit at 12 Mbit/s, 3 pF do not (62.9). A powerful clamp goes on the supply and slow lines, a low-capacitance one on interfaces.
A capacitor at the pin helps against a charged device discharge and short spikes: it takes the charge before the voltage reaches the oxide. But it is one more capacitance on the line, and on fast signals its budget is the same as the TVS's.
Where it is not needed. Lines between chips on one board that never go outside do not need external protection: they are touched only during assembly, and there the wrist strap and mat (207.2) and the internal diodes do the job.
49ж.6 Layout: the path of the discharge current
Discharge current is the same current, only very fast: 26.7 A/ns at the start of
a contact discharge in our model. At such rates every
nanohenry of track is volts: U = L · di/dt. Hence the rules.
- TVS right at the connector, before the line has gone deep into the board. The discharge current must turn into ground at the edge, not pass by the microcontroller.
- TVS ground short and wide, with a via straight into the solid plane (130.2). Variant E showed the price: 20 nH in the clamp ground — 324 V on its node instead of 30.0 V.
- Resistor after the TVS, closer to the microcontroller, and the protected part of the line does not run next to the unprotected one: otherwise the discharge jumps capacitively (49а.5) past the clamp.
- The connector housing and shield are tied to ground at the connector, so that the discharge path closes along the edge of the board (203.4). Discharge current that passed through the whole board induces spikes in neighbouring loops (49б).
- Analog inputs — the same circuit, plus a filter capacitor; the rules for common ground and pickup are in section 181.
Layout matters no less than the choice of components: the same TVS and resistor in variants D and E differ only in the ground track, while the peak current into the pin differs 13 times.
49ж.7 Pitfalls
"The datasheet says 2000 V — so a finger discharge is not a problem". 2000 V is by the body model, for assembly. An 8 kV contact discharge puts 19 times more current into the pin (variant A). Everything that goes outside is protected separately.
A 100 Ω resistor was fitted and the input is considered protected. Against 8 kV it reduces the current only from 22.8 to 17.8 A. Without a clamp a resistor is no protection.
A TVS was fitted without a resistor. The internal diode opens before the TVS and takes 6.40 A.
The TVS was placed "where there was room". A long clamp ground means hundreds of volts on its node (324 V at 20 nH), and the current into the pin is again above the test level.
The board passed the body-model test, but chips die during assembly. A charged device discharge: 250 V for the G431, a 4.48 A peak within 0.18 ns. What helps is not the circuit but a grounded workbench, an ioniser and packaging (207.1).
After a discharge the input works, but a week later it stopped. Latent damage: a partly melted junction or oxide gives a growing leakage. The check is the input leakage current before and after the tests.
After interference the board "hung" and heats up until power is removed. Latch-up from current through the lower pin diode. A resistor on the line and a Schottky diode to ground limit this current (62.2).
49ж.8 Summary
- Static is separated charge, voltage is set by capacitance: 0.939 µC on 188 pF is 5 kV, lift a foot (108 pF) — 8.68 kV.
- Air does not break down below 305 V (Paschen minimum); 1 mm — 5.03 kV.
- Body model 2 kV: 1.22 A, 200 µJ, hundreds of nanoseconds — it heats. Charged device 250 V: 4.48 A within 0.18 ns, 0.125 µJ — it punches through the oxide. These are different chip robustness figures.
- An 8 kV contact discharge without protection gives 22.8 A into the pin, 19 times more than the test; a 100 Ω resistor alone — 17.8 A; a TVS alone — 6.40 A.
- TVS at the connector plus 100 Ω — 0.247 A and 0.0519 µJ: within what the chip survived in the test.
- TVS ground through 20 nH — 324 V on the node and 3.14 A into the pin: layout matters no less than components.
Next: section 50 "I-V curves, voltage divider, RC circuits" — how elements whose resistance is not constant behave, and what happens when time enters the circuit.