When you ask "how does a temperature sensor work," the answer depends on whether you are looking at the silicon physics or the system-level thermal management. At the component level, it is about transducing heat into an electrical signal. At the system level, it is about mapping that signal back to a hidden junction temperature ($T_J$) to prevent your ESP32 or power MOSFET from melting its own solder joints.

In embedded power design, a sensor reading is useless unless you understand the thermal path from the silicon die to the ambient air. This guide bridges the gap between sensor physics and practical thermal management, showing you how to use sensor data to calculate thermal resistance, interpret derating curves, and select the right heatsink.

The Physics: Transducing Heat into Data

Temperature sensors in embedded systems generally fall into two categories: thermistors and silicon bandgap sensors. Understanding how they work dictates where and how you mount them.

NTC Thermistors rely on semiconductor ceramics. As temperature rises, more charge carriers are excited across the bandgap, causing resistance to drop exponentially. We linearize this using the Steinhart-Hart equation. They are rugged and cheap but require ADC calibration and self-heating compensation.

Silicon Bandgap Sensors (like the MCP9808 or TMP117) use the Proportional to Absolute Temperature (PTAT) principle. They measure the voltage difference ($\Delta V_{BE}$) between two matched bipolar transistors operating at different current densities. This $\Delta V_{BE}$ is strictly proportional to absolute temperature. An onboard ADC and I2C/SPI interface handle the math, outputting a clean digital value.

Table 1: Embedded Temperature Sensor Specifications and Use Cases
Sensor Model Type / Interface Typical Accuracy Temp Range Best Application
Generic 10k NTC (Epoxy) Analog / ADC ±1.0°C (calibrated) -40 to 125°C Battery pack monitoring, liquid immersion
Microchip MCP9808 Silicon / I2C ±0.25°C -40 to 125°C High-precision PCB ambient, enclosure monitoring
Texas Instruments TMP117 Silicon / I2C ±0.1°C -55 to 150°C Medical devices, industrial calibration rigs
Dallas DS18B20 Silicon / 1-Wire ±0.5°C -55 to 125°C Long-run wiring, multi-drop bus topologies

For a deep dive into the digital conversion architecture of silicon sensors, the Microchip MCP9808 Datasheet provides an excellent block diagram of the internal delta-sigma ADC and PTAT core.

Thermal Path Math: Calculating Junction Temperature

A common mistake in embedded design is assuming the sensor reads the temperature of the component you are trying to protect. It does not. The sensor only measures its own temperature. If it is mounted on the PCB, it measures local ambient ($T_A$). If it is strapped to a MOSFET case, it measures case temperature ($T_C$). To protect the silicon, you must calculate the hidden junction temperature ($T_J$).

This requires thermal path math using thermal resistance ($R_\theta$), measured in °C/W. The fundamental equation is:

$T_J = T_C + (P_D \times R_{\theta JC})$

Where:

  • $T_J$: Junction temperature (the silicon die)
  • $T_C$: Case temperature (measured by your sensor)
  • $P_D$: Power dissipated by the component (in Watts)
  • $R_{\theta JC}$: Junction-to-case thermal resistance (from the datasheet)

Interpreting the Derating Curve

Every power MOSFET datasheet includes a Power Derating Curve. For an IRF540N, the absolute maximum $P_D$ is 94W, but only when $T_C$ is held at 25°C. The derating factor is 0.63 W/°C. If your I2C sensor strapped to the TO-220 tab reads $T_C = 100°C$, the maximum allowable power drops to roughly 46.7W. If your circuit is dissipating 50W at that temperature, you are violating the Safe Operating Area (SOA), even if $T_J$ hasn't technically hit the 175°C hard limit yet.

Warning: The Spirito Effect
Modern trench MOSFETs suffer from localized thermal runaway (the Spirito effect) at high voltages and low currents. Even if your average $T_J$ math looks safe, localized hotspots can destroy the die. Always derate $P_D$ by at least 30% below the datasheet curve for linear-mode operation.

Heatsink Selection and Airflow Dynamics

Let us apply this math to a real-world scenario. You are using an ESP32 to PWM-drive a stepper motor through an IRF540N MOSFET. The MOSFET is dissipating $P_D = 4W$. The maximum safe $T_J$ is 150°C, but we will target $T_J = 110°C$ for long-term reliability. The ambient temperature inside your enclosure ($T_A$) is 45°C.

