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 -
@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
FelixThanks 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 -
Hello,
Thanks @jesse-schein for your contribution !
Could you please add a sample code to wake up from light ou deep sleep ? i can't find à way to go in light or deep sleep and wake up by CORE2 touch or rumble detection.
Thanks !
-
Hello @todely
have a look at this example I've put together a while ago. It shows how to go into light sleep and deep sleep and how to wake up by timer or touch.
What do you exactly mean by 'rumble detection'? If you mean waking M5Core2 when it is shaken then I am afraid that's not possible without a hardware modification. The reason being that the interrupt line of the motion detection IC (MPU6886) is not connected to anything. See here for how I modified my M5Core2.
Thanks
Felix -
@felmue Thanks for the sample code !
For rumble part yes it was shaken it.. i have read your kb about Core2 and see not possible without hardware modification...Thanks again for you quick answer !
-
@felmue I just read this post. I am also facing high current during deep sleep om the M5Atom.
I am curious : could you give an example code how to power down (expect for AXP and RTC).
Thanks -
Hello @HappyUser
I think you are mistaken. AFAIK the M5Atom Lite / Matrix doesn't contain an AXP.
BTW: With M5Atom Lite / Matrix you will never get a really low power consumption as even when ESP32 is sleeping there still is the USB/Serial chip which cannot be turned off I think.
For the M5AtomS3 you can find a deep sleep example here.
Thanks
Felix