Electronics Design AU
SensorsAnalog

How Do You Measure Current with a Shunt Resistor?

Last updated 27 June 2026 · 8 min read

Direct Answer

A shunt resistor converts current into a small differential voltage by Ohm's law: Vshunt = I × R_shunt. Typical shunt values are 1–100 mΩ to minimise power loss while keeping the voltage measurable. A differential amplifier or dedicated current-sense amplifier (INA219, INA226) amplifies this small signal before an ADC reads it. High-side sensing (shunt between the supply and the load) measures total load current without disturbing the load's ground reference — required for multi-load circuits and battery monitoring. Low-side sensing (shunt between load and GND) is simpler but shifts the load's ground potential. The INA219 (12-bit, I2C, up to 3.2 A with 0.1 Ω shunt) and INA226 (16-bit, I2C, alert function) are the most common integrated solutions — they include the differential amplifier, ADC, and I2C interface in one IC.

Detailed Explanation

Current measurement is fundamental to power management, motor control, battery state estimation, and fault detection. Shunt-resistor-based sensing is the most common method in embedded electronics: it is inexpensive, bidirectional (detects current flowing in either direction), and achieves low drift compared to Hall-effect alternatives.

The Physics: Ohm's Law as a Current-to-Voltage Converter

A shunt resistor uses the simplest possible relationship: V = I × R. A 10 mΩ shunt carrying 1 A develops 10 mV across it. A differential amplifier measures this small voltage and converts it to a larger signal for an ADC.

Power dissipation in the shunt: P = I² × R. At 10 A and 10 mΩ: P = 100 × 0.01 = 1 W. This must be dissipated through the PCB copper and the resistor package — use a low-value shunt (1–5 mΩ) for high-current designs, and verify that the PCB copper area surrounding the shunt provides adequate thermal path to ambient.

Voltage drop across the shunt: ΔV = I × R. At 10 A and 10 mΩ: ΔV = 100 mV. For a 3.3 V supply, this is a 3% voltage drop — typically acceptable. For battery-powered designs where minimum operating voltage is critical, minimise shunt resistance to maintain maximum usable voltage headroom.

Low-Side vs High-Side Current Sensing

Low-side sensing: Shunt resistor between the load's GND return and the system ground. The shunt is at near-GND potential, so a simple single-supply amplifier can measure the voltage. However, the load's ground reference is shifted by the shunt voltage (up to 100 mV) — this can cause ground-referenced loads to malfunction, and the measurement includes only the current path through that specific ground connection.

High-side sensing: Shunt resistor between the supply voltage and the load's positive terminal. Measures all current to the load. The shunt sits at the supply voltage level (3.3 V, 5 V, 12 V, or higher), which means the differential amplifier must reject a high common-mode voltage — a task that a standard single-supply op-amp cannot do without additional level-shifting circuitry. Dedicated current-sense amplifier ICs (INA219, INA226, MAX4080, INA282) are designed to handle high common-mode voltages up to 26–60 V while measuring a millivolt-level differential signal.

For most embedded designs, high-side sensing is preferred because:

  • It monitors all current to the load, not just one return path
  • It does not affect the load's ground reference
  • Battery current monitoring requires high-side (between the battery+ terminal and the rest of the circuit)

INA219 — 12-bit I2C Current and Power Monitor

The INA219 from Texas Instruments integrates a precision instrumentation amplifier, 12-bit ADC, and I2C interface in a single IC. It measures both shunt voltage and bus voltage and computes power (P = V × I) internally.

Key specifications:

  • Supply voltage: 3.0–5.5 V
  • Common-mode input range: 0–26 V (high-side up to 26 V bus)
  • Shunt voltage ADC: 12-bit (10-bit effective at fastest conversion rate), ±320 mV full-scale (selectable ±40/80/160/320 mV)
  • Bus voltage ADC: 12-bit, 0–32 V
  • I2C address: 0x40–0x4F (set by A1, A0 pins — allows 4 INA219s on one bus)

Hardware circuit:

V_supply ─── R_shunt ─┬── V_load (Load+)
                      │
            INA219 IN+ (shunt+)
            INA219 IN− (shunt−) ─── V_load after shunt
            INA219 VS ────── 3.3 V
            INA219 GND ──── GND
            INA219 SCL, SDA ──── I2C bus

