Beginner Thermistor question!?

I have put together a remote temperature sensor using the Thermistor tutorial located at,
Instead of a 10k thermistor I got a 100k from Digikey (, THERMISTOR NTC 100K OHM 1% RAD, part #B57861S0104F040.
In the code below:

// calculate the resistance of the thermistor at the current temperature local r_therm = <u>100000.0 </u>/ ( (v_high / v_therm) - 1); local ln_therm = math.log(<u>100000.0</u> / r_therm); local t_therm = (t0_therm * b_therm) / (b_therm - t0_therm * ln_therm) - 273.15;

I changed the 10,000 to 100,000 to compensate for the 100k thermistor and I also changed the b_therm from 3988 to 4540 for the same reasons.

I have the impee up and running however the reading’s are about 5 degrees higher than my other thermometers.
When I change the ‘1’ in the code below:

local r_therm = <u>100000.0 </u>/ ( (v_high / v_therm) - 1);

to a ‘2’. My readings are closer to what the thermometers are reading.

So my questions are:
Is it correct to alter the code to compensate for the differing (10k to 100k) thermistors?
In the code, where I changed the ‘-1’ to a ‘-2’, was is this ‘1’ for?
And lastly, please help, any suggestions are welcome!?

Thanks in advance for all responses!

I edited your post to wrap your code in code tags (the ‘C’ in the format bar).

Ok, thanks!

You’ll need to build a slightly different circuit (use a 100kΩ resistor instead of a 10kΩ resistor for the voltage divide circuit), and grab some values off the datasheet.

I also suggest using our NTC class. With the NTC class, you need 3 values:

b Value

t0 value

r0 value
This is the resistance of the NTC thermistor (in your case: 100,000)

Once you have those, all you need to is initialize the class, and read the temp :slight_smile:

const b = 4540.0;
const t0 = 25.0;
const r = 100000.0;

NTC <- thermistor(hardware.pinWhatever, b, t0, r);