I'm creating some temperature sensors for home use. To measure outside and rooms' temperatures.
Range from -30 °C to +50 °C.

Temperature measurement is based on 10k NTCs SDNT2012X103F3950FTF (B=3950K, 1%): enter image description here
LMV321 has typical input offset voltage ±0.1 mV (maximum ± 3.5 mV).

These sensors are driven by PIC16F1704 MCU, which has 10bit ADC with these parameters: enter image description here

ADC reads value of NTC1, and MCU uses look-up table to convert measured voltage to temperature.
I have created 5 such identical sensors.

I added "TWEAK" resistors between 10 Ω and 100 Ω so measured temperatures at 23 °C are basically within 0.1 °C: enter image description here

Problem is when I place sensors to temperature around 4 °C, the measured temperatures spread is around 2 °C: enter image description here

Why is it so inaccurate?
Is my procedure wrong? I expected that when I manually tweak voltage divider (R401+TWEAK):(TH401) at 23 °C then it will be very close at other temperatures as well.
Or NTC temperature measurement is accurate only when it is calibrated for 2 temperatures? (like for 0 °C and 23 °C)

I have made the measurements again. I placed those sensors to temperature around 4 °C and the measured temperatures were not with 2 °C spread but around 0.6 °C. Which is already in ballpark of things that are explainable (like 1 % tolerances of NTCs, input offset voltage of buffer opamp and ADC precision).
I have no idea why it it was so way off before. Most likely bad measuring environment (a balcony).
Anyway, I wanted better precision than 0.6 °C (or ±0.3 °C) so I decided to make 2 point calibration (at 2 °C and 23 °C) so I am at precision like ±0.1 °C. I think it is not possible to get such precision with NTCs without calibration.

  • \$\begingroup\$ How are you converting from the measured voltage to a temperature? Keep in mind that NTC devices like you're using has a resistance vs temperature curve that is more complicated than a simple exponentiation function. \$\endgroup\$
    – SteveSh
    Dec 4, 2021 at 20:36
  • \$\begingroup\$ Yes you would need to calibrate it if you really want it to read "accurately". Most thermistor applications don't require high precision. For a generic description "how to do it", check this out: control.com/textbook/instrument-calibration/… \$\endgroup\$
    – Kyle B
    Dec 4, 2021 at 20:38
  • \$\begingroup\$ @SteveSh, I know it is a curve, resistance of NTC is not linear. I have lookup table with values from datasheets with 5C steps. \$\endgroup\$ Dec 4, 2021 at 21:44
  • 1
    \$\begingroup\$ @Chupacabras - " So I used standard formula for NTCs where you enter B and it is possible to calculate resistance for every temperature". No, that's not sufficient. A single B value is only good for a limited range of temperatures, say 25C to 50C. And even then how good that approach is depends on what kind of accuracy you need. \$\endgroup\$
    – SteveSh
    Dec 4, 2021 at 22:31
  • 1
    \$\begingroup\$ @Chupacabras - I see your point. The 6 sensors may all be "wrong", but they should all read close to the same. That leaves B variation between thermistors as the most likely culprit. \$\endgroup\$
    – SteveSh
    Dec 5, 2021 at 13:02

1 Answer 1


The way to approach this sort of thing (when you get an unexpected result) is to try to divide the problem to see where your assumptions went awry.

The sensor is guaranteed (from the factory, assuming it's not damaged) to be within +/-1% at 25°C and the \$\beta\$ is 3950 +/-1%.

Let's see what that means at 25°C - using an online calculator out of laziness, that's about +/-0.23°C. 4°C should be 27287.5K according to the \$\beta\$ model, so a 1% error in \$\beta\$ contributes about another 0.2°C. So we would expect the error due to the sensor to be less than 0.5°C worst-case and perhaps a fraction of that typically. This is something you can check with a multimeter if you have confidence you actually know the temperatures that closely. Even if your multimeter is only good to 0.25% accuracy, the repeatability is much closer.

This would be a good first check to see if the problem is your circuit or your sensors and/or their application and mounting or even real temperature variations.

As far as the op-amp circuit goes, you have an error of +/-3.5mV. That represents a potential resistance error of about 0.3% or less than 0.1°C at 25°C and perhaps 0.2°C at 4°C. Assuming a 5V supply, worse with a 3.3V supply.

ADC error is several times that worst-case, at 4°C

There are a few other errors such as self-heating.

So worst-case we could see unadjusted errors in that range, but it seems unlikely to get worst-case error that large.

Let's consider self-heating- 3.5mW/K is typical of an 0805 mounted on a PCB.

Power dissipation is worst-case at 25°- with a 5V supply you have 2.5mW which would account for almost 1°C error depending on whether your PCB and how much copper it has etc. If the part was floating in air with thin leads it might be considerably worse.

It's a bit strange that you added resistance to the series resistor to make them read 'correctly' since one would expect them to require a lower resistance due to self heating. Perhaps you also fiddled the equation? If that was done improperly (for example, by subtracting a constant from the ADC reading) that could add enormously to the error at temperatures far from 25°C.

If you still think your circuit/equations might be the problem, replace the sensors with precision resistors of 10.00K/27.288K (or whatever your tables say the resistances should be) and compare the readings.

Reading accurate to a fraction of 1°C is actually not so easy. Getting a reading with a high resolution is dead easy with at thermistor or an RTD or a semiconductor sensor, but that's only part of the problem. Things like self-heating and thermal conductivity of wires can add significant errors. You can look at how calibration of probes is checked at standards labs.

And, of course, it's always possible the sensors themselves are not as accurate as claimed.

  • \$\begingroup\$ Thanks for answer. I did the same math as you did. ADC should not be a source of a big error, there is around 2.5 lsb error. In addition to that, I make 4 readings and then average them. I disconnect power to NTC section, it's powered on only for the time of measurement with overhead (like 200ms). Is NTC self heated in such short time? \$\endgroup\$ Dec 5, 2021 at 6:35
  • \$\begingroup\$ Power dissipation in the thermistor at 25C is only ~0.6 mW, with a 5V supply. At that temperature only 2.5V is across the thermistor. \$\endgroup\$
    – SteveSh
    Dec 5, 2021 at 12:59
  • \$\begingroup\$ @SteveSh, is that related to my case? I switch power to NTC section only briefly, for 200ms at measuring. Otherwise it is not powered on. Is self heating a problem in such case? \$\endgroup\$ Dec 5, 2021 at 14:01
  • \$\begingroup\$ No it won't heat much in 200ms, especially if soldered to a PCB, and as @SteveSh points out the power is less. I do suggest you follow the suggested path to debug this. A multimeter and the sensors at the two temperatures will tell you more than reading for an hour. \$\endgroup\$ Dec 5, 2021 at 14:06
  • 1
    \$\begingroup\$ And I like Sephro's idea of replacing the thermistors with precision resistors, if you can do that. That will help you isolate the problem. \$\endgroup\$
    – SteveSh
    Dec 5, 2021 at 14:37

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.