Maker Pro
Maker Pro

NTC 10k - PIC18F4550

Jack41

Nov 2, 2015
5
Joined
Nov 2, 2015
Messages
5
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 =ADRES;
  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;

NTC-Thermistor-10K.jpg 12435345345.png
 

Harald Kapp

Moderator
Moderator
Nov 17, 2011
13,700
Joined
Nov 17, 2011
Messages
13,700
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.
 

Jack41

Nov 2, 2015
5
Joined
Nov 2, 2015
Messages
5
Sorry to be doing so many questions. But then I'll have to measure the resistance value at two different temperatures?
I decided to change the NTC for 10D-9. I found some data in the datasheet:

NTC 10D-9.png
 
Top