A thermistor is one of the cheapest, toughest temperature sensors you can put on a board: two wires, a few cents, and a resistance that swings hard with temperature. The difficult part is everything around it — the divider you hang it on, the equation you run on the result, and the small practical details that keep noise and self-heating from eating your accuracy. Get those right and even a 10-bit ADC will give you readings you can trust in a greenhouse, a battery pack, or a reflow oven.

The Sensor, in One Paragraph

An NTC thermistor is a resistor whose value falls as it warms up, roughly exponentially. A common part reads 10 kΩ at 25 °C with a B value somewhere between 3500 K and 4000 K. That steep, nonlinear curve is why thermistors are so sensitive — and why you cannot simply map ADC counts to degrees with a straight line. Digital sensors like the DS18B20 are easier to wire, and RTDs are more stable over years, but for a fast, cheap, tiny, forgiving analog sensor, the NTC still wins.

Designing the Voltage Divider

Wire the thermistor in series with a fixed resistor between your analog rail and ground, and read the midpoint with the ADC. Put the thermistor on the ground side and the output rises with temperature, which is slightly easier to reason about:

Vrail → R_thermistor → ADC node → R_series → GND

Because the ADC usually measures the node against the same rail that feeds the divider, most of the supply variation cancels out. This ratiometric trick is worth protecting: if you switch to an internal bandgap reference of 1.1 V or 2.5 V, that cancellation disappears and supply noise lands directly in your reading. It also means the node voltage must stay below the reference, so rescale the divider if you use one.

Picking the series resistor

Match the series resistor to the thermistor's resistance at the middle of the range you care about. For a 10 kΩ NTC used around room temperature, a 10 kΩ, 1% metal-film resistor is the classic choice; it gives the largest voltage change per degree right where you need it. Move the setpoint to 80 °C and you would fit the divider at the thermistor's resistance near 80 °C instead.

What sort of sensitivity does that give you? On a 3.3 V rail with a 10 k/10 k divider, the node moves roughly 35 mV per °C near 25 °C. On a 10-bit ADC with 3.2 mV steps, that is about a tenth of a degree per count. Resolution is not your bottleneck — noise, tolerance, and self-heating are.

Turning ADC Counts Into Resistance

Read the raw code, convert it to a voltage or, better, to a fraction of full scale, then solve for resistance:

  • R_thermistor = R_series × V_out / (V_rail − V_out) for the arrangement above
  • With a fixed reference, V_out = code / (2^N − 1) × V_ref; with a rail-tied reference, the rail voltage drops out of the ratio entirely

Use a 1% or better series resistor and measure its actual value if you can. That resistor becomes your reference, so its error is your error.

From Resistance to Temperature: Steinhart–Hart

The standard model is the Steinhart–Hart equation, with temperature in kelvin:

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

Three coefficients need three calibration points. Choose temperatures spread across your working range rather than clustered at room temperature, solve the resulting 3×3 system once on a PC, and hard-code the coefficients in firmware. Do not forget the kelvin-to-celsius conversion at the end — it is the most common bug in thermistor code. Some datasheets use a different arrangement of the same equation, so check which form the coefficients belong to before pasting them in.

The B-parameter shortcut

If you only need a narrow range, the two-constant form is far less work:

1/T = 1/T₀ + (1/B)·ln(R/R₀)

With T₀ = 298.15 K and R₀ the nominal resistance at 25 °C, this is accurate to a few tenths of a degree near room temperature and drifts to a degree or more at the ends of a wide span. Fine for a thermostat; not fine for a calibrated instrument.

Calibration Is Where the Accuracy Lives

Cheap NTCs are interchangeable to a degree or worse, and the tolerance at 25 °C tells you nothing about the tolerance at 90 °C. Read the datasheet curve, not just the headline number.

The easiest good reference is an ice bath: crushed ice, a little distilled water, stir, and wait. That is 0 °C almost exactly. For a second point, use a known-good thermometer in stirred warm water rather than boiling water, whose temperature depends on atmospheric pressure and your altitude. If your error is small and roughly constant, a single offset correction beats refitting coefficients. If it grows at one end of the range, recalibrate with points closer to that end.

Killing Noise and Self-Heating

Electrical noise and joule heating are the two quiet failures in thermistor circuits. Both are manageable:

  • Average 16 to 64 readings, and discard the first sample after any channel or reference switch so the sample-and-hold capacitor has time to charge.
  • Take a median of a few readings before averaging to reject spikes from nearby switching.
  • Add an RC low-pass at the node — 1 kΩ and 100 nF gives a corner around 1.6 kHz and also supplies charge to the ADC input.
  • Mind the divider's Thevenin impedance. A 10 k/10 k pair looks like 5 kΩ to the ADC, which is high for some microcontrollers; check the datasheet or add a unity-gain buffer.
  • Drive the divider from a spare GPIO pin: power it, wait for the RC to settle, read, then turn it off. Average power drops by orders of magnitude.
  • Keep sensor wiring away from motors, switching regulators, and PWM traces. Twist long runs in pairs, and shield them if the cable is longer than a metre.

Small bead thermistors typically dissipate on the order of 1 mW per °C in still air, so a fraction of a milliwatt of excitation can already bias the reading by a couple of tenths of a degree. Check your part's datasheet and keep excitation low, especially in still air or when the thermistor is potted.

A Practical Bring-Up Checklist

  1. Measure the thermistor with a multimeter at room temperature and compare it with the resistance your firmware computes. They should agree closely.
  2. Drop the probe in an ice bath and confirm 0 °C within your target error.
  3. Log a few hundred readings with the sensor sitting still and look at the spread. That spread, not the resolution, is your real precision.
  4. Turn off the excitation between reads and verify the reading does not creep upward — that is self-heating disappearing.
  5. Leave it logging for an hour next to a reference thermometer and compare trends, not just single points.

Temperature measurement is a chain, and the weakest link sets the result. A 1% resistor, a sensible divider value, the right equation, and a bit of averaging will get you further than any single expensive component.

Photo: FOX ^.ᆽ.^= ∫ / Pexels