I’m about to make my mailbox smart. It’s a two lid mailbox and I’m thinking about using a wemos d1 with two reed or micro switches and then power it with a battery pack.
From what I have read deep sleep is I good function to use to save battery.
Do I need any more components eg resistors?
I have searched for examples but haven’t found anything like I’m looking for.
I want to have a binary sensor I HA eg mail/ no mail and I want my second lid to reset to no mail regardless off how many times the first lid has been open and triggered mail
The ESP2866 boards (like the D1) only have one wake pin. Use the ESP32. You can have more than one wake from sleep pin with the ESP32 boards. One for each lid. Much simpler.
First thing I would do through is check whether you get a good WiFi signal between esp8266 in your mailbox and your network. Otherwise you could be wasting a lot of time.
Why do the reed switches need to be separate, could just wire them in series if NC or parallel if NO.
Unless one of them tells when the box is emptied and one when it’s filled?
The esp32 looks like a good choice except the price, you can get to d1 for one esp32, is that a better way or just go with the esp32?
Does any one have some code examples regarding the toggle one way and just on and keep state on the other switch so that the binary sensor behaves like I want?
@nickrout regarding price I was found prices that was more like 2.3$ I was thinking that it maybe was a better way. Either way, it was just I question on how to do it cheep and same way good. As I said I’m new to this area regarding the whole ESP
You really need to take heed of suggestions to check coverage at your mailbox (WiFi) because my experience is it’s not that impressive. There’s no way I could get a signal from my mailbox and it’s pretty close to my house.
I’m getting about -74dBm 50m away from a Unifii Lite AP. Which is ok. I plan on doing this in the next few days to see what sort of improvement it makes:
Hoping for at least 3dB improvement, not just from the antenna gain, but from better antenna placement as well.
Regarding the ESP32 it seems hard to get I Europe compared to the wemos d1 if you don’t want to wait a month for arrival, any tips on sites? I have googled, eBay, some Swedish sites as well.
Yeah China… what about Amazon Marketplace as well? Can’t be that hard.
I’d just flash the device and put it out where it’s going to ‘live’ and see if it gets any signal… then you will know and not be guessing. Even if your phone works, the esp may or may not work… it’s a 5 minute test.
Assuming WiFi signal is fine at mailbox, you can change your wiring to not need deep sleep. Wire both switches in parallel NC so when the doors are closed, the switches are open. Feed the ESP unit power through these switches. If either door is open, the ESP gets power. If both doors are closed, no power. Then write your ESP program so that it sends a “door open” message at startup then sleeps forever. No GPIO necessary.