# Thermistor resistance to celsius conversion

I'm new to electronics, and experimenting with a thermistor plugged into an Arduino. It is a 4.7k thermistor (full specs) and I'm using it in conjunction with a 10k resistor (product page). When rigged up to the Arduino (and powered via a 3.3V pin) it returns an analog reading of around 2870 at room temperature.

I've looked at a few different conversion scripts out there, but most seem to be working when the analog reading is ~600-700. Have I done something wrong? If not, how do I go about working out how to do the conversion?

• Show the schematic. Nov 4, 2015 at 19:53
• Done! Let me know if you need anything else. Pin A5 is set to high, so it should give a constant 3.3v output. Nov 4, 2015 at 20:07
• Swap the thermistor and the 10K and see if your numbers are then closer to the "other people's numbers" perchance? It's a voltage divider either way. Nov 4, 2015 at 20:09
• Damn, that's confusing! That's now returning values around ~1300 Nov 4, 2015 at 20:14
• So, try 20K (or two 10K in series) - it should not be all that confusing - I would hope that your unit-less numbers have some reasonable relationship to voltage (perhaps the handy one of being millivolts, though that does not seem to fit what you've reported. Might be 4096 to 3.3V??) If you are doing the calibration/LUT yourself, you don't really need a particular value to start with so long as the current is not excessive for the part (self-heating can cause errors in a manner that should self-explanatory.) Nov 4, 2015 at 22:19

There are two formulas describing the resistance-temperature dependency. The most commonly used formula is

## The B-Formula

$$R(T)=R_0\cdot \exp \left(B\cdot\left(\frac{1}{T}-\frac{1}{T_0}\right)\right)$$

where $R_0=4.7k\Omega$ and $T_0=298.15K$ (Note that the formula uses Kelvin, and the nominal resistance $R_0$ is given for 25°C=298.15K)

$B=3977K$ is a constant specific for your part, and usually listed in the datasheet, or your product page.

the inverse of the formula is $$T=\frac{T_0\cdot B}{T_0\cdot \ln(R/R_0)+B}$$

This formula is usually suitable for a temperature range of -20...+120°C, but you may find your own value for B if your measurement range is far away from this. However, I observed a deviation of just 1°C at -40°C for a type I used.

## The Steinhart-Hart-Formula

If the B-Formula doesn't meet your accuracy needs, you can use this:

$$T=\frac{1}{A+B\cdot\ln\frac{R}{R_0}+C\cdot\ln^2\frac{R}{R_0}+D\cdot\ln^3\frac{R}{R_0}}$$

However, the Steinhart-Hart coefficients A, B, C, D are usually not given in datasheets, and you have to find them out on your own. (Also, calculation of the inverse is... one of my professors would say something for long Christmas night without girlfriend...)

I would advise you to go with the B-Formula, as it's the easiest and the B value is usually known. A look-up table eats some memory, and the work to determine the values is in vain when you have to exchange the thermistor due to part spread.

If A5 outputs 3.3V, you should get about $\frac{10k\Omega}{10k\Omega+4.7k\Omega}\cdot 3.3V=2.24V$ for high room temperatures (25°C). For lower temperatures, the thermistor has a higher resistance, and the voltage should be lower.