I would like to get some ideas for alternatives and improvements: I want to build a wifi-based door contact to register when a door is opened. The door should never be open for a long time, since it is an apartment door.
My idea is the following.
- Base on ESP8266 and use either an LM7333 or a Pololu 3.3V Step-Up/Step-Down S7V8F3 to power from LiPo battery. (LDO might be on the edge with 250mA rating, but has a super low quiescent current, S7V8F3 costs about twice of the whole rest of the project and has a much higher, but still reasonable quiescent current)
- Put a magnet on the door and connect VCC over an NC reed switch to an input pin and to RST over a capacitor.
When the door is opened, the NC reed switch will close and send a pulse to the reset pin of the ESP, waking it up. The ESP checks the input pin and sends an open or closed status to an MQTT server. If status is open, it sets a timer of a few seconds, to wake up again and recheck, if it is closed again, it just goes to sleep.
If I want to avoid repeating the open message, I could use a capacitor on another pin as a 1 bit storage to save the previous state and only send an open message if the charge of the capacitor indicates that it was closed before (to avoid discharge over longer closed times, closed would obviously be LOW. During open times, the charge could be refreshed every few seconds).
Any comments? Improvements? Ideas how I could realize this with NO reed switches, since I do not have NC at the moment? (I do have ideas for the latter, but it will either lead to a relatively high permanent current draw, or might cause problems with the pulse to RST over the capacitor).