Skip to content

Commit

Permalink
Merge pull request #9 from CapableRobot/low_temp_fix
Browse files Browse the repository at this point in the history
Fix for below 0C measurements with nominal resistance other than 100 ohms
  • Loading branch information
kattni committed Jan 8, 2020
2 parents 95bc559 + 207e1f7 commit 17c638c
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions adafruit_max31865.py
Original file line number Diff line number Diff line change
Expand Up @@ -246,6 +246,11 @@ def temperature(self):
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
Expand Down

0 comments on commit 17c638c

Please sign in to comment.