When designing high-power embedded systems—like an ESP32 driving a stepper motor or a power MOSFET switching a 12V heater—the first question is never just 'how do I read the data.' The first question is 'where do I place the sensor, and what threshold triggers a shutdown?' If you are monitoring PCB ambient conditions, the default pick is the TI TMP117 digital IC. If you are monitoring a power component's case or heatsink, the default pick is a 10k 3950 NTC thermistor secured with Kapton tape. To understand why, and to set accurate firmware thresholds, you must calculate the thermal path from the silicon junction to your sensor.

The Thermal Path: Calculating Junction Temperature

You cannot select a sensor or a heatsink without knowing the wattage and the thermal resistance ($R_{ heta}$) of your system. Let us look at a common scenario: an IRLZ44N logic-level MOSFET in a TO-220 package switching 10A at 12V for a heating element. The $R_{DS(on)}$ at $V_{GS} = 5V$ is roughly 22m$\Omega$. The power dissipated as heat is $P = I^2R = 100 \times 0.022 = 2.2W$. To find the junction temperature ($T_J$), we use the thermal equivalent of Ohm's Law: $T_J = T_A + P_D(R_{\theta JC} + R_{\theta CS} + R_{\theta SA})$
ParameterSymbolValueSource
Ambient Temperature$T_A$25°CAssumed room temp
Junction-to-Case Resistance$R_{\theta JC}$1.5 °C/WIRLZ44N Datasheet
Case-to-Sink Resistance$R_{\theta CS}$0.5 °C/WThermal paste interface
Sink-to-Ambient Resistance$R_{\theta SA}$62.0 °C/WTO-220 in free air (no heatsink)
If we run this MOSFET without a heatsink, the math yields: $T_J = 25 + 2.2(1.5 + 0.5 + 62) = 25 + 140.8 = 165.8°C$. This is dangerously close to the 175°C absolute maximum rating. Furthermore, a sensor placed on the case would read $T_C = T_J - (P_D \times R_{\theta JC}) = 165.8 - 3.3 = 162.5°C$. Your sensor will read 162°C while the silicon inside is melting at 165°C. This delta is why placing sensors for temperature without doing the Rtheta math leads to catastrophic firmware blind spots.

How Hot is Too Hot? Derating and Failure Signatures

Silicon does not instantly die at 175°C; it degrades. Most power semiconductor datasheets include a linear derating curve. For the IRLZ44N, power dissipation must be derated linearly from 100% at 25°C to 0% at 175°C. At 150°C, you are only allowed to dissipate 25% of the rated maximum power. If your firmware ignores this and keeps the PWM duty cycle at 100%, the component enters thermal runaway.
Warning: Electrolytic capacitors placed near hot power components suffer from accelerated electrolyte evaporation. According to the Arrhenius equation, the operational lifespan of an aluminum electrolytic capacitor halves for every 10°C increase in core temperature. Keep capacitors outside the direct thermal plume of your MOSFETs and voltage regulators.
When a component exceeds its thermal limits, failure signatures manifest in specific ways:
  • Increased $R_{DS(on)}$: As silicon heats up, electron mobility drops. A MOSFET at 150°C has roughly double the $R_{DS(on)}$ it had at 25°C, generating even more heat for the same current.
  • I2C/SPI Bus Lockups: If your digital temperature sensor shares a bus with other peripherals and is heat-soaked, the sensor's internal logic can brown out, pulling the SDA line low and freezing the entire I2C bus.
  • Bond Wire Lift-off: Repeated thermal cycling (expansion and contraction) causes the aluminum bond wires connecting the silicon die to the package pins to fatigue and snap, resulting in an instant open-circuit failure.

Choosing the Right Sensors for Temperature: A Decision Matrix

