Ode to the INA226 voltage/current sensor - Page 1
Forum section: electronics / projects

author: tooki
author_rank: Super Contributor
timestamp: August 04, 2017, 09:19:01 pm
content: So part ofProject Pimp My Cheap Lab PSUwas replacing the factory ICL7107-based panel meters with something better, both in precision and in update rate.Finding panel meters (both 7-segment as well as MCU-based with 1602 or graphical LCDs) with added precision is easy; finding them with good accuracy and high update rate is not, as it turns out. Many of them have stupid dead zones around zero, making them useless for low values. Most update at just 3x per second, which I find super annoying.I decided to see how a DIY solution might do, and came across the INA226 and ordered one. I'm floored. This little $4 chip has a voltage range of 0-36V with milllivolt resolution (i.e. 36000 counts or 5.5 digits) at a default (slowest/most accurate) measurement rate of 120Hz (or much higher with reduced accuracy). At that rate, using just 4-sample averaging, it remains within 3 counts of my Keithley 2015!! (For current, its range is +/-32,768 counts covering +/-81.92mV, the actual current range being determined by the value of the shunt resistor.) It outputs on I2C, and there are a few Arduino libraries for it.An Arduino Uno, with my crappy unoptimized code, can update a 1602 LCD at over 60Hz, more than enough to provide a responsive feel FAR more usable than the 3-per-second meters. (For fun, I wanted to see how fast an Arduino Due could update, but the INA226 library I'm using won't compile for ARM, and my programming skills are far too rudimentary to understand the problem and fix it.)Anyone else done any cool projects with this chip? (Or the other members of its family? TI seems to have a stable of related chips.)

author: DBecker
author_rank: Frequent Contributor
timestamp: August 04, 2017, 11:17:08 pm
content: A company I worked for often used dozens (*), sometimes over a hundred, on their development boards to monitor voltage and power on the different supply rails and to any external connections. They work great for debugging power draw issues, especially brief events.I hadn't considered using them as a panel meter front end. Their specs are good enough -- certainly better than the typical cheap ones.* Once you use over 16 devices, you need an I2C bus expander which complicates use.

author: Mr. Scram
author_rank: Super Contributor
timestamp: May 12, 2019, 05:04:14 pm
content: I'll have to remember this one. Very interesting!

author: David Hess
author_rank: Super Contributor
timestamp: May 12, 2019, 10:52:54 pm
content: The reason this chip is not used in general purpose panel meters is that it has no 50/60 Hz line rejection which would require support for a 100 millisecond conversion time. (1) This is also what ultimately limits the speed of general purpose panel meters although 10 updates per second is feasible if done correctly.(1) Or a much faster 16.6 or 20 millisecond conversion time if 50 or 60 Hz can be selected but this is still slower than this chip supports.

author: OwO
author_rank: Super Contributor
timestamp: May 13, 2019, 04:02:45 am
content: The big elephant in the room is the price. If a panel meter has a BOM cost of $20 (realistic if you drop $4 here and there on chips) it will retail for $100 which is too high for the market to bear.

author: mikerj
author_rank: Super Contributor
timestamp: May 13, 2019, 07:04:33 am
content: It's a nice device, though I wish there was an SPI option.

author: David Hess
author_rank: Super Contributor
timestamp: May 13, 2019, 05:35:01 pm
content: Given its intended application, I can see why they went with I2C instead of SPI. There are other similar dual channel ADCs which can be used if you want SPI.

author: tooki
author_rank: Super Contributor
timestamp: May 09, 2023, 09:06:22 pm
content: Quote from: mikerj on May 13, 2019, 07:04:33 amFYI, I just discovered, browsing the “digital power monitors” section on ti.com, that they do have a number of similar chips with SPI, like the INA239 and INA229.

author: PCB.Wiz
author_rank: Super Contributor
timestamp: May 09, 2023, 11:43:16 pm
content: Quote from: OwO on May 13, 2019, 04:02:45 amFair point, but notice the INA226 and better INA236 show as $0.950 / 1ku

author: SiliconWizard
author_rank: Super Contributor
timestamp: May 10, 2023, 12:54:03 am
content: I've used it to implement power (delivered to heater) monitoring on a soldering controller. Easy to use, works plenty fine.

author: newbrain
author_rank: Super Contributor
timestamp: May 10, 2023, 06:13:02 am
content: Quote from: tooki on August 04, 2017, 09:19:01 pmI use the INA226 in my small (0..20 V, 0..2 A) PSU, after trying with little success to use the ADC in a STM32F030.Current and voltage DAC and 20x4 LCD are also controlled by I2C, so that was an easy mod.Displayed resolutions are 10 mV and 10 mA,100% matching my Fluke 87V.