+ Post New Thread
Results 1 to 18 of 18
  1. #1
    Full Member level 5
    Points: 2,843, Level: 12
    Achievements:
    7 years registered

    Join Date
    May 2010
    Location
    usa
    Posts
    294
    Helped
    0 / 0
    Points
    2,843
    Level
    12

    NTC thermistor interface to MCU

    I read temperature using NTC 10k ,beta 3950 and connect resistance 10k in series but it is n't accurate for more than 5 degrees, how to get accurate readings for wider range.
    here is the conversion and co coefficient i used
    Code:
    int Vo;
    float R1 = 10000;
    float logR2, R2, T;
    float c1 = 1.009249522e-03, c2 = 2.378405444e-04, c3 = 2.019202697e-07;
    
    Vo = analogRead(ThermistorPin);
      R2 = R1 * (1023.0 / (float)Vo - 1.0);
      logR2 = log(R2);
      T = (1.0 / (c1 + c2*logR2 + c3*logR2*logR2*logR2));
      T = T - 273.15;
      T = (T * 9.0)/ 5.0 + 32.0;

  2. #2
    Super Moderator
    Points: 72,488, Level: 65
    Achievements:
    7 years registered
    Awards:
    Most Frequent Poster 3rd Helpful Member

    Join Date
    Apr 2014
    Posts
    14,735
    Helped
    3365 / 3365
    Points
    72,488
    Level
    65

    Re: ntc thermistor interface to MCU

    Hi,

    for precise readings you first need to setup the hardware correctly.

    * Use a 1uF ceramics capacitor from ADC0 to AGND, close to the uC.
    * use VCC --> 10R --> AVCC
    * and 10uF (best ceramics) from AVCC to AGND, close to the uC
    * be sure VCC is stable, use a scope.

    ****
    Then according I think it should be:

    R2 = R1 * (1024 / Vo -1)

    Where R1 = the externally used known resistor --> 9250 instead of 10000

    ****

    I didn´t check the rest of your math.

    Klaus
    Please don´t contact me via PM, because there is no time to respond to them. No friend requests. Thank you.



  3. #3
    Full Member level 5
    Points: 2,843, Level: 12
    Achievements:
    7 years registered

    Join Date
    May 2010
    Location
    usa
    Posts
    294
    Helped
    0 / 0
    Points
    2,843
    Level
    12

    Re: ntc thermistor interface to MCU

    Quote Originally Posted by KlausST View Post
    Hi,


    * use VCC --> 10R --> AVCC

    Klaus
    what do you mean by 10R?

    - - - Updated - - -

    I used external resistor 9250 which make the reading close to what expected. if i use 10000 MCU reads 44 C in stead of 40 ( deviation 4 degrees)



    •   AltAdvertisment

        
       

  4. #4
    Super Moderator
    Points: 72,488, Level: 65
    Achievements:
    7 years registered
    Awards:
    Most Frequent Poster 3rd Helpful Member

    Join Date
    Apr 2014
    Posts
    14,735
    Helped
    3365 / 3365
    Points
    72,488
    Level
    65

    Re: ntc thermistor interface to MCU

    Hi,

    what do you mean by 10R?
    A resistor with the value "10 Ohms".

    See figure 96 of the datsheet.

    Instead of the undamped LC (which causes a resonance at 160kHz)
    I rather use the 10R / 10uF lowpass filter of 1600Hz ... without resonance.

    Klaus
    Please don´t contact me via PM, because there is no time to respond to them. No friend requests. Thank you.



  5. #5
    Super Moderator
    Points: 28,804, Level: 41
    andre_teprom's Avatar
    Join Date
    Nov 2006
    Location
    Brazil
    Posts
    8,584
    Helped
    1087 / 1087
    Points
    28,804
    Level
    41
    Blog Entries
    6

    Re: ntc thermistor interface to MCU

    but it is n't accurate for more than 5 degrees
    Question: Is the problem really of acuracy or fluctuation of the measured value along time? If acuracy, the resolution of the problem would go through the fine adjustment of the calibration parameters c1, c2, c3. However, if the problem is of measured value not being steady, my bet is that you are probably not subjecting the sensor to an environment with a stable temperature; if that is the case, consider implementing some bulky mass apparatus, so that the specific heat capacity of the measured body (e.g., metal bar) tends to remain stable over time, filtering out small thermal oscillations.
    --------------------------------------------------------------------------------------------------
    Part of the world that you live in, You are the part that you're giving ( Renaissance )



  6. #6
    Super Moderator
    Points: 253,760, Level: 100
    Awards:
    1st Helpful Member

    Join Date
    Jan 2008
    Location
    Bochum, Germany
    Posts
    44,210
    Helped
    13455 / 13455
    Points
    253,760
    Level
    100

    Re: ntc thermistor interface to MCU

    It's not actually clear if the original post is talking about limited accuracy of the NTC sensor or errors of the ADC and measurement circuit. You don't specify a NTC type, so we can only guess about the accuracy. Down to +/- 1 K initial accuracy is available for popular industrial NTC, e.g. from Vishay.



  7. #7
    Full Member level 5
    Points: 2,843, Level: 12
    Achievements:
    7 years registered

    Join Date
    May 2010
    Location
    usa
    Posts
    294
    Helped
    0 / 0
    Points
    2,843
    Level
    12

    Re: NTC thermistor interface to MCU

    I did simulation in proteus, there is a display with the ntc which shows a temperaturre value and the lcd connected to the mcu displays another value. Connection As shown in the attched picture, it is 31 on ntc display but 32 on mcu lcd

    - - - Updated - - -

    Let me elaborate. What should i expect when i connect ntc 10k in series with 10k resistor.
    Is this enough to linearize it. If so what is the linearized range?

    - - - Updated - - -

    What is the expected accuracy in temperature? All i know about my ntc is 10k and Koefficient B (25 C/50 C): 3950
    Accuracy: ±1%
    Temp. Range -40 C to 200 C
    Last edited by mshh; 22nd March 2019 at 12:53.



  8. #8
    Super Moderator
    Points: 28,804, Level: 41
    andre_teprom's Avatar
    Join Date
    Nov 2006
    Location
    Brazil
    Posts
    8,584
    Helped
    1087 / 1087
    Points
    28,804
    Level
    41
    Blog Entries
    6

    Re: NTC thermistor interface to MCU

    and connect resistance 10k in series but it is n't accurate for more than 5 degrees
    Do you mean an inaccuracy of ±5°C or is it the total deviation ?
    And more, is your volt meter calibrated, and if yes, at which tolerance?
    Are you considering the device inacuracy on the above result?

    What should i expect when i connect ntc 10k in series with 10k resistor
    Once you are performing linearization by mathematical function, perhaps this will be not usefull, this would reduce the resolution of the measurement and inrease the noise/signal ratio.
    --------------------------------------------------------------------------------------------------
    Part of the world that you live in, You are the part that you're giving ( Renaissance )



    •   AltAdvertisment

        
       

  9. #9
    Full Member level 5
    Points: 2,843, Level: 12
    Achievements:
    7 years registered

    Join Date
    May 2010
    Location
    usa
    Posts
    294
    Helped
    0 / 0
    Points
    2,843
    Level
    12

    Re: NTC thermistor interface to MCU

    I need accurate sensor, 0.2 degree is critical. could the NTC do this?



  10. #10
    Advanced Member level 5
    Points: 14,318, Level: 28
    schmitt trigger's Avatar
    Join Date
    Apr 2013
    Posts
    2,388
    Helped
    774 / 774
    Points
    14,318
    Level
    28

    Re: NTC thermistor interface to MCU

    Before anything else, please define "wide temperature range". How wide?
    0 to 100C?
    -40 to 125C?
    or what?

    For 0.2 degree accuracy (I would assume it is Celsius, you have not specified), a simple NTC thermistor sensor simply will not make it.

    A thermocouple will have an even worse error budget.

    You'll require either a three or four wire PT100 or PT1000 sensor, with the proper front-end amplifier conditioning, like a MAX31865. Send the data your processor via SPI.

    Adafruit has a breakout board for it: https://www.adafruit.com/product/3328

    I know, I know, they are expensive. But is either that or you will have to relax your requirements. I.e., the 0.2 degree accuracy to be only available for a narrow range AND after calibration vs. a known reference, and relax the accuracy requirements for wider ranges.
    My batteries are recharged by "Helpful Post" ratings.
    If you feel that I've helped you, please indicate it as a Helpful Post



  11. #11
    Super Moderator
    Points: 253,760, Level: 100
    Awards:
    1st Helpful Member

    Join Date
    Jan 2008
    Location
    Bochum, Germany
    Posts
    44,210
    Helped
    13455 / 13455
    Points
    253,760
    Level
    100

    Re: NTC thermistor interface to MCU

    Curiously you are adding more and more demanding specifications, first -40 to 200 °C temperature range, then something like 0.2° accuracy. Achieving similar performance with an off-the-shelf NTC is impossible, even the best Pt100 or Pt1000 accuracy class has difficulties. Similarly an ATmega ADC is far from providing sufficient accuracy.

    My suggestion:
    - fix your specification
    - identify sensors with suitable accuracy
    - design a measurement circuit that can support it



  12. #12
    Full Member level 5
    Points: 2,843, Level: 12
    Achievements:
    7 years registered

    Join Date
    May 2010
    Location
    usa
    Posts
    294
    Helped
    0 / 0
    Points
    2,843
    Level
    12

    Re: NTC thermistor interface to MCU

    but thermistor is more accurate than pt100. i need to measure in range 35 to 39 with accuracy 0.2 like this one https://ram-e-shop.com/product/12vdc...-switch-probe/



  13. #13
    Advanced Member level 5
    Points: 14,318, Level: 28
    schmitt trigger's Avatar
    Join Date
    Apr 2013
    Posts
    2,388
    Helped
    774 / 774
    Points
    14,318
    Level
    28

    Re: NTC thermistor interface to MCU

    If you only require to measure a span of only 35 to 39 C, then you could in theory achieve the desired 0.2C by performing a two point calibration, in addition to the linearization equation.
    But then you must have a pair of temperature sources that on their own are more accurate than 0.2C, to perform the two point calibration.

    Also...the reference voltage to the microcontroller would have to be highly accurate and stable.

    "but thermistor is more accurate than pt100." Who told you such a lie? Thermistors have hysteresis, whereas a PT100 does not. Granted, if your temperature span is only 4C, then the hysteresis could be neglected.
    My batteries are recharged by "Helpful Post" ratings.
    If you feel that I've helped you, please indicate it as a Helpful Post



  14. #14
    Full Member level 5
    Points: 2,843, Level: 12
    Achievements:
    7 years registered

    Join Date
    May 2010
    Location
    usa
    Posts
    294
    Helped
    0 / 0
    Points
    2,843
    Level
    12

    Re: NTC thermistor interface to MCU

    conclusion on omega said that Conclusion:.https://www.omega.co.uk/temperature/...ouple-rtd.html

    Below that temperature, thermistors are often preferred when accuracy is important. RTDs, on the other hand, are chosen when tolerance (i.e. resistance) is important. In short: thermistors are better for precision measurement and RTDs for temperature compensation

    - - - Updated - - -

    Quote Originally Posted by schmitt trigger View Post
    .

    "but thermistor is more accurate than pt100." Who told you such a lie? Thermistors have hysteresis, whereas a PT100 does not. Granted, if your temperature span is only 4C, then the hysteresis could be neglected.
    also this site said that thermistor is more accurate https://www.bapihvac.com/application...lication-note/



    •   AltAdvertisment

        
       

  15. #15
    Super Moderator
    Points: 253,760, Level: 100
    Awards:
    1st Helpful Member

    Join Date
    Jan 2008
    Location
    Bochum, Germany
    Posts
    44,210
    Helped
    13455 / 13455
    Points
    253,760
    Level
    100

    Re: NTC thermistor interface to MCU

    There's no need to argue. Please report if you have found an off-the-shelf thermistor with suitable accuracy for the -40-200 °C range. For the time being, I'm continuing to use RTD for similar applications.



  16. #16
    Full Member level 5
    Points: 2,843, Level: 12
    Achievements:
    7 years registered

    Join Date
    May 2010
    Location
    usa
    Posts
    294
    Helped
    0 / 0
    Points
    2,843
    Level
    12

    Re: NTC thermistor interface to MCU

    ok , what is the accuracy of RTD you used and how did you assure it? do you have another calibrated reference?
    Last edited by mshh; 25th March 2019 at 20:51.



  17. #17
    Advanced Member level 4
    Points: 8,015, Level: 21
    Achievements:
    7 years registered
    paulfjujo's Avatar
    Join Date
    Jun 2008
    Location
    France 01120
    Posts
    1,303
    Helped
    264 / 264
    Points
    8,015
    Level
    21

    Re: NTC thermistor interface to MCU

    hello,

    RTD are used in industrial environment
    and follow Datasheet rules
    differents classes of RTD A,B,C .. differents prices and accuracy
    read theses doccuments to be inform about it..

    Sonde PT1000, Classe B, 10mm, 2 fils, Platine ~7€

    CLASSE B ± 0,30ºC
    CLASSE A ± 0.15ºC
    1/3 DIN ± 0,10ºC
    1/10 DIN ± 0.03ºC cost *100 !

    But the sensor itself is not enough !
    Transducer is an important device in the measurment chain.

    Also length of cable to connect the RTD ..
    RTD mode of connection 2 wires (worth case) 3 wires 4 wires ...

    RTS is quite linear in a short range
    calibrating resistors (Fer-constantant) are used to pre-calibrate the chain measure.
    (very costly!)
    or a specific calibrator ( out of scope for an hobyste)

    you can choose also PT1000
    to reduce the effect of wires resistance
    in 2 wires mode..
    and get delta about 38,5 ohms/100°C

    CTN Thermistors are also used , to get a high resolution Temperature measure
    but needs a calibration between 2 points ( the usual range to measure)
    there are 2 families
    CTN for hobyste : low cost, dispersion of caracteristics between sensors
    CTN for Industries: high cost, datasheet , more interchangeable sensor



  18. #18
    Advanced Member level 5
    Points: 14,318, Level: 28
    schmitt trigger's Avatar
    Join Date
    Apr 2013
    Posts
    2,388
    Helped
    774 / 774
    Points
    14,318
    Level
    28

    Re: NTC thermistor interface to MCU

    Quote Originally Posted by FvM View Post
    There's no need to argue. Please report if you have found an off-the-shelf thermistor with suitable accuracy for the -40-200 °C range. For the time being, I'm continuing to use RTD for similar applications.
    You are correct. I will stop the argument.
    My batteries are recharged by "Helpful Post" ratings.
    If you feel that I've helped you, please indicate it as a Helpful Post



--[[ ]]--