ESPresence with sensors!

Edit: The below wiring diagram is missing resistors on the lines going into the transistor. Do not try following it as-is; you will fry the esp32.

I’ve been using monitor for presence detection for quite some time now. Although for some reason it started giving me issues recently. Maybe the SD card is getting bad in the Pi Zero it runs on. Either way, I’ve decided to make the switch to ESPresence since it seems to be popular lately. The Pi Zero used to have a DHT22 hooked up to it and I want the same with my ESPresence setup. I happen to have some mini PIR sensors as well so I figure I might as well include that too while I’m at it.

The first step is to flash the esp32 with espresence. I’m using an esp32-cam because that’s what I have on-hand. The esp32.bin file doesn’t support dht sensors so I used the esp32-sensors.bin file instead. As far as I can tell you can only do this if you upload manually (i.e. you can’t use the website uploader). I took the time to configure the esp now too. I chose pin 13 for the pir sensor and pin 15 for the dht22.

When I used a Pi Zero, it just had the DHT22 hanging off it with some jumper wires. I wanted to make this setup a bit tidier (emphasis on a bit) since there will be a few extra wires. First thing is to figure out what gets wired where. Thanks to my incredible photoshop skills, this is easy to visualize.

Pretty straight forward stuff. I mounted everything on a piece of breadboard and wired it up accordingly.



That’s it; plug it in and it works.

2 Likes

Quick update: I neglected to add resistors between the esp32/pir sensor and transistor and fried the 5V regulator on the esp. 🤦

A quick test confirmed the esp still works if supplied with 3.3V instead. I’ll leave it like this for now until I get around to rewiring the breadboard version. I still have ESPresence working (which was the original goal) and I learned a few things from the experience, which is always a nice bonus.

:+1:
God-like operation

Would you mind updating the wiring diagram for those of us who can’t figure out how to wire it up?

1 Like