Diagnosing a Circuit That Drifts When It Heats Up

It started as a minor annoyance. The sensor board was reading correctly at room temperature — dead-on, actually — but after about twenty minutes of operation, the output crept by nearly 8%. Nobody noticed at first because the device was being tested in a climate-controlled lab where equipment barely warms up before someone shuts it down. Field deployment told a different story. In a Texas summer, inside a metal enclosure sitting on a rooftop, the drift was enough to cause false alarms.

This is a story about thermal drift: what causes it, how to chase it down systematically, and — critically — how to calculate your way to a fix rather than guess your way there.

What Thermal Drift Actually Is (And Why It's Sneaky)

Resistors, capacitors, semiconductors, and even PCB traces change their electrical behavior as temperature rises. This isn't a defect — it's physics. The atoms in a conductor vibrate more energetically at higher temperatures, which increases collisions with charge carriers and raises resistance. In carbon-film resistors, the resistance change can be quite significant. In precision metal-film resistors, it's smaller but never zero.

The spec that matters here is the Temperature Coefficient of Resistance, or TCR, expressed in parts per million per degree Celsius (ppm/°C). A resistor rated 100 ppm/°C will change its resistance by 100 parts per million for every degree of temperature change. That sounds tiny. Over a 50°C rise, though, it becomes 0.5% — and in a bridge circuit or precision amplifier, errors compound.

Physical expansion plays a role too. A copper PCB trace gets slightly longer and wider as it heats, and the resistance changes accordingly. Trace resistance is given by:

R = ρ × L / A

Where ρ is resistivity (which itself increases with temperature), L is length, and A is cross-sectional area. Thermal expansion increases both L and A, but since resistivity dominates in copper, resistance still rises with temperature. For long, thin signal-path traces, this becomes measurable.

The Debugging Session

The first thing I did was reproduce the problem in a controlled way. I set up the board on a bench, attached a thermocouple to the hottest component (a linear regulator running without adequate heatsinking, as it turned out), and logged both temperature and output voltage every thirty seconds. Within the first eight minutes, I had a clear thermal signature: output voltage climbed almost linearly as board temperature rose, then leveled off as the board reached equilibrium around 67°C.

That linearity was a clue. Random component failures tend to produce step changes. Thermal drift produces smooth, monotonic curves. The fact that the output was climbing told me resistance somewhere in the signal path was increasing — which was reducing current or raising a voltage divider ratio in a way that made the output read high.

I started at the voltage divider feeding the ADC input. The circuit was using two resistors — 10 kΩ and 4.7 kΩ — to scale a 0–5V signal down to 0–3.3V for the microcontroller. Standard stuff. I measured both resistors in-circuit (after powering down) at room temperature, then remeasured after running the board hot for fifteen minutes. The 10 kΩ resistor had climbed to 10,043 Ω. The 4.7 kΩ had climbed to 4,724 Ω.

The output ratio of a voltage divider is:

V_out = V_in × R2 / (R1 + R2)

At room temperature: V_out = 5 × 4700 / (10000 + 4700) = 1.599 V

After heating: V_out = 5 × 4724 / (10043 + 4724) = 1.601 V

That's only about 0.12% change from the divider itself — not enough to explain an 8% drift. The resistors weren't the main culprits. But this calculation confirmed I needed to look elsewhere, and confirmed the methodology was sound.

The Real Offender: An Op-Amp Gain Stage

The signal then fed into a non-inverting amplifier stage before the ADC. The gain was set by another pair of resistors — both nominally 47 kΩ — giving a gain of 2. But I noticed something: one of those resistors was a garden-variety carbon-film part pulled from a general-purpose bin. The other was a proper metal-film unit (I could tell by the color coding).

I grabbed the TCR specs. The carbon-film resistor was rated at 200 ppm/°C. The metal-film resistor was 50 ppm/°C.

The gain of a non-inverting amplifier is:

G = 1 + R_f / R_in

At room temperature (25°C), with both resistors at exactly 47 kΩ:

G = 1 + 47000 / 47000 = 2.000

At 67°C (a rise of 42°C), the carbon-film feedback resistor changes by:

ΔR = R × TCR × ΔT = 47000 × 200×10⁻⁶ × 42 = 394.8 Ω

So R_f becomes approximately 47,395 Ω.

The metal-film R_in changes by:

ΔR = 47000 × 50×10⁻⁶ × 42 = 98.7 Ω

So R_in becomes approximately 47,099 Ω.

New gain at 67°C:

G = 1 + 47395 / 47099 = 2.00629

That's a gain increase of 0.315% — still not 8%, but the effect stacks with the sensor's own thermal characteristics and any offset drift in the op-amp itself. When I checked the op-amp's datasheet, its input offset voltage drift was specified at 5 µV/°C, which over a 42°C rise added another 210 µV of offset error before gain — multiplied by the gain of 2, that's 420 µV at the output, which on a 3.3V full-scale signal is another 0.127%.

The bigger issue was the sensor itself. Checking the sensor's datasheet — which I admittedly should have done first — revealed a sensitivity drift of 0.18% per °C. Over 42°C, that's 7.56%. There was the 8%.

Fixing It Properly

The sensor drift required a software correction table or a hardware analog compensation circuit. We went with software: I measured output at five temperature points, fit a linear correction function, and baked that into the firmware. The correction looked like:

V_corrected = V_raw × (1 - 0.0018 × (T - 25))

This required adding a cheap NTC thermistor near the sensor to feed temperature into the MCU's second ADC channel — about $0.12 in parts and a few lines of code.

For the resistor mismatch in the op-amp stage, the fix was simpler: replace the carbon-film resistor with a matched metal-film part, and ideally use a resistor network where both elements are on the same substrate and track each other thermally. Vishay makes dual-resistor packages specifically for this — the ratio stays constant even as absolute values drift, because both resistors drift together. That's what you want in a gain-setting application.

For the PCB traces, I re-routed two signal paths that were running close to the regulator. The linear regulator itself got a small aluminum heatsink and a revised power budget — we switched to a more efficient topology, which dropped its case temperature by 18°C and reduced the thermal stress on every component nearby.

What to Check First on Your Next Thermal Drift Hunt

If you're staring at a system that drifts with temperature, here's the sequence I'd follow:

  1. Log temperature and output simultaneously. If the drift is smooth and monotonic, it's almost certainly thermal. If it's abrupt, look for intermittent connections or thermal expansion causing mechanical contact issues.
  2. Check your resistor types. Carbon film (brown-black body, gold band tolerance) has high TCR. Metal film (blue body, tighter tolerances) has low TCR. Never mix them in a ratio-dependent circuit.
  3. Calculate before you swap. Use the TCR formula — it'll tell you whether a given component can realistically explain the drift you're seeing, so you don't chase ghosts.
  4. Read the sensor datasheet for thermal specs. Sensitivity drift and offset drift are almost always specified. It's the first thing to calculate.
  5. Consider thermal layout. Components that generate significant heat should be placed to minimize thermal gradients across precision circuitry. Your hot regulator and your precision resistors should not be neighbors.

Thermal drift is one of those problems that feels mysterious until you start calculating, and then it becomes very mechanical. Everything has a coefficient. Everything has a temperature delta. Multiply them, add them up, and the numbers either explain what you're seeing or tell you where to look next. That's the job.

In this case, a $0.12 thermistor, one matched resistor pair, a small heatsink, and a three-line firmware correction dropped the system drift from 8% to under 0.4% across the full operating temperature range. The rooftop deployment has been running clean for six months.