A Costly Lesson in Smart Home Design

Learn how Mellow Labs used the SHT40’s built-in heater to create a smart home sensor node that survives extreme humidity.

Nick Bild
2 seconds agoSensors
A custom smart home sensor built for use in for high humidity (📷: Mellow_Labs)

Not every weekend electronics project is meticulously planned out in advance. Sometimes makers just have a rough sketch of what they would like to accomplish before they start digging through their spare parts drawers. In these cases, flexibility is the name of the game. You might be looking for an Arduino Nano, but a Raspberry Pi Pico may do the job just as well if that’s what’s available. Finding an alternative part is far faster than waiting for an online order to be delivered.

However, you don’t want to get too loose with those substitutions. As Tomasz of Mellow Labs recently found out, it’s always a good idea to read through the datasheets before you start on a project to make sure the parts are going to work as planned. After destroying four environmental sensors from his DIY smart home setup, Tomasz had to take a step back and more carefully design the hardware so that it could stand up to the conditions it was operating in.

The culprit behind the repeated failures turned out to be high humidity levels in the bathroom. This quickly overwhelmed common environmental sensors like the BME280 and BME680, leading to unreliable readings and eventual hardware failure. Early attempts to protect the sensors were creative, but not effective. Wrapping the device in a sponge and experimenting with complex 3D-printed enclosures helped shield it from moisture, but introduced new problems, including inaccurate measurements due to restricted airflow.

The solution was the SHT40 sensor, a component specifically designed to handle harsh, moisture-rich environments. It is equipped with a built-in micro-heater capable of briefly raising the sensor’s temperature to nearly 100°C. This rapid heating evaporates condensation before it can accumulate and cause damage. The heater operates in short pulses — never more than one second — to avoid overheating the chip or compromising its mounting.

Around this sensor, Tomasz built a custom device powered by an ESP32 microcontroller. The system also integrates a presence sensor and a light sensor, turning it into a multifunctional smart bathroom node. A custom PCB and 3D-printed enclosure tie everything together, though even these required iteration. Initial designs trapped heat from the ESP32, skewing temperature readings upward. Adding ventilation holes and refining the layout corrected the issue.

On the software side, the project runs on ESPHome, enabling integration with a broader smart home ecosystem. When humidity rises above 70%, the system activates the SHT40’s heater while temporarily suspending temperature readings to avoid capturing false data. Lighting is also automated, with brightness levels adjusted based on ambient light and time of day to provide a more comfortable nighttime experience.

After a few more refinements — such as angling the enclosure for better presence detection and adding a heater status indicator — the system was finally found to be reliable in real-world use. Next time you are reaching for close-enough parts for a build, keep this project in mind and verify everything will work together as expected before you move forward.

Nick Bild
R&D, creativity, and building the next big thing you never knew you wanted are my specialties.
Latest articles
Sponsored articles
Related articles
Latest articles
Read more
Related articles