I have an analog sensor which outputs voltages between 0.5 and 5V. I would like my nodemcu to go into deepsleep when the sensor voltage is between sensor voltage limits I can set. For example, I want to wake up the nodemcu when the sensor voltage exceeds say 3.4V (upper limit) or dips below 2V (lower limit) and send to firebase (using Wifi) the current sensor voltage or limit that was breached, how would I go about doing this? I believe I have to setup an external circuit to bring the RST pin high when either of the voltage limits are breached and low when they are not? I beleive I can determine which limit was breached as I have my sensor attached to A0 so I can send that once the nodemcu wakes up, but my problem is setting up the external circuit. I`ve been looking at chips like these https://www.ti.com/lit/ds/symlink/sn74lvc1g373.pdf but not sure where to even begin!
Another case I hope to accomplish is to be able to "override" the deepsleep when the sensor voltage is between the limits and read the sensor voltage when I set a bit in firebase. I`m thinking I can do this by "ESP.deepSleep(interval)" where interval is a global variable that is changed between 0 and 1us using firebase.
I want to do this so I can save as much power as possible. I have the wifi and data sending to firebase working but I notice large power consumption of always being connected to wifi (80mA draw). I notice I can only achieve 10mA current draw by powering nodemcu through 3V pin but I hope to eventually use the ESP-12E chip soley so I can achieve 20uA deepsleep functionality. I am also planning to use a coin cell battery that is charged by a small solar panel and could use advice there as well on types of batteries/solar cells I could use that would work with the wake up circuit