Calibration register: The INA219 requires setting a calibration register to relate the raw shunt ADC reading to a current in milliamps. The calibration value is:

CAL = trunc(0.04096 / (Current_LSB × R_shunt))

where Current_LSB is the desired current resolution per ADC bit (e.g. 1 mA/bit for 1 mA resolution). For a 100 mΩ shunt with 1 mA/bit resolution:

CAL = trunc(0.04096 / (0.001 × 0.1)) = trunc(409.6) = 409

Write 409 to the Calibration register (0x05). Then reading the Current register (0x04) returns current in 1 mA/LSB units.

I2C reading example:

uint8_t buf[2];

// Write Calibration register
buf[0] = 0x01;  // High byte
buf[1] = 0x99;  // Low byte (409 = 0x0199)
i2c_write(INA219_ADDR, 0x05, buf, 2);

// Read Current register
i2c_read(INA219_ADDR, 0x04, buf, 2);
int16_t raw_current = (buf[0] << 8) | buf[1];
float current_mA = raw_current * 1.0f;  // 1 mA/LSB as calibrated above

INA226 — 16-bit I2C with Alert Function

The INA226 uses the same conceptual approach as the INA219 but with 16-bit ADC resolution and includes a configurable ALERT pin (open-drain) that can trigger an MCU interrupt when:

  • Shunt voltage exceeds over-current threshold
  • Bus voltage falls below under-voltage threshold
  • Bus voltage rises above over-voltage threshold
  • Power exceeds a maximum limit

This makes the INA226 suitable for designs that need autonomous over-current protection without polling the I2C bus — the MCU can sleep until the ALERT fires.

Maximum continuous shunt input voltage: ±81.92 mV (at ±2.5 mA/LSB LSB setting). For a 10 mΩ shunt, this limits full-scale current to ±8.2 A. For higher currents, use a lower-value shunt (1 mΩ) to keep Vshunt within range.

For a complete implementation guide covering the INA219 and INA226 configuration register, ALERT pin setup, I2C address selection, and bring-up code examples, see INA219 and INA226 I2C current-sense ICs.

Discrete Op-Amp Current Sensing

For designs without a dedicated current-sense IC, a precision instrumentation amplifier (INA128, AD8221) can amplify the shunt voltage. Set gain with the external resistor: G = 1 + 50kΩ/R_G for INA128.

Example: 10 mΩ shunt, 0–5 A range, Vshunt = 0–50 mV. Target output 0–3 V for a 3.3 V ADC. Required gain = 3,000 mV / 50 mV = 60 V/V. R_G = 50,000 / (60−1) = 847 Ω → use 845 Ω (E96 series).

This approach is lower cost at volume but requires more PCB area, careful PCB layout to match the diff-amp resistors, and an additional voltage reference for the output offset shift if measuring bidirectional current.

PCB Layout — Kelvin Connection

The shunt's sense connections (into the INA219/INA226 IN+ and IN−) must tap directly at the shunt resistor pads, not at a remote point on the power bus. On a 2-layer PCB, use a 4-pad Kelvin resistor package (or two separate pads with inner Kelvin tabs) and route the sense traces inward from the pads, away from the power current path:

Heavy copper power trace → [Pad 1]---[SHUNT BODY]---[Pad 2] → Heavy copper power trace
                               ↑                          ↑
                           Kelvin sense              Kelvin sense
                           trace to IN+              trace to IN−

Keep the Kelvin traces short and away from switched-mode power converter switching nodes, which generate millivolt-level noise that could corrupt the shunt measurement.

For power monitoring in switching power supply design, see how does a buck converter work? for the inductor current waveform that a shunt measurement must resolve, and inductor types and saturation current for why peak current matters in SMPS inductor selection.

For current measurement integration in a complete product — including shunt specification, PCB layout, and calibration — Zeus Design's electronics engineering team provides full power monitoring circuit design.

Design Considerations

  • Account for shunt resistance tolerance: Precision shunt resistors are available with ±0.1% tolerance and low TCR (< 50 ppm/°C). Standard 1% resistors can shift ±1% over the operating temperature range, adding directly to current measurement error. For measurement systems requiring < 2% total error budget, use a precision shunt or calibrate each unit.
  • Decouple the INA219/INA226 VS pin: Place a 100 nF + 10 µF ceramic close to the VS pin. The INA IC draws brief current spikes during I2C communication. Without adequate decoupling, these spikes can cause supply voltage dips that shift the internal reference voltage and corrupt the measurement.
  • Use ALERT interrupt rather than polling: Continuously polling the I2C current register at 10 Hz keeps the I2C bus occupied and prevents the MCU from sleeping below STOP mode (I2C DMA wake-up is possible but complex). Configuring the INA226's ALERT pin as an interrupt allows the MCU to sleep until an over-current condition occurs — better for both efficiency and latency.

Common Mistakes

  • Floating the IN+ and IN− pins: If no shunt resistor is installed (e.g. during board bring-up before the shunt is placed), the INA219/INA226 IN pins float. The device will read garbage current values, typically at maximum positive or negative range. Always verify the shunt is present before trusting readings from the current register.
  • Setting calibration for 1 A full-scale and then passing 5 A: The INA219's current register saturates at ±32,767 counts. If the calibration is set for 1 mA/bit (0–32.7 A range is fine), but 5 A flows and the shunt is 0.1 Ω (Vshunt = 500 mV, far beyond the ±320 mV ADC range), the shunt voltage ADC clips. Ensure the maximum shunt voltage at maximum current stays within the selected PGA gain setting (±40, ±80, ±160, or ±320 mV).
  • Ignoring bus voltage drop in battery designs: When monitoring battery discharge current with the shunt between the battery positive terminal and the load, the bus voltage reported by the INA219 is the load voltage, not the open-circuit battery voltage. The voltage across the shunt (up to 100 mV) means the measured bus voltage will be slightly lower than the actual battery terminal voltage. Account for this in state-of-charge calculations.

Frequently Asked Questions

What resistance value should I choose for a shunt resistor?
The shunt value is a trade-off between voltage drop (power loss and load regulation) and measurable signal level. Target a maximum Vshunt of 50–100 mV at full-scale current — this is large enough for an amplifier or ADC to measure accurately and small enough not to affect the load significantly. For a 5 A maximum current: R = 100 mV / 5 A = 20 mΩ. Power dissipation: P = I² × R = 25 × 0.020 = 0.5 W — use a resistor rated at least 1 W with adequate PCB copper area for heat dissipation. For high-current designs (10+ A), 1–5 mΩ shunts are common; at these values, a high-gain current-sense amplifier (e.g. INA282, 50 V/V gain) is needed to amplify the mV-level signal to a usable ADC input range.
What is a Kelvin (4-wire) connection for a shunt resistor and why does it matter?
A Kelvin connection uses separate force and sense connections to the shunt resistor's terminals. Without it, the resistance of the PCB traces between the measurement point and the resistor pads adds to the measured resistance — at milliohm shunt values, even 5 mΩ of PCB trace resistance (common on a typical 2-layer board) is 50% of a 10 mΩ shunt, causing a 50% measurement error. In a Kelvin connection: the force connections (power traces) carry the current; the sense connections (thin Kelvin traces) tap directly at the shunt pad ends and carry virtually no current into the amplifier's high-impedance input. Precision shunt resistors are manufactured with four terminals specifically for this purpose. On a PCB, the INA219/INA226's IN+ and IN− sense inputs must connect directly to the shunt pads, not to the power bus at a remote point.
Can I measure current from a microcontroller's onboard ADC instead of using an INA219?
Yes, with limitations. A direct ADC approach: connect the shunt differential voltage through a differential op-amp amplifier stage (see instrumentation amplifier), then to the MCU ADC input. For low-side sensing with a 10 mΩ shunt at 3 A (30 mV signal), an op-amp gain of ~100 produces 3 V — within the ADC's range. The challenges are: common-mode rejection (the ADC input must measure a small difference between two voltages that may be close to the supply rail, requiring a rail-to-rail or high common-mode range op-amp); gain accuracy (a 1% resistor network error adds directly to current measurement error); and no built-in over-range protection. The INA219/INA226 handle all these internally and include a precision voltage reference. For calibration-grade measurement (< 1% error), the integrated solution is almost always preferable over a discrete design.

References

Related Questions

Related Forum Discussions