For the vast majority of DIY thermal control projects—3D printer hotends, reflow hotplates, incubators, and sous-vide baths running under 300°C—the EPCOS 100k NTC thermistor (Part # B57560G104F) paired with a 10kΩ pull-up resistor is the definitive default choice. It delivers ±1°C accuracy, responds in milliseconds, and costs under $2.00, completely outclassing digital sensors like the DS18B20 which are too slow and physically bulky for embedded heater blocks.

However, reading a raw analog heater temp sensor with a microcontroller like the ESP32 requires navigating non-linear resistance curves, ADC voltage quirks, and severe electromagnetic interference from the switching relays. This guide provides the exact wiring, the Steinhart-Hart conversion math, and the hardware filtering required to get stable readings.

The Physics: How Heater Thermistors Actually Work

NTC (Negative Temperature Coefficient) thermistors rely on semiconductor physics. The sensing element is a sintered ceramic of metal oxides (typically manganese, nickel, and cobalt). As temperature increases, more charge carriers (electrons and holes) are thermally excited across the material's bandgap, which drastically drops the electrical resistance. This relationship is highly non-linear. Unlike a PT100 RTD which yields a nearly linear resistance change, an NTC's resistance curve is exponential. This means you get exceptional sensitivity and resolution at lower temperatures, but the resolution compresses as you approach 300°C. For heater control loops (PID), this high sensitivity at the lower end is actually beneficial for preventing thermal runaway during the initial heat-up phase.

Wiring, Pinout, and Supply Requirements

Because the ESP32's ADC pins can only read voltage (0V to 3.3V) and not resistance directly, you must build a voltage divider. The thermistor acts as the lower leg, and a fixed precision resistor acts as the upper pull-up leg.

Bench Insight: The ESP32 ADC is notoriously non-linear near 0V and 3.1V+. By using a 10kΩ pull-up with a 100kΩ NTC, the voltage at the ADC pin sits around 1.6V at roughly 80°C—right in the linear sweet spot of the ESP32's ADC curve. Do not use a 100kΩ pull-up, or your ADC will saturate in the non-linear zone at standard heater operating temperatures.
ESP32 Heater Temp Sensor Wiring Matrix
Component Pin / WireESP32 DevKit PinNotes & Requirements
VCC (Pull-up Resistor Top)3V3Supply range: 3.3V strictly. Do not use 5V on ESP32 ADC pins.
Signal (Divider Midpoint)GPIO 36 (ADC1_CH0)Use ADC1 pins only. ADC2 conflicts with WiFi on the ESP32.
GND (Thermistor Bottom)GNDKeep ground return path short; avoid sharing with high-current heater grounds.
Pull-up ResistorN/A (Inline)10kΩ, 1% tolerance, 0.25W metal film. Place physically close to the MCU.
Filter CapacitorN/A (Parallel)100nF (0.1µF) ceramic X7R between Signal and GND at the MCU pin.

Raw ADC to Celsius: The Steinhart-Hart Math

The output of this circuit is an analog voltage that varies inversely with temperature. To convert the ESP32's raw 12-bit ADC reading (0-4095) into a physical Celsius value, you must pass the data through three distinct mathematical stages. You cannot simply map the ADC value linearly to temperature.

Stage 1: ADC Raw to Voltage

Using the modern ESP-IDF v5.x adc_oneshot API with calibration enabled, you get a millivolt reading directly. If using legacy Arduino analogRead(), convert the raw 12-bit value to voltage:

V_out = (Raw_ADC * 3.3) / 4095.0

Stage 2: Voltage to Resistance

Using the voltage divider formula, solve for the thermistor's current resistance ($R_t$). With a 10kΩ pull-up ($R_p$) and a 3.3V supply ($V_{cc}$):

R_t = R_p * (V_out / (V_cc - V_out))

Stage 3: Resistance to Temperature (Steinhart-Hart)

The Steinhart-Hart equation models the non-linear curve of the NTC ceramic. For the standard 100kΩ 3950 beta thermistor (like the EPCOS B57560G104F), the coefficients are well-documented by Adafruit's thermistor guide.

The equation is: 1 / T = A + B * ln(R_t) + C * (ln(R_t))^3

  • A = 0.001129148
  • B = 0.000234125
  • C = 0.0000000876741

Note: T is in Kelvin. Subtract 273.15 at the end to get Celsius.

// C++ Implementation for ESP32
float readHeaterTempC(float v_out, float v_cc, float r_pullup) {
    float r_t = r_pullup * (v_out / (v_cc - v_out));
    float logR = log(r_t);
    float tempK = 1.0 / (0.001129148 + (0.000234125 * logR) + (0.0000000876741 * logR * logR * logR));
    return tempK - 273.15;
}

Beating EMI: Interference from SSRs and Heating Elements

The most common point of failure in DIY heater builds is not the sensor itself, but electromagnetic interference (EMI) from the Solid State Relay (SSR) switching the AC mains to the heating element. When an SSR switches 120V or 240V AC, it creates massive dV/dt (voltage over time) spikes. These spikes capacitively couple into long thermistor wires, causing the ESP32 to read phantom temperature spikes of 50°C or more, which will cause your PID loop to shut down the heater prematurely.

To eliminate this interference, apply these three physical layer fixes:

  1. Twisted Pair Wiring: Twist the two thermistor wires tightly (at least 4 twists per inch). This ensures that any induced magnetic noise hits both wires equally, canceling out as common-mode noise at the ADC pin.
  2. Avoid Phase-Angle SSRs: Phase-angle fired SSRs (used for dimming) chop the AC sine wave mid-cycle, generating horrific high-frequency harmonic noise. Always use Zero-Cross SSRs (like the Omron G3NA-210B) for heater control. They only switch when the AC waveform crosses 0V, drastically reducing EMI.
  3. Hardware Low-Pass Filter: The 100nF ceramic capacitor mentioned in the wiring table is non-negotiable. It forms an RC low-pass filter with the 10kΩ pull-up, cutting off high-frequency SSR switching noise before it reaches the ESP32's ADC sampling capacitor.
Mains Safety Warning: When wiring the SSR to the AC mains and the cartridge heater, ensure all connections are made inside a grounded metal junction box. Use high-temperature fiberglass sleeving over the heater wires. Local electrical codes (NEC/IEC) require proper fusing and a mechanical disconnect for mains-powered heating elements; never rely solely on the SSR or the microcontroller to break the circuit.

Decision Tree: Which Heater Temp Sensor Should You Buy?

While the 100k NTC is the workhorse of the maker bench, extreme applications require different physics. Use this decision matrix to select the exact part number for your build.

Application ConstraintSensor TypeRequired Interface ICExact Part Recommendation
Target < 300°C
(3D Printers, Hotplates, Incubators, Coffee Roasters)
NTC Thermistor (Analog) None (Direct to ADC via voltage divider) EPCOS B57560G104F
(100kΩ, 3950 Beta, Glass Coated)
Target 300°C - 600°C
(High-temp reflow ovens, lab kilns, forge pre-heaters)
Type K Thermocouple (Digital SPI) MAX31855 or MAX31856 Adafruit MAX31855 Breakout + Standard Type K Probe
Target < 400°C but requires ±0.1°C Precision
(Calibration baths, medical incubators, chemistry)
PT100 RTD (Digital SPI) MAX31865 Adafruit MAX31865 + 3-Wire PT100 Probe

The Final Verdict

If your heater block operates below 300°C and you are building a standard PID controller on an ESP32 or Arduino, buy the EPCOS B57560G104F 100k NTC thermistor. Do not overcomplicate the build with SPI RTD boards unless your application strictly demands sub-degree laboratory precision. The EPCOS glass-coated bead survives the harsh thermal cycling of a hotend, the 10kΩ pull-up keeps the ESP32 ADC in its linear zone, and the Steinhart-Hart math guarantees accurate physical scaling. Pair it with a zero-cross SSR, twist your wires, and your thermal control loop will be rock solid.