Your humidity monitor works on the bench. What changes inside the case?

You have a temperature and humidity reading on screen, and now you want to put the electronics in a neat case. For a room monitor or a small instrument this is an important step: the finished device has to measure the surrounding air, even while its own electronics are warming up.

A thermostat builder's write-up on r/PrintedCircuitBoard describes that problem with an SHT45: heat traveling through the board affected the reported temperature. That is the author's account of a different design, but the concern is well supported by Sensirion's humidity and temperature design guide, which explains why air exchange and separation from heat sources matter.

Before investigating a case, keep a clear record of the bare probe. On our bench we connected a Mysentech MHT04 temperature and humidity probe to a Raspberry Pi Pico (RP2040) on a GraftPort carrier and logged its wiring, configuration and readings. That baseline lets a team separate "we can read this device" from "the assembled monitor measures the air we intended".

Start with the probe and interface you actually have

The MHT04 comes in more than one housing and interface variant; the MHT04H, for example, has a different housing. Our program was written for the MHT04-IIC variant (IIC is another spelling of I2C), so match the interface documentation to the exact part you have before comparing results.

I2C uses a data line and a clock line. In our setup they went to GPIO4 and GPIO5, and the probe sat at the end of its cable, well away from the development board. Keep that arrangement in the baseline record. Moving the probe beside a display or a power circuit changes the physical experiment, even if the program stays the same.

It helps to know what happens before a number reaches the screen. The sensing element feeds a capacitance-processing chip (an MDC04), calibration information stored in EEPROM helps turn the signal into a measurement, and the digital interface carries the result to the host controller, which applies conversion and compensation. When a reading surprises you, a successful connection and the correct stored parameters are both worth checking.

Read the configuration before changing it

The first check is a bus scan. An address selects a device on the bus, and finding it confirms that something responds:

from machine import I2C, Pin

i2c = I2C(0, sda=Pin(4), scl=Pin(5), freq=100000)
print([hex(a) for a in i2c.scan()])

Our probe answered at 0x44. We then used our MHT04 I2C driver to read the probe's configuration and to read temperature and humidity in a loop, with address checking, error handling and cleanup around it.

The configuration read returns fields including a capacitance offset and range, and a humidity slope and offset. They describe the conversion this particular probe is using. Keep them in the log rather than copying another device's settings to make the displayed number look plausible.

The captured run started at 26.80 °C and 56.20 %RH and later reached 27.29 °C and 78.29 %RH. Relative humidity, written %RH, describes the moisture in the air relative to saturation at its temperature. It is a different quantity from the raw capacitance a soil probe reports.

The log shows the output changing, but it does not record what caused the change, and we did not compare it with a reference hygrometer. It is a communication and configuration baseline. It is not a measured response time or an accuracy claim.

Carry that baseline into the assembled device

For the next experiment, put the same probe in the proposed case and compare it with the open arrangement under similar ambient conditions. Record whether the display, the radio and other heat-producing parts are on, and leave enough time to see warm-up behavior; a reading taken a minute after power-on can differ from one taken after the electronics have reached their working temperature. We have not run this comparison yet.

If the readings change after assembly, the comparison gives you something specific to investigate:

Adjust those physical conditions before reaching for a software offset. An offset tuned on one day can hide a difference that changes with load, ambient temperature or airflow. The right next revision may be a change to the enclosure or the probe placement rather than a new sensor model.

That is the value of keeping the bare-probe wiring and output on record. They give you a repeatable starting point for finding out what the case changes, instead of trying to debug the whole monitor at once.