A Printed Case For Your ESP Environmental Sensors

We’ve said it before but it’s worth repeating: rolling your own hardware solution is ridiculously easy these days. If you want to make a network attached environmental sensor, you wire a DHT11 up to an ESP8266 and you’re done. Time to move onto the software. In fact, it can take longer to come up with some kind of suitable enclosure for your hardware project than it does to assemble the thing.

Which is why [Pixel Hawk] has come up with this elegant 3D printed enclosure for the ESP8266 and ESP32. It’s designed to hold the microcontroller in the bottom compartment, while the environmental sensor (either the DHT11 or DHT22) is mounted to the top so it’s exposed to the outside. The case snap fits together so you don’t have to worry about gluing it, and there’s even an opening so you can keep the USB cable plugged in.

In the notes for the design, he mentions that in testing it was determined that the heat of the ESP itself can skew the temperature readings. So he recommends putting the microcontroller to sleep whenever possible, and keeping reads short so the enclosure doesn’t have time to heat up. He’s also created an alternate version of the case with more openings which should help combat this issue if you need to keep the chip awake.

If you’re looking for a complete solution, [Pixel Hawk] has included the source code he personally used to get his ESP32 sensor talking to Blynk, but you certainly don’t have to go that route if you don’t want to. There’s no shortage of existing projects out there that will help you get started with whole-house environmental monitoring. Our very own [Elliot Williams] happens to be partial to MQTT when he wants to get all his gadgets to play nice.

13 thoughts on “A Printed Case For Your ESP Environmental Sensors

  1. Hi,
    I wonder every time when see such cases for sensors.
    Guys, you’ll get incorrect measures. I built a lot of sensors on ESP and denied to use sensors in or on cases at all.
    It should be isolated very well from an ESP because it ‘s hot enough.
    So, my choice: any sensor must be connected with the wire 0.2-0.5m.
    The best results were with DS1820 on 0.3m wire in a steel tube.

      1. Orly? I have half a dozen DHT22s that have been running faultlessly for 18 months.

        I do agree with the heating point made by Rex. Using a 100mm square vented case with the DHT diagonally below the ESP (opposite comers of the case) has minimised this effect for me.

    1. the BME280 option also tends to offer good repeatability once calibrated.
      I saw many DHT/SHT units off e-bay start to glitch up after about 2 weeks of sampling, and required a power cycle to reset.
      There have been more methodical comparisons others have posted on these sensors. But its lame seeing people with the same set of design issues 5 years later on HaD. =(

    1. I have a distant memory – although I’ve not been able to turn up a reference after a quick search – that DHT* sensors need special handling, and are compromised if touched with the bare hand?

  2. With it mounted in the same case, even sleep mode wont fix the heat issue. The DHT are not consistent unit to unit I’ve seen as much as 10 degree different between two side by side. I’ve never had one fail though.

  3. Knocked up a bmp230 based thermostat based on an esp32 board last week. No enclosure, and no power saving. The temp reading from self heating is at least 3C!
    Nice as it is to have humidity/pressure, I think one wire DS1820 is going to be the next stop – easy to mount externally or even remotely if necessary.

  4. If you think you’re really really constrained to mounting the sensor in the same case as the heater, at least stick it in at the bottom of the case with vents there, and put vents at the top, so that environmental air is drawn past it by convection.

    1. This is exactly what I did. I just mounted a DHT22 sensor below the ESP8266 and made it sleep whenever its not getting any readings. If there’s any heat convection should pull room air across the sensor. It’s been working perfectly for over a year now in my bathroom. It’s accurate enough for me. I run a script to figure out if a shower has been taken and log it.

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.