Temperature sensor applications in embedded systems go far beyond logging room weather or building smart thermostats. When you are pushing an ESP32-WROOM-32 to run continuous WiFi while driving a stepper motor, or dropping 12V down to 3.3V via a linear regulator on a custom PCB, thermal management is the difference between a reliable product and a melted enclosure. The direct answer to "how do I manage heat?" is to map your thermal resistance path ($R_{\theta}$), select a heatsink based on calculated wattage, and place an external NTC thermistor exactly where the silicon meets the board to create a closed-loop thermal cutoff.

Thermal Path Math and Derating Curves

To determine how hot is too hot for a specific part, you must look past the ambient temperature of your room and calculate the junction temperature ($T_J$). Every semiconductor datasheet provides a maximum $T_J$ (usually 125°C or 150°C) and a thermal resistance from junction-to-ambient ($R_{\theta JA}$), measured in °C/W. The governing equation for natural convection is:

$T_J = T_A + (P_D \times R_{\theta JA})$

Where $T_A$ is ambient temperature and $P_D$ is power dissipation. Let us look at a common embedded power scenario: an AMS1117-3.3 linear regulator (SOT-223 package) dropping 12V to 3.3V to feed an ESP32 and a few sensors drawing a combined 300mA. The power dissipated as heat is $P_D = (12V - 3.3V) \times 0.3A = 2.61W$. The $R_{\theta JA}$ for a SOT-223 with standard PCB copper is roughly 50°C/W. Assuming a 25°C ambient, $T_J = 25 + (2.61 \times 50) = 155.5°C$. The AMS1117 max $T_J$ is 125°C. Without intervention, this part will trigger its internal thermal shutdown or fail permanently.

This is where derating curves become critical. A derating curve shows the linear drop-off in maximum allowable power dissipation as ambient temperature rises. If a datasheet specifies a derating factor of 15mW/°C above 25°C, operating at an ambient of 85°C costs you 900mW of your thermal budget before you even turn the circuit on. You must design your thermal path to keep $T_J$ below the derating threshold, not just below the absolute maximum.

Table 1: Common Embedded IC Thermal Limits and Sensor Pairings
Component / IC Class Typical Max $T_J$ (°C) $R_{\theta JA}$ (°C/W) No Heatsink Derating Start Temp (°C) Recommended Sensor Type
ESP32-WROOM-32 (SoC) 105 ~35 (PCB dependent) 85 Internal + External NTC
AMS1117-3.3 (LDO, SOT-223) 125 50.0 70 PCB-mounted Thermistor
IRFZ44N (Power MOSFET, TO-220) 175 62.5 25 TO-220 clip-on K-type / NTC
MCP73831 (LiPo Charger, SOT-23) 125 130.0 65 Adjacent 10k NTC (104NT)

Heatsink Selection and Airflow: What Actually Buys You Headroom

When your $R_{\theta JA}$ calculation yields a fatal junction temperature, you must lower the thermal resistance by introducing a heatsink. The total thermal path from junction to ambient becomes a series circuit: $R_{\theta JA} = R_{\theta JC} + R_{\theta CS} + R_{\theta SA}$, where $R_{\theta JC}$ is junction-to-case, $R_{\theta CS}$ is case-to-sink (thermal interface material), and $R_{\theta SA}$ is sink-to-ambient.

Let us apply this to an IRFZ44N MOSFET (TO-220) switching a 10A continuous load. At elevated temperatures, the $R_{DS(on)}$ rises to roughly 0.035Ω. Power dissipation is $I^2R = 100 \times 0.035 = 3.5W$. The bare $R_{\theta JA}$ is 62.5°C/W, which would push $T_J$ to 243°C. We want to keep $T_J$ under 100°C for long-term reliability. Our target total $R_{\theta JA}$ is $(100 - 25) / 3.5 = 21.4°C/W$.

The IRFZ44N datasheet lists $R_{\theta JC}$ at 1.5°C/W. Using a quality thermal paste yields an $R_{\theta CS}$ of about 0.5°C/W. Therefore, the required heatsink thermal resistance ($R_{\theta SA}$) must be $21.4 - 1.5 - 0.5 = 19.4°C/W$ or lower.

Heatsink Selection Example: Browsing the Aavid Thermalloy catalogs, the Aavid 527202B02500G is a standard extruded aluminum TO-220 heatsink. Its datasheet specifies an $R_{\theta SA}$ of 18.0°C/W in natural convection. Because 18.0 is less than our required 19.4, this specific $3 part solves the thermal crisis without requiring a fan.

What Airflow and Enclosure Changes Buy You: Heatsink ratings assume an open bench environment. If you mount this assembly inside a sealed NEMA 4X polycarbonate enclosure, the internal ambient temperature ($T_A$) will rise 15°C to 20°C above external room temperature due to trapped heat from other components. Conversely, introducing forced air changes the game entirely. Adding a standard 40mm brushless fan providing just 1 meter per second (m/s) of airflow across the Aavid 527202B02500G drops its $R_{\theta SA}$ from 18.0°C/W down to approximately 8.0°C/W. This effectively doubles your allowable power dissipation before hitting the same $T_J$ limit.

Sensor Placement and Failure Signatures of Thermal Stress

Knowing the math is useless if your temperature sensor applications are feeding bad data to your microcontroller. A common mistake in ESP32 and Raspberry Pi Pico projects is relying on the internal silicon die temperature sensor to monitor system health. The internal sensor measures the heat generated by the CPU and RF blocks, not the ambient temperature or the heat of your power delivery network. According to the Espressif hardware design guidelines, internal readings can fluctuate wildly based on WiFi transmission bursts, making them useless for monitoring external power components.

For true thermal management, you must place an external sensor at the thermal bottleneck. For SOT-223 LDOs or SOT-23 LiPo charging ICs (like the MCP73831), the exposed thermal pad on the bottom of the chip is the primary heat exit path. Route a copper pour under the pad to a via-stitched ground plane, and epoxy a 10k NTC thermistor (such as the EPCOS B57891S0103K000) directly to that copper pour on the opposite side of the board. This gives your microcontroller an accurate, rapid-response reading of the IC's actual thermal stress.

Failure Signatures of Thermal Stress: If you ignore thermal limits, components do not always fail with a dramatic pop. They exhibit specific, diagnosable failure signatures:

  • Electromigration in MOSFETs: Sustained operation near max $T_J$ causes metal atoms in the silicon die to migrate over time. The signature is a gradual, irreversible increase in $R_{DS(on)}$ over months of operation, leading to higher heat generation and eventual thermal runaway.
  • Solder Joint Creep (BGA/QFN): Repeated thermal cycling (heating up under load, cooling down at idle) causes the PCB and the IC package to expand and contract at different rates (CTE mismatch). The signature is intermittent I2C or SPI bus faults that only occur when the board is warm, caused by micro-cracks in the BGA solder balls.
  • Thermal Runaway in Linear Regulators: As an LDO approaches its thermal limit, its internal leakage current increases. This leakage draws more power, which generates more heat, creating a positive feedback loop that destroys the silicon before the internal thermal shutdown circuit can react fast enough.

By mapping your $R_{\theta}$ path, selecting verified heatsinks, and placing external NTC sensors at the copper thermal vias, you transform temperature sensor applications from simple data-logging exercises into robust, life-saving feedback loops for your embedded hardware.