5 Replies Latest reply on Jul 24, 2018 10:54 PM by user_342122993

# Thermistor (103AT-11) Sample Project

This time, actually a while ago, I came across a chance to make a sample project of thermistor. Although the circuit seemed to be easy, the calculation was not as easy as I was expecting. According to the web page of the thermistor, we can calculate the resistance of  a thermistor with following equation. Rt : Resistance at temperature t (kelvin)

R0: Resistance at T0

B: Thermistor related constant. For 103AT-11 it is 3435 +/- 1%

Conversion from Tk (Kelvin) to Tc (Celsius) is Tc = Tk - 273.15

Dividing both sides by R0, we get Replacing e to log Dividing both sides by B From the Datasheet the resistance value of this thermistor is 10.0K at 25 degree Celsius,

so if we replace R0 to R25 and T0 to T25 (Klevin for 25c) the equation  is now Moving 1/T25 from the right side to the left side Reducing the left side Then reforming the equation according to T Finally we get

In the figure below

Rt = R1 x Vt / (VDDA -Vt) If we normalize the ADC value (ADin)  of input voltage 0V ~ VDDA V to 0.0 ~ 1.0

Rt = R1 x ADin / (1 - ADin)

Now we can write a code

Rt = R1 * ADin / (1 - ADin) ;

K = 1.0 / (log(Rt / R25) / B + 1.0/T25) ;

T = K - 273.15 ;

To make the long story short, here is the whole enchilada!

(aka, project attached...)

moto

• ###### 1. Re: Thermistor (103AT-11) Sample Project

Hello Tanaka san,

Thanks for your contribution to the community.

Best Regards,
VSRS

• ###### 2. Re: Thermistor (103AT-11) Sample Project

本サンプルは CQ出版　インターフェース 9月号に

-50 ～ +105℃で使える高精度サーミスタ

として掲載されました。

I contributed this sample project to a Japanese

technical mazagine "Interface" Sep. edition.

moto

• ###### 3. Re: Thermistor (103AT-11) Sample Project

Motoo,

You can speed-up temperature calculation using Fast Thermistor Calculator component, which takes about 15 times less CPU clocks than traditional calculations.

/odissey1

1 of 1 people found this helpful
• ###### 4. Re: Thermistor (103AT-11) Sample Project

Dear /odissey1-san,

Thank you very much for your information!

I studied your code a little, and noticed that there are two differences.

(1) You (and Cypress Component) use approximation between 0 ~ 50 C degree,

beside the range of 103AT-11 is -50 ~ +105 C degree and I used the maker's formula.

(In general 0 ~ 50 should be enough though)

(2) The biggest contribution to the speed is usage of "fastlog()" which does not use "log()"

It requires 3 sampled values, such as @5C, @25C, @45C,

and the error out side of 0~50 could be large (Sorry I was too lazy to calculate them, yet).

About (2), if "fastlog()" can speed up the calculation, may be replacing "log()" in my

formula also provide speed boost similar to your estimation and it also discard the

requirement for "-lm" option, which is very nice.

BTW, the Thermistor Calculator's URL has been changed and it is now

Attached is my project using "fastlog()".

Around 25~26 C degree, the value seems to be OK.

Best Regards,

25-Jul-2018

Motoo Tanaka

• ###### 5. Re: Thermistor (103AT-11) Sample Project

Motoo,

Thank you for updated link and updated project.

/odissey1