I want to send information to the server when the light changes (turns on or turns off). As for now, I have a photoresistor connected to ESP8266's ADC pin. I'm measuring voltage and sends information to a server when it changes much. ESP stays always on.
Here is my current circuit:
However, I'd like to make it in slightly more energy efficient way.
The sensor will be used in a bathroom, so the light is usually turned off.
Perhaps I could make ESP8266 wake up somehow by photoresistor and then send a request to the server and wait for the light to turn off back again and then send the second request and enter the deep-sleep mode? Or maybe there is a better way?
I'm seeking help in creating a circuit. What should I use? How the circuit should look like?