We have a board that uses 5 x INA220 devices and an I2C EEPROM on the same bus. The I2C bus is controlled from an FPGA and runs at 400kHz.
The config register of the INA220 devices are all as per the default setting in the datasheet (continuous bus & shunt conv, 12-bit 532 us, 40mV PGA). The calibration register is set to 8192 (to give current result in 1mA per bit from a 5mOhm sense resistor)
We have a problem that we first noticed with the INA220 device attached to our unused "expansion" 12V rail that measures 12V BUT zero current (since it is currently unused). We expect to read zero or very close to zero current and/or shunt voltage, BUT, occasionally we get a spurious reading from the shunt voltage register, the current register or both. The spurious reading is very often around 2306,2304,2558, and sometimes around the negative of these values, but can sometimes also be a very high or very low (negative) reading (+32000 ish or -32000 ish)
One of the other INA220 devices is on a 5V0 rail and usually measures a positive current (without issue). The design has the recommended RCR filter so as an experiment we removed one of the filter R's and shorted out the sense resistor to simulate zero current. We saw a similar effect. ie occasional spurious readings.
We have done many experiments to narrow down the problem. We have scoped the I2C signals with a high speed scope and can see no issues with regard to signal integrity.
We now have an experimental setup as follows :-
One single INA220 device (powered from 3V3 and measuring a 12V rail) on the I2C bus from the FPGA (all other I2C devices physically removed from the PCB).
FPGA code resets the INA220, then sets the config and calibration registers (as noted above), and then continually loops just reading the bus voltage, shunt voltage, and current registers in this sequence. The FPGA code records the max and min values for each and every one of these 3 parameters that we read back over I2C.
The FPGA monitors the I2C bus SDA & SCL lines and checks that they are the expected value after every transition if possible (ie when under the control of the FPGA) and checks for the ACK bit. We see no I2C related protocol issues or errors.
We NEVER see an issue with the bus voltage value. The bus voltage max & min values are always within a few mV of the expected 12V value.
If we add a small positive current load (10mA ish), OR, small negative current load (-10mA ish) using a resistor then we can leave the unit running for many hours (around 8-10 hours overnight) and not see an issue and the max & min recordings are within a few mA of the expected +10mA or -10mA. AND, as per our cal reg setting of 8192, and as expected, we always see the current reg max/min being double the shunt voltage max/min value.
However, if we have no current load, and the readings hover around zero (just above and just below zero) then we see issues with spurious readings. Usually it only takes a few seconds or minutes to get a spurious reading but sometimes this does take longer.
Interestingly the readings from the shunt voltage register and the current register do not seem to correlate in this 'spurious reading' situation. With our cal reg value of 8192 we would expect the max current reg value to be DOUBLE the shunt voltage reg value, but we have had situations where we see a spurious max/min reading from the shunt voltage reg, but nothing spurious from the current reg, or, we see a spurious max/min from the current reg, but nothing spurious from the shunt voltage reg, or we see spurious max/min readings from BOTH the shunt voltage reg AND the current reg, BUT both of them being in the same sort of range. eg a shunt max value in the region of 2300 and a current max value in the region of 2500, BUT the current max value is NOT double the shunt value.
We have also tried changing the config reg to change the ADC averaging of the shunt voltage to average 2 samples (SADC mode of B"1001") but this seems to have no effect. ie the most common spurious reading remains in the region of 2300 to 2500. If only one of the two samples was a spurious value and the other was close to zero as expected, then we would expect the 2 sample average to be half of the 2300 to 2500 range, but this does not appear to change. This suggests the issue is not with the ADC measurement, but more with the processing of the value and reporting it over I2C.
Our design monitors the currents and voltage to provide over-current and over-voltage 'trips' so these spurious readings cause occasional 'trips' and this is causing us issues.
We are convinced the INA220 has an internal issue when measuring currents around zero. Is this a known issue and are there any fixes?
Thanks