NEARFIELD·TOOLS

NTC thermistor calculator

Resistance to temperature and back with the Beta or Steinhart-Hart equation, then the part most calculators leave out: the series resistor for your ADC, the error at every tolerance corner with self-heating and the ADC added, and a C lookup table whose interpolation error is measured, not assumed.

Divider and ADC

Range and self-heating

Convert

Defaults: Vishay's NTCLE100E3103 (10 kΩ, B25/85 = 3977 K ±0.75 %, 7 mW/K, the ±2 % version). The three points are from the extended Steinhart-Hart formula in its datasheet. The ADC error is illustrative: take yours from the microcontroller datasheet's total unadjusted error.

—
series resistor
—
worst error
—
per ADC count
—
self-heating
—
resistance
—
temperature
part tolerances with self-heating and ADC target
Temp.ResistanceADC counts°C per countParts errorSelf-heatingWorst error

Steinhart-Hart coefficients

C lookup table

Beta or Steinhart-Hart

An NTC thermistor's resistance falls roughly exponentially as it warms. The simplest description, and the one on the front page of most datasheets, is the Beta equation:

R(T) = R0 · eB·(1/T − 1/T0)

with T in kelvin and R0 the resistance at T0, nearly always 25 °C. B is not a constant of the material: a datasheet measures it between two temperatures and says which, as in B25/85 or B25/50, and the equation is exact at those two and drifts away from the real part elsewhere. For the default part, B is 3931 K measured to 50 °C, 3977 K to 85 °C and 3994 K to 100 °C. Using B25/85 between 0 and 100 °C reads up to 0.77 °C off the curve Vishay publishes for the part, and more below freezing.

The Steinhart-Hart equation fits the curve with three terms instead of two:

1/T = A + B·ln R + C·(ln R)³

Three points from the datasheet's resistance table fix A, B and C. Choose three points, enter a cold one, one in the middle and a hot one that span the range you care about, and the page solves for the coefficients, reports the B25/50 and B25/85 the fitted curve implies, and tells you how far a Beta model would read from it. Steinhart and Hart's form is good to a few hundredths of a degree between the points; outside them it is an extrapolation, and the page says so. With the default points the fit stays within 0.020 °C of Vishay's own four-term formula from 0 to 100 °C.

The series resistor

A microcontroller measures a thermistor as one half of a voltage divider, with a fixed resistor Rs as the other half. With the divider's supply also the ADC's reference, the reading is ratiometric and the supply's own accuracy cancels:

counts = 2N · Rt / (Rt + Rs)

for the thermistor to ground, or Rs on top for the thermistor to the supply. Which way round makes no difference to anything on this page except the direction the counts run. It does decide what a fault reads as: with the thermistor to ground, a broken wire reads as full scale, the coldest possible temperature, and a short reads as zero, the hottest. Firmware should treat readings near either rail as a fault, not a temperature.

The usual advice is Rs = √(Rmin·Rmax), which gives the largest voltage swing between the two ends of the range. The swing is not what matters, though. What matters is how many degrees one count is worth at the worst point, and how much the current through the divider heats the thermistor. The page tries every value in the series and keeps the one whose worst point in the range has the least of the two together: self-heating plus the ADC error in degrees (at least half a count, the rounding of an ideal ADC). For the defaults, √(Rmin·Rmax) is 4.819 kΩ and the page picks 3.74 kΩ. The classic 10 kΩ would make one count worth 0.142 °C at 100 °C instead of 0.065 °C.

One count is worth 1/(2N·|dV/dT|/Vref) degrees, and

d(counts)/dT = 2N · RtRs / (Rt + Rs)² · |d ln Rt / dT|

which is largest where Rt = Rs. The thermistor's own sensitivity falls as it warms (B/T², about 4.5 %/°C at 25 °C and 2.9 %/°C at 100 °C for B = 3977 K), so the hot end of the range is usually the coarse one.

Self-heating

The current through the divider warms the thermistor above the thing it measures, by the power it dissipates divided by its dissipation constant δ, in mW/°C from the datasheet:

ΔT = V2 · Rt / (Rt + Rs)² / δ

