NTC 10k - PIC18F4550

Discussion in 'Microcontrollers, Programming and IoT' started by Jack41, Nov 2, 2015.

1. Jack41

5
0
Nov 2, 2015
Hello!
I'm using a 10k NTC like the image on a PIC18F4550 , with the circuit of another image.
I researched a bit and found the code below, but it puts values for "A" , "B" and " C " I did not understand how I can get .

a = 0,0011303
b = 0,0002339
c = 0,00000008863

Code:
sensor *=5;
sensor/=1023;
rntc=33000/sensor;//RNTC=(Vcc*R1/Vin)-R1
rntc=rntc-10000;//
b1=log(rntc);//LN(RNTC)
b1=b1*b;//b*LN(RNTC)
c1=log(rntc);//LN(RNTC)
c1=pow(c1,3);//LN(RNTC)^3
c1=c1*c;//c*(LN(RNTC)^3)
temp=a+b1+c1;//a+b*LN(RNTC)+c*(LN(RNTC)^3)
temp=1/temp;//1/(a+b*LN(RNTC)+c*(LN(RNTC)^3))
temp=temp-273.15;  2. Harald KappModeratorModerator

11,968
2,799
Nov 17, 2011
A, B and C are the parameters of the Steinhart-Hart equation which is a mathematical model of the thermistor's resistance as a function of the temperature.
Depending on your requirements with respect to accuracy you may be able to use the somewhat simpler 2-parameter model as described e.g. here.

5
0
Nov 2, 2015
4. Harald KappModeratorModerator

11,968
2,799
Nov 17, 2011
That should be easy.

What's the question?  