← Linear Regression
Real Data: Sensor Temperature Drift
40 measurements from an ultrasonic snow-depth sensor — all taken under dry conditions, so true depth = 0 cm throughout. The variation you see is caused entirely by temperature.
The setup
A sensor that should read zero
An ultrasonic sensor measures the distance to the ground to calculate snow depth. On days with no snow it should always read 0 cm — but it doesn't. Something is making the readings wander by as much as ±9 cm.
The clue
Temperature changes too
The sensor is mounted outdoors and its electronics warm up in sunlight. The temperature of the sensor chip itself swings from −6 °C to +34 °C across the dataset — a range of 40 °C. Could this be causing the drift?
The finding
A near-perfect linear relationship
Plotting depth against temperature reveals a strikingly straight line with R² = 0.959. Temperature explains 96% of the apparent depth variation. This is temperature drift — a well-known phenomenon in electronic sensors.
True snow depth
0 cm (all dry)
Sensor temp range
−5.8 °C to +34.0 °C
Measured depth range
−9.0 cm to +4.2 cm
depth = −0.3494 · temp + 3.4292 R² = 0.959