Measuring Current with the INA3221 and ACS758

A microcontroller can tell you that a motor is spinning or that an LED is lit, but it can't tell you what that's costing in amps unless something in the circuit is actually watching the current. Measuring current turns three common guessing games into arithmetic: how long a battery pack will actually last under real load, whether a motor has stalled or jammed (stall current spikes well above running current on almost every DC motor), and whether a multi-peripheral build — a handful of sensors, a display, a radio module, all sharing one 5V rail — is about to exceed what the power supply can deliver. The two chips in this article take different physical routes to that same number: the INA3221 senses current indirectly through a shunt resistor's voltage drop, and the ACS758 senses it directly through the magnetic field the current itself generates.

Why would a project need to measure current?

Voltage alone rarely tells you whether a circuit is healthy. A battery can sit at a comfortable voltage while still being seconds from cutting out because it can't source the current a motor is momentarily demanding. Current measurement closes that gap in three practical ways:

  • Battery life estimation — multiplying measured current draw by battery capacity (in mAh) gives a real runtime estimate instead of a datasheet guess, and lets you catch a component that's silently drawing far more than expected.
  • Detecting motor stall or overcurrent — a motor under normal load draws a fairly steady current; a jammed gear, a stalled rotor, or a short in the winding shows up as a sharp current spike that a firmware watchdog can catch before it damages the driver or the battery.
  • Power budgeting for multi-peripheral builds — when several sensors, a display, and a radio module all share one regulator, summing their individual current draws (or measuring the total rail current directly) tells you whether the power supply has headroom or is already at its limit.

INA3221 vs ACS758: which current sensor should you use?

Both chips answer "how much current is flowing," but they're built for different jobs and read out over different interfaces.

The INA3221 is a 3-channel, I2C current/voltage/power monitor. It measures current indirectly: you place a small, precise shunt resistor in series with the load, and the INA3221 reads the tiny voltage drop across that shunt (plus the bus voltage) with an internal precision amplifier and ADC, then reports current, voltage, and power over I2C for all three channels independently. Because it's shunt-based, it's well suited to monitoring smaller, lower currents across multiple rails at once — for example, watching the 3.3V, 5V, and battery rails of the same project simultaneously from two I2C wires.

The ACS758 is a Hall-effect current sensor IC from Allegro MicroSystems. Instead of a shunt, it has the current-carrying conductor built directly into the package; the chip senses the magnetic field that current generates as it passes through, and outputs an analog voltage proportional to that field. It's a single-channel device with no I2C bus — you read it on an analog input pin. Because it doesn't insert a resistive shunt into the current path, it adds essentially no extra resistance to the circuit, which is why Hall-effect sensors in this family are the more common choice for higher currents, like motor loads, where a shunt would waste power as heat.

In short: reach for an INA3221-style I2C shunt monitor when you want precise, multi-channel monitoring of modest currents on several rails at once, and reach for an ACS758-style Hall-effect sensor when you're measuring one higher-current path — a motor, a battery pack under load — without wanting to add series resistance to it.

How do you wire a current sensor to an Arduino Uno?

The two families wire up differently because they measure differently.

An I2C shunt-based monitor like the INA3221 needs four connections, shared with any other I2C device on the bus:

  • VCC on the module → 5V on the Uno
  • GND on the module → GND on the Uno
  • SDA on the module → A4 on the Uno
  • SCL on the module → A5 on the Uno

The load itself is wired in series through the shunt input terminals of the module (typically labeled IN+ and IN-, or VIN+/VIN-), not through the Arduino at all — the Arduino only reads the measurement over I2C.

A Hall-effect analog sensor in the ACS758/ACS712 family wires up differently, with power pins to the Arduino and the load current passed through the sensor's own conductor path:

  • VCC on the module → 5V on the Uno
  • GND on the module → GND on the Uno
  • OUT on the module → an analog input pin on the Uno (for example, A0)
  • The current path being measured (the load's supply wire) is routed in series through the sensor's IP+ and IP- terminals — not through any Arduino pin

In both cases, the measurement path (the wire actually carrying the current you care about) and the signal path (the wires talking to the Arduino) are separate. Only three or four low-current wires ever touch the Uno; the load current itself flows through the sensor, not through the microcontroller.

What's a shunt resistor and why does it matter for accuracy?

A shunt resistor is a low-value, high-precision resistor placed deliberately in series with a current path so it can be measured. Ohm's law makes the conversion straightforward: the voltage dropped across a known resistance is proportional to the current flowing through it (V = I × R), so measuring that voltage drop — usually just a few millivolts to a few hundred millivolts — and dividing by the known resistance yields the current. This is exactly what an INA3221 does internally: it amplifies that small voltage drop with a precision differential amplifier before digitizing it, which is why shunt-based monitors like the INA3221 can resolve small currents accurately.

Three things determine how accurate a shunt-based measurement ends up being: the shunt resistor's own tolerance (a resistor that's off by 1% puts a 1% error floor on every reading regardless of how good the amplifier is), its power rating (the shunt dissipates I²R as heat, so a resistor rated too low will overheat or drift at higher currents), and the resolution of whatever is reading the voltage drop. A Hall-effect sensor like the ACS758 sidesteps the shunt entirely — it has no added series resistance and no I²R heating penalty — which is precisely why it scales better to higher currents, at some cost in the fine-grained precision a well-chosen shunt and amplifier combination can achieve at low currents.

Watch it built live

We ran this exact request through Compoden's AI shopping assistant at compoden.com: "I want to measure electrical current and power using an INA3221 or ACS758 current sensor with an Arduino Uno." Naming both chips by their exact model numbers routed the request to a generic board-buying reply rather than a build — the assistant answered: "Use for learning electronics, prototyping IoT devices, and automation projects.
Here are the 5 we stock:
- Arduino Uno R3 — Rs.1850 (official)
- Arduino Uno R3 CH340G ATmega328P Board — Rs.230 (clone)
- Arduino Uno R3 CH340G — Rs.280 (clone)
- Arduino Uno R3 Compatible Development Board (ATmega328P DIP) — Rs.420 (compatible)
- Arduino Starter Kit with Sensors & Modules — Rs.781 (compatible) To use it you'll also need a USB Type-B cable — add it?"
No current sensor was carded in that first reply.

We followed up describing the same goal by outcome instead of part number: "I want to build a circuit that monitors current draw on multiple power rails with my Arduino Uno, without breaking the circuit with a shunt if possible." That phrasing routed correctly to a build. The assistant replied: "This build lets you monitor the electrical current flowing through three separate power lines using an Arduino Uno R3 CH340G ATmega328P Board. The board reads signals from three ACS712ELCTR-05B-T current sensors, which detect current without needing to break the circuit." The screenshot below is the real build tray from that second exchange.

Compoden AI shopping assistant build tray for a current-sensing Arduino Uno project

To be transparent about the substitution: Compoden does not currently stock a component listed under the exact names INA3221 or ACS758. Both are real chips this article discusses conceptually, but the parts the assistant actually carded — and the parts in the table below — are the closest in-stock equivalents: the ACS712ELCTR-05B-T, a Hall-effect current sensor from the same family and the same non-invasive measurement principle as the ACS758, rated for lower current (±5A) than a typical ACS758. Separately, we confirmed via the catalog that Compoden does stock an INA219 — the single-channel sibling in Texas Instruments' same shunt-based, I2C current/power-monitor family as the INA3221 — for anyone who specifically wants the shunt-based approach described above rather than the Hall-effect build shown here.

Watch the firmware get generated

Separately, we ran the firmware request through Compoden's VoltIQ build tool: "I'm using a current sensor (INA3221 or ACS758) with an Arduino Uno to measure current draw. Write firmware to read the current value and print it to the serial monitor." The build log matched the same ACS712ELCTR-05B-T sensor and reported "Checking the catalog — 4/4 matched." Its explanation of the approach: "You've got an ACS712ELCTR-05B-T current sensor, which is an analog output sensor. The Arduino Uno's analog input pins are perfect for reading its voltage output, which directly corresponds to the current. I'll use analog pin A0 for the sensor input and print the current in Amperes to the serial monitor at 9600 baud."

VoltIQ firmware editor showing generated Arduino code for an ACS712 current sensor

The generated source read the sensor as a straightforward analog input, with the math for converting the raw ADC reading into amps spelled out directly in code comments:

// ACS712ELCTR-05B-T Current Sensor
// Wiring:
// ACS712 VCC -> Arduino 5V
// ACS712 GND -> Arduino GND
// ACS712 OUT -> Arduino A0
#define ACS712_PIN A0 // Analog input pin for ACS712 output

// ACS712ELCTR-05B-T is a 5A sensor.
// Sensitivity for ACS712-05B is 185 mV/A.
// Arduino's ADC is 10-bit (0-1023) over 5V (0-5000mV).
// So, 1 ADC unit = 5000mV / 1024 = ~4.88mV.
// Current (A) = (ADC_reading * ADC_unit_mV - VCC/2) / Sensitivity_mV_per_A
// For 5V Arduino, VCC/2 is 2500mV (at no current, output is VCC/2).
// The sensor output is ratiometric, so the zero current output is VCC/2.

One honest caveat worth repeating rather than hiding: the build tool flagged its own wiring/firmware mismatch before letting us flash anything — "Before you flash this — 1 hardware issue I could not fix automatically: the firmware does not use the pin we assigned to ACS712ELCTR-05B-T (2). The wiring diagram is generated from that assignment, so the schematic and the code will disagree — rewire to 2 or regenerate both together." The wiring step had assigned digital pin 2, while the firmware it generated used analog pin A0. It called the mismatch out explicitly and offered to regenerate rather than shipping a silent disagreement — a reminder to always cross-check a generated wiring diagram against the actual pin referenced in the code before wiring anything up.

Get everything in this build

Part Role Price Buy
Arduino Uno R3 CH340G ATmega328P Board Microcontroller board Rs.230 Add to cart
ACS712ELCTR-05B-T Current Sensor Module (×3, one per rail) Current sensor (Hall-effect) Rs.285 Add to cart
23 AWG Multi-Strand Breadboard Wire Hookup wire Rs.10 Add to cart
Male-to-Male Breadboard Jumper Wires (20 cm, 24 AWG) Wiring Rs.40 Add to cart
5V 2A Micro-USB Power Adapter Power supply Rs.140 Add to cart
Total Rs.705 Add all to cart

For anyone who wants the shunt-based, multi-channel I2C approach described earlier instead of the Hall-effect build above, Compoden separately stocks an INA219 Bi-Directional Current Sensor I2C Module at Rs.100 — the single-channel sibling in the same TI current/power-monitor family as the INA3221.

Built and Backed by Compoden

Every part in the table above is a real, currently stocked listing on compoden.com, checked directly against the live catalog rather than assumed from a chat reply. Compoden ships Arduino-compatible boards, sensors, and prototyping accessories across India, and the AI build tools referenced in this article — the storefront assistant and the VoltIQ firmware generator — are the same tools available to any customer building this project today. Where naming the exact chip by model number didn't route to a build on the first try, we've said so directly, along with exactly what did work.

Frequently asked questions

What's the difference between the INA3221 and the ACS758?
The INA3221 is a 3-channel I2C current/voltage/power monitor that measures current indirectly through the voltage drop across an external shunt resistor. The ACS758 is a single-channel Hall-effect sensor that measures current directly from the magnetic field it generates, with no shunt and no added series resistance.

Which one should I use for a motor project?
A Hall-effect sensor in the ACS758/ACS712 family is generally the better fit for motor loads — it doesn't add resistance to the current path, so it doesn't waste power as heat at higher currents the way a shunt would.

Does Compoden stock the exact INA3221 or ACS758?
Not under those exact part names at the time of writing. Compoden stocks the INA219 (the single-channel sibling in the same TI shunt-based I2C family as the INA3221) and the ACS712 (a lower-current sibling in the same Allegro Hall-effect family as the ACS758), both of which use the same measurement principles described in this article.

Do I need to calibrate a Hall-effect current sensor?
Yes. Its output is ratiometric to the supply voltage, meaning zero current reads as roughly half the supply voltage rather than zero volts — the generated firmware in this article accounts for that midpoint before converting the reading into amps.

Back to blog