I am a complete noob to temperature measurement. I initially tried to measure temperature using LM35 but i got negative values at room temperature and the values were fluctuating a lot. I want to try to measure temp between 0-100 degrees Celsius using thermistor and found out that need to connect one end of the thermistor to a resistor and then to ground for voltage divider rule. How do i calculate this resistance. i randomly tried 10K ohms and am getting room temperature values, but it is not measuring any higher. i also tried 100k and 3.3k but i am getting extremely small or negative values even at room temperature.I hope you guys can help me out.

  • 2
    \$\begingroup\$ You need to provide a link to the datasheet of the thermistor. Also, add a schematic of your circuit and tell us exactly how and where you are measuring the voltage. \$\endgroup\$ – Elliot Alderson Feb 21 '19 at 16:03
  • 2
    \$\begingroup\$ Let's go back to your LM35. That you get "negative" values suggests that you are doing something very wrong. So how about providing a schematic of exactly what you tried. \$\endgroup\$ – WhatRoughBeast Feb 21 '19 at 16:36

Thermistors are harder to use than the LM35- they are usually very nonlinear.

You need the parameters for the model of thermistor you have, either the \$\beta\$ (and the associated \$T_0\$) or the Steinhart–Hart equation parameters.

Once you have that, you can estimate the temperature as a function of the resistance. For example, the simplified equation:

\$\frac{1}{T} = \frac{1}{T_0} + \frac{1}{\beta}\ln \left(\frac{R}{R_0}\right)\$

One common set of parameters for 10K thermistors is 25/85 3977.

Of course you find the resistance from the ADC reading and a series resistance set up as a voltage divider. You would typically want to maximize the resolution near the temperature where it will be most used, so the series resistor can be chosen to be the same as the thermistor resistance at that temperature. For example, if the thermistor is ~5K at 43°C (and that is near where it will be used) you can use a series 4K99 resistor, and the voltage will be Vin/Vref = R/(R+4K99)

Rx = \$ \frac{4990}{\frac{Vref}{Vin}-1)}\$

You would also want to move to a higher resistance thermistor and series resistor if the self-heating is excessive for your application.

Rather than use transcendental functions of the S-H equation in your MCU you can do the calculations once and use a lookup table to do the conversion from ADC reading to temperature.


First things first, just putting random resistors on there isn't going to work. While a 10k resistor may give you a decent result at room temperature, it will start to drift the higher or lower it gets.

Now the simplest method:

I assume you are familiar with the voltage divider, as this seems to be your method. So, what you need to do is not think about the resistor you are going to use, but rather the resistance of the thermistor at various temperatures. This information should be found in the datasheet.

We can have a look at a standard NTC thermistor curve:

enter image description here


You can see that the resistance changes with temperature. You can then use this data and apply the voltage divider rule to see what voltage you will be getting from your divider at any given temperature. Be sure to put this signal through a buffer!

From here, you can interface with a microcontroller. If you let your microcontroller know the voltages to expect at 25°C, 0°C and 100°C, then you can write an algorithm so that it can work out the rest of the temperature scale to a relatively good accuracy. There will be information online on how to do this.

  • \$\begingroup\$ Please provide a link to the source of your graphic or some other kind of citation. \$\endgroup\$ – Elliot Alderson Feb 21 '19 at 17:26

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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