Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
ArjenR49 opened this issue May 25, 2022 · 0 comments

Comments

@ArjenR49
Copy link

ArjenR49 commented May 25, 2022

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant