logo elektroda
logo elektroda
X
logo elektroda

Switching the ESP8266 on when the light changes and off when the information is sent

Defozo 2871 5
ADVERTISEMENT
Treść została przetłumaczona polish » english Zobacz oryginalną wersję tematu
  • #1 16188748
    Defozo
    Level 17  
    I would like to send information to the server when a light is switched off/on.
    My current scheme looks like this:
    Switching the ESP8266 on when the light changes and off when the information is sent

    However, I would like to make it a little more energy efficient.
    The sensor will be placed in the bathroom, so the light will normally be off.
    Perhaps I could somehow wake up the ESP8266 using a photoresistor, then the ESP8266 would send information to the server and then go into deep-sleep mode or switch off? - the same when the light is turned off.

    I am looking for help in designing such a circuit. What should I use? What should the circuit diagram look like?
  • ADVERTISEMENT
  • #2 16189659
    szymon122
    Level 38  
    Comparator + photoresistor. When it is bright then the comparator will power through the ESP8266 transistor and then the ESP will send what it is supposed to send and the transistor itself will switch off by switching itself off.
  • ADVERTISEMENT
  • #3 16189795
    Defozo
    Level 17  
    I can't quite see it. What should be connected to the inputs of the comparator? What to the +, what to the -?
  • ADVERTISEMENT
  • #4 16189989
    szymon122
    Level 38  
    With a photoresistor you have to make a voltage divider. But it's probably simpler to do it on the ESP itself, let it wake up every 10 seconds and check if it's bright.
  • ADVERTISEMENT
  • #5 16190093
    Defozo
    Level 17  
    This is how I have it done now (look at the schematic), but I want to do this ESP wake-up via photoresistor.
    Could you tell me a bit more detail about this comparator solution?
  • #6 16191069
    el2010tmp
    Level 25  
    DS ESP8266
    https://nurdspace.nl/images/e/e0/ESP8266_Specifications_English.pdf
    Quote:
    8.4.2 General Purpose IO
    There are up to 16 GPIO pins. They can be assigned to various functions by the firmware. Each
    GPIO can be configured with internal pull-up/down, input available for sampling by a software
    register, input triggering an edge or level CPU interrupt, input triggering a level wakeup interrupt,
    open-drain or push-pull output driver, or output source from a software register, or a sigma-delta
    PWM DAC.


    That is, that any gpio pin can be used to wake up. All you need is a divider with a photoresistor.
ADVERTISEMENT