Table of Contents
KEY TAKEAWAYS
📘 Reading sensors like these in firmware takes solid C — ADCs, scaling math, and data types. My complete Master C & Embedded C course takes you from zero to hardware-ready code — free on YouTube (53 videos), or guided on Udemy with quizzes, certificate and my Q&A support.
- NTC (Negative Temperature Coefficient) thermistors decrease resistance as temperature increases
- PTC (Positive Temperature Coefficient) thermistors increase resistance as temperature increases
- NTC thermistors are used for temperature sensing; PTC thermistors are used for overcurrent protection
- The Steinhart-Hart equation converts NTC resistance to temperature for accurate measurements
What is a Thermistor?
A thermistor is a type of resistor whose resistance changes significantly with temperature. The name comes from combining “thermal” and “resistor.” Unlike regular resistors that are designed to have a stable resistance regardless of temperature, thermistors are specifically designed to be temperature-sensitive.
Thermistors are widely used in embedded systems and IoT projects for temperature measurement, temperature compensation, and over-temperature protection.
There are two types of thermistors:
- NTC (Negative Temperature Coefficient) – resistance decreases as temperature increases
- PTC (Positive Temperature Coefficient) – resistance increases as temperature increases
NTC Thermistors
How NTC Works
NTC thermistors are made from semiconductor materials (typically metal oxides like manganese, nickel, and cobalt). As temperature rises, more charge carriers become available in the semiconductor material, which reduces the resistance.
The relationship between resistance and temperature follows the Steinhart-Hart equation, but a simplified version called the B-parameter equation is commonly used:
R(T) = R0 * exp(B * (1/T - 1/T0)) Where: R(T) = Resistance at temperature T (in Kelvin) R0 = Resistance at reference temperature T0 (usually 25 C = 298.15 K) B = B-value constant (typically 3000-5000 K) T = Temperature in Kelvin T0 = Reference temperature in Kelvin (298.15 K)
Example: A 10K NTC thermistor (R0 = 10K ohm at 25 degree Celsius) with B = 3950:
- At 0 degree C: approximately 32.6K ohm
- At 25 degree C: 10K ohm (nominal)
- At 50 degree C: approximately 3.6K ohm
- At 100 degree C: approximately 0.68K ohm
Notice how the resistance drops dramatically as temperature rises.
Reading NTC with a Microcontroller
The most common circuit for reading an NTC thermistor is a voltage divider connected to an ADC pin:
VCC (3.3V or 5V)
|
|
[R_fixed] (10K ohm)
|
+--------- ADC Pin
|
[NTC] (10K NTC thermistor)
|
GNDThe voltage at the ADC pin depends on the ratio of the fixed resistor to the NTC resistance:
V_adc = VCC * R_ntc / (R_fixed + R_ntc)
Arduino/Embedded Code Example
#include <math.h>
#define ADC_MAX 1023 // 10-bit ADC
#define V_SUPPLY 5.0 // Supply voltage
#define R_FIXED 10000.0 // Fixed resistor: 10K ohm
#define R_NOMINAL 10000.0 // NTC nominal resistance at 25C
#define B_COEFFICIENT 3950.0 // B-value from datasheet
#define T_NOMINAL 298.15 // 25C in Kelvin
float read_ntc_temperature(int adc_value) {
// Step 1: Calculate NTC resistance from ADC reading
float voltage = (adc_value / (float)ADC_MAX) * V_SUPPLY;
float r_ntc = R_FIXED * voltage / (V_SUPPLY - voltage);
// Step 2: Apply B-parameter equation to get temperature
float t_kelvin = 1.0 / (
(1.0 / T_NOMINAL) +
(1.0 / B_COEFFICIENT) * log(r_ntc / R_NOMINAL)
);
// Step 3: Convert Kelvin to Celsius
float t_celsius = t_kelvin - 273.15;
return t_celsius;
}
int main(void) {
int adc_reading = read_adc(0); // Read ADC channel 0
float temperature = read_ntc_temperature(adc_reading);
printf("Temperature: %.1f C\n", temperature);
return 0;
}Common NTC Applications
- Temperature measurement: Room thermostats, weather stations, industrial monitors
- Temperature compensation: Correcting circuit behavior that varies with temperature
- Inrush current limiting: NTC placed in series with power supply to limit startup current surge. As the device heats up, NTC resistance drops and power flows normally.
- Battery temperature monitoring: Most lithium battery packs include an NTC thermistor for safety
PTC Thermistors
How PTC Works
PTC thermistors behave opposite to NTC: their resistance increases with temperature. There are two types:
1. Silistors (linear PTC): Made from doped silicon. Resistance increases gradually and somewhat linearly with temperature. Used for temperature measurement and compensation.
2. Switching PTC (ceramic PTC): Made from barium titanate ceramics. These have a dramatic, non-linear resistance increase above a specific temperature called the Curie temperature or switch temperature. Below this temperature, resistance is low. Above it, resistance jumps by several orders of magnitude (from ohms to megaohms).
PTC Self-Regulating Behavior
The switching behavior of ceramic PTC thermistors makes them self-regulating:
- Current flows through the PTC, causing it to heat up (I squared R heating)
- As it heats up past the switch temperature, resistance increases sharply
- High resistance limits the current, which reduces heating
- The PTC settles at an equilibrium temperature
This makes PTC thermistors inherently safe. They act as resettable fuses.
Common PTC Applications
- Overcurrent protection (resettable fuses / PolyFuses): When too much current flows, the PTC heats up, resistance increases, and current is limited. Once the fault is removed and the PTC cools down, it resets automatically.
- Motor starting: PTC in series with the start winding of a motor. Initially low resistance allows starting current. As it heats up, high resistance disconnects the start winding.
- Self-regulating heaters: PTC ceramic heaters automatically maintain a target temperature without external control circuits.
- Over-temperature protection: PTC placed on a circuit board near heat-generating components. If temperature exceeds the threshold, resistance spikes and shuts down the circuit.
NTC vs PTC: Key Differences
| Property | NTC | PTC |
|---|---|---|
| Resistance vs Temperature | Decreases with temperature | Increases with temperature |
| Temperature Coefficient | Negative | Positive |
| Material | Metal oxides (semiconductor) | Doped silicon or barium titanate |
| Response Curve | Exponential (smooth) | Linear (silistor) or sharp switch (ceramic) |
| Primary Use | Temperature measurement | Overcurrent/overtemperature protection |
| Typical Range | -55 C to +300 C | -55 C to +150 C (switch type: specific temp) |
| Cost | Very low | Low |
| Accuracy | Good (with calibration) | Moderate (not for precision measurement) |
Choosing Between NTC and PTC
Choose NTC when:
- You need to measure temperature (most common choice)
- You need temperature compensation in a circuit
- You need inrush current limiting for power supplies
- You need a wide measurement range
Choose PTC when:
- You need overcurrent protection (resettable fuse)
- You need over-temperature protection that automatically trips
- You need self-regulating heating elements
- You need motor start circuit protection
Tips for Using Thermistors in Projects
- Use the right fixed resistor: For a voltage divider with an NTC, use a fixed resistor equal to the NTC nominal resistance (typically 10K for a 10K NTC). This gives maximum sensitivity around 25 degrees Celsius.
- Apply averaging: Take multiple ADC readings and average them to reduce noise.
- Use a lookup table: For faster computation on 8-bit microcontrollers, pre-calculate resistance-to-temperature values in a lookup table instead of using floating-point math at runtime.
- Check self-heating: Current flowing through a thermistor causes self-heating, which affects accuracy. Keep the measurement current low (under 1 mA for most NTCs).
- Refer to the datasheet: Always get the exact B-value and resistance table from the manufacturer datasheet for accurate measurements.
Summary
Thermistors are simple, inexpensive, and effective temperature-sensitive components. NTC thermistors are your go-to choice for temperature measurement in embedded and IoT projects. PTC thermistors excel at protection applications, acting as self-resetting safety devices. Understanding both types helps you pick the right component for your specific application, whether that is reading room temperature with an NTC or protecting a USB port with a PTC resettable fuse.
Going further: Thermistors are read through the MCU’s ADC, where sampling, reference voltage, and noise all show up in the reading. Our ADC in Microcontrollers guide covers the practical interfacing details.

Vivek Bhageria — Lead Firmware R&D Engineer, 12+ years. Ex-Bosch (automotive powertrain), MusicTribe (real-time audio), medical devices. M.Tech BITS Pilani. I write at NerdyElectronics — practical, register-level embedded systems for engineers who want to understand what’s actually happening under the hood.




