2
\$\begingroup\$

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:

enter image description here

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?

asked Dec 11, 2016 at 0:15
\$\endgroup\$
4
  • \$\begingroup\$ How much more energy efficient are you looking for? Whats the current load of your circuit? \$\endgroup\$ Commented Dec 11, 2016 at 0:40
  • 2
    \$\begingroup\$ Just a bit. Well, I simply don't want my ESP8266 to be turned on at all time. If it could go to deep-sleep mode it would raise its time of life on a single battery a lot, wouldn't it? My device currently works for about 2 weeks on 2x AA. \$\endgroup\$ Commented Dec 11, 2016 at 1:05
  • \$\begingroup\$ Are you using the sleep modes already available with internal timers? What's the actual current draw though? \$\endgroup\$ Commented Dec 11, 2016 at 1:25
  • \$\begingroup\$ @Passerby I'm not using any sleep modes currently. Sorry, I can't measure the precise current draw now (but it's probably around 40 mA). Please see my updated question. \$\endgroup\$ Commented Jan 7, 2017 at 1:34

3 Answers 3

1
\$\begingroup\$

The deep sleep functionality of the ESP8266 is managed by tying pin 16 to the RESET pin and when you call the deep sleep function you pass the number of microseonds you want to sleep. Then the microcontroller sets pin 16 high and goes to sleep. After the specified amount of time the pin 16 goes low causing the ESP8266 to reset. Please see the "low power solutions" pdf from Espressif for the API details, including some application notes.

So, your plan of connecting to pin 16 is not going to work exactly. You need a circuit that detects that pin 16 is high and then generates a low pulse on RST when your condition triggers. Without knowing more details about your circuit and exact triggering condition or is hard to provide a detailed answer.

answered Dec 11, 2016 at 13:25
\$\endgroup\$
1
  • \$\begingroup\$ I updated my question. Please take a look. \$\endgroup\$ Commented Jan 7, 2017 at 1:35
1
\$\begingroup\$

Enter deepsleep without connecting GPIO16 and RESET leeds to endless deepsleep unless you pulse reset with an extern circuit!

That is what you have to do. Connect your photoresistor to a differential-Amp with monoflop in series to ensure clean pulses on reset pin or use a ultra low power mcu to do that. So every time the light changes the differntial-amp detects the high slope and triggers the Monoflop!

Reading Pin 16 is not a musthave you can use a timeout in monoflop but adding an AND-Gate is also not really hard to do.

answered Aug 17, 2018 at 12:33
\$\endgroup\$
0
\$\begingroup\$

You could just put the esp into light sleep mode, and tie a gpio pin as an interrupt to wake it up. Have your photoresistor wake up the esp whenever the light is turn on, then send to server. That should save a lot of power

See Esp8266

answered Aug 15, 2017 at 1:17
\$\endgroup\$

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.