Author Topic: Ode to the INA226 voltage/current sensor  (Read 3548 times)

0 Members and 1 Guest are viewing this topic.

Offline tookiTopic starter

  • Super Contributor
  • ***
  • Posts: 11536
  • Country: ch
Ode to the INA226 voltage/current sensor
« on: August 04, 2017, 09:19:01 pm »
So part of Project Pimp My Cheap Lab PSU was 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.)
« Last Edit: August 04, 2017, 09:20:35 pm by tooki »
 
The following users thanked this post: rsjsouza, newbrain

Offline DBecker

  • Frequent Contributor
  • **
  • Posts: 326
  • Country: us
Re: Ode to the INA226 voltage/current sensor
« Reply #1 on: August 04, 2017, 11:17:08 pm »
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.
 
The following users thanked this post: tooki

Offline Mr. Scram

  • Super Contributor
  • ***
  • Posts: 9810
  • Country: 00
  • Display aficionado
Re: Ode to the INA226 voltage/current sensor
« Reply #2 on: May 12, 2019, 05:04:14 pm »
I'll have to remember this one. Very interesting!
 

Offline David Hess

  • Super Contributor
  • ***
  • Posts: 16620
  • Country: us
  • DavidH
Re: Ode to the INA226 voltage/current sensor
« Reply #3 on: May 12, 2019, 10:52:54 pm »
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.
 
The following users thanked this post: tooki

Offline OwO

  • Super Contributor
  • ***
  • Posts: 1250
  • Country: cn
  • RF Engineer.
Re: Ode to the INA226 voltage/current sensor
« Reply #4 on: May 13, 2019, 04:02:45 am »
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.
Email: OwOwOwOwO123@outlook.com
 
The following users thanked this post: tooki

Offline mikerj

  • Super Contributor
  • ***
  • Posts: 3240
  • Country: gb
Re: Ode to the INA226 voltage/current sensor
« Reply #5 on: May 13, 2019, 07:04:33 am »
It's a nice device, though I wish there was an SPI option.
 

Offline David Hess

  • Super Contributor
  • ***
  • Posts: 16620
  • Country: us
  • DavidH
Re: Ode to the INA226 voltage/current sensor
« Reply #6 on: May 13, 2019, 05:35:01 pm »
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.
 

Offline tookiTopic starter

  • Super Contributor
  • ***
  • Posts: 11536
  • Country: ch
Re: Ode to the INA226 voltage/current sensor
« Reply #7 on: May 09, 2023, 09:06:22 pm »
It's a nice device, though I wish there was an SPI option.
FYI, 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.
 

Online PCB.Wiz

  • Super Contributor
  • ***
  • Posts: 1545
  • Country: au
Re: Ode to the INA226 voltage/current sensor
« Reply #8 on: May 09, 2023, 11:43:16 pm »
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.

Fair point, but notice the INA226 and better INA236 show as $0.950 / 1ku
 

Online SiliconWizard

  • Super Contributor
  • ***
  • Posts: 14481
  • Country: fr
Re: Ode to the INA226 voltage/current sensor
« Reply #9 on: May 10, 2023, 12:54:03 am »
I've used it to implement power (delivered to heater) monitoring on a soldering controller. Easy to use, works plenty fine.

 
The following users thanked this post: tooki

Offline newbrain

  • Super Contributor
  • ***
  • Posts: 1719
  • Country: se
Re: Ode to the INA226 voltage/current sensor
« Reply #10 on: May 10, 2023, 06:13:02 am »
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.)
I 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.
Nandemo wa shiranai wa yo, shitteru koto dake.
 
The following users thanked this post: tooki


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf