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.

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
- Power the divider from a compatible 3.3 V rail and share circuit ground. Do not power it from 5 V.
- 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.
- 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.
- 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.
- Average samples and filter only as justified by noise. Software filtering cannot fix bad wiring, noisy ground or a wrong equation.

Convert an ADC reading into temperature
- 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.
- Measure or know VCC at the divider. For better accuracy, use the actual rail voltage rather than treating its nominal value as exact.
- Calculate RNTC = Rfixed × VADC/(VCC−VADC). When VADC approaches zero or VCC, conversion error grows and useful resolution falls.
- 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.
- 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.

Diagnose implausible readings
| Symptom | First check | What it separates |
|---|---|---|
| ADC always reads zero | 3.3 V, node, ground continuity and pin number | Open circuit, wrong pin or configuration error |
| ADC stays near maximum | NTC orientation, midpoint and maximum pin voltage | Node pulled to 3.3 V, open NTC or reversed topology |
| Temperature moves the wrong way | Compare VADC during warming and verify the equation | Reversed divider or formula for the wrong orientation |
| Jumps when Wi-Fi starts | Pin choice, supply, ADC and family-specific guidance | ADC2 sharing, rail noise or digital coupling |
| Stable but offset value | Fixed resistor, reference temperature, R25, beta and ADC calibration | Systematic 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
- Espressif ESP-IDF, ADC calibration driver — calibration and attenuation-dependent limits.
- Espressif Arduino-ESP32 ADC API — resolution, attenuation and calibrated reads by API.
- Vishay NTCLE100E3 data sheet — R/T data and beta for a specific variant.
- Analog Devices CN0545 — thermistor conversion and Steinhart–Hart.
Sources consulted November 2, 2026. ADC ranges, supported pins and software APIs vary with ESP32 chip and software release.
Be the first to leave a comment.