TExcelTAD
Home › Analog Electronics: Diodes, Transistors & Op-Amps › Grounding, Shielding and PCB Layout for Analog

Grounding, Shielding and PCB Layout for Analog

The schematic says "ground" in twenty places, and the simulator treats all twenty as one perfect node. The board does not. Ground is copper, with resistance and inductance, and every current that flows into it comes back out somewhere. A 0.05 Ω0.05\ \Omega trace shared by a motor and a sensor turns 2 A of motor current into 100 mV of "sensor signal". A 10 cm210\ \text{cm}^2 loop of wire near a transformer picks up hum. A digital clock trace 1 mm from a high-impedance input injects spikes through a fraction of a picofarad. None of this is in the noise formulas, because none of it is random: it is interference, and grounding, shielding and layout remove it. This lesson covers the roadmap's "noise, grounding and shielding" and "PCB layout for analog circuits" topics as rules you can apply on your next board.

Where return currents go

Kirchhoff's current law says every current returns to its source. At DC it takes the path of least resistance; above a few tens of kilohertz it takes the path of least inductance, which on a board with a solid ground plane is the plane directly under the signal trace (the return current spreads only a few trace heights to each side). This explains most layout rules: a slot cut in the plane under a trace forces the return current round the slot, creating a loop that radiates and picks up.

The basic failure is common impedance coupling: two circuits share a piece of ground, and one's current makes a voltage in the other's reference.

shared return (daisy chain) star ground supply motor 2 A sensor+ADC RSH 50 mOhm motor current shifts the sensor ground by I x RSH supply motor 2 A sensor+ADC star point each return has its own path to one point

Star grounding gives each circuit its own return to a single point, usually at the supply or the ADC. On multilayer boards the modern version is a solid ground plane with careful placement: keep high-current and switching parts close to where their currents enter and leave the board, so their return currents never flow under the sensitive analog section. Splitting the plane into "analog" and "digital" halves causes more problems than it solves when signals cross the split; one plane, partitioned by placement, is the usual recommendation today (with the split joined at the ADC if a mixed-signal part's datasheet asks for it).

Interactive: the shared trace

A 12 V12\ \text{V} supply drives a 6 Ω6\ \Omega motor (about 2 A) whose return shares a trace RSH with a sensor. The sensor produces 100 mV100\ \text{mV} relative to its own ground pin ga; the ADC (a 1 MΩ1\ \text{M}\Omega input) measures node s against the supply ground 0. All elements are linear, so this is a fair DC model.

node voltages (to ground 0)vp12.00 Vga99.17 mVs199.2 mVnetlistV1 vp 0 12RM vp ga 6RSH ga 0 50mVS s ga 0.1RADC s 0 1megelement currents (node 1 to node 2 through it)V1vp>0-1.98 ARMvp>ga1.98 ARSHga>01.98 AVSs>ga-199 nARADCs>0199 nA

At 50 mΩ50\ \text{m}\Omega the lab shows V(ga)=99.17 mVV(\text{ga}) = 99.17\ \text{mV} and the ADC reads V(s)=199.2 mVV(s) = 199.2\ \text{mV} instead of 100 mV: a 99 % error, and it changes every time the motor's current changes. Slide RSH down to 1 mΩ1\ \text{m}\Omega (a separate return: only the wire from the star point to the supply is shared) and the error falls to 2 mV2\ \text{mV}. Raise RM to 120 Ω120\ \Omega (a light load) and see the error scale with the current.

Coupling paths and their cures

Path Physics Grows with Cure
Common impedance V=IRV = I R and L di/dtL\,di/dt in shared copper current, trace length separate returns, plane, placement, Kelvin connections
Magnetic (inductive) v=dΦ/dt=A dB/dtv = d\Phi/dt = A\,dB/dt in a loop loop area, frequency small loops: run signal and return together, twist pairs
Electric (capacitive) i=C dv/dti = C\,dv/dt through stray capacitance node impedance, edge rate distance, grounded shield or guard, low impedance nodes
Radiated the above at a distance, at high frequency frequency, cable length shields, filtering at the enclosure entry; see EMC, Signal Integrity & Advanced Electromagnetics

Ground loops. Two pieces of equipment each earthed through their mains cords, and joined again by a signal cable's shield, form a large loop. Mains-frequency magnetic fields and differences between the two earth points drive current round it, and the current's drop along the shield appears in series with the signal: hum. Cures: break the loop at signal frequency (differential inputs, an instrumentation amplifier, isolation transformers or isolated amplifiers, battery operation), never by removing a safety earth.

Shields. A grounded conductive shield stops electric coupling by giving the stray field somewhere to land; ground it at one end for low-frequency analog cables (no loop), at both ends (or one end plus a capacitor) at radio frequencies. Thin shields do little against low-frequency magnetic fields: reduce the loop area instead, or use steel or mu-metal for transformers.

Guard rings. On a picoamp input (photodiode, pH electrode, electrometer) the board's surface leakage, several gigaohms across a contaminated gap, is larger than the signal. Surround the input pad with a copper ring driven at the same voltage as the input (from the op-amp's other input or a buffer). No voltage across the gap means no leakage, whatever its resistance.

Kelvin (four-wire) connections. For a current-sense resistor or a regulator's sense point, run separate thin traces from the exact ends of the resistor (or the load) to the amplifier, so no high current flows in the measuring traces (Voltage References and Linear Regulators).

Decoupling. Every IC draws current in fast pulses. A capacitor at its supply pins provides that current locally, so the pulses do not travel down the supply traces (common impedance) or make loops (magnetic). Real capacitors have ESR and ESL (a few hundred picohenries to a few nanohenries, much of it the mounting), so each one is a series RLC and only works up to its self-resonance. Place the smallest capacitor closest to the pin, with its ground via right beside it.

Cross-check with SPICE: decoupling capacitor impedance

Each capacitor as a series RLC: (a) 100 nF100\ \text{nF} with 20 mΩ20\ \text{m}\Omega and 1 nH1\ \text{nH}; (b) 10 μF10\ \mu\text{F} with 5 mΩ5\ \text{m}\Omega and 2 nH2\ \text{nH}; (c) both in parallel. A 1 A AC current source into each makes the node voltage equal to the impedance.

bash · try it yourself
cat > decap.cir <<'EOF'
* Decoupling capacitors with ESR and ESL: impedance seen by a 1 A AC test current
* (a) 100 nF, ESR 20 mohm, ESL 1 nH   (b) 10 uF, ESR 5 mohm, ESL 2 nH   (c) both in parallel
Ia 0 a AC 1
Ca a a1 100n
Ra a1 a2 20m
La a2 0 1n
Ib 0 b AC 1
Cb b b1 10u
Rb b1 b2 5m
Lb b2 0 2n
Ic 0 c AC 1
Cc1 c c1 100n
Rc1 c1 c2 20m
Lc1 c2 0 1n
Cc2 c c3 10u
Rc2 c3 c4 5m
Lc2 c4 0 2n
.control
ac dec 200 100k 1g
meas ac fres_a when vp(a)=0
meas ac fres_b when vp(b)=0
meas ac fanti_c when vp(c)=0 cross=2
meas ac zmax_c max vm(c) from=3meg to=14meg
meas ac z1meg_a find vm(a) at=1meg
meas ac z1meg_c find vm(c) at=1meg
meas ac z1meg_b find vm(b) at=1meg
meas ac z50meg_a find vm(a) at=50meg
meas ac z50meg_c find vm(c) at=50meg
.endc
.end
EOF
ngspice -b decap.cir 2>&1 | grep -E '^(fres|fanti|zmax|z1meg|z50meg)'
fres_a              =  1.591579e+07
fres_b              =  1.125411e+06
fanti_c             =  9.324134e+06
zmax_c              =  5.316603e-01 at=  9.225714e+06
z1meg_a             =  1.585392e+00
z1meg_c             =  6.005073e-03
z1meg_b             =  6.018025e-03
z50meg_a            =  2.830351e-01
z50meg_c            =  1.951876e-01

The self-resonances agree with 1/(2πLC)1/(2\pi\sqrt{LC}): 15.92 MHz15.92\ \text{MHz} for (a) and 1.125 MHz1.125\ \text{MHz} for (b). Above its resonance each capacitor is an inductor: at 50 MHz the "100 nF" is 0.28 Ω0.28\ \Omega, almost all ESL. In parallel they cover a wider range (6 mΩ6\ \text{m}\Omega at 1 MHz), but between the two resonances the big capacitor's inductance and the small one's capacitance form a parallel resonance, here a peak of 0.53 Ω0.53\ \Omega at 9.2 MHz9.2\ \text{MHz}. That is why power-integrity engineers model the whole network rather than add capacitors by habit, and why the mounting inductance (short, wide connections, vias next to the pads) matters more than the capacitor's value at high frequency.

Worked example: how big is the error?

Given: a 50 mm long, 0.5 mm wide trace in 1 oz (35 μm35\ \mu\text{m}) copper shared by a 2 A motor return and a sensor ground; a 12-bit ADC on 3.3 V full scale. Separately, a 1 pF stray capacitance from a 5 V logic edge (2 ns) to an analog node.

Find: the trace resistance, the ground shift in ADC steps, and the current injected by the edge.

Solve:

R=ρLwt=1.72×10−8 Ω m⋅0.05 m0.5 mm⋅35 μm=49.1 mΩ,ΔV=2 A⋅49.1 mΩ=98 mVLSB=3.3 V4096=0.806 mV  ⇒  98 mV0.806 mV=122 LSBi=C dvdt=1 pF⋅5 V2 ns=2.5 mA\begin{aligned} R &= \frac{\rho L}{w t} = \frac{1.72 \times 10^{-8}\ \Omega\,\text{m} \cdot 0.05\ \text{m}}{0.5\ \text{mm} \cdot 35\ \mu\text{m}} = 49.1\ \text{m}\Omega, \qquad \Delta V = 2\ \text{A} \cdot 49.1\ \text{m}\Omega = 98\ \text{mV} \\ \text{LSB} &= \frac{3.3\ \text{V}}{4096} = 0.806\ \text{mV} \;\Rightarrow\; \frac{98\ \text{mV}}{0.806\ \text{mV}} = 122\ \text{LSB} \\ i &= C\,\frac{dv}{dt} = 1\ \text{pF} \cdot \frac{5\ \text{V}}{2\ \text{ns}} = 2.5\ \text{mA} \end{aligned}

Check: 122 LSB is about 3 % of full scale from one trace, which is why motor and sensor returns must never share copper. The 2.5 mA spike gives 250 mV across a 100 Ω100\ \Omega node but nearly half a volt on a high-impedance node with 10 pF to ground: separation and low impedance both help.

python · try it yourself
import numpy as np

rho_cu = 1.72e-8                     # copper resistivity at 20 C, ohm m
t = 35e-6                            # 1 oz/ft^2 copper foil
def trace_R(length, width):
    return rho_cu * length / (width * t)

R = trace_R(0.05, 0.5e-3)
print(f"50 mm x 0.5 mm trace, 35 um copper: {R * 1e3:.1f} mOhm")
print(f"2 A of motor current through it: {2 * R * 1e3:.0f} mV of ground shift")
print(f"in LSBs of a 12-bit, 3.3 V ADC: {2 * R / (3.3 / 4096):.0f}")

# Magnetic pickup: a 50 Hz field of 10 uT through a loop of area A
B, f = 10e-6, 50.0
for A_cm2 in [100, 10, 0.1]:
    v = 2 * np.pi * f * B * A_cm2 * 1e-4
    print(f"loop {A_cm2:6.1f} cm^2: {v * 1e6:7.2f} uV peak induced")

# Capacitive pickup: 1 pF from a 5 V, 2 ns digital edge
C, dV, tr = 1e-12, 5.0, 2e-9
i = C * dV / tr
print(f"1 pF coupling: {i * 1e3:.1f} mA during the edge")
print(f"  into a 100 Ohm node (RC << edge): {i * 100 * 1e3:.0f} mV spike")
Cnode = 10e-12                       # a 10 k node with 10 pF to ground: RC = 100 ns >> edge
print(f"  into a 10 k node with 10 pF: about {dV * C / (C + Cnode) * 1e3:.0f} mV (capacitive divider)")
50 mm x 0.5 mm trace, 35 um copper: 49.1 mOhm
2 A of motor current through it: 98 mV of ground shift
in LSBs of a 12-bit, 3.3 V ADC: 122
loop  100.0 cm^2:   31.42 uV peak induced
loop   10.0 cm^2:    3.14 uV peak induced
loop    0.1 cm^2:    0.03 uV peak induced
1 pF coupling: 2.5 mA during the edge
  into a 100 Ohm node (RC << edge): 250 mV spike
  into a 10 k node with 10 pF: about 455 mV (capacitive divider)

A 10 μT10\ \mu\text{T} field at 50 Hz (a value found within some tens of centimetres of a mains transformer; the general public exposure guideline is far higher) induces 31 μV31\ \mu\text{V} in a 100 cm2100\ \text{cm}^2 loop, more than the 1.2 μV1.2\ \mu\text{V} noise budget of the amplifier in Noise in Analog Circuits. Shrink the loop by running the signal and its return together and the pickup falls in proportion.

