FILED
Relative humidity is a temperature measurement
Filed under best practices, because it is the kind of thing that is easy to get wrong and expensive to notice later.
Relative humidity is not an independent quantity. It is the ratio of the water vapor
actually present to the most the air could hold at that temperature, expressed as a
percentage. The denominator — saturation vapor pressure — climbs steeply with
temperature: roughly 7% per °C near room temperature. So the same absolute amount
of water in the air reads as a different RH at 20°C than at 25°C. A relative
humidity figure without the temperature it was measured at is half a reading.
This has a direct consequence for the cheap combined sensors most of this work uses — the SHT3x, BME280, DHT22 family. They measure temperature and humidity on the same die, and they report RH relative to their own temperature reading. If that temperature is wrong, the humidity is wrong with it, and in a way no amount of post-processing recovers.
Self-heating is the usual culprit
The die runs warmer than the air around it. The sensor’s own power draw, the MCU next to it, the regulator, the enclosure with no airflow — all of it biases the temperature reading high, which drags the reported RH low. A board logging continuously can sit several tenths of a degree above ambient, and a poorly placed sensor far more than that.
The fixes are unglamorous:
- Duty-cycle the measurement. Single-shot mode at a slow interval lets the die cool
between reads.
60sis plenty for a room; faster only with a reason. (This is the same logging-interval discipline Directive 01 argues for, arrived at from the other direction.) - Get the sensor away from heat. Off the hot side of the board, out of the dead air next to the regulator, with a path for ambient air to reach it.
- Trust the datasheet’s self-heating figure, then verify it. Compare a continuously polled sensor against one read once a minute in the same room. The gap is your self-heating budget.
Let it settle
RH sensors have hysteresis. After exposure to high humidity — condensation, a breath, a humid garage overnight — they read high for a while and recover slowly. The first reading after a power-up or a humidity excursion is not a reading; it is a sensor still making up its mind. Discard it, or wait.
Log honestly
Persist the temperature alongside every humidity value, at the same timestamp, from the same sensor. Note the sampling interval in the record, not just in your memory. If a reading is suspect — sensor just powered on, enclosure just opened — say so in the data rather than silently dropping it. A failure mode written down is worth more than a clean-looking series that quietly lied.
None of this is novel. It is the granular how-it-actually-worked that is most useful to the next person and most likely to be lost. Hence: filed.