Ground Embedded KO Subscribe

Notes / Electronic Circuits

Current-sensing circuit: reading a few mV with an ADC

The small voltage across a shunt resistor is amplified and read by the ADC. Low side and high side, Kelvin connection, and offset handling.

GROUND EMBEDDED · NOTEElectronic Circuits 08Current-sense circuitsVCC 3.3V10kΩButtonMCUGPIOHIGH when released

The chain

Load currentShunt resistora few mΩAmplifiertens of timesRC filterADC
The path for reading current. The few mV on the shunt are amplified to fit the ADC range.

Current → shunt resistor → tens of mV → amplifier (10 to 50×) → RC filter → ADC

Example: 10 A maximum, 5 mΩ shunt → 50 mV. A gain of 20 makes it 1 V. For both directions, add a 1.65 V offset to get 0.65 to 2.65 V, inside the 3.3 V ADC range.

Low side and high side

Low sidebetween load and GNDSimple circuit, GND is liftedHigh sidebetween supply and loadDetects shorts, needs a special amplifier
Where to put the shunt.
Position Advantage Disadvantage
Low side (ground side) Simple, an ordinary op-amp works The load's ground is lifted; ground faults cannot be detected
High side (supply side) Load ground is kept; short circuits are detected Needs an amplifier for high common-mode voltage (INA240 and similar)

In a motor inverter the shunts go under each half-bridge (three low-side shunts) or in the phase output lines (in-line).

RoadmapSee where this note sits in Electronic Circuits→

What to observe on the PCB

  • Kelvin connection: take the traces to the amplifier directly from the shunt pads, separately from the trace carrying the large current, so the voltage drop of trace resistance is not mixed in.
  • Route the two amplifier input traces side by side so they pick up the same noise.

Software calibration

At power-up, with zero current, average the ADC value several times, store it as the offset and subtract it from later values.

FREE PDFGet the 3 free ebooksIf you want to keep reading this topic as one book: BLDC motor control, serial communication and sensors at book length. PDFs are in Korean.Get them free →