This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

INA219: Invalid current measurements with custom shunt register

Part Number: INA219


Hello, I have a technical question regarding INA219.

I have configured the device from my microcontroller, communicated with it via I2C and succesfully read and verifided bus voltage
However, the current value I obtain is different from what I expect and what I read using a power profiler.
I've used the power monitor calculator excel sheet that you provide and compared my code with some available libraries I've found, but still can't find the problem to solve this issue.

Here there is some additional information.

 

Excel table with configuration:

Parameter

Value

VBUS_MAX

16

VSHUNT_MAX

0,04

RSHUNT

0,018

MaxPossible_I

2,222

MaxExpected_I

2,000

MinimumLSB

0,000061

MaximumLSB

0,000488

CurrentLSB

0,00007

CurrentLSB_PerBit

70

CalibrationReg

32507

PowerLSB

0,0014

PowerLSB_PerBit

1,4

Max_Current

2,294

Max_Current_No_Overflow

2,222

Max_ShuntVoltage

0,04

Max_ShuntVoltage_No_Overflow

0,04

MaximumPower

35,556

BusADCResolution

INA219_CONFIG_ADCRES_12BIT_AVG_8S_4260US

ShuntADCResolution

INA219_CONFIG_ADCRES_12BIT_AVG_8S_4260US

ConfigMode

INA219_CONFIG_MODE_SANDBVOLT_CONTINUOUS

SampleTime

8,520

Schematics of this part:

Register values:

Configuration validated with EVM tool:

 

Current measured with INA: 10mA (667 register value / 70 uA per bit currentLSB).

Current measured with power profiler and multimeter: 45mA.

 When I had some more peripherals enabled and consuming variable loads: 20mA in INA vs 103mA in power profiler.

Please let me know what can be the problem and how to correct the setup or code to get valid current readings.

  • Hello,

    Current measured with INA: 10mA (667 register value / 70 uA per bit currentLSB).

    The current from the INA219 should be calculated by multiplying the current LSB by the current register value, not dividing it as you have done. Therefore, the result is 667*70uA=46.69mA. This is close to the reference value you stated, so I am assuming that you rounded slightly in your calculations.

    Let me know if you have any other issues I can help with,

    Levi DeVries

  • Hi Levi, thanks for the answer. This solved my issue.

    The library I was using had a current divisor parameter for converting to mA and when I created my custom INA219 configuration function I set this parameter directly to the currentLSB instead of (1000/currentLSB) and then I overlooked the operation type when reviewing the datasheet. My fault.

    Thanks,

    Bruno