When a high-precision temperature sensor, load cell, or 16-bit ADC like the ADS1115 starts drifting, the culprit is rarely the sensor itself. The problem is almost always localized sensor heat generated by the microcontroller's power delivery network. An ESP32-WROOM-32 pulling 240mA during WiFi transmission, combined with a linear voltage regulator dropping 5V to 3.3V, turns the PCB into a hotplate. This localized thermal environment shifts the ambient temperature ($T_A$) for nearby components, introducing thermal drift, noise, and eventual silicon degradation.
To fix this, you cannot rely on guesswork or simply slapping a generic fan on the enclosure. You must treat heat flow exactly like electrical current: voltage is temperature, current is power dissipation, and resistance is thermal resistance. Here is how to calculate the thermal path, read derating curves, and engineer a physical layout that keeps your sensor readings stable.
The Thermal Path: Calculating Junction-to-Ambient Math
Every semiconductor datasheet includes thermal resistance metrics, denoted as $R_{ heta}$ (Theta), measured in °C/W. This value tells you how many degrees the temperature will rise per watt of power dissipated. The most critical metric for bare PCB designs without heatsinks is $R_{ heta JA}$ (Junction-to-Ambient). If your IC has an exposed thermal pad soldered to a heatsink, you must calculate the series resistance of the entire path: Junction-to-Case ($R_{ heta JC}$), Case-to-Sink ($R_{ heta CS}$), and Sink-to-Ambient ($R_{ heta SA}$).
The fundamental thermal equation mirrors Ohm's Law ($V = I imes R$):
$T_J = T_A + (P_D imes R_{ heta JA})$
Where $T_J$ is junction temperature, $T_A$ is ambient temperature, and $P_D$ is power dissipated in watts.
Let us look at the real-world thermal resistance values for common components found on embedded sensor boards. According to the Texas Instruments SPRA953 Application Report, these values assume a standard JEDEC test board with minimal copper pours. Your actual layout will vary based on thermal vias and ground planes.
| Component / Package | Typical $R_{ heta JC}$ (°C/W) | Typical $R_{ heta JA}$ (°C/W) | Max $T_J$ (°C) | Primary Heat Source? |
|---|---|---|---|---|
| AMS1117-3.3 (SOT-223) | 15 | 100 | 125 | Yes (Linear LDO) |
| ESP32-WROOM-32 (QFN) | 12 | 40 | 125 | Yes (RF/Compute) |
| ADS1115 (MSOP-10) | 45 | 140 | 150 | No (Victim) |
| DRV8871 (HSOP-8) | 18 | 55 | 150 | Yes (Motor Driver) |
| LM399 Reference (TO-46) | N/A | N/A | 150 | Intentional (Internal Heater) |
Worked Example: You are powering an ESP32 sensor node from a 5V USB supply. The onboard AMS1117-3.3 LDO steps 5V down to 3.3V. The ESP32 and sensors draw a combined 250mA. The LDO must dissipate the voltage difference as heat: $P_D = (5V - 3.3V) imes 0.25A = 0.425W$.
Using the $R_{ heta JA}$ of 100 °C/W for the SOT-223 package in still air, the junction temperature rise is $0.425W imes 100 = 42.5°C$. If your room is 25°C, the silicon junction is at 67.5°C. More importantly, the plastic case of the LDO will sit around 61°C, radiating heat directly into the FR4 substrate. If your ADS1115 is placed 5mm away, its local ambient temperature is no longer 25°C; it is likely 40°C or higher, destroying the baseline calibration of your precision measurements.
How Hot is Too Hot? Derating Curves and Failure Signatures
Knowing the junction temperature is only half the battle; you must understand how that temperature affects component lifespan and accuracy. Silicon itself will not melt until it hits 125°C or 150°C, but for precision analog circuits, functional failure occurs long before thermal destruction.
Interpreting the Derating Curve
Every power component datasheet includes a power derating curve. This graph shows the maximum allowable power dissipation on the Y-axis and ambient temperature on the X-axis. The curve typically runs flat at 100% up to a 'knee' temperature (often 25°C or 85°C), then slopes linearly down to 0W at the maximum junction temperature (e.g., 150°C).
If you are running an LDO at 80% of its rated wattage, but your enclosure traps heat and raises the ambient to 70°C, you must check the derating curve. At 70°C ambient, that same LDO might only be rated for 50% of its nominal power. Exceeding this line pushes the silicon into thermal runaway or triggers internal protection circuits.
The ESP32 features an internal temperature sensor accessible via the
temperaturesensor driver in ESP-IDF. Do not use this to compensate for external sensor heat. The internal sensor measures the silicon die temperature of the ESP32, which is heavily influenced by CPU clock speed and WiFi TX power, not the ambient air temperature surrounding your external thermocouple or load cell. Always use a dedicated, thermally isolated digital sensor (like an SHT40) placed near the measurement target.
Failure Signatures of Thermal Stress
When sensor heat management fails, the system exhibits specific, diagnosable symptoms:
- Thermal Drift (Creep): Your load cell or RTD readings slowly shift by 0.2% to 1.0% over the first 15 minutes of power-on. This is the PCB reaching thermal equilibrium. The Wheatstone bridge resistors are heating up unevenly due to proximity to the microcontroller.
- Thermal Shutdown Hysteresis: The microcontroller resets randomly, but only after sustained heavy processing. Unlike a brownout reset (which is instantaneous when voltage dips below 2.7V), a thermal shutdown reset requires a cooldown period. If your ESP32 crashes, stays dead for 10 seconds, and then reboots without a voltage dip on the oscilloscope, you are hitting the internal thermal protection threshold.
- Solder Joint Fatigue: After months of operation, the board develops intermittent connections. This is caused by the Coefficient of Thermal Expansion (CTE) mismatch between the silicon die, the copper pads, and the FR4. Repeated thermal cycling from 30°C to 80°C causes micro-cracking in QFN and BGA solder joints.
Heatsink Selection and Enclosure Airflow Strategies
Once you have calculated your power dissipation and identified that your $R_{ heta JA}$ is too high, you must lower the thermal resistance of the path to the environment. You can do this via PCB layout changes, board-level heatsinks, or forced convection.
Calculating Required Heatsink Resistance
Suppose you are driving a stepper motor using a DRV8871 motor driver that is dissipating 1.5W in a sealed outdoor enclosure. The maximum ambient temperature inside the enclosure on a summer day is 55°C. The DRV8871 maximum $T_J$ is 150°C, but we want to keep it under 110°C for reliability.
We need to find the required Sink-to-Ambient resistance ($R_{ heta SA}$):
- $R_{ heta SA} = (T_{J(target)} - T_{A(enclosure)}) / P_D - R_{ heta JC} - R_{ heta CS}$
- $R_{ heta SA} = (110 - 55) / 1.5 - 18 - 1.5$ (assuming 1.5 °C/W for a thermal interface pad)
- $R_{ heta SA} = 36.6 - 19.5 = 17.1 °C/W}$
You need a heatsink with a thermal resistance of 17.1 °C/W or lower. A standard board-level extruded heatsink like the Aavid Thermalloy 576302B03300G provides roughly 24 °C/W in natural convection, which is insufficient. However, adding a small 40mm forced-air fan, such as the Sunon MF40101VX-1000U-A99, drops the effective $R_{ heta SA}$ of that same heatsink to approximately 8 °C/W, providing a massive safety margin.
PCB Layout: Thermal Vias and Copper Pours
Before buying physical heatsinks, optimize the PCB. According to the Espressif ESP32 Hardware Design Guidelines, components with exposed thermal pads must be tied to internal ground planes using thermal vias to spread the heat.
Thermal Via Best Practices:
- Drill Size: Use 0.3mm drill holes with 0.6mm pads. Smaller holes risk incomplete plating; larger holes reduce the number of vias you can fit under the pad.
- Via Array: Place vias in a grid pattern (e.g., 1.0mm pitch) directly under the IC's exposed pad. A 3x3 array of nine vias can reduce the effective $R_{ heta JC}$ to the PCB by up to 40%.
- Tenting: If your thermal vias break out onto the opposite side of the board, ensure they are 'tented' (covered with solder mask) to prevent solder from wicking away from the component pad during reflow, which causes tombstoning.
Enclosure Airflow and Convection
If you must seal your sensor node in an IP67 enclosure, natural convection is dead. The air inside becomes a static insulator. To manage sensor heat in sealed environments, you must thermally bond the hot components to the enclosure wall using a thermal gap pad (like Bergquist Gap Pad TGP1000). This turns the entire aluminum or polycarbonate enclosure into a massive heatsink, utilizing the external ambient air rather than the trapped internal air. For high-density sensor arrays where physical spacing is impossible, consider switching from linear LDOs to high-efficiency buck converters (like the TI TPS562201), which reduce power dissipation from 0.4W to under 0.05W, eliminating the heat source entirely at the cost of slight switching noise.






