I fine with the software side of things and I have tried this out on a breadboard and verified that the circuit works, however I would appreaciate any feedback on the electronics side, is there any thing I am doing dangerously, overly inefficienty, or stupidly? Are there any potential problems that anyone sees? The parts I am using are parts I have on hand, I realize there may be better transistors to use ect.
Benifits of piggy backing off existing devices.
-Already have low battery alarms built in
-Already have power supply and enclosure
Case 1: Water Detector (GPIO_5 isn't used, Just an email notification)
-ESP Starts up when it is activated but a +5V that is present when the Alarm goes off
-Sets GPIO_4 HIGH to keep ESP active till we are done with it
-Connects to WiFi and sends an email
-If the alarm stops we send another email then set GPIO_4 LOW and the ESP shuts down
Case 2: NFC door lock (GPIO_5 is used as an output)
-ESP Start up when lock is activated by the button on the lock (piggy backing off the LED circuit that lights up)
-Sets GPIO_5 HIGH to keep the ESP active for a set amount of time where it connects to wifi and checks a url for a valid unlock code
-If it sees a valid code it sets GPIO_5 HIGH then LOW which activates the switch on the door lock
-Set GPIO_4 LOW and shutdown the ESP