With the thermal math established, we can select the appropriate sensor based on the physical location and required accuracy. The market is flooded with options, but embedded thermal management narrows the field quickly.
If your requirement is...Then choose this sensor typeSpecific Part Recommendation
Monitoring PCB ambient or enclosure air with high precisionDigital I2C IC (Local)TI TMP117 (±0.1°C accuracy)
Monitoring a power component case, heatsink, or battery cellNTC Thermistor (Analog)10k 3950 NTC with Kapton tape
Monitoring industrial fluids or exhaust >150°CRTD (Resistance Temp Detector)PT1000 with MAX31865 amplifier
Non-contact measurement of a moving or isolated targetThermopile (IR)Melexis MLX90614
For 90% of DIY and prosumer embedded builds, you only need to decide between the TMP117 and the 10k NTC. The TMP117 is superior for environmental baseline tracking because it eliminates ADC noise and self-heating errors. The 10k NTC wins for direct-contact component monitoring because its small physical mass allows it to be taped directly to a MOSFET tab or inductor core, reacting to thermal spikes in milliseconds rather than seconds.

Heatsink Selection and Sensor Placement in Practice

Returning to our 2.2W IRLZ44N example, we need to drop the junction temperature to a safe 80°C. Target $R_{\theta JA(total)} = (80 - 25) / 2.2 = 25 °C/W$. Subtracting the junction-to-case (1.5) and case-to-sink (0.5) leaves us needing a heatsink with an $R_{\theta SA}$ of 23 °C/W or lower. A standard, low-cost choice is the Wakefield-Vette 680-125AB, a stamped extruded aluminum TO-220 heatsink rated for approximately 12.5 °C/W in natural convection. Let us recalculate the junction temp with this heatsink: $T_J = 25 + 2.2(1.5 + 0.5 + 12.5) = 25 + 31.9 = 56.9°C$. This is a massive safety margin. But what airflow and enclosure changes buy you if you put this inside a sealed project box?
  • Enclosure Penalty: A sealed plastic enclosure adds roughly 15 to 25 °C/W to the ambient thermal resistance. Your $T_A$ inside the box might rise to 45°C, pushing $T_J$ back up to 76.9°C.
  • Airflow Bonus: Introducing just 1 meter per second (m/s) of forced airflow across the Wakefield-Vette fins drops its $R_{\theta SA}$ from 12.5 °C/W down to roughly 7 °C/W. This is the difference between needing a massive aluminum block and using a tiny clip-on fin.
Sensor Placement Rule: Never place your NTC thermistor on the top of the plastic package. The plastic acts as an insulator. Always mount the sensor directly to the exposed metal tab (the case) or the bare aluminum of the heatsink, using a square of polyimide (Kapton) tape and a dab of thermal compound between the bead and the metal.
If you mount the 10k NTC on the case of the MOSFET with the Wakefield heatsink installed, the case temperature will read $T_C = 56.9 - (2.2 \times 1.5) = 53.6°C$. In your firmware, you now know that a sensor reading of 54°C equates to a silicon junction temperature of 57°C. You can confidently set your firmware thermal throttling threshold to a sensor reading of 90°C, knowing the junction is safely below 110°C.

The Final Verdict: Default Sensor Picks

Thermal management is not an 'it depends' guessing game; it is a calculated physics problem. For your next embedded build, stop relying on the internal temperature sensor of your microcontroller—it is heavily skewed by the MCU's own dynamic current draw and tells you nothing about your power stage. Here is the default hardware bill of materials for robust thermal monitoring:
  1. For Enclosure/Ambient Monitoring: Use the Texas Instruments TMP117 on the I2C bus. Place it on the opposite side of the PCB from your power components, shielded from direct radiant heat.
  2. For Power Component Monitoring: Use a generic 10k$\Omega$ B=3950 NTC thermistor. Secure it to the metal tab of your MOSFET, voltage regulator, or inductor using Kapton tape. Wire it to your MCU's ADC with a 10k$\Omega$ pull-up resistor to 3.3V, and implement a software moving-average filter to reject PWM-induced electrical noise.
By pairing the TMP117 for baseline ambient tracking and the 10k NTC for localized component tracking, you close the loop on your thermal path math, ensuring your hardware survives the worst-case duty cycles your code can throw at it.