Electronic – wake ESP8266 with photoresistor like in this schematic

battery-operatedesp8266low-powerresetsleep

I want to wake ESP8266 when the light turns on, send information to the server, go to deep-sleep for a few seconds and then send the information again and keep doing that. If the server stops receiving the information, it would mean that the light is tuned off back again.

This is my schematic:
enter image description here

Will it work?

I'm asking specifically about the part where I connect my photoresistor to the RESET pin.

Additional question (optionally to answer): If I'd like to swap resistor with potentiometer, how should I connect it?

Best Answer

I'd recommend not doing that. Photoresistors are slow devices, and you might be oscillating around the point where a reset is triggered, so this might not work that great.

I'd instead recommend using something that has a clear threshold and issues a single reset impulse instead of a constant high, so this doesn't happen. In any case, RESET should be driven with a binary signal, and not something like "well, I was 0.1 V below threshold, I'm 0.05 V above, so better reset".

Anyway, I don't know the ESP8266 very well, but are you sure you want to reset the device? That's like switching your PC on and off with the power switch, just to wake it up. Maybe the ESP8266 has a pin that can be used as interrupt instead and a sleep mode to wake up from, and your would prefer that.

Your idea seems to be that you hold the ESP8266 in reset mode while it's dark – I'm not even sure that is in any way power-efficient.