Thermistors for Makers: NTC vs PTC, Steinhart-Hart Calibration, and Reading Them with Arduino and ESP32
Almost every FDM 3D printer hotend and heated bed on your bench already has a thermistor buried in it, yet the component itself rarely gets explained. A thermistor is just a resistor whose resistance changes predictably with temperature — cheap, fast-responding, and good enough for the vast majority of maker projects that need to sense heat, from a reflow oven to a greenhouse controller. The catch is that the relationship between resistance and temperature is nonlinear, and getting an accurate reading out of one means understanding how to calibrate that curve instead of trusting a rough lookup table.
NTC vs PTC: Two Very Different Behaviors
Thermistors come in two families that behave almost opposite to one another:
- NTC (Negative Temperature Coefficient): resistance drops as temperature rises. This is the type in nearly every 3D printer hotend (100K NTC is the de facto standard), most reflow ovens, and most DIY temperature-logging projects. NTC thermistors are prized for high sensitivity over a usable range, typically -50°C to 300°C depending on the part.
- PTC (Positive Temperature Coefficient): resistance rises with temperature, often dramatically past a trip point (these are called "switching" PTCs). PTCs are more common as resettable fuses and self-regulating heaters than as precision sensors, because their resistance curve is far less linear and less suited to fine measurement. A small subset of PTCs (silistors, like the KTY series) are built for linear measurement, but they are far less common on hobbyist boards than NTC parts.
Unless a datasheet specifically calls out a linear PTC sensor, assume "thermistor" on a maker board means NTC.
Why You Can't Just Use a Linear Formula
A standard resistor's value barely shifts with temperature. An NTC thermistor's resistance can fall by a factor of 10 or more across its working range, and the curve is exponential, not linear. Simple two-point linear interpolation works fine over a narrow band (which is why printer firmware tables are "good enough" for a 180–260°C hotend range) but falls apart if you need accuracy across a wide span, like a shop environment that swings from a cold garage in winter to a hot attic in summer.
The Steinhart-Hart Equation
The standard model used to convert thermistor resistance to temperature is the Steinhart-Hart equation:
1/T = A + B·ln(R) + C·(ln(R))³
Where T is temperature in Kelvin, R is the measured resistance in ohms, and A, B, and C are coefficients unique to that thermistor. Most hobbyist projects never need to derive these from scratch — manufacturers publish them, or you can calculate good-enough coefficients from three resistance/temperature pairs taken at known reference temperatures (ice water at 0°C, room temperature, and boiling water at 100°C, adjusted for elevation, are the classic three-point calibration baths). A simpler single-coefficient version, the Beta equation, is adequate for most non-critical work and only needs the thermistor's nominal resistance (usually at 25°C) and its Beta value, both of which are almost always on the datasheet or printed on the part.
| Method | Accuracy | Complexity | When to Use |
|---|---|---|---|
| Linear lookup table | Low outside narrow range | Trivial | Printer firmware, narrow operating band |
| Beta equation (single coefficient) | Good, ±1-2°C typical | Low | Most hobby sensing, weather stations, enclosures |
| Full Steinhart-Hart (3 coefficients) | Excellent, ±0.1-0.2°C achievable | Moderate | Reflow ovens, scientific logging, calibration work |
Wiring and Reading a Thermistor with Arduino or ESP32
Thermistors are almost always read with a simple voltage divider: the thermistor in series with a fixed reference resistor (commonly matched to the thermistor's nominal value, e.g. 100K for a 100K NTC) between your supply voltage and ground, with the midpoint going to an analog input. A few practical notes that matter more than people expect:
- Reference resistor tolerance matters. A 1% or better reference resistor noticeably improves repeatability versus a generic 5% part, since its error directly multiplies into your resistance-to-temperature math.
- Self-heating is real. Running too much current through a thermistor continuously (rather than pulsing the measurement) warms the part itself and skews the reading, especially on small SMD thermistors with little thermal mass to dissipate the heat.
- ESP32 ADC nonlinearity compounds the error. The ESP32's ADC has well-documented nonlinearity and channel-to-channel variation — for anything beyond rough sensing, calibrate the ADC itself before you worry about thermistor math, or you're just adding two sources of error together.
- Lead length and connector resistance add directly to your divider's resistance on long sensor runs. For anything over a meter or so of wire, especially at low resistance values, consider a 3-wire or 4-wire measurement to cancel lead resistance, or budget for the offset in your calibration constants.
Practical Calibration Workflow
- Note the thermistor's nominal resistance and Beta value from the datasheet (or measure resistance at a known room temperature as a starting point if the part is unmarked).
- For better-than-Beta accuracy, take three resistance readings at three well-separated, accurately known temperatures (an ice bath, room temperature verified against a calibrated reference thermometer, and a boiling water bath, correcting for altitude).
- Solve the three simultaneous Steinhart-Hart equations for A, B, and C (freely available calculators and spreadsheets do this instantly from your three data pairs).
- Hard-code those coefficients into your firmware instead of generic datasheet values, and re-verify against your reference thermometer at a fourth, independent temperature to confirm the fit.
For most shop and home-automation projects a datasheet Beta value read through a clean voltage divider is entirely sufficient. Reach for full three-point Steinhart-Hart calibration specifically when the project's value depends on absolute accuracy — a reflow oven profile, a calibration reference, or anything you plan to compare against another instrument.