Skip to content

Commit 17c638c

Browse files
authored
Merge pull request #9 from CapableRobot/low_temp_fix
Fix for below 0C measurements with nominal resistance other than 100 ohms
2 parents 95bc559 + 207e1f7 commit 17c638c

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

adafruit_max31865.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -246,6 +246,11 @@ def temperature(self):
246246
temp = (math.sqrt(temp) + Z1) / Z4
247247
if temp >= 0:
248248
return temp
249+
250+
# For the following math to work, nominal RTD resistance must be normalized to 100 ohms
251+
raw_reading /= self.rtd_nominal
252+
raw_reading *= 100
253+
249254
rpoly = raw_reading
250255
temp = -242.02
251256
temp += 2.2228 * rpoly

0 commit comments

Comments
 (0)