---
title: Grounding, ground loops and differential measurement
heading: Where the hum comes from, and how to reject it
eyebrow: C11 · Lesson 17 · Grounding, ground loops and differential measurement
xp: 40
---

::: hook
Connect a grounded scope to a grounded circuit across the lab and a 50 Hz hum appears on every trace. Its source isn't the circuit: the two "grounds" are at slightly different voltages, because mains currents flow in the building's wiring, and the scope's cable shield connects them, closing a **ground loop**. The cure is not to cut the safety ground but to measure **differentially**: look at the difference between two points and reject whatever voltage they share. How well an instrument does that is its **common-mode rejection ratio**, and it decides whether microvolt signals can be measured on a noisy bench.
:::

::: play
- The measured trace is a 10 mV, 1 kHz signal plus whatever fraction of a 50 Hz common-mode voltage $V_{cm}$ leaks through, set by the measurement's CMRR.
- A single-ended scope measurement (CMRR about 0 dB) shows the hum at full size, swamping the signal. A differential amplifier with 60 dB CMRR cuts 1 V of hum to 1 mV.
- Raise the CMRR to 100 dB and the hum vanishes. The readout gives what's left of it.
:::
:::

```sim plot
view: graph
x: t = 0..40 ms
y: v = -0.1..0.1 V
slider: Vcm = 0..1 = 0.5 step 0.01 V
slider: CMRR = 0..100 = 40 step 1 dB
plot: 0.01*sin(2*pi*1000*t*1e-3) + Vcm*10^(-CMRR/20)*sin(2*pi*50*t*1e-3) | samples: 4000 | label: measured
plot: 0.01*sin(2*pi*1000*t*1e-3) | dashed | samples: 4000 | label: signal
readout: hum left, mV = 1000*Vcm*10^(-CMRR/20) | digits: 3
```

::: predict
## A differential amplifier with a CMRR of 60 dB measures a small signal riding on 1 V of common-mode hum. How much hum reaches the output (referred to the input)?

- [ ] 60 mV
- [ ] 10 mV
- [x] 1 mV
- [ ] 1 µV

::: reveal
1 mV: 60 dB is a factor of 1000 in voltage, so 1 V of common mode looks like 1 mV of differential signal. For a 10 mV measurement that's still a 10% error; strain gauges and thermocouples need 100 dB or more.
:::
:::

::: nameit
## Ground loops

When two pieces of equipment are each grounded through the mains and also joined by a cable shield, the shield and the building's ground wiring form a loop. Current from the ground potential difference, or induced by a changing magnetic field through the loop's area, flows in the shield, and its drop $IR_\text{shield}$ adds to the signal. A loop of area A in a field B oscillating at f picks up

$$V = 2\pi fBA$$

Remedies: a single ground point, short cables, twisted pairs (small loop area), and above all differential measurement. **Never** remove the safety ground from an instrument to break a loop: its chassis can then rise to mains voltage.

## Common-mode rejection

A voltage on both inputs at once is **common mode**; the difference is **differential**. A differential input rejects common mode by its CMRR:

$$V_\text{error} = V_{cm} \times 10^{-\text{CMRR}/20}$$

Instrumentation amplifiers (C6) reach 100 to 120 dB at low frequencies, less at high.

## Measuring across a floating component

To see the voltage across a component that isn't connected to ground (the high side of a motor driver, a current-sense resistor), use a **differential probe**, or two ordinary probes and the scope's A − B math. The second is limited by how well the two channels match: a 1% gain mismatch gives only about 40 dB of rejection.
:::

::: example
## A thermocouple signal of 2 mV sits on 5 V of common mode from a heater supply. What CMRR keeps the error below 1 µV?

::: solution
1. **Required rejection.** The error must be at most $10^{-6}$ V out of 5 V:
   $$\begin{aligned} \text{CMRR} &= 20\log_{10}\frac{5}{10^{-6}} \\ &= 134\ \text{dB} \end{aligned}$$
2. **In practice.** That's beyond most amplifiers at 50 Hz, so the design also needs isolation or filtering.

**Answer:** at least 134 dB.
:::
:::

::: example
## A 1 cm² loop of probe ground lead sits near a transformer with a 1 mT field at 50 Hz. How much does it pick up?

::: solution
1. **Induced voltage.**
   $$\begin{aligned} V &= 2\pi fBA \\ &= 2\pi \times 50 \times 10^{-3} \times 10^{-4}\ \text{V} \\ &= 31\ \mu\text{V} \end{aligned}$$
2. **Near a transformer.** Close to a power transformer the field can be ten times larger, which is why a probe's long ground lead picks up hum.

**Answer:** about 31 µV.
:::
:::

::: example
## A sensor's return current of 1 A shares 10 mΩ of ground wiring with a measurement. What error does that cause single-ended, and with a differential amplifier of 80 dB CMRR?

::: solution
1. **Single-ended.** The drop appears directly in the reading:
   $$1\ \text{A} \times 10\ \text{m}\Omega = 10\ \text{mV}$$
2. **Differential.** It becomes common-mode, attenuated by $10^{80/20} = 10^4$:
   $$\frac{10\ \text{mV}}{10^4} = 1\ \mu\text{V}$$
3. **Where to measure.** Measuring between the two ends of the sensor, rather than to a distant ground, removes the shared wiring from the signal path.

**Answer:** a 10 mV error single-ended, and 1 µV with the differential amplifier.
:::
:::

::: check
given: Vcm = 0.1 | 1 | 10; C = 40 | 60 | 90
answer: Vcm*10^(-C/20)*1e3
unit: mV
tolerance: 0.5%

## {Vcm} V of common mode reaches an input with {C} dB of CMRR. How much error does it cause?

::: right
Right. $V_{cm}10^{-\text{CMRR}/20}$ = {answer} mV.
:::

::: misses
- [Vcm*10^(-C/10)*1e3] CMRR in dB is a voltage ratio: divide by 20.
- [any] Not yet. $V_{cm} \times 10^{-\text{CMRR}/20}$.
:::
:::

::: check
given: Vcm = 1 | 10 | 230; e = 0.001 | 0.01 | 0.1
answer: 20*log(Vcm/(e*1e-3))
unit: dB
tolerance: 0.5%

## How much CMRR keeps {Vcm} V of common mode to under {e} mV of error?

::: right
Right. $20\log_{10}(V_{cm}/V_\text{error})$ = {answer} dB.
:::

::: misses
- [10*log(Vcm/(e*1e-3))] Voltages: 20 log.
- [any] Not yet. $20\log_{10}$ of the ratio.
:::
:::

::: check
given: I = 10 | 100 | 500; R = 0.005 | 0.05 | 0.5
answer: I*R
unit: mV
tolerance: 0.5%

## A ground loop drives {I} mA through a cable shield of {R} Ω. How much voltage does it add to a single-ended measurement?

::: right
Right. $IR$ = {answer} mV.
:::

::: misses
- [any] Not yet. Shield current times shield resistance.
:::
:::

::: check
given: f = 50 | 60; B = 0.1 | 1 | 5; A = 1 | 10 | 100
answer: 2*pi*f*B*1e-3*A*1e-4*1e6
unit: µV
tolerance: 0.5%

## A loop of {A} cm² sits in a {B} mT field at {f} Hz. How much voltage is induced?

::: right
Right. $2\pi fBA$ = {answer} µV.
:::

::: misses
- [f*B*1e-3*A*1e-4*1e6] Include 2π: the field's rate of change is ωB.
- [any] Not yet. $2\pi fBA$.
:::
:::

::: check
given: m = 0.1 | 1 | 5
answer: 20*log(100/m)
unit: dB
tolerance: 0.5%

## Two scope channels' gains differ by {m}%. About what CMRR does an A − B measurement achieve?

::: right
Right. $20\log_{10}(1/\text{mismatch})$ = {answer} dB.
:::

::: misses
- [any] Not yet. The mismatch fraction is what leaks through.
:::
:::

::: check
kind: choice

## A ground loop puts 50 Hz hum on a measurement. Which fix is unsafe?

- [ ] Using a differential probe
- [ ] Twisting the signal pair and shortening the cable
- [x] Removing the ground pin from the scope's mains plug
- [ ] Running the circuit from a battery

::: misses
- [1] Safe and effective.
- [2] Safe: it shrinks the loop area.
- [4] Safe: it removes the second ground connection.
:::
:::

::: check
kind: parts
given: V = 0.1 | 5 | 120; C = 60 | 80 | 100

## A differential amplifier with {C} dB CMRR sees {V} V of common mode.

::: part
answer: V/10^(C/20)*1e6
unit: µV
tolerance: 0.5%

### What error does that add?

::: misses
- [any] $V_{cm}/10^{CMRR/20}$.
:::
:::

::: part
answer: V/10^((C + 20)/20)*1e6
unit: µV
tolerance: 0.5%

### And with 20 dB more CMRR?

::: misses
- [any] Ten times smaller.
:::
:::
:::

::: check
kind: parts
given: B = 0.1 | 1 | 5; A = 1 | 10 | 50; f = 50 | 60

## A {A} cm² loop sits in a {B} mT field at {f} Hz.

::: part
answer: 2*pi*f*B*1e-3*A*1e-4*1e3
unit: mV
tolerance: 0.5%

### What peak voltage does it pick up?

::: misses
- [any] $2\pi fBA$.
:::
:::

::: part
answer: 2*pi*f*B*1e-3*A*1e-4*1e3/10
unit: mV
tolerance: 0.5%

### And with the loop area cut by ten (a twisted pair)?

::: misses
- [any] Pickup is proportional to area.
:::
:::
:::

::: explain
## Why does a differential measurement reject a ground loop's hum while a single-ended one doesn't?

::: model
The ground-loop voltage appears between the two instruments' grounds, so at the receiving end it's added equally to both the signal wire and its return: it's common mode. A single-ended input measures the signal wire against its own local ground, so the hum, being the difference between the two grounds, appears directly in the reading. A differential input measures the signal wire against the return wire from the source, and since the hum is on both, it cancels, leaving only a residue set by how perfectly matched the two inputs are, the CMRR.
:::
:::

::: practice

::: check
given: Vcm = 2 | 20; C = 80 | 100
answer: Vcm*10^(-C/20)*1e6
unit: µV
tolerance: 0.5%

## Error from {Vcm} V common mode at {C} dB CMRR?

::: misses
- [any] $V_{cm}10^{-\text{CMRR}/20}$.
:::
:::

::: check
given: I = 50 | 200; R = 0.02 | 0.1
answer: I*R
unit: mV
tolerance: 0.5%

## Hum from {I} mA in a {R} Ω shield?

::: misses
- [any] $IR$.
:::
:::

::: check
given: m = 0.1 | 0.2 | 0.5 | 1 | 2 | 5
answer: 20*log(100/m)
unit: dB
tolerance: 0.5%

## CMRR of A − B with {m}% gain mismatch?

::: misses
- [any] $20\log_{10}(100/m)$.
:::
:::
:::
