An NTC temp sensor outputs a variable analog resistance, not a direct temperature value. To read it with a microcontroller, you must convert that resistance into a voltage using a series resistor (a voltage divider). For a standard 10kΩ 3950 NTC, use a 10kΩ 1% metal film pull-down resistor, read the analog pin, and apply the Beta parameter equation to convert the raw ADC counts into degrees Celsius.

The Sensing Principle: How an NTC Temp Sensor Works

NTC (Negative Temperature Coefficient) thermistors are sintered semiconductor devices whose electrical resistance drops predictably and non-linearly as temperature rises. Unlike RTDs (Resistance Temperature Detectors) which use pure metals like platinum and exhibit a linear, positive coefficient, NTCs rely on electron mobility increasing with thermal energy. A standard 10kΩ NTC rated at 25°C will typically drop to roughly 2.2kΩ at 85°C, providing high sensitivity in the biological and ambient temperature ranges.

Because microcontrollers like the ESP32 or Arduino Uno cannot measure resistance directly, you must pass a known current through the NTC to generate a measurable analog voltage. This is universally achieved using a voltage divider circuit. The output signal is strictly an analog voltage (typically scaling between 0V and 3.3V or 5V) that the microcontroller's Analog-to-Digital Converter (ADC) samples. There is no digital protocol (like I2C or 1-Wire) native to a raw NTC bead; it is purely a passive analog component.

Wiring and Pinout: Building the Voltage Divider

To interface the NTC with your microcontroller, you need to build a voltage divider. The most stable configuration for 3.3V logic systems (like the ESP32 or Raspberry Pi Pico) places the series resistor between the analog pin and ground, with the NTC between the analog pin and the 3.3V supply. As temperature rises, the NTC's resistance drops, allowing more voltage to pass through to the analog pin.

NTC Voltage Divider Wiring & Supply Specifications
Component Connection Point A Connection Point B Notes / Supply Range
NTC Thermistor (10kΩ) 3.3V Supply (VCC) MCU Analog Input (e.g., GPIO 34) Max supply 5V; 3.3V preferred to reduce self-heating.
Series Resistor (10kΩ 1%) MCU Analog Input (e.g., GPIO 34) Ground (GND) Must be 1% tolerance metal film. 10kΩ matches the 25°C baseline.
Filter Capacitor (Optional) MCU Analog Input Ground (GND) 0.1µF ceramic capacitor to smooth high-frequency ADC noise.

Physical Wiring Steps

  1. Prep the breadboard: Connect your microcontroller's 3.3V pin to the positive rail and GND to the negative rail.
  2. Place the series resistor: Insert a 10kΩ 1% metal film resistor. Connect one leg to the negative (GND) rail and the other leg to an empty row (this will be your signal node).
  3. Place the NTC thermistor: Insert the NTC leads. Connect one lead to the positive (3.3V) rail and the other lead to the exact same row as the series resistor's signal node.
  4. Wire the signal: Run a jumper wire from the signal node to your microcontroller's ADC pin (e.g., GPIO 34 on ESP32, A0 on Arduino Uno).
  5. Add filtering (optional but recommended): Place a 0.1µF ceramic capacitor across the signal node and GND to stabilize the ADC reading.

The Math: Converting Raw ADC Reads to Celsius

Converting the raw ADC integer into a physical temperature requires a two-step mathematical translation: first from ADC counts to resistance, then from resistance to temperature. We use the Beta (B) parameter equation, which is a simplified derivative of the Steinhart-Hart equation. It is accurate to within ±0.5°C across the 0°C to 70°C range for standard 3950 B-value thermistors.

Step 1: ADC Counts to Resistance

The microcontroller reads a voltage, but the math requires the NTC's resistance. Using the voltage divider formula rearranged for the NTC:

R_ntc = R_series * (ADC_read / (ADC_max - ADC_read))

For a 12-bit ADC (like the ESP32), ADC_max is 4095. For a 10-bit ADC (Arduino Uno), it is 1023.

Step 2: Resistance to Temperature (Beta Equation)

Once you have R_ntc, apply the Beta equation:

1/T = (1/T0) + (1/B) * ln(R_ntc / R0)

  • T0: Nominal temperature in Kelvin (25°C = 298.15K)
  • B: Beta coefficient (typically 3950 for standard hobbyist NTCs)
  • R0: Nominal resistance at T0 (10,000Ω)

Complete C++ Implementation (Arduino / ESP32)

#include <math.h>

// Hardware & Thermistor Constants
const int ADC_PIN = 34;          // ESP32 GPIO 34 (ADC1_CH6)
const float SERIES_RESISTOR = 10000.0; // 10k Ohm pull-down
const float NOMINAL_RESISTANCE = 10000.0; // 10k Ohm at 25C
const float NOMINAL_TEMPERATURE = 298.15; // 25C in Kelvin
const float B_COEFFICIENT = 3950.0;      // Datasheet B-value
const int ADC_MAX = 4095;        // 12-bit resolution for ESP32