That is largest where Rt = Rs, at V²/(4Rs). The default part's 7 mW/K is its datasheet's figure for the leaded part. A small SMD part on a board, or a bead potted in a probe, can be far lower or far higher, so use the figure for your part and mounting. If the error is too large, power the divider from a GPIO pin and switch it on only to sample. As long as it is on for a short time compared with the thermistor's thermal time constant (15 s for the default part), the heating scales with the share of time it is on: enter that under divider powered.

The error at every corner

Your firmware turns counts back into a resistance using the nominal Rs, and that resistance into a temperature using the nominal curve. Every tolerance shows up as a temperature error. The page evaluates all eight corners of the thermistor's resistance tolerance, its B tolerance and the series resistor's tolerance at each temperature, and reports the lowest and highest reading. A resistance tolerance shifts the whole curve, and costs about tol/(B/T²) degrees: ±2 % on a 3977 K part is ±0.45 °C at 25 °C and ±0.70 °C at 100 °C. A B tolerance tilts the curve about 25 °C, so it costs nothing there and more the further you go from it. The series resistor's tolerance adds to the thermistor's directly, whichever way round the divider is, because the firmware cannot tell a 1 % high Rs from a thermistor 1 % low.

To those the page adds the self-heating, which always reads hot, and the ADC error, ± its counts at the local slope. For the defaults the worst total is ±1.95 °C against a target of ±1 °C, so they fail, and the table shows where: at 100 °C the ±0.75 % B tolerance alone costs 0.71 °C and the ±2 % resistance tolerance as much again. If the thermistor's tolerances dominate, the cheapest fix is often a single-point calibration at the temperature that matters most, which removes the resistance tolerance and the series resistor's together and leaves only the B tolerance, small near the calibration point.

The lookup table

Firmware on a small microcontroller rarely evaluates a logarithm. The usual method is a table of ADC counts at fixed temperature steps and linear interpolation between them. The page generates that table for your divider, with a function that interpolates it in integer arithmetic and returns tenths of a degree, and then runs the same function against every reading an ideal ADC would produce across the range and reports the largest difference from the true temperature. That figure includes the curvature between table points, the rounding of the table entries to whole counts and the rounding of the result, so it is what the code delivers, not an estimate. With 5 °C steps on the defaults it is 0.17 °C, and 2 °C steps bring it to 0.10 °C. Finer steps gain nothing more: what is left is the rounding of the ADC itself, half a count at the coarse hot end, plus the 0.05 °C rounding of the result. Outside the table the function clamps to the end temperature; a reading there is better treated as a fault, as above.

On a part with floating point, the coefficients above are all the code needs: T = 1.0 / (A + B*L + C*L*L*L) - 273.15 with L = log(R) and R in ohms.

Related

How the ADC samples through a divider, and how much source resistance it tolerates, is on the voltage divider calculator. A filter capacitor across the thermistor sets how fast the reading settles, which the RC time constant calculator works out; the source resistance it sees is Rt in parallel with Rs. For a thermistor on a heatsink, the heatsink calculator gives the temperatures it should read.

FAQ

What is the B value of a 10k thermistor?

It depends on the material, not the resistance. Vishay's NTCLE100E3 series alone runs from 2880 to 4570 K, and the generic parts sold as "3950" are one more material. Use your part's datasheet. Even a near miss costs something away from 25 °C: 3950 K entered for a 3977 K part reads 0.6 °C high at 100 °C.

Which series resistor should I use with a 10k NTC?

The classic choice is 10 kΩ, which is best around 25 °C. For a range of 0 to 100 °C a smaller one is better at the hot end, where a 10 kΩ divider has the least slope. Enter your range and the page compares every value.

How do I get Steinhart-Hart coefficients from a datasheet?

Take three rows of the resistance-temperature table, one near each end of your range and one in the middle, and enter them under three points. The page solves the three equations and shows A, B and C ready to paste.

Why does my thermistor read a degree high?

Self-heating is the usual suspect when the error is always high and larger in still air than in a draught; the part's resistance tolerance when it is constant across the range. Enter the dissipation constant and see which one the table says it is.