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.
Due to the nature of mounting everything via friction, here are non-affiliate links to the exact parts I used.
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.
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.
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.
The author marked this model as their own original creation.