Skip to content

Temperature calculation ignores rtd_nominal for temperatures below zero #11

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

Closed
KlaasH opened this issue May 8, 2019 · 3 comments
Closed

Comments

@KlaasH
Copy link

KlaasH commented May 8, 2019

The above-zero calculation uses rtd_nominal but the below-zero calculation doesn't. So if rtd_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 returning None or raising an exception in the case where rtd_nominal is overridden and the initial calculation is negative would seem better to me.

@osterwood
Copy link
Contributor

I created a PR a while back that is one fix for this issue. See #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.

@KlaasH
Copy link
Author

KlaasH commented May 8, 2019

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.

@kattni
Copy link
Contributor

kattni commented Jan 8, 2020

Fixed by #9

@kattni kattni closed this as completed Jan 8, 2020
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

3 participants