🤖Have you ever tried Chat.M5Stack.com before asking??😎
    M5Stack Community
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Register
    • Login

    Light / Deep sleep example

    Core 2
    6
    18
    30.2k
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • ZontexZ
      Zontex
      last edited by

      @felmue said in Light / Deep sleep example:

      link to pull-request

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

      1 Reply Last reply Reply Quote 0
      • felmueF
        felmue
        last edited by

        Hello @Zontex

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

        Cheers
        Felix

        GPIO translation table M5Stack / M5Core2
        Information about various M5Stack products.
        Code examples

        1 Reply Last reply Reply Quote 0
        • RopR
          Rop
          last edited by

          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?

          1 Reply Last reply Reply Quote 0
          • felmueF
            felmue
            last edited by

            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

            GPIO translation table M5Stack / M5Core2
            Information about various M5Stack products.
            Code examples

            1 Reply Last reply Reply Quote 1
            • RopR
              Rop
              last edited by

              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...

              1 Reply Last reply Reply Quote 0
              • felmueF
                felmue
                last edited by felmue

                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

                GPIO translation table M5Stack / M5Core2
                Information about various M5Stack products.
                Code examples

                1 Reply Last reply Reply Quote 0
                • felmueF
                  felmue
                  last edited by

                  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

                  GPIO translation table M5Stack / M5Core2
                  Information about various M5Stack products.
                  Code examples

                  1 Reply Last reply Reply Quote 0
                  • felmueF
                    felmue
                    last edited by

                    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

                    GPIO translation table M5Stack / M5Core2
                    Information about various M5Stack products.
                    Code examples

                    1 Reply Last reply Reply Quote 0
                    • J
                      jesse-schein
                      last edited by

                      @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?

                      1 Reply Last reply Reply Quote 0
                      • felmueF
                        felmue
                        last edited by

                        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

                        GPIO translation table M5Stack / M5Core2
                        Information about various M5Stack products.
                        Code examples

                        J H 2 Replies Last reply Reply Quote 0
                        • J
                          jesse-schein @felmue
                          last edited by

                          @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!

                          1 Reply Last reply Reply Quote 0
                          • felmueF
                            felmue
                            last edited by

                            Hello @jesse-schein

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

                            Happy Stacking!
                            Felix

                            GPIO translation table M5Stack / M5Core2
                            Information about various M5Stack products.
                            Code examples

                            1 Reply Last reply Reply Quote 0
                            • T
                              todely
                              last edited by

                              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 !

                              1 Reply Last reply Reply Quote 0
                              • felmueF
                                felmue
                                last edited by

                                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

                                GPIO translation table M5Stack / M5Core2
                                Information about various M5Stack products.
                                Code examples

                                T 1 Reply Last reply Reply Quote 0
                                • T
                                  todely @felmue
                                  last edited by

                                  @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 !

                                  1 Reply Last reply Reply Quote 0
                                  • H
                                    HappyUser @felmue
                                    last edited by

                                    @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

                                    1 Reply Last reply Reply Quote 0
                                    • felmueF
                                      felmue
                                      last edited by

                                      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

                                      GPIO translation table M5Stack / M5Core2
                                      Information about various M5Stack products.
                                      Code examples

                                      1 Reply Last reply Reply Quote 0
                                      • First post
                                        Last post