NTC Thermistor Calculator
Turn an ADC count into a temperature through an NTC divider. Beta and Steinhart-Hart both ways, resolution over the range, and the self-heating nobody checks.
Ohms — the R25 on the datasheet.
Celsius, almost always 25.
Kelvin. Datasheets quote it as B25/85.
Ohms — the other leg of the divider.
Which leg the thermistor is in.
Full scale 4095
ADC counts, 0 to 4095.
Volts, for the self-heating estimate.
2048 counts → 10k Ω → 24.99 °C10k Ω0.022 °C per count272 µW → 0.136 °C rise2048 countsA 0.14 °C rise from the measurement current is comparable to the accuracy an NTC is usually chosen for. A larger fixed resistor, or switching the divider on only while sampling, removes it.
Across the range
Resolution is finest where the thermistor's resistance is near the fixed resistor's and falls away either side. That is what choosing the fixed resistor actually decides.
| Temperature | Resistance | Counts | °C per count |
|---|---|---|---|
| -40 °C | 401.9k Ω | 3996 | 0.142 |
| -25 °C | 144.3k Ω | 3830 | 0.063 |
| -10 °C | 58.2k Ω | 3495 | 0.034 |
| 5 °C | 25.9k Ω | 2955 | 0.024 |
| 20 °C | 12.5k Ω | 2278 | 0.022 |
| 35 °C | 6.51k Ω | 1614 | 0.025 |
| 50 °C | 3.59k Ω | 1081 | 0.033 |
| 65 °C | 2.09k Ω | 707 | 0.049 |
| 80 °C | 1.27k Ω | 462 | 0.077 |
| 95 °C | 805.4 Ω | 305 | 0.121 |
| 110 °C | 529.1 Ω | 206 | 0.190 |
| 125 °C | 358.8 Ω | 142 | 0.293 |
Three conversions, three ways to be wrong
A thermistor is the cheapest way to measure temperature and among the most awkward to get right, because three separate steps sit between the number firmware reads and the number a person wants.
| Step | Depends on |
|---|---|
| counts → resistance | Which leg of the divider the NTC is in |
| resistance → kelvin | The Beta equation, or Steinhart-Hart |
| kelvin → celsius | 273.15, not 273 |
That last one looks like a joke and is not. Using 273 puts every reading 0.15 °C out, which is well inside what a careless reviewer would accept and well outside what the part is capable of.
Read it as a ratio, not as a voltage
With the NTC to ground and a fixed resistor to the supply, the reading as a fraction of full scale gives the resistance directly:
R = Rfixed × ratio / (1 − ratio), where ratio = counts / fullScale
The supply voltage does not appear. On a ratiometric ADC — one whose reference is the same rail that feeds the divider — a supply that sags moves the divider output and the reference by the same factor, and the count does not change at all. That immunity is the main reason this circuit is used.
Code that converts counts to volts and then to ohms has thrown it away before the temperature is computed, and the reading starts drifting with the battery. It is a common shape in example code because volts feel more concrete than a ratio.
One detail inside that ratio is worth being exact about: full scale for an n-bit ADC is 2n − 1, not 2n. A 12-bit converter reads 0 to 4095, so half scale is 2047.5 and a reading of 2048 is just above the midpoint — which is why the calculator above answers 24.99 °C rather than 25.00 for a 10 kΩ part in a 10 kΩ divider. Dividing by 4096 is a small error at the middle and a growing one towards the top of the range.
Beta is the two-point model
1/T = 1/T₀ + ln(R/R₀) / B, with temperatures in kelvin.
One constant, exact at the reference temperature by construction, and exact at the second temperature it was fitted to. A datasheet quoting B25/85 is naming those two. Between and beyond them the real curve bends away, which is why a sensor calibrated at room temperature can read a degree out in a fridge and still be working perfectly.
Steinhart-Hart is the same equation with the curvature put back
1/T = A + B·ln(R) + C·ln(R)³
Look at what happens when C is zero: the equation becomes linear in ln(R), which is exactly the Beta equation rewritten. Beta is not an alternative to Steinhart-Hart, it is the C = 0 case of it.The cubic term is the curvature a real part has and a two-point fit cannot express.
Three coefficients need three measurements, and the fit passes through all three exactly. That makes the choice of points the whole job: three rows clustered around room temperature produce coefficients that are superb there and useless at the ends. Spread them across the range that matters.
The fixed resistor decides the resolution
Sensitivity peaks where the thermistor's resistance is near the fixed resistor's and falls away sharply either side. A 10 kΩ NTC with a 10 kΩ resistor resolves finely around 25 °C and coarsely at 100 °C, where the thermistor has dropped to a few hundred ohms and a whole ADC count covers a large temperature step.
Matching R25 is the reflex, and it is the right answer only if room temperature is what matters. For an oven or a battery pack running hot, size the fixed resistor to the thermistor's resistance in the middle of that range instead. The table above prices the trade.
Self-heating
Current through the thermistor warms it, and the reading follows the part up. Power divided by the dissipation constant on the datasheet — milliwatts per degree — gives the rise.
A 10 kΩ NTC in a 10 kΩ divider on 3.3 V dissipates about 270 µW, which with a typical 2 mW/°C constant is under a seventh of a degree. Tolerable. Halve the resistors for a stronger signal and the power quadruples, at which point the sensor is measuring its own current as much as the environment. Where that matters, the usual fix is to power the divider from a GPIO and switch it on only while sampling.
Getting the wiring backwards
With the NTC to ground, counts fall as it warms. With the NTC to the supply, they rise. Swap the legs and the reading still moves by the right amount, in the wrong direction — which looks like a wiring fault rather than a software one and gets debugged with a multimeter for far longer than it should.
Frequently asked questions
Beta or Steinhart-Hart — which should I use?
Beta if a degree or so is fine, or if the range is narrow and near the two temperatures the datasheet fitted it at. Steinhart-Hart when the range is wide or the accuracy matters: it costs three constants and one extra multiply, and removes most of the error at the ends of the range.
Why is my reading a degree out at the extremes but right at 25 °C?
That is the signature of the Beta equation. Beta is a two-point fit, exact at the two temperatures it was measured at — usually 25 and 85 — and drifting away from the real curve outside them. Fitting Steinhart-Hart to three points spread across your actual range removes it.
Do I need to know the supply voltage?
No, and you should avoid using it. The resistance comes from the reading as a fraction of full scale, so a supply that sags cancels out — provided the ADC reference is the same rail that feeds the divider. Converting counts to volts first throws that away and makes the reading move with the battery.
Which value should the fixed resistor be?
The reflex is to match R25, which centres the resolution on room temperature. If the range that matters is a hot end, size it to the thermistor resistance in the middle of that range instead — the table above shows what the choice costs elsewhere.
How much does self-heating matter?
It is the current through the thermistor warming the thing being measured. Power over the dissipation constant from the datasheet, in mW per °C, gives the rise. A tenth of a degree is usually ignorable; anything approaching the accuracy being claimed means the divider draws too much, and a larger fixed resistor or a switched divider fixes it.
The code behind this
The arithmetic on this page is published as the thermistor module — the same functions you are using here, with the same tests. MIT, no dependencies.
Read the sourceOn npmnpm i electronics-math
Related tools
- I²C Pull-Up Resistor CalculatorThe window between pulling low and rising in time, with the standard values inside it.
- Ohm's Law CalculatorAny two of V, I, R and P give the other two, and it shows its working.
- Parallel & Series Resistor CalculatorTotals both ways, plus the E-series pair that lands on a value you cannot buy.