# NTC thermistor interface to MCU

1. ## 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;

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. ## 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

3. ## Re: ntc thermistor interface to MCU

Originally Posted by KlausST
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)

•

4. ## 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

5. ## 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.

•

6. ## 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. ## 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

8. ## 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.

9. ## Re: NTC thermistor interface to MCU

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

10. ## 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.

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.

11. ## 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:
- identify sensors with suitable accuracy
- design a measurement circuit that can support it

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. ## 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.

14. ## 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 - - -

Originally Posted by schmitt trigger
.

"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/

15. ## 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. ## 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?

17. ## Re: NTC thermistor interface to MCU

hello,

RTD are used in industrial environment
differents classes of RTD A,B,C .. differents prices and accuracy

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. ## Re: NTC thermistor interface to MCU

Originally Posted by FvM
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.

--[[ ]]--