Skip to content

Warning against experimenting with the optional parameters in the INA219 configuration command ... #104

@ArjenR49

Description

@ArjenR49

Admittedly the INA219 configuration command in the sample code uses the default parameters, which work OK, but from the INA219 documentation one can find several optional parameters to experiment with. The probably rather futile idea would be to improve accuracy, but like me you might just be inclined to try and see what happens ....

I am not going to describe the optional parameters, but here are a few lines as an example of what I mean:

#        inaRPi = INA219(0.00725, busnum=DEVICE_BUS, address=0x40)
#        inaRPi = INA219(0.0145, busnum=DEVICE_BUS, address=0x40)
        inaRPi = INA219(0.0145, 4, busnum=DEVICE_BUS, address=0x40)
##        inaRPi.configure()
##        inaRPi.configure(inaRPi.RANGE_16V, inaRPi.GAIN_2_80MV, inaRPi.ADC_32SAMP, inaRPi.ADC_32SAMP)
##        inaRPi.configure(inaRPi.RANGE_32V, inaRPi.GAIN_AUTO, inaRPi.ADC_12BIT, inaRPi.ADC_12BIT)
        inaRPi.configure(inaRPi.RANGE_16V)

The lines without # work for me, and so do the original commands (I adjusted the shunt values, but that's another story).
However in my case the configuration(s) above with 4 parameters repeatedly work(s) only for a few hours before some error occurs that I have not traced. Some other possible values for the 4 parameters might work fine. I only tried those in the above quote.

The INA219 had obviously stopped measuring and in Home Assistant I would see just a flat line for the values from the INA219's.

There may be a bug in the python driver library, but I'll leave it to others to pinpoint out the exact cause.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions