← How-Tos
electronics 16 min ago ◯ 5 min read

Thermistors for Makers: NTC vs PTC, Steinhart-Hart Calibration, and Reading Them with Arduino and ESP32

thermistorntcptcsteinhart-harttemperature sensingesp32arduino

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:

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.

MethodAccuracyComplexityWhen to Use
Linear lookup tableLow outside narrow rangeTrivialPrinter firmware, narrow operating band
Beta equation (single coefficient)Good, ±1-2°C typicalLowMost hobby sensing, weather stations, enclosures
Full Steinhart-Hart (3 coefficients)Excellent, ±0.1-0.2°C achievableModerateReflow 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:

Practical Calibration Workflow

  1. 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).
  2. 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).
  3. 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).
  4. 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.