Light / Deep sleep example



  • Hi guys

    I took a stab at fixing light / deep sleep for M5Core2 and created an example showing how light / deep sleep works. link to pull-request

    Happy Stacking
    Felix


  • Global Moderator

    @felmue said in Light / Deep sleep example:

    link to pull-request

    Pull request merged into master, thanks for the contribution @felmue !



  • Hello @Zontex

    cool, you are welcome and thank you for taking the time to test and merge.

    Cheers
    Felix



  • Hi @felmue ,

    Question: do you know how many mA the system uses in it's most power-saving sleep state where it is still able to wake up on a timer as well as when the touch screen is pressed? Is there code somewhere to accomplish this?



  • Hello @Rop

    the lowest power consumption, with timer and touch screen wakeup, I've managed to achieve so far is about 3.2 mA in light sleep (measured at the battery).

    An experimental example with the relevant part and pieces can be found here.

    Interestingly the power consumption in deep sleep is slightly higher (about 4.5 mA) and I have not yet been able to figure out why.

    Please let me know if you happen to figure out how to get even lower power consumption in either sleep mode.

    Thanks
    Felix



  • Hi Felix!

    Strange... With me that code, using Arduino IDE, just says "Going to light sleep for 50 seconds." and then it never wakes up again. I measure 19.7 mA at the USB input when it does that.

    Have to powercycle and then start uploading code before it goes to sleep again to get out of it...



  • Hello Rop

    hmm, never waking up normally means that for some reason ESP32 lost power completely somehow.

    You could try to comment out the five code lines before going to light sleep to see if that helps in regard of waking up. If yes, try to uncomment line by line to find the culprit.

    BTW: with those five code lines commented out I get 11.1 mA in light sleep (again, measured at the battery).

    Thanks
    Felix



  • Hi Rop

    it just occurred to me that the behaviour you're describing is exactly how the system reacted with the original M5Core2 library and before my pull-request which fixed light / deep sleep was merged.

    So, please make sure you have the latest M5Core2 library from github.

    Thanks
    Felix



  • Hi guys

    I finally figured out how to lower deep sleep current below light sleep current.

    Function gpio_deep_sleep_hold_en() needs to be called before going into deep sleep.

    With that deep sleep current goes down to 2.6 mA (timer and touch enabled as wake source). Or even lower to 1.8 mA if only timer is enabled as wake source.

    Thanks
    Felix



  • @felmue
    With your recent commits to the github library, will RTC sleep mode with the IRQ actually turn off everything (ESP, AXP, LDO2,LDO3, DC boosts)? It will just leave the RTC on since its connected to LDO1?

    Does this result in super low deep sleep current in the microamp range? I tried to look at the AXP192 data sheet to see what the LDO1 quiescent current is but didnt see anything listed. I'd imagine just external RTC on is basically no power? And I can use that to wake the ESP32/AXP192 backup since the AXP192 is in powermode A since LDO1 is tied to Sys_en on the AXP192?

    Or does this completely stop the current since the RTC has its own battery it looks like?



  • Hello @jesse-schein

    When everything is powered down except for AXP and RTC (e.g. shutdown mode / RTC sleep mode) I measure a current at the battery of about 0.263 mA = 263 uA.

    Thanks
    Felix



  • @felmue said in Light / Deep sleep example:

    Hello @jesse-schein

    When everything is powered down except for AXP and RTC (e.g. shutdown mode / RTC sleep mode) I measure a current at the battery of about 0.263 mA = 263 uA.

    Thanks
    Felix

    Thanks so much! Thanks for all your contributions around the m5stack details, m5stack team does a pretty good job at describing the products but you really help out! Thanks again!



  • Hello @jesse-schein

    you are very welcome and thank you for your kind words - much appreciated.

    Happy Stacking!
    Felix