Hello. I have bought INA219 chip to measure my voltage and current of the solar panel. Before I connect it to solar panel I have decided to test it with a simple power supply and see whether I can get correct readings from it.
I have connected everything to an arduino as shown in the picture below. I have connected Vin- to my arduino as a load, to see how much current and voltage it is drawing.
After i run arduino code I have noticed that there was about 0.1 - 0.15V difference in the power supply and INA219 reading which is confusing. Where is it coming from? I have tried a range of voltages and still I always get arround 0.1 -0.15V error.
(NOTE THAT FIRST ROW OF LCD DISPLAYS VOLTAGE AND SECOND ROW DISPLAYS CURRENT IN mA)
Then I have added some extra bits to the load to check how it will change if i increase the load. I have used 10V power supply and current draw was 150mA. now the error became about 3 times bigger ( 0.5v error). 3 times bigger error matches 3 times higher current drawn but I still cannot figure out where is it coming from!
In both cases, I have measured voltages across shunt resistor and I was able to identify that the voltage drop was correct- In first case with 40mA current I was able to measure 4mV across the shunt and in the second case I measured 16mV. I have also measured directly Vin+ of INA219 and i almost matches the supply voltage.
I doubt its programming error cause I use arduino library for INA219 and there are prebuilt functions that measures voltage and current.