If you want a microcontroller to know how much current a circuit is drawing, the simplest route is a digital current monitor: a small chip that measures the voltage across a shunt resistor, measures the supply voltage, and reports both over I2C. Two parts from Texas Instruments dominate this job in hobby and professional designs alike. The INA219 came first and made the idea popular. The INA226 followed with better accuracy, finer resolution and a higher voltage rating.

On a breakout board they look much the same, and the code to read them is similar. The differences are in the numbers, and those numbers decide whether your measurement is good to a few milliamps or a few hundred microamps. This article compares the two parts in detail and gives clear guidance on which to use for common applications.

How both parts work

Each device contains an analog-to-digital converter that alternates between two measurements. The first is the small differential voltage across an external shunt resistor placed in series with the load. By Ohm’s law that voltage is proportional to the current. The second is the bus voltage, measured from the load side of the shunt to ground.

The results are stored in registers that the host reads over I2C. If you program a calibration register with a value based on your shunt resistance, the chip also calculates current in amps and power in watts internally, so the host does not need to do the arithmetic.

Both parts can sense on the high side, with the shunt between the supply and the load, or on the low side, with the shunt between the load and ground. High-side sensing is usually preferred because it leaves the load’s ground undisturbed and can detect a short from the load to ground.

Specifications side by side

FeatureINA219INA226
Bus voltage range0 to 26 V0 to 36 V
ADC resolution12 bits16 bits
Shunt voltage rangePlus or minus 40, 80, 160 or 320 mV, selectablePlus or minus 81.92 mV, fixed
Shunt voltage step10 microvolts2.5 microvolts
Bus voltage step4 mV1.25 mV
Gain error (maximum)1 percent for the A grade, 0.5 percent for the B grade0.1 percent
Offset voltage (maximum)Tens of microvolts to about 100 microvolts, depending on grade and range10 microvolts
Alert outputNoYes, programmable
AveragingUp to 128 samplesUp to 1,024 samples
I2C addresses1616
Supply voltage3.0 to 5.5 V2.7 to 5.5 V
Supply current (typical)About 0.7 mAAbout 0.33 mA
PackagesSOT23-8, SOIC-8VSSOP-10

Take these as headline figures and confirm them against the current datasheets.

Bus voltage range

The INA219 measures buses up to 26 V. That covers 5 V, 12 V and 24 V nominal systems, but a 24 V rail can exceed 26 V during charging or transients, which leaves little margin. The INA226 measures up to 36 V, which comfortably covers 24 V industrial supplies, 6-cell and 7-cell lithium packs and 28 V systems.

See also  Pantry Pests: Why Moths and Beetles Turn Up in Dry Food

In both parts the bus voltage rating is independent of the chip’s own supply. A device powered from 3.3 V can still monitor a 24 V rail.

Neither part suits 48 V systems. For those, newer members of the same product line are rated to 85 V.

Resolution

This is the largest practical difference. The INA219 uses a 12-bit converter with a shunt step of 10 microvolts. The INA226 uses a 16-bit converter with a step of 2.5 microvolts.

What that means in current depends on the shunt. With the 0.1 ohm resistor fitted to most breakout boards:

  • INA219: 10 microvolts across 0.1 ohm is 100 microamps per step.
  • INA226: 2.5 microvolts across 0.1 ohm is 25 microamps per step.

With a 2 milliohm shunt for a 30 A system:

  • INA219: 5 mA per step.
  • INA226: 1.25 mA per step.

The INA226 resolves four times finer for the same shunt. Looked at another way, it can use a shunt a quarter of the size for the same resolution, which cuts the power wasted in the shunt by the same factor.

The bus voltage reading follows the same pattern: 4 mV steps for the INA219 against 1.25 mV for the INA226. For battery monitoring, where a few millivolts mean a meaningful change in state of charge, the finer step is useful.

Accuracy

Resolution tells you the smallest change the chip can report. Accuracy tells you how close the reading is to the truth. Two errors matter most.

Offset is the reading you get when the true shunt voltage is zero. It dominates at low currents. The INA226 has a maximum offset of 10 microvolts. The INA219’s offset is several times larger, and varies with grade and gain setting. With a 0.1 ohm shunt, 10 microvolts of offset is 100 microamps of error, while 50 to 100 microvolts is 0.5 to 1 mA. If you are measuring the sleep current of a low-power device, that difference is decisive.

Gain error is a percentage error that scales with the reading. It dominates at high currents. The INA226 is specified at 0.1 percent maximum. The INA219 is 1 percent for the A grade and 0.5 percent for the B grade.

In both cases, the shunt resistor adds its own tolerance and temperature drift. A 1 percent shunt wastes most of the INA226’s advantage. To get the benefit of the better chip, fit a 0.1 or 0.5 percent shunt with a low temperature coefficient.

Shunt voltage range and gain

The INA219 has a programmable gain amplifier with four full-scale ranges, from 40 mV to 320 mV. The widest range allows a larger shunt voltage, which was useful for getting adequate resolution from a 12-bit converter. The cost is more power lost in the shunt.

See also  Select Suitable Copper Grades for Your Copper CNC Machining Projects

The INA226 has one fixed range of plus or minus 81.92 mV. Because the converter has 16 bits, that single range gives finer resolution than any INA219 setting. It also simplifies setup, since there is no gain to choose. The design rule is to pick a shunt that produces no more than about 80 mV at your maximum current.

The alert pin

