Electronic – arduino – INA219 bus voltage depends on supply voltage

arduinovoltage measurement

I tried to measure voltage with INA219A connected to Arduino. As datasheet says INA219 works from 3V to 5.5V supply voltage but I get different values for bus voltage when I change supply voltage. Here are some values I get, when I measure Arduino's 5V output (which is actually 4.6V):

  • At 3V supply I get 4.54V,
  • At 3.5V –> 3.34V,
  • At 4V –> 2.93V,
  • At 4.6V –> 2.48V.

I've measured bus voltage myself as voltage between GND and Vin- as mentioned in datasheet and get 4.6V regardless supply voltage.

All was connected like in the picture below:

enter image description here

Edited:

I tried to supply INA219 from batteries and measure Arduino's 5V. When I supply 3V I get nearly 4.6V what the multimeter shows but when I supply 4.5 V I get 2.5V. The same question remains regardless INA219 is powered from batteries or potentiometer.

Best Answer

First, powering INA219A via 10K resistor is really bad idea. The high side of a resistor basically works as current limiter. For example when set for 3V output it limits supply current to something like 1.25 mA, which is awfully close to quiescent current of the chip.

Furthermore, if you are using some kind of breakout board with built-in I2C pull-ups, like this one, the same supply is also used for those pullups. Your chip is basically starving for power which can lead to all kinds of strange behavior.

If you are not using off-shelf breakout make sure you have 0.1 μF bypass installed.

But since you haven't reported any I2C failures and also tried powering from battery the actual problem can be somewhere else (does not mean you shouldn't fix the above before troubleshooting further).

Let's see... I would recommend checking your software next.

  • Since maximum voltage is around 5V it is better to change default 32V full-scale range to 16V (see BRNG bit);

  • Make sure you set mode to "continuous bus voltage" (0b110 in MODE bits);

  • If you are using repeated reads then make sure you send correct register address (0x02) first time. Actually, for troubleshooting I'd avoid repeated reads and send register address on each request;

  • The bus voltage register bits are not right-aligned. Make sure you shift the register value right by 3 bits before multiplying by 4 mV LSB.