Other Parts Discussed in Thread: INA219, TEST2
Hello,
We build a board 2 INA219.
We are using ESP32 with python library (from here https://github.com/chrisb2/pi_ina219/blob/master/ina219.py. We are using on board 0.1 ohm shunt
Everything works fine on I2C, but the current and power output are always ZERO.
I checked step by step the library and regarding the current I saw that reading from registry is returning always zero. Below is some output with and without battery.
Any idea why we got ZERO amp?
Thx
ina219 loaded
[65, 68]
DEBUG:INA219: gain set to 0.04V
DEBUG:INA219: shunt ohms: 0.010, bus max volts: 16, shunt volts max: 0.04, max expected amps: 0.200A, bus ADC: 3, shunt ADC: 3
DEBUG:INA219: calibrate called with: bus max volts: 16V, max shunt volts: 0.04V, max expected amps: 0.200A
DEBUG:INA219: max possible current: 4.000A
DEBUG:INA219: max expected current: 0.200A
DEBUG:INA219: __CURRENT_LSB_FACTOR 32800 current_lsb: 6.250191e-05
DEBUG:INA219: current LSB: 6.250e-05 A/bit
DEBUG:INA219: power LSB: 1.250e-03 W/bit
DEBUG:INA219: max current before overflow: 2.0480A
DEBUG:INA219: max shunt voltage before overflow: 20.4800mV
DEBUG:INA219: calibration: 0xfffd (65533)
DEBUG:INA219: calibration: 0xfffd
DEBUG:INA219: write register 0x05: 0xfffd 0b1111111111111101
DEBUG:INA219: configuration: 0x019f
DEBUG:INA219: write register 0x00: 0x019f 0b110011111
DEBUG:INA219: read register 0x02: 0x06ba 0b11010111010
Bus Voltage : 0.860 V
DEBUG:INA219: read register 0x02: 0x06ba 0b11010111010
DEBUG:INA219: read register 0x04: 0x0000 0b0
DEBUG:INA219: _current_register: 0
Bus Current : 0.000 mA
DEBUG:INA219: read register 0x02: 0x06ba 0b11010111010
DEBUG:INA219: read register 0x02: 0x06ba 0b11010111010
DEBUG:INA219: read register 0x01: 0x0000 0b0
Supply Voltage : 0.860 V
DEBUG:INA219: read register 0x02: 0x06ba 0b11010111010
DEBUG:INA219: read register 0x01: 0x-001 0bb1
Shunt voltage : -0.010 mV
DEBUG:INA219: read register 0x02: 0x06ba 0b11010111010
DEBUG:INA219: read register 0x03: 0x0000 0b0
Power : 0.000 mW
WITH BATTERY
ina219 loaded
[65, 68]
DEBUG:INA219: gain set to 0.04V
DEBUG:INA219: shunt ohms: 0.010, bus max volts: 16, shunt volts max: 0.04, max expected amps: 0.200A, bus ADC: 3, shunt ADC: 3
DEBUG:INA219: calibrate called with: bus max volts: 16V, max shunt volts: 0.04V, max expected amps: 0.200A
DEBUG:INA219: max possible current: 4.000A
DEBUG:INA219: max expected current: 0.200A
DEBUG:INA219: __CURRENT_LSB_FACTOR 32800 current_lsb: 6.250191e-05
DEBUG:INA219: current LSB: 6.250e-05 A/bit
DEBUG:INA219: power LSB: 1.250e-03 W/bit
DEBUG:INA219: max current before overflow: 2.0480A
DEBUG:INA219: max shunt voltage before overflow: 20.4800mV
DEBUG:INA219: calibration: 0xfffd (65533)
DEBUG:INA219: calibration: 0xfffd
DEBUG:INA219: write register 0x05: 0xfffd 0b1111111111111101
DEBUG:INA219: configuration: 0x019f
DEBUG:INA219: write register 0x00: 0x019f 0b110011111
DEBUG:INA219: read register 0x02: 0x06ba 0b11010111010
Bus Voltage : 0.860 V
DEBUG:INA219: read register 0x02: 0x06ba 0b11010111010
DEBUG:INA219: read register 0x04: 0x0000 0b0
DEBUG:INA219: _current_register: 0
Bus Current : 0.000 mA
DEBUG:INA219: read register 0x02: 0x06ba 0b11010111010
DEBUG:INA219: read register 0x02: 0x06ba 0b11010111010
DEBUG:INA219: read register 0x01: 0x0000 0b0
Supply Voltage : 0.860 V
DEBUG:INA219: read register 0x02: 0x06ba 0b11010111010
DEBUG:INA219: read register 0x01: 0x-001 0bb1
Shunt voltage : -0.010 mV
DEBUG:INA219: read register 0x02: 0x06ba 0b11010111010
DEBUG:INA219: read register 0x03: 0x0000 0b0
Power : 0.000 mW