Closed KlaasH closed 4 years ago
I created a PR a while back that is one fix for this issue. See https://github.com/adafruit/Adafruit_CircuitPython_MAX31865/pull/9
It's based on the logic within Adafruit C++ library for the MAX31865 : https://github.com/adafruit/Adafruit_MAX31865/blob/master/Adafruit_MAX31865.cpp
In my limited testing this past winter it gave reasonable results, but I don't have a great way to generate below-0C temperatures with accurate ground truth to benchmark against.
Oh, nice! I looked for open issues but didn't check the open PRs. Looks like those lines were added to the C++ library a few months after this package was ported from it.
I have some wireless air temperature sensors that are accurate below freezing. I could try putting the RTD probe and one of those in the freezer and seeing if they agree. Not exactly rigorous, but I do have 2 different freezers I could try...
In any case, even if it's not that accurate, it's better than the status quo.
Fixed by #9
The above-zero calculation uses
rtd_nominal
but the below-zero calculation doesn't. So ifrtd_nominal
is set to anything but 100, when the resistance drops below that value the reported temperature will abruptly jump to the uncalibrated value.It seems like the below-zero formula is more complicated and it might not be feasible to incorporate
rtd_nominal
in it, but giving the wrong answer seems like a bad failure mode. Either returningNone
or raising an exception in the case wherertd_nominal
is overridden and the initial calculation is negative would seem better to me.