First, find the maximum allowable total thermal resistance ($R_{\theta JA}$):

$R_{\theta JA(max)} = (T_J - T_A) / P_D = (110 - 45) / 4 = 16.25°C/W$

The total thermal path is the sum of its parts: $R_{\theta JA} = R_{\theta JC} + R_{\theta CS} + R_{\theta SA}$.

  • $R_{\theta JC}$ (Junction-to-Case) = 1.5°C/W (from datasheet)
  • $R_{\theta CS}$ (Case-to-Sink) = 0.5°C/W (using a standard Bergquist Sil-Pad thermal interface material)
  • $R_{\theta SA}$ (Sink-to-Ambient) = The heatsink we need to find.

$16.25 = 1.5 + 0.5 + R_{\theta SA}$
$R_{\theta SA} = 14.25°C/W$

If you browse the CUI Devices Heatsink Catalog or similar suppliers, you will find the CUI Devices HSP-101-25.4. In natural convection (still air), its $R_{\theta SA}$ is roughly 19°C/W. This is too high; your MOSFET will overheat.

What Airflow and Enclosure Changes Buy You

You have two choices: pick a larger extruded heatsink, or introduce forced airflow. Thermal resistance is not static; it drops as air velocity increases, measured in Linear Feet per Minute (LFM).

Table 2: Wakefield Vette 637K (TO-220) Thermal Resistance vs. Airflow
Airflow Condition Air Velocity (LFM) $R_{\theta SA}$ (°C/W) Resulting $T_J$ at 4W
Natural Convection 0 15.5 119°C (Marginal)
Light Forced Air 100 11.0 101°C (Safe)
Moderate Forced Air 200 8.0 89°C (Ideal)

By simply adding a 40mm brushless fan pushing 10-15 CFM across the enclosure, you generate roughly 100-200 LFM over the board. This cuts the thermal resistance of the Wakefield Vette 637K nearly in half, dropping your junction temperature from a dangerous 119°C down to a highly reliable 89°C. If your enclosure is sealed (IP65), you cannot use airflow; you must instead use a larger finned extrusion or mount the MOSFET directly to the aluminum enclosure chassis using an insulating pad.

Failure Signatures: How Hot is Too Hot?

How hot is too hot? The silicon die itself can survive up to 175°C or even 200°C before intrinsic carrier concentration causes it to stop functioning as a semiconductor. However, the packaging and interconnects fail long before the silicon melts.

According to Texas Instruments thermal management guidelines, the practical limits are dictated by the packaging materials and solder joints. Lead-free SAC305 solder melts at 217°C, but mechanical creep and fatigue begin degrading the joint integrity well above 125°C.

When a component is subjected to chronic thermal stress, you will see specific failure signatures before it catastrophically dies:

  1. Parameter Drift (Positive Feedback): As a MOSFET heats up, its $R_{DS(on)}$ increases. A higher $R_{DS(on)}$ means more $I^2R$ conduction losses, which generates more heat. If your thermal management cannot dissipate this extra wattage, the part enters a slow thermal runaway.
  2. Leakage Current Multiplication: Silicon leakage current ($I_{DSS}$) roughly doubles for every 10°C increase in temperature. At 150°C, a MOSFET that leaks 25µA at room temperature might leak several milliamps, generating unexpected static heat.
  3. Bond Wire Lift-Off: The silicon die and the aluminum bond wires connecting it to the pins have different Coefficients of Thermal Expansion (CTE). Repeated thermal cycling (heating up under load, cooling down at rest) causes shear stress at the bond pad. Eventually, the wire snaps or lifts off, resulting in an open-circuit failure.
  4. Delamination: In TO-220 and D2PAK packages, the solder or epoxy attaching the silicon die to the copper leadframe can crack or delaminate. This creates a micro-void, spiking the $R_{\theta JC}$ value. Your case-mounted sensor will read a cool 60°C, while the hidden junction is actually cooking at 160°C.

By understanding how your temperature sensor works and applying rigorous $R_\theta$ math, you move beyond guessing heatsink sizes. You can confidently design embedded power systems that run cool, reliable, and well within their Safe Operating Area, regardless of the enclosure constraints.