ESP8266 Lolin v3 Nodemcu External Reset Deep sleep

Hi,
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

That will be difficult to obtain, as I know. Being in sleep mode the controller will not be monitoring an analog port like that.

How quickly must the ESP8266 report the voltage out of range when it happens?
If the timing is not critical then you could deep sleep the ESP for (something like) 1 minute intervals and when it wakes it checks the voltage range and if it's out of bounds starts the wifi and transmits the results.
If you need a quick response then a dual (or 2 single) comparator chip should do the job but you will need to take into account the current they draw when powered as this will be a constant drain on the power source.

Yes I could do that but I need it to report within 3 seconds. The dual comparator chips is a good idea! I will look into it.

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.