NTC thermistor calculator: the beta equation, the divider and the ADC
An NTC thermistor is a resistor whose value falls steeply as it warms: a "10 kΩ" part is 10 kΩ at 25 °C, about a third of that at 50 °C and three times it at 0 °C. The data sheet gives that curve as two numbers, R25 and β, and the beta equation R = R25 · eβ(1/T − 1/T25) (T in kelvin) reproduces it to a degree or so. Put the NTC in a divider with a fixed resistor and a microcontroller's ADC reads a voltage that firmware turns back into a temperature. This calculator does all of it: the resistance at a temperature or the temperature from a resistance, the divider's output and count, the slope and resolution, the series resistor that puts the sweet spot where you want it, and the self-heating error.
How to use the thermistor calculator
- Type R25 and β from the data sheet (10k and 3950 are the commonest; β is quoted as β25/85 or β25/50).
- Type a temperature to get the resistance, or a measured resistance to get the temperature; the last one typed is used.
- Describe the divider: the supply, the series resistor, whether the NTC is on top (output rises with heat) or at the bottom, and the ADC's bits. The dissipation constant (1–3 mW/°C for a bead in air) gives the self-heating error.
- The drawing shows the divider, a thermometer and the R–T curve with the series resistor's level and the midpoint it sets. The Lookup table tab lists resistance, voltage and count every 10 °C for pasting into firmware; the midpoint button sets the series resistor equal to the NTC at the current temperature.
The beta equation
R = R25 · eβ (1/T − 1/T25) T = 1 / (1/T25 + ln(R/R25) / β)
T and T25 (298.15 K) are in kelvin. β, in kelvin, is the material constant that says how steep the curve is; 3000–4500 K covers most parts, and a bigger β means more change per degree. The equation is exact at 25 °C and at the second temperature β was measured at, and within about a degree between them; for wider ranges or better accuracy the Steinhart–Hart equation with three coefficients A, B, C (also in the data sheet) is used instead. β can be found from any two points on the curve: β = ln(R1/R2) / (1/T1 − 1/T2).
The divider and the series resistor
Vout = Vcc × Rs / (RNTC + Rs) (NTC on top)
The NTC in series with a fixed resistor across the supply gives an output that follows an S-curve with temperature: flat at the cold and hot ends, steepest where the two resistances are equal. That crossing is where the resolution is best, so choose Rs equal to the NTC's resistance in the middle of the range you care about: 10 kΩ for room temperature with a 10 kΩ NTC, about 1 kΩ for a 10 kΩ NTC reading 70–90 °C, 4.7 kΩ for a 100 kΩ hot-end thermistor around 200 °C. Use a 1 % resistor; its error goes straight into the reading.
The ADC and the firmware
If the ADC's reference is the same supply that feeds the divider (an Arduino reading a divider from its own 5 V, for instance), the supply voltage cancels and the count depends only on the ratio: count = max × Rs / (RNTC + Rs). Firmware inverts that, RNTC = Rs × (max − count) / count, and applies the beta equation, or looks the count up in a table and interpolates. A 10-bit ADC gives 1024 steps; near the midpoint that is a few hundredths of a degree per count with a 10 kΩ NTC, but at the ends of the S-curve a count may be a whole degree, which is why the midpoint matters.
Errors: tolerance, self-heating and lag
A 1 % R25 tolerance is about 0.25 °C; β tolerance adds an error that grows away from 25 °C. Self-heating is the measuring current warming the bead: P = I²R divided by the dissipation constant (1–2 mW/°C for a small bead in still air, more in moving air or liquid) is the rise, and it makes the reading high. Keep the current small (a larger series resistor, a lower supply, or power the divider only while reading). Thermal lag is the bead's time constant, a few seconds in air and longer in a housing; a reading taken during a change is behind it.
Your thermistor, step by step
- Resistance at 50 °C: 10 kΩ × e3950 (1/323.15 − 1/298.15) = 3.588 kΩ.
- Divider: 3.3 V × 10 kΩ / (3.59 kΩ + 10 kΩ) = 2.429 V, ADC 753 of 1023; midpoint at 25 °C.
- Slope: 136 Ω/°C, 24.3 mV/°C, 0.133 °C per count; self-heating +0.14 °C.
Worked example: a 10 kΩ β 3950 NTC at 50 °C
At 50 °C, T = 323.15 K, so the exponent is 3950 × (1/323.15 − 1/298.15) = -1.0249 and the resistance is 10 kΩ × ethat = 3.588 kΩ. In a divider from 3.3 V with a 10 kΩ series resistor and the NTC on top, the output is 3.3 × 10 kΩ / (3.59 kΩ + 10 kΩ) = 2.429 V, which a 10-bit ADC reads as 753. The slope there is 136 Ω/°C, or 24.3 mV/°C, so one count is 0.133 °C. The divider's midpoint, where the NTC equals 10 kΩ, is 25 °C; for a range centred on 50 °C a 3.59 kΩ series resistor would be better. The current, 243 µA, dissipates 0.212 mW in the bead, which at 1.5 mW/°C warms it by 0.14 °C: negligible. Measured the other way, a reading of 3.59 kΩ on this NTC means 50 °C.
Questions
What is β25/85?
β measured between 25 °C and 85 °C. Data sheets also quote β25/50 or β25/100; they differ by a percent or two because the real curve is not exactly exponential. Use the one closest to your range.
Why is my reading a few degrees off?
Usually the series resistor's tolerance, self-heating, or β being applied far from the temperatures it was measured at. A 1 % series resistor, a small current and the Steinhart–Hart coefficients fix most of it.
NTC on top or at the bottom?
Either works. On top, the output rises with temperature and a broken sensor reads 0 V (easy to detect); at the bottom the output falls with temperature. Many boards use the pull-up (NTC at the bottom with Rs to Vcc) convention.
Can I use a PTC the same way?
Not with this equation. Silicon PTC sensors (KTY) are nearly linear and use a polynomial; switching PTCs are for protection, not measurement.