esp8266 various sketches for esp8266 modules mqtt_pir_deepsleep uses esp8266-01 pir always "on" EN pin on SPX3819 LDO regulator and GPIO 2 high keep esp awake VERY LOW current circuit, < 50uA link to created PCB (2nd version, untested)