Current measurements via get_current
are off by factor 4 under specific circumstances
#10
Labels
get_current
are off by factor 4 under specific circumstances
#10
If you first do
set_shunt_calibration
, thenset_config(adc_range=ti.ina238.ADCRange.LOW)
, theSHUNT_CAL
register is not updated. This causes theget_current
function to return results that are off by a factor 4 (https://github.com/GSI-HPC/py-ina238/blob/main/src/ti/ina238.py#L278).As a workaround, you can call
set_config(adc_range=ti.ina238.ADCRange.LOW)
first, then after that callset_shunt_calibration
. Alternatively, you can useget_shunt_voltage
and do the current calculation yourself in Python.The text was updated successfully, but these errors were encountered: