49а. Electric field and capacitance: charge, field strength, the capacitor from the inside, parasitic capacitances on the board
Section 49 treated voltage, current and power as numbers in a circuit. Here is what stands behind them: charge and field. This is the first section of the series "Physics for the developer". It explains why a capacitor holds charge, where the picofarads of a pin, a trace and a pad come from, how a neighbouring trace couples noise into an ADC input and why a discharge from a finger burns a pin. Every formula comes with a calculation on board values: FR-4, an STM32 pin, a 100 nF capacitor.
Sources: constants — CODATA 2022 from scipy.constants (scipy 1.18.1,
numpy 2.3.3, image stm-ml:1); pin capacitance, ADC sampling
capacitance and discharge robustness — from datasheets DS12589 Rev 4
(STM32G431) and DocID13587 Rev 17 (STM32F103) from the Keil packs. Trace
capacitances are computed by our own grid solution of the field
equation in the board cross-section (script calc49a.py) and checked
against the Hammerstad microstrip formula. The FR-4 permittivity is
taken as 4.5, as in section 160.2; there is no laminate datasheet on
disk. There are no hardware measurements.
What it is called in the documentation
Original Meaning electric charge electric charge electric field (strength) electric field strength potential, equipotential potential, line of equal potential dielectric, permittivity (εr, Dk) dielectric, (relative) permittivity fringing field field at the edges parasitic (stray) capacitance unwanted capacitance I/O pin capacitance (CIO) pin capacitance sample and hold capacitor (CADC) ADC sampling capacitor crosstalk coupling between lines guard trace grounded shielding trace ESD, human body model (HBM), charged device model (CDM) electrostatic discharge, human body model, charged device model
49а.1 Charge, field and potential
Charge is measured in coulombs. One electron carries 1.602176634·10⁻¹⁹ C
— this number is exact in SI. A 100 nF capacitor charged to 3.3 V holds
Q = C·U = 330 nC, that is 2.06·10¹² extra electrons on one plate and
as many missing on the other. The current of section 49 is the rate at
which charge passes through a cross-section: 1 A = 1 C/s.
Charges act on each other through a field. Field strength E is the
force on a unit charge, its unit is volt per metre. Potential is the
"height" to which a unit charge must be lifted; voltage is a difference
of heights. The field is the slope of that height: E = −dφ/dx, and in
the uniform case simply E = U/d. So the field grows when the same
voltage is applied across a smaller gap:
- 3.3 V across a 0.15 mm gap between traces — 22.0 V/mm (kV/m);
- 3.3 V across 1.5 mm of FR-4 — 2.20 V/mm;
- 3.3 V across 0.2 mm to an inner layer — 16.5 V/mm.
Where it shows on the board: the field, not the voltage, decides whether a gap breaks down, whether charge leaks over a dirty surface and how strongly two conductive parts "feel" each other. A thin layer means a strong field at the same voltage.
Dielectric. In an insulator charges do not flow but shift: molecules polarise and partly cancel the external field. By how much is shown by the relative permittivity εr. The vacuum permittivity is ε₀ = 8.8541878188·10⁻¹² F/m (CODATA 2022), FR-4 has εr of about 4.5. The same capacitor with FR-4 between the plates holds 4.5 times more charge than with air.
49а.2 The parallel-plate capacitor from the inside
Two conductive plates of area S at distance d with a dielectric between them form a parallel-plate capacitor:
C = ε0 · εr · S / d
Capacitance grows with area and falls with the gap. On a board this is any two copper areas above each other:
| What | Gap 1.5 mm (two-layer) | Gap 0.2 mm (to a layer of a four-layer board) |
|---|---|---|
| 1 × 1 mm pad over ground | 0.0266 pF | 0.199 pF |
| 10 × 10 mm electrode over ground | 2.66 pF | 19.9 pF |
| power and ground layers, per 1 cm² | 2.66 pF | 19.9 pF |
With a 0.1 mm gap — 39.8 pF/cm². A pair of 50 × 50 mm power planes at 0.2 mm gives 498 pF: 201 times less than one 100 nF capacitor. But it is capacitance without leads and almost without inductance — it works at frequencies where ordinary decoupling no longer helps (decoupling — section 167.5).
The formula holds while the plates are wide compared with the gap. At the edges the field bulges outwards — the fringing field — and adds capacitance:
For plates of width 4d the field calculation gave a capacitance 1.36 times the formula. The narrower the copper compared with the gap, the larger the share of the edge. A narrow trace over distant ground is almost all "edge", and the parallel-plate formula does not fit it (49а.4).
49а.3 Energy and real capacitors
A charged capacitor stores energy W = C·U²/2. It sits in the field:
per unit volume ε·E²/2; for a parallel-plate capacitor both ways give
the same result (the calculation agrees to the sixth digit).
| Capacitor | Voltage | Energy |
|---|---|---|
| 100 nF decoupling | 3.3 V | 0.544 µJ |
| 10 µF | 3.3 V | 54.5 µJ |
| 1000 µF at the power input | 12 V | 72.0 mJ |
Hence the practice: decoupling at a pin gives microjoules per edge — little, but fast; the electrolytic at the input stores 132 thousand times more and sparks on a short circuit.
Ceramics. To get a lot of capacitance in a small package one needs a dielectric with a huge εr. Such dielectrics (classes X7R, X5R, Y5V) are ferroelectric: their permittivity comes from regions with their own polarisation that a small field turns easily. A DC voltage aligns them, and fewer "turnable" regions are left for the AC signal — capacitance drops. Temperature changes the ability to polarise itself. C0G (NP0) is a dielectric without this mechanism: small εr, small capacitance per package, but stable. The field in a layer is stronger the thinner the layer at the same voltage — so a small package at the same voltage loses more. There are no numbers for the voltage loss here: there is no such graph for any part on disk, and it must not be invented. Classes and the practice of choosing — section 167.2–167.3.
Electrolytic — an oxide film nanometres thick on etched foil: huge area, tiny gap, hence hundreds of microfarads. The price is the series resistance ESR and ageing; this is sections 167.4–167.6, 53 and 58.
49а.4 Parasitic capacitances on the board
Any two conductors form a capacitor, whether we want it or not. What is on an ordinary board:
| What | Capacitance | Source |
|---|---|---|
| STM32G431 pin | 5 pF | DS12589, p. 111, CIO |
| STM32F103 pin | 5 pF | DocID13587, p. 62, CIO |
| F103 ADC input pad, "roughly" | 7 pF | DocID13587, p. 78 |
| pin and board together, rough estimate | 10 pF | DS12589, p. 100 |
| ADC sampling capacitance G4 / F1 | 5 / 8 pF | DS12589, p. 119; DocID13587, p. 75 |
| 0.25 mm trace over ground at 1.5 mm | 0.440 pF/cm | field calculation |
| 0.25 mm trace over ground at 0.2 mm | 0.981 pF/cm | field calculation |
| 1 mm trace over ground at 1.5 mm | 0.708 pF/cm | field calculation |
| 1 mm trace over ground at 0.2 mm | 2.53 pF/cm | field calculation |
The parallel-plate formula would give 0.0664 pF/cm for a 0.25 mm trace over 1.5 mm — 6.63 times less: almost all the capacitance is in the fringing field. Over ground at 0.2 mm — 0.498 against 0.981, 1.97 times; for a 1 mm trace — 2.67 and 1.27 times. The Hammerstad microstrip formula gives 0.431; 0.703; 0.961 and 2.50 pF/cm — the difference from the calculation is no more than 2.0 %. A grid twice as fine changes the result by −0.96 %, a domain twice as large — by 0.00 %.
How it was computed: the field equation in the cross-section, capacitance from energy. The mutual capacitance of two traces comes from three solutions:
W10, W01, W11 = run([1.0, 0.0] + z), run([0.0, 1.0] + z), run([1.0, 1.0] + z)
return W10 + W01 - W11, 2 * W01
Pin load. A G4 pin (5 pF), 10 cm of 0.25 mm trace on a two-layer
board (4.4 pF) and the input of another chip (take the same 5 pF) —
14.4 pF. Every switching period the pin charges and discharges this
capacitance: energy C·U² = 157 pJ per period, power C·U²·f at
10 MHz — 1.6 mW, average current C·U·f — 0.48 mA. The current flows in
pulses on the edges — this is what decoupling catches (section 130.3).
How fast a capacitance charges through a resistor is the RC circuit of
section 50.
ADC input. At the moment of sampling the switch connects the
sampling capacitor, charged from the previous conversion, to the input.
The charge is shared between it and everything hanging on the input:
ΔU = U·Cs/(Cs + Cext). Let the input be 2 V and Cs discharged to zero:
| What is on the input | G4 (5 pF) | F1 (8 pF) |
|---|---|---|
| only the pin and 5 cm of trace, 7.2 pF | 820 mV (1017 LSB) | 1053 mV (1307 LSB) |
| a 1 nF capacitor | 10.0 mV (12 LSB) | 16 mV (20 LSB) |
| a 100 nF capacitor | 0.100 mV (0.12 LSB) | 0.16 mV (0.20 LSB) |
The unit is the step of a 12-bit ADC at 3.3 V, 0.806 mV. Without an external capacitor the dip is huge, and only the source can correct it within the sampling time; with a capacitor at the input the charge comes from it. How much time is needed and what it costs — sections 14 and 180.
49а.5 Capacitive coupling between traces
Two neighbouring traces form a capacitor Cm. When the voltage on one
(the aggressor) jumps, a current i = Cm·dU/dt flows through Cm into
the other (the victim). If the victim is high-impedance, it simply
divides the edge: ΔU = U·Cm/Ctot, where Ctot is the whole capacitance
of the victim. If the victim is held by a source with resistance R, the
pulse is smaller the smaller R is.
Field calculation for two 0.25 mm traces, per centimetre of length:
| Gap | Cm, two-layer (1.5 mm) | Cm share | Cm, ground at 0.2 mm | Cm share |
|---|---|---|---|---|
| 0.15 mm | 0.32 pF/cm | 52 % | 0.13 pF/cm | 13 % |
| 0.3 mm | 0.22 pF/cm | 41 % | 0.055 pF/cm | 5.6 % |
| 0.6 mm | 0.14 pF/cm | 29 % | 0.015 pF/cm | 1.5 % |
| 1.2 mm | 0.072 pF/cm | 16 % | 0.0037 pF/cm | 0.37 % |
The share is Cm relative to the whole capacitance of the victim. Close ground takes the field for itself: at the same 0.6 mm gap the coupling drops 9 times.
Now the coupled noise: the aggressor is a pin, 0 → 3.3 V in 5 ns, 5 cm of common path, a 5 pF input at the victim's end. Peak on the victim, mV:
| Layout | High-impedance input | 10 kΩ source | 100 Ω source |
|---|---|---|---|
| gap 0.15 mm, two-layer | 652 | 633 | 105 |
| gap 0.3 mm | 477 | 461 | 73 |
| gap 0.6 mm | 310 | 300 | 46 |
| gap 1.2 mm | 164 | 158 | 24 |
| gap 0.75 mm without ground between | 260 | 252 | 38 |
| gap 0.75 mm, 0.25 mm ground trace in the middle | 97 | 94 | 15 |
| gap 0.15 mm, ground at 0.2 mm | 221 | 216 | 44 |
| gap 0.6 mm, ground at 0.2 mm | 25 | 24 | 4.9 |
A sensor through 10 kΩ behaves almost like an input hanging in the air: its time constant is much longer than the edge. For an ADC this is hundreds of 0.806 mV steps — if the sample lands on the neighbour's edge.
How to reduce it, by strength of effect:
1. ground close under the traces (a four-layer board or a solid
bottom layer) — several times;
2. distance — doubling the gap lowers the coupling one and a half to
two times;
3. a ground trace between — 2.5 times less Cm at the same spacing;
in the calculation it is grounded along its whole length, in reality
by frequent vias to ground, otherwise it becomes an antenna itself;
4. a slower edge and a shorter common path — the current is
proportional to dU/dt and to length;
5. low victim impedance — a capacitor at the ADC input (49а.4).
Inductive coupling through a shared current — section 49б; transmission lines — 49в.
49а.6 Static and the capacitive button
A human is a capacitor. The human body model test: 100 pF charged to a given voltage discharge into a pin through 1.5 kΩ. The time constant is 150 ns, the current falls to 10 % in 345 ns.
| Voltage | Charge | Peak current | Energy |
|---|---|---|---|
| 2 kV | 200 nC | 1.33 A | 200 µJ |
| 8 kV | 800 nC | 5.33 A | 3200 µJ |
The STM32G431 withstands 2000 V in this model (class 2) and 250 V in the charged device model (DS12589, p. 109); the STM32F103 — 2000 V and 500 V (DocID13587, p. 60).
Why pins burn. Without protection the charge of 100 pF at 2 kV, flowing into a 5 pF pin, would raise it to 1905 V — the gate of the transistor behind the pin is insulated by a thin oxide and cannot stand such a field. The built-in diodes dump the current into the supply, but 1.33 A through a structure a fraction of a millimetre in size means local heating. Internal protection is designed for assembly, not for a finger on a connector; field discharge in a product and external clamps — sections 62.8–62.9 and 203.3.
The capacitive button is the same physics in reverse. A 10 × 10 mm
electrode over solid ground through 1.5 mm of FR-4 already has 2.66 pF of
its own, to which the pin and trace add. A finger is a conductor coupled
to ground through the body; through the panel it adds a capacitance
ε0·εr·S/d. For a 50 mm² finger spot, per unit of panel εr:
- 1 mm panel — 0.443 pF;
- 2 mm panel — 0.221 pF;
- 3 mm panel — 0.148 pF.
The signal is fractions of a picofarad against tens of picofarads of background, so the ground under the electrode is hatched and the panel is thin and pressed tight: an air gap with εr = 1 eats the sensitivity. How the TSC controller measures this difference by charge transfer — section 45.2.
49а.7 Pitfalls
Trace capacitance computed by εS/d came out several times smaller. A narrow trace over distant ground is almost all in the fringing field: 0.0664 pF/cm by the formula against 0.440 by the field calculation.
An ADC input without a capacitor is "pulled" towards the neighbouring channel. The sampling charge is shared with 7 pF of the input — a dip of hundreds of millivolts. A 1–100 nF capacitor at the pin or a buffer (section 180).
An analog line next to a clock line. On a two-layer board with a 0.15 mm gap and 5 cm side by side — hundreds of millivolts on a high-impedance input. Route further apart, put ground between, or better — solid ground underneath.
A "protective" ground trace hangs on one end. Without frequent vias to ground it does not shield but carries the noise further.
An X7R capacitor in a filter has "shrunk". The DC voltage aligned the dielectric domains; take the capacitance from the voltage graph of the specific part (167.3).
The board burns when the connector is touched. Built-in protection is for assembly: 2000 V in the human body model. External lines are protected separately (62.8).
A touch button does not sense a finger through the enclosure. A thick panel or air between panel and electrode: at 3 mm the finger capacitance is three times smaller than at 1 mm.
49а.8 Summary
- The charge of 100 nF at 3.3 V is 330 nC, 2.06·10¹² electrons; the field
is the slope of potential,
E = U/d: 3.3 V over 0.15 mm is 22.0 V/mm. C = ε0·εr·S/d, ε₀ = 8.8541878188·10⁻¹² F/m, FR-4 — εr 4.5: layers at 0.2 mm — 19.9 pF/cm², at 1.5 mm — 2.66 pF/cm²; the edge adds 36 % for plates of width 4d.- Energy
C·U²/2: 100 nF at 3.3 V — 0.544 µJ, 1000 µF at 12 V — 72.0 mJ. - A 0.25 mm trace: 0.440 pF/cm over ground at 1.5 mm and 0.981 pF/cm over 0.2 mm; an STM32 pin — 5 pF, ADC sampling — 5 pF (G4) and 8 pF (F1).
- A pin with 10 cm of trace and an input — 14.4 pF: 1.6 mW and 0.48 mA at 10 MHz.
- Sampling charge sharing: without a capacitor at the input — an 820 mV dip (G4), with 100 nF — 0.100 mV.
- Coupling over 5 cm with a 5 ns edge: from 652 mV (0.15 mm, two-layer) to 25 mV (0.6 mm, ground at 0.2 mm); a ground trace between — 2.5 times less coupling.
- Human body model discharge at 2 kV: 200 nC, 1.33 A, 200 µJ, 150 ns.
- A finger through a 2 mm panel — 0.221 pF per unit of εr.
Next: section 49б "Magnetic field and induction: current creates a field, the coil, mutual inductance, the transformer, self-induced EMF and switching spikes" — the second section of the series "Physics for the developer": where the inductance of a coil and of a loop on the board comes from, why a switch without a diode sees hundreds of volts when a relay is turned off, how a transformer works and how a neighbouring loop couples noise through the magnetic field.