Author Topic: INA226 measurement offset/nonlinearity problems  (Read 1641 times)

0 Members and 1 Guest are viewing this topic.

Offline SaitamaTopic starter

  • Contributor
  • Posts: 40
  • Country: ge
INA226 measurement offset/nonlinearity problems
« on: November 11, 2025, 01:17:24 pm »
Hi all,

I’ve been working on a DIY battery tester/electronic load using an ESP32, TFT displays, and a few other fun toys. The core of the project is a current sink with a feedback loop and a digitally controlled setpoint. While I have a few ideas for design improvements (I admit I made a couple of questionable choices), my main headache right now is with the INA226 current measurements.

The Problem:
At low input voltages, say around 4 V on the PCB terminals, when I try to increase the current, the INA226 readings are lower than the actual current (verified with a DMM) and non-linear. The discrepancy grows as I increase the set current.

 -This issue appears above ~50 mA.
 -At higher voltages (around 18 V), the problem almost disappears.
 -Interestingly, the feedback loop setpoint vs actual current is very close—typically under ±0.5 mA.

So essentially, my load behaves as expected, but the INA226 seems to “under-report” current at low voltages.

Questions:

1. Has anyone seen the INA226 behave like this at low bus voltages under load?
2. Could this be related to the shunt voltage drop, I2C timing, or something else?
3. Any tips on stabilizing the readings or improving accuracy in this scenario?

I can share additional photos, wiring diagrams, code snippets  or the complete kicad project if needed. I’d really appreciate any guidance or similar experiences.

Thanks!
 

Offline mawyatt

  • Super Contributor
  • ***
  • Posts: 6173
  • Country: us
Re: INA226 measurement offset/nonlinearity problems
« Reply #1 on: November 11, 2025, 03:57:43 pm »
Do you see any stability issues with C1 working against R4? This creates a delay back to the op-amp inverting input, and maybe enough with the delay introduced in the Darlington to cause oscillations or some ringing.

Best
Curiosity killed the cat, also depleted my wallet!
~Wyatt Labs by Mike~
 
The following users thanked this post: Saitama

Offline SaitamaTopic starter

  • Contributor
  • Posts: 40
  • Country: ge
Re: INA226 measurement offset/nonlinearity problems
« Reply #2 on: November 11, 2025, 05:45:22 pm »
I admit I haven't thought of that. My thought process was that since the battery voltage is stable, no fast adjustments were needed and an RC low-pass would decrease noise/oscillations. I will certainly check this on the scope.

Also, forgot to mention above, Q1 is changed from 2n2222 to BD139
 

Offline mtwieg

  • Super Contributor
  • ***
  • Posts: 1821
  • Country: us
Re: INA226 measurement offset/nonlinearity problems
« Reply #3 on: November 13, 2025, 01:05:32 pm »
I've never used this specific part, but have used other various INA2xx current shunt amplifiers from TI. Generally they work as well as the datasheet suggests. But what you're describing definitely doesn't match the part's datasheet.

I agree with mawyatt about checking the stability of that opamp circuit. It's probably best to connect C1 between the opamp output and its inverting input, rather than from noninverting to gnd.

Testing with a benchtop power supply in place of the battery would probably be wise as well.
 
The following users thanked this post: Saitama

Offline Magnethicc

  • Contributor
  • Posts: 49
  • Country: il
Re: INA226 measurement offset/nonlinearity problems
« Reply #4 on: November 13, 2025, 02:27:05 pm »
why is the VBUS of INA226 is not connected to the battery + terminal?
 
The following users thanked this post: Saitama

Offline SaitamaTopic starter

  • Contributor
  • Posts: 40
  • Country: ge
Re: INA226 measurement offset/nonlinearity problems
« Reply #5 on: November 13, 2025, 07:24:07 pm »
Yeah, I too have had great success with INA amplifiers, so it's weird to have issues now. I'll try reconnecting C1 as you suggested, but I don't have my scope at the moment so it is a bit difficult to check stuff.
The initial tests were done on a benchtop power supply, I switched to a battery because my supply is a bit noisy and wanted to rule that out.
 

Offline SaitamaTopic starter

  • Contributor
  • Posts: 40
  • Country: ge
Re: INA226 measurement offset/nonlinearity problems
« Reply #6 on: November 13, 2025, 07:28:59 pm »
why is the VBUS of INA226 is not connected to the battery + terminal?
I haven't drawn in the schematic, but I wanted to have internal and external voltage sensing modes. From experience, banana/alligator cables drop significant voltage while drawing more than around an amp.
On this board, Vbus is routed to a connector. That connector is connected to a switch which either takes measurements from main banana posts or switches to 4 wire mode. It is a bit hard to explain, but the main idea was to measure the voltage directly on the source.
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf

 

-->