Current Sensing for Makers: Shunt Resistors, INA219/INA226, and ACS712 Hall-Effect Sensors
Voltage is easy to measure — a resistor divider and an ADC pin get you most of the way there. Current is a different problem: you either have to insert something into the circuit path and measure the tiny voltage it drops, or you have to measure the magnetic field the current creates without touching the conductor at all. Both approaches show up constantly in maker electronics — battery fuel gauges, solar charge controllers, 3D printer power monitoring, motor driver current limiting, and DIY power supplies all need to know how many amps are actually flowing. This guide covers the three current-sensing approaches you'll actually use: raw shunt resistors, the INA219/INA226 digital power monitor family, and ACS712-style Hall-effect sensors, along with when each one is the right tool.
Low-Side vs. High-Side Sensing
Before picking a sensing method, decide where the sense element goes in the circuit, because it changes what your measurement circuitry has to tolerate.
- Low-side sensing places the shunt between the load and ground. The sense voltage sits near 0V regardless of supply voltage, which makes the amplifier design trivial — but it means the load's ground reference is no longer true ground, it floats above real ground by the shunt drop. That's a problem if the load has its own ground-referenced connections (a USB port, a shared bus) elsewhere in the system.
- High-side sensing places the shunt between the supply and the load, so the load stays solidly grounded. This is usually what you want for battery-powered and multi-device systems, but it requires an amplifier that can handle a small differential signal riding on top of a much higher common-mode voltage — which is exactly what the INA-series parts are built for.
Method 1: Raw Shunt Resistor + Amplifier
The simplest current sensor is a low-value, high-precision resistor (a "shunt") in series with the load. By Ohm's law, the voltage across it is proportional to current. Shunts are typically sized to drop 50-100mV at full rated current — low enough to not waste significant power as heat, high enough to be measurable above noise.
The catch is that 50-100mV is too small for a microcontroller ADC to resolve with any precision on its own, so you need a differential or instrumentation amplifier ahead of it. This is the DIY path: pick a current-sense amplifier IC (INA138, INA180, or a differential op-amp configuration), size the shunt for your current range, and calibrate the gain in firmware. It's more work than a purpose-built module, but it's the cheapest and most flexible option, and it's the only practical way to measure very large currents (100A+) where dedicated modules run out of range.
Method 2: INA219 / INA226 — Digital Power Monitors
The INA219 and its more accurate successor the INA226 are complete solutions: they contain their own precision shunt-sensing amplifier, a 12 or 16-bit ADC, and an I2C interface that hands you current, bus voltage, and computed power directly — no external amplifier, no ADC calibration math in firmware. They're the standard choice for maker current-monitoring projects for exactly that reason.
INA219INA226 Resolution12-bit16-bit Bus voltage accuracy±1%±0.1% Max bus voltage26V36V Alert pinNoYes (programmable threshold) Typical useHobby projects, USB/5V-12V railsPrecision energy monitoring, higher-voltage battery packsBoth parts need an external shunt resistor (many breakout boards, like Adafruit's INA219 module, include one sized for a specific current range — typically 0.1Ω for up to 3.2A). If your project needs a different range, you can swap in a different shunt value and reprogram the calibration register; the datasheet's calibration formula looks intimidating but Adafruit and SparkFun's libraries handle it if you give them your shunt value and max expected current.
Because these are I2C devices, you can put several on one bus (the INA219 supports up to 16 addresses via A0/A1 pins) to monitor multiple rails or multiple battery packs from a single ESP32 or Raspberry Pi, which is a common pattern in multi-channel power monitoring builds.
Method 3: ACS712 — Hall-Effect Current Sensors
The ACS712 measures current without breaking the circuit or inserting a resistive element at all. Current flowing through an internal conductive path generates a magnetic field, which a Hall-effect sensor on the same die converts into a proportional analog output voltage centered around Vcc/2 (so it can read both positive and negative current for AC or bidirectional DC applications).
- Advantages: galvanic isolation between the sense path and your microcontroller isn't fully complete on the cheap breakout modules (the internal conductor is still part of the same board), but true optically-isolated Hall sensors exist for mains-adjacent work; no added series resistance/power loss; simple analog output any ADC pin can read.
- Downsides: lower accuracy than a well-calibrated shunt setup (typically ±1.5% of full scale, and that's before accounting for offset drift with temperature); the common 5A/20A/30A fixed-range variants mean you have to pick your range up front, unlike a shunt system you can rescale later; noisier output that usually needs firmware-side averaging.
- Best use: quick current sensing on 3D printer power supplies, motor current limiting on robotics projects, or anywhere you want a current reading without redesigning the power path — the ACS712 clips inline with almost no circuit changes.
Choosing Between Them
NeedBest Choice Precise energy/power logging (Wh, kWh over time)INA226 Simple hobby-grade current displayINA219 or ACS712 Very high current (50A+)Custom shunt + amplifier, or a CT-clamp based approach for AC Quick inline retrofit onto an existing supply lineACS712 Battery fuel gauge / coulomb countingDedicated fuel gauge IC (MAX17048, BQ27441) rather than a raw current sensorWiring and Firmware Tips
- Keep shunt and Hall-sensor wiring short and away from switching regulator inductors — both are sensitive to the same kind of EMI that plagues other low-level analog signals.
- For the INA219/226, always calibrate the register with your actual shunt value and expected max current rather than trusting library defaults blindly — a mismatched calibration constant produces confidently wrong numbers rather than an obvious error.
- For AC current, none of these three methods directly apply without additional signal conditioning (true RMS calculation, isolation) — that's a job for a current transformer (CT clamp) setup instead, which is a different sensing principle entirely.
- Always average multiple samples in firmware before displaying or logging a current reading; a single raw sample on any of these methods will show more noise than actual signal.
Current sensing is one of those areas where the "right" answer depends entirely on how much precision you actually need and whether you can tolerate inserting resistance into the path. For most ESP32 and Arduino projects, an INA219 or INA226 breakout gets you accurate, calibrated, digital current readings with almost no design work, and it's the sensible default unless you have a specific reason — very high current, or a need for full galvanic isolation — to reach for a shunt-and-amplifier build or a Hall-effect module instead.
Related Guides
- How to Use Sensors with Arduino and ESP32: Temperature, Distance, Load, Current, and Hall Effect
- Battery Fuel Gauge ICs for Lithium Projects: MAX17048, BQ27441, and Coulomb Counting Explained
- How to Program Addressable LED Strips: WS2812B Patterns, Effects, and Power Design
- I2C vs SPI vs UART: How to Choose and Use Serial Communication Protocols
- How to Control Motors with Arduino and ESP32: Stepper, DC, and Servo Drivers
- ESP32: Setting Up for Arduino IDE
- Arduino vs ESP32: Which Should You Use? A Practical Comparison
- Getting Started with ESP32: GPIO, WiFi, and Your First Project