How long does it take for the INA3221 to react to changing input conditions? I am measuring battery voltage with solar charging applied, then remove the solar cells and measure battery voltage again. If I do that immediately one after the other I still get the same measurement. If I add a 1 second delay I get the expected results.
Here is the information from the INA3221 Specification. It depends on how you have programmed it and other considerations:
Device Functional Modes (continued) 184.108.40.206 Averaging and Conversion-Time Considerations The INA3221 has programmable conversion times for both the shunt- and bus-voltage measurements. The selectable conversion times for these measurements range from 140 μs to 8.244 ms. The conversion-time settings, along with the programmable-averaging mode, enable the INA3221 to optimize available timing requirements in a given application. For example, if a system requires data to be read every 2 ms with all three channels monitored, configure the INA3221 with the conversion times for the shunt- and bus-voltage measurements set to 332 μs. The INA3221 can also be configured with a different conversion-time setting for the shunt- and bus-voltage measurements. This approach is common in applications where the bus voltage tends to be relatively stable, and allows for the time focused on the bus voltage measurement to be reduced relative to the shunt-voltage measurement. For example, the shunt-voltage conversion time can be set to 4.156 ms with the bus-voltage conversion time set to 588 μs for a 5-ms update time. There are trade-offs associated with the conversion-time and averaging-mode settings. The averaging feature significantly improves the measurement accuracy by effectively filtering the signal. This approach allows the INA3221 to reduce the amount of noise in the measurement caused by noise coupling into the signal. A greater number of averages allows the INA3221 to be more effective in reducing the measurement noise component. The trade-off to this noise reduction is that the averaged value has a longer response time to input-signal changes. This aspect of the averaging feature is mitigated to some extent with the critical-alert feature that compares each single conversion to determine if a measured signal (with noise component) has exceeded the maximum acceptable level.
Interesting. So maybe the issue is with Python on the Pi somewhere. If I read so close after instantiation I get much higher current values than when I read after a one second pause. I don't help it by abandoning and then reinstantiating the INA3221 every five minutes, but I can't justify keeping the app running at all times.