Analog layout checklist

  1. One solid ground plane (on a four-layer board, layer 2), unbroken under analog signals. No traces routed through it.
  2. Place by current: power entry, switchers and motor drivers at one edge, the sensitive analog front end away from their current paths, the ADC between analog and digital with its ground pins straight to the plane.
  3. Decoupling capacitors at every supply pin, smallest closest, with vias at the pads.
  4. Keep high-impedance nodes short and small; guard picoamp inputs; keep feedback resistors right at the op-amp's input pin (stray capacitance on the inverting input erodes phase margin).
  5. Differential and Kelvin connections for low-level and current-sense signals; route the pair together.
  6. Clocks and switch nodes away from analog inputs, with ground between them; slow down edges that need not be fast.
  7. Filter every signal and supply that enters or leaves the board, at the connector.

Board-level practice continues in Engineering Design, Reliability & EE Capstones and the EMC course linked above.

Guided lab: see a ground loop and a shared return

Hand calculation. Your test lead's resistance (about 1010 to 30 mΩ30\ \text{m}\Omega for 30 cm of light wire) times the load current gives the expected shift.

Simulation. The netlist lab with your measured lead resistance.

What you would measure. From a bench supply at 12 V (current limit 1 A), run a 15 Ω15\ \Omega, 20 W power resistor (0.8 A) as the "motor" and a 1.5 V cell with a 1 kΩ1\ \text{k}\Omega resistor as the "sensor" (about 1.5 V). First connect both returns to one thin, 30 cm ground lead and measure the sensor voltage at the supply's minus terminal with a meter on its millivolt range: switching the load on should move the reading by roughly 0.8 A⋅20 mΩ=16 mV0.8\ \text{A} \cdot 20\ \text{m}\Omega = 16\ \text{mV} (your lead resistance sets the exact value; meter resolution about 0.1 mV0.1\ \text{mV}). Then give the load its own return wire to the supply terminal: the shift falls to a fraction of a millivolt. Finally, open a scope input with a 10x probe, wrap the probe lead into a large loop near (not on) a plug-in transformer adapter, and watch the 50 or 60 Hz pickup shrink as you twist the probe lead and ground lead together.

Hazards and safe setup. Low voltage and current-limited supply only. Do not open the adapter or touch its mains plug; keep it plugged into a normal socket and only bring the probe near its case. The power resistor gets hot.

Pitfalls

  • "Ground" on the schematic means one point. On the board it is a network with resistance and inductance; think about where each current flows.
  • Lifting a mains safety earth to cure hum. Never; break the loop at signal level instead.
  • Slots and splits under signal traces. They force return currents into large loops.
  • Decoupling capacitors placed "nearby" with long thin traces. A few millimetres of trace add nanohenries and undo the capacitor above a few megahertz.

Practice

  1. A 2 mm wide, 100 mm long trace in 35 μm35\ \mu\text{m} copper carries 3 A. What voltage drops along it?
  2. By what factor does magnetic pickup fall when a 20 cm220\ \text{cm}^2 loop is reduced to 0.5 cm20.5\ \text{cm}^2?
  3. Why does a guard ring at the input's own voltage stop leakage regardless of the board's surface resistance?
Answer
  1. R=1.72×10−8⋅0.1/(2×10−3⋅35×10−6)=24.6 mΩR = 1.72 \times 10^{-8} \cdot 0.1/(2 \times 10^{-3} \cdot 35 \times 10^{-6}) = 24.6\ \text{m}\Omega; 3 A⋅24.6 mΩ=74 mV3\ \text{A} \cdot 24.6\ \text{m}\Omega = 74\ \text{mV}.
  2. Pickup is proportional to the area: 20/0.5=4020/0.5 = 40 times smaller.
  3. Leakage current is the voltage across the leakage path divided by its resistance; the ring makes that voltage (nearly) zero, so no current flows into the input from the ring, and any leakage from other nodes is caught by the ring instead.

Test yourself

A sensor and a 2 A motor share a 50 mΩ50\ \text{m}\Omega ground trace. The ADC sees an extra…

  1. 2.5 mV2.5\ \text{mV}
  2. 25 mV25\ \text{mV}
  3. 100 mV100\ \text{mV}
  4. 1 V1\ \text{V}

At high frequency a return current on a board with a ground plane flows…

  1. along the shortest straight line between ground pins
  2. in the plane directly under the signal trace
  3. only through the decoupling capacitors
  4. uniformly over the whole plane

Above its self-resonant frequency a decoupling capacitor behaves like…

  1. a larger capacitor
  2. a resistor equal to its ESR
  3. an inductor (its ESL)
  4. an open circuit

The right cure for hum from a ground loop between two mains-earthed instruments is…

  1. remove the earth wire from one mains plug
  2. a differential or isolated input so the shield's voltage does not appear in series with the signal
  3. a longer cable
  4. a larger decoupling capacitor