void setup() {
  Serial.begin(115200);
  analogReadResolution(12);      // Ensure 12-bit on ESP32
}

void loop() {
  // 1. Read raw ADC and calculate resistance
  int raw_adc = analogRead(ADC_PIN);
  if (raw_adc >= ADC_MAX) raw_adc = ADC_MAX - 1; // Prevent divide-by-zero
  
  float resistance = SERIES_RESISTOR * ((float)raw_adc / (ADC_MAX - raw_adc));
  
  // 2. Apply Beta Equation
  float steinhart;
  steinhart = resistance / NOMINAL_RESISTANCE;     // (R/Ro)
  steinhart = log(steinhart);                      // ln(R/Ro)
  steinhart /= B_COEFFICIENT;                      // 1/B * ln(R/Ro)
  steinhart += 1.0 / NOMINAL_TEMPERATURE;          // + (1/To)
  steinhart = 1.0 / steinhart;                     // Invert
  steinhart -= 273.15;                             // Convert to Celsius
  
  Serial.print("Temperature: ");
  Serial.print(steinhart);
  Serial.println(" *C");
  
  delay(1000);
}

Interference Sources and Calibration Tactics

Raw NTC readings rarely work perfectly out of the box without accounting for three primary interference sources. Addressing these is the difference between a ±2°C guess and a ±0.2°C measurement.

⚠️ Warning: ESP32 ADC Non-Linearity

The ESP32's internal ADC is notoriously non-linear, particularly near the 0V and 3.3V rails. If your NTC reads accurately at room temperature but fails at extremes, do not blame the thermistor. Use the ESP-IDF ADC calibration API (esp_adc_cal) or restrict your measurement range to the 0.5V - 2.8V sweet spot by adjusting your series resistor value.

1. Self-Heating Error

Current flowing through the NTC generates heat (P = V² / R). If you power the voltage divider continuously from a 5V rail, a 10kΩ NTC will dissipate roughly 2.5mW. In still air, this can artificially raise the sensor's temperature by 1°C to 2°C. Fix: Power the top of the voltage divider from a microcontroller GPIO pin instead of VCC. Set the pin HIGH for 10ms before reading, then set it LOW. This drops the average power dissipation to near zero.

2. Lead Wire Resistance

Copper wire has resistance (roughly 0.03Ω per meter for 24 AWG). If you run 5 meters of wire to an NTC bead, you add 0.3Ω to the circuit. While negligible for a 10kΩ sensor at 25°C, at 85°C the NTC drops to ~2.2kΩ, making the 0.3Ω lead resistance a larger percentage of the total, skewing the reading. Fix: For runs over 2 meters, use a 100kΩ NTC and a 100kΩ series resistor to render lead resistance mathematically irrelevant.

3. Series Resistor Tolerance

If you use a standard 5% tolerance carbon film resistor for your voltage divider, your baseline resistance could be anywhere from 9.5kΩ to 10.5kΩ. This introduces a hard offset error across the entire temperature curve. Fix: Always use a 1% or 0.1% tolerance metal film resistor for the series leg. Measure it with a multimeter and update the SERIES_RESISTOR constant in your code with the exact measured value.

Decision Tree: Picking the Right Sensor for Your Build

Not all temperature sensing scenarios require an NTC. Use this decision matrix to select the correct component for your specific hardware constraints.

Sensor Selection Matrix: NTC vs Digital Alternatives
Criteria 10kΩ 3950 NTC 100kΩ 3950 NTC DS18B20 (Digital 1-Wire)
Response Time Very Fast (< 2s in liquid) Very Fast (< 2s in liquid) Slow (up to 750ms for 12-bit)
Wiring Complexity Moderate (Requires divider) Moderate (Requires divider) Low (Needs 4.7k pull-up only)
Long Wire Runs (>3m) Poor (Lead resistance skew) Excellent (High impedance) Good (Digital signal, but needs strong pull-up)
MCU Processing Overhead High (Floating point math) High (Floating point math) Low (Returns pre-calculated bytes)
Typical Cost (2026) ~$0.15 per unit ~$0.20 per unit ~$2.50 per unit

Decision Path

  • IF you are measuring battery pack temperatures, 3D printer hotends, or liquid immersion where rapid thermal response is critical AND wire runs are under 1 meter Choose the 10kΩ NTC.
  • IF you are measuring HVAC ducting, greenhouse ambient air, or solar enclosures where wire runs exceed 3 meters Choose the 100kΩ NTC to defeat lead resistance.
  • IF you are using a microcontroller with limited memory (no floating-point unit), need waterproofing out-of-the-box, or want to daisy-chain 10 sensors on a single GPIO Abandon the NTC and choose the DS18B20.
✅ The Default Concrete Pick

For 90% of general-purpose ESP32 and Arduino workbench projects (ambient air, enclosure monitoring, basic liquid temp), buy the Vishay NTCLE100E3103 (10kΩ, 3950 B-value, 1% tolerance) paired with a 10kΩ 1% metal film resistor. It provides the best balance of fast thermal response, low self-heating at 3.3V, and cheap replacement cost.