The INA226 has an alert output that the INA219 lacks. It can be programmed to assert on one of several conditions: shunt voltage over or under a limit, bus voltage over or under a limit, or power over a limit. It can also signal that a conversion is ready.

This allows hardware-level protection. The alert pin can interrupt the microcontroller, or drive a load switch directly, when current exceeds a threshold, without waiting for software to poll the device. It is also the efficient way to read data: wait for the conversion-ready signal, then fetch the result.

With the INA219, the host has to poll and compare in software.

Conversion time and averaging

Both parts let you trade speed for noise. The INA219 offers conversion settings from 9 to 12 bits and averaging of up to 128 samples. The INA226 offers conversion times from 140 microseconds to about 8.2 milliseconds per measurement, set independently for shunt and bus voltage, and averaging from 1 to 1,024 samples.

With long conversion times and heavy averaging, the INA226 gives very stable readings of a fluctuating load, which is what you want for energy measurement. With short conversion times it can follow faster changes. The INA226 also has strong rejection of common-mode voltage, which helps when the bus is noisy.

Power consumption

The INA226 draws roughly half the supply current of the INA219 in normal operation, and both have a power-down mode that reduces current to a microamp or less. In a battery-powered data logger that measures once a minute, either can be put to sleep between readings, and the INA226 uses less charge while awake.

Packages and layout

The INA219 comes in SOT23-8 and SOIC-8 packages. The SOIC version is easy to solder by hand. The INA226 comes in a 10-pin VSSOP with 0.5 mm lead pitch, which is small but still leaded and manageable with a fine iron tip.

The two parts are not pin-compatible, so you cannot swap one for the other on an existing board.

For both, the connection to the shunt is the critical part of the layout. Use a Kelvin connection: route two separate sense traces from the inside edges of the shunt pads to the chip, and do not let load current flow through any part of the sense path. Route the pair close together. Without this, the resistance of solder and copper is added to the shunt and the reading is wrong by a few percent.

Software differences

The register maps are similar in spirit but not identical. Both have configuration, shunt voltage, bus voltage, power, current and calibration registers. The INA226 adds mask and alert-limit registers, plus manufacturer and die identification registers that let software confirm which chip is present.

See also  Building Wealth With Purpose: A Smarter Way to Plan Your Financial Future in California

The calibration formulas use different constants. For the INA226, the calibration value is 0.00512 divided by the product of the current step and the shunt resistance, and the power step is 25 times the current step. For the INA219 the constants are 0.04096 and 20. The bus voltage register is also formatted differently: the INA219 result must be shifted to discard status bits, while the INA226 result is used directly.

Libraries exist for both on every common platform. Porting application code between them is a matter of changing the driver.

Which should you choose?

Battery packs and chargers. The INA226 is the better fit. The 36 V range covers more pack configurations, the bus voltage step is finer, and the low offset gives accurate readings at low charge and discharge currents.

Solar charge controllers. Panel voltages often exceed 26 V in open circuit. Use the INA226 for anything above a 12 V nominal panel.

Low-power device profiling. Measuring microamp-level sleep currents and milliamp-level active currents with one shunt needs low offset and fine resolution. Use the INA226.

Bench instruments and power supplies. Accuracy sells instruments. Use the INA226 with a precision shunt.

Simple monitoring on 5 V and 12 V rails. If you only need to know whether a motor, LED strip or USB device is drawing roughly the right current, the INA219 does the job at lower cost and in an easier package.

Education and quick prototypes. The INA219 has the largest collection of tutorials. It is a fine starting point, and moving to the INA226 later is straightforward.

Overcurrent protection. If you want a hardware alert without polling, use the INA226.

Buying the INA226

The INA226 is sold in the VSSOP-10 package under order codes that differ by reel size. The large-reel code is the INA226AIDGSR, which is listed by Verified Electronics, an electronic components distributor that carries Texas Instruments parts and uses third-party testing. A small-reel code with a T suffix contains the same device. An automotive-qualified version is also available for vehicle designs.

Beyond these two

If neither part fits, the same product line offers options. Monitors rated to 85 V cover 48 V systems. Versions with an integrated shunt remove the need for an external resistor. A three-channel device monitors three rails with one chip. For most single-rail designs under 36 V, though, the choice is between the two parts covered here.

Frequently asked questions

Is the INA226 a drop-in replacement for the INA219? No. The package, pinout and register details differ. It needs a board change and a driver change.

Can either part measure current in both directions? Yes. Both report signed shunt voltage, so they measure charge and discharge current.

How many can share an I2C bus? Sixteen of either type, using the two address pins.

What shunt value should I use with the INA226? Choose one that gives up to about 80 mV at maximum current. For 10 A, that is 8 milliohms or less.

Do I need the B grade of the INA219? Only if you want its tighter accuracy. If accuracy matters that much, the INA226 is usually the better step.

Can they measure AC current? They are designed for DC and slowly varying currents. They are not suitable for mains-frequency waveform measurement.

Summary

The INA219 is a 12-bit, 26 V current monitor that is simple, inexpensive and well documented. The INA226 is a 16-bit, 36 V monitor with a quarter of the shunt voltage step, about a tenth of the gain error, much lower offset, a programmable alert pin and lower supply current. For rough monitoring on low-voltage rails the INA219 is sufficient. For battery systems, low-current measurement, instruments and anything that needs an alert output, the INA226 is the better choice, provided you pair it with a shunt resistor good enough to match it.

Leave a Comment