ESP32 Environmental Sensor Enclosure

A ventilated enclosure for an ESP32 with basic environmental sensors
10
46
0
3077
updated January 3, 2023

Description

PDF

While automating my home using Home Assistant, I found that I needed to sense motion, temperature, and humidity in multiple locations throughout my home. So, I created an enclosure that bundles a 30-pin ESP32 module with microwave/radar motion, temperature, and humidity sensors.

The ESP32 generates a bit of heat and, while nothing gets even remotely hot, the added heat affects the accuracy of the temperature sensor. To reduce this effect, the enclosure is ventilated and I'd recommend mounting the enclosure on a wall, vertically, to allow convection to help. If that's insufficient for your needs, a 5v 25mm fan can also be attached to one end to increase airflow, if desired.

The only hardware required beyond the electronics is a method to attach the enclosure to the wall (I'm using Command Strips) and the screws for the optional fan. Otherwise, all modules and the cover are held in place by tight friction fits, so your printer likely needs to be dialed in pretty well.

Parts List

Due to the nature of mounting everything via friction, here are non-affiliate links to the exact parts I used.

  • 30-Pin ESP32 module
  • RCWL-0516 - microwave/radar motion sensor
  • Right angle header pins - for the RCWL-0516 (there is not enough clearance for straight header pins!)
  • DHT11 - temperature and humidity sensor
  • Micro USB cables - passes through cover to supply power
  • USB wall charger or other powered USB port
  • (Optional) 5v 25mm fan
  • (Optional) Command Strips some or other method to mount the enclosure
Print Orientation/Supports

The 3mf file shows the recommended print orientation and includes supports under the screw tabs for mounting the fan. All other overhangs should be easily printable without supports in this orientation.

Wiring

The DHT11 needs 3.3-5V so I chose to power that from the 3.3v and GND pins on the ESP32 and connected the ‘out’ pin to D5 (GPIO5 in the yaml). The RCWL-0516 requires 4-28V so that's powered by the VIN and GND pins on the ESP32 with the ‘out’ pin connected to D13 (GPIO13 in the yaml). The ‘CDS’ and ‘3V3’ pins on the RCWL-0516 are left unconnected.

If you use a 5V fan, you should also be able to power that from the VIN and GND pins on the ESP32, you'll just need split the power wires between the fan and the RCWL-0516 so they're powered in parallel.

You can see how to wire the modules in the attached Wiring Diagram.png file.

Code

The included ESPHomeConfig.yaml.txt file contains a basic configuration that should allow you to use this bundle in ESPHome with minimal manual setup. See the comments at the top of the file for more info on what values you need to enter into the file manually.

Tags



Model origin

The author marked this model as their own original creation.

License