To read a 10 kΩ NTC with an ESP32, place it in series with a known resistor to make a voltage divider, then measure the midpoint with a compatible ADC input. In this wiring, the fixed resistor connects to 3.3 V, the midpoint goes to the ADC and the NTC returns to ground. Midpoint voltage falls as the NTC warms. Convert voltage to resistance, then resistance to temperature using the exact R25 and beta values. Never apply 5 V directly to an ESP32 pin.

Circuit and direction of change

Wire it as 3.3 V → Rfixed → ADC node → NTC → GND. The midpoint is:

VADC = VCC × RNTC / (Rfixed + RNTC)

Solving for the thermistor gives RNTC = Rfixed × VADC / (VCC − VADC). Because NTC resistance falls as temperature rises, this orientation makes the ADC voltage fall while warming. If the NTC and fixed resistor are swapped, voltage rises; use the matching equation. Identify the parts before copying code: both orientations work, but their formulas are not interchangeable.

ESP32 board, NTC and fixed resistor arranged to form a low-voltage divider
Original illustration: the NTC and fixed resistor make the divider, powered from 3.3 V.

Choose the fixed resistor

A value near RNTC at the center of the useful range often improves sensitivity around that point, but there is no one optimum value for every temperature range. A 10 kΩ fixed resistor with a 10 kΩ-at-25°C NTC is a common starting point, not a precision guarantee. Choose based on the temperature range, useful ADC resolution, current, thermistor self-heating and sampling interval.

In an ideal nominal example at 25°C, RNTC = Rfixed = 10 kΩ and VCC = 3.3 V produce VADC ≈ 1.65 V. This assumes ideal components, known supply and a sensor exactly at 25°C. In practice, resistor tolerance, thermistor R25 and beta, ADC error and supply changes shift the value. Divider current in this example is 3.3 V / 20 kΩ = 0.165 mA. NTC power is I²R; check its data sheet to keep self-heating acceptable.

Protect and read the ADC input

  1. Power the divider from a compatible 3.3 V rail and share circuit ground. Do not power it from 5 V.
  2. Confirm node voltage stays within the range allowed for the exact ESP32 variant and chosen attenuation. Measurable full-scale range and the pin’s absolute electrical limit are different specifications.
  3. Use an ADC input that fits the chip and radio context. On some generations, ADC2 is shared with Wi-Fi; details vary by family. Check the chip and framework documentation.
  4. Prefer a calibrated conversion supplied by the current framework where available, such as a calibrated millivolt API in Arduino-ESP32 or the ESP-IDF calibration driver. Assumed legacy Vref values are not universal.
  5. Average samples and filter only as justified by noise. Software filtering cannot fix bad wiring, noisy ground or a wrong equation.
Multimeter checking the NTC divider midpoint connected to the ESP32 ADC
Original illustration: check the midpoint without exceeding the input pin voltage.

Convert an ADC reading into temperature

  1. Convert the calibrated ADC code to VADC. If you only have raw counts, use calibration for that chip and attenuation; do not assume 4095 equals exactly 3.3 V.
  2. Measure or know VCC at the divider. For better accuracy, use the actual rail voltage rather than treating its nominal value as exact.
  3. Calculate RNTC = Rfixed × VADC/(VCC−VADC). When VADC approaches zero or VCC, conversion error grows and useful resolution falls.
  4. Convert resistance with the manufacturer’s table, or with beta when its conditions apply: 1/T = 1/T0 + ln(R/R0)/B. T and T0 are kelvin; then convert °C = K−273.15.
  5. For a wide range or demanding accuracy, use multiple calibration points or Steinhart–Hart coefficients for the part rather than applying an approximate beta outside its range.

Example: with Rfixed = 10 kΩ, VCC = 3.30 V and calibrated ADC voltage 1.50 V, RNTC ≈ 10 kΩ × 1.50/(3.30−1.50) ≈ 8.33 kΩ. Then find temperature from the curve for the exact part. This calculation alone does not prove the sensor is at 30°C; the curve, tolerance and circuit error determine that conclusion.

Temperature reading tracked as an NTC warms under controlled conditions
Original illustration: a stable, monotonic reading helps validate calibration.

Diagnose implausible readings

SymptomFirst checkWhat it separates
ADC always reads zero3.3 V, node, ground continuity and pin numberOpen circuit, wrong pin or configuration error
ADC stays near maximumNTC orientation, midpoint and maximum pin voltageNode pulled to 3.3 V, open NTC or reversed topology
Temperature moves the wrong wayCompare VADC during warming and verify the equationReversed divider or formula for the wrong orientation
Jumps when Wi-Fi startsPin choice, supply, ADC and family-specific guidanceADC2 sharing, rail noise or digital coupling
Stable but offset valueFixed resistor, reference temperature, R25, beta and ADC calibrationSystematic error rather than instantaneous noise

The guide to unstable ESP32 ADC readings helps separate noise from calibration. The ESP32 battery divider guide covers other analog-input precautions. To test the sensor separately, see how to test a 10 kΩ NTC with a multimeter.

Why can a 10 kΩ NTC report the wrong temperature?

R25 alone does not define the curve. Beta, tolerance, fixed resistor, actual reference temperature, ADC calibration, divider supply and self-heating all add error.

Can I power the divider from USB 5 V?

Not with its midpoint connected directly to an ESP32 unless a specified divider and protection make it safe. Pins are not 5 V tolerant by default. Use the board’s 3.3 V rail and verify the board/chip documentation.

What equation applies if the NTC is on top?

The equation changes with orientation. For NTC from VCC to the node and Rfixed from node to ground, RNTC = Rfixed × (VCC/VADC−1). Check the actual wiring before reusing the previous equation.

Technical sources

Sources consulted November 2, 2026. ADC ranges, supported pins and software APIs vary with ESP32 chip and software release.