Skip to content

Commit 207e1f7

Browse files
committed
Fix for below 0C measurements with nominal resistance other than 100 ohms
1 parent 53bf421 commit 207e1f7

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
@@ -244,6 +244,11 @@ def temperature(self):
244244
temp = (math.sqrt(temp) + Z1) / Z4
245245
if temp >= 0:
246246
return temp
247+
248+
# For the following math to work, nominal RTD resistance must be normalized to 100 ohms
249+
raw_reading /= self.rtd_nominal
250+
raw_reading *= 100
251+
247252
rpoly = raw_reading
248253
temp = -242.02
249254
temp += 2.2228 * rpoly

0 commit comments

Comments
 (0)