Connect with us

NTC 10k - PIC18F4550

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

  1. Jack41

    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 =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
     
  2. Harald Kapp

    Harald Kapp Moderator Moderator

    9,136
    1,844
    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.
     
  3. Jack41

    Jack41

    5
    0
    Nov 2, 2015
    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
     
  4. Harald Kapp

    Harald Kapp Moderator Moderator

    9,136
    1,844
    Nov 17, 2011
    That should be easy.

    What's the question?
     
Ask a Question
Want to reply to this thread or ask your own question?
You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.
Electronics Point Logo
Continue to site
Quote of the day

-