From 207e1f7e2e1f408389b435a197cda6026a878e8a Mon Sep 17 00:00:00 2001 From: Chris Osterwood Date: Tue, 12 Mar 2019 21:49:45 -0400 Subject: [PATCH] Fix for below 0C measurements with nominal resistance other than 100 ohms --- adafruit_max31865.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/adafruit_max31865.py b/adafruit_max31865.py index 4209cd1..e66361f 100644 --- a/adafruit_max31865.py +++ b/adafruit_max31865.py @@ -244,6 +244,11 @@ class MAX31865: temp = (math.sqrt(temp) + Z1) / Z4 if temp >= 0: return temp + + # For the following math to work, nominal RTD resistance must be normalized to 100 ohms + raw_reading /= self.rtd_nominal + raw_reading *= 100 + rpoly = raw_reading temp = -242.02 temp += 2.2228 * rpoly