Temperature Calculation Algorithm


 

KennyDado

TVWBB Member
I was poking around the schematics on github and had a question and was hoping Bryan or anyone could chime in.

The standard way to read a thermistor is to make a simple voltage divider, take an analog reading, and given the known value of the fixed resistor you calculate the resistance of the thermistor and use the Steinhart coefficients to translate that into a temperature, etc. These are straight forward calculations.

My question is that with the latest HeaterMeter board's thermistor circuits having two resistors, and a capacitor, how does that change the thermistor resistance calculation? I took a look at grillpid.cpp's TempProbe::calcTemp and as far as I could tell (which doesn't mean much) the resistance of the thermistor was still being calculated as if it were the simple voltage divider circuit. Does the improved circuit only effect the readings negligibly, or not at all? Or did you in fact modify the code to account for the change? (I'm an amateur and terrible at deciphering other peoples code)

If you did change the resistance calculation could you share what the equation becomes after we add the second resistor and capacitor?
 
Last edited:
I understand it doesn't change the resistance of the thermistor, but I would have thought the change in circuitry would have changed the voltage reading at the arduino.

Would the calculation of the resistance of the thermistor not now be a combination of a resistive divider AND an RC filter?
https://en.wikipedia.org/wiki/Voltage_divider#Resistive_divider
https://en.wikipedia.org/wiki/Voltage_divider#Low-pass_RC_filter

So based on the HeaterMeter schematic and the equations given in the Wikipedia articles posted above I get
R_thermistor = R_1 / (V_in/(V_out*sqrt(1+(w*R_3*C)^2)) - 1)
Where R_1 = the 10k resistor
R_3 = the 100k resistor
C = the 0.1u cap
V_in = 3v3
V_out = voltage at arduino pin
w = radian frequency of the input voltage (this is where I get lost)
 
Last edited:
I understand it doesn't change the resistance of the thermistor, but I would have thought the change in circuitry would have changed the voltage reading at the arduino.

Would the calculation of the resistance of the thermistor not now be a combination of a resistive divider AND an RC filter?
https://en.wikipedia.org/wiki/Voltage_divider#Resistive_divider
https://en.wikipedia.org/wiki/Voltage_divider#Low-pass_RC_filter

So based on the HeaterMeter schematic and the equations given in the Wikipedia articles posted above I get
R_thermistor = R_1 / (V_in/(V_out*sqrt(1+(w*R_3*C)^2)) - 1)
Where R_1 = the 10k resistor
R_3 = the 100k resistor
C = the 0.1u cap
V_in = 3v3
V_out = voltage at arduino pin
w = radian frequency of the input voltage (this is where I get lost)

I got lost just reading your post!
 
Yeah.. I get that a lot.

Anyway, after a little more research it *appears* that this RC filter has negligible impact, if any, on the voltage readings. So it's all for nothin.

Now ground the Pit TC. Do you see any cyclical variances?
 
"TC" means thermocouple, but a TC doesn't use a pullup resistor so I'm not sure how it is relevant to this discussion.
 

 

Back
Top