-->
Page 1 of 2

Esp8266 low power mqtt + Reed Switch

PostPosted: Mon Dec 10, 2018 6:45 pm
by Glorifiedg
Hi guys, noob here!

I've searched for something like this but didn't found anything exactly like this.

I want to build a mail sensor with esp8266 and a Reed switch that, when the mail door is opened, sends an mqtt message to a broker. I wander of this can use the deepsleep mode everyone is talking while not "open" so I can spare the powerbank battery.

Thanks!

Re: Esp8266 low power mqtt + Reed Switch

PostPosted: Wed Dec 12, 2018 4:32 am
by QuickFix
  • Take a schematic like this
    MomentaryESPSchematic.png
  • Connect switch "SW1" (the reed switch) to the door
  • Write code that does the following:
    • Boot
    • Make GPIO2 LOW to hold the MOSFET
    • Make contact to AP and MQTT broker
    • Send "Door opened"-message to broker
    • Make GPIO2 HIGH to power the circuit off

Re: Esp8266 low power mqtt + Reed Switch

PostPosted: Thu Dec 13, 2018 5:51 am
by btidey
My take on this is at https://github.com/roberttidey/SecuritySensor

The Schematic_SecuritySwitchSchematic.png has the hook up.

This uses a normally closed contact. When opened the device wakes up via EN going high. A GPIO is set to maintain the EN. It then performs any actions, releases the GPIO holding EN and returns to deep sleep.

Background current is deep sleep + quiescent of LDO regulator. Although not the zero current obtained by using a MOSFET in power line, it still gives me over a year of operation using a modest LIPO.

Re: Esp8266 low power mqtt + Reed Switch

PostPosted: Thu Dec 13, 2018 7:32 am
by QuickFix
btidey wrote:Although not the zero current obtained by using a MOSFET in power line, it still gives me over a year of operation using a modest LIPO.

I might have interest in this approach for one of my projects.
Do you have an estimate of the quiescent current in sleep mode, I'm assuming the 400mA LiPo in your schematics is not what you mean by "Modest". ;)