#Calibrate thermistor?

1 messages · Page 1 of 1 (latest)

hoary atlas
#

Looking for a nudge in the right direction: how do I calibrate the curve of my thermistor? I have a pi, adc, and thermistor using a wheatstone bridge, clamped to a hot water pipe. when i tested it at room temp it was accurate, but i am reading now the resistance is exponential to temperature, not linear, so the higher temps i'm using it at are not properly calibrated it seems (pi reads 140F, temp gun is reading 165F). my code for the reading the temp on the pi is:

#

`#### Temp calc ####

the resistor values for the Wheatstone bridge are:

resistor1 = 10000
resistor2 = 10000
resistor3 = 10000

Input voltage

voltin = 3.3

Resistance thermometer values from datasheet

bResistance = 3977
t25Resistance = 10000

Constants

t0 = 273.15
t25 = t0 + 25

def calcResistance(voltage):
return (resistor2*resistor3 + resistor3 * (resistor1+resistor2)*voltage / voltin) / (resistor1 - (resistor1+resistor2)*voltage / voltin)

def calcTemp(resistance):
return 1 / ((math.log(resistance / t25Resistance) / bResistance) + (1 / t25)) - t0

bridgeVoltage = chan.voltage
thermresistance = calcResistance(bridgeVoltage)
temperature = calcTemp(thermresistance)
tempf = temperature * (9/5) + 32`

Do I need to modify t25, bResistance, or is it something else?

stoic inlet
#

From memory, t25 is the 25% point, not 25 degrees

hoary atlas
#

🤯

#

this is a great starting point. thank you lol

stoic inlet
#

A little poking around reveals my memory isn't right...

hoary atlas