Welcome to the Pycom forum Forum
    • \[\[global:header.categories\]\]
    • \[\[global:header.recent\]\]
    • \[\[global:header.tags\]\]
    • \[\[global:header.popular\]\]
    • Login

    Explore Pybytes | Official Documentation | Report a Firmware Bug/Issue | GitHub

    is short period Deep Sleep possible to save power?

    Scheduled Pinned Locked Moved Expansion Board
    power savingpytracksipy
    12 Posts 6 Posters 4.0k Views 6 Watching
    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.
    • C Offline
      chrisi
      last edited by chrisi

      I am using a sipy and pytrack to take an accelerometer measurement every second or so. I need to drastically reduce power and was wondering what would be the shortest period i could go into deep sleep for to save power. I do not need wifi or Bluetooth enabled but would like to send a sigfox message once a day. Normal sleep mode still uses 50mA of power which is barley less than not sleeping at all.

      I guess what i am asking is

      • what power is consumed to wake up / go into deep sleep?
      • how long does it take to wake up / go into deep sleep?
      • Other then disabling Wifi, Bluetooth and other sensors I am not using how else can I save power (maybe by clock speed)?
      J 1 Reply Last reply Reply Quote 0
      • B Offline
        bucknall
        last edited by

        Hi @chrisi,

        Please read this post (https://forum.pycom.io/topic/1022/root-causes-of-high-deep-sleep-current/54) for more information regarding the Deep Sleep.

        In short, you will need to use a Deep Sleep shield to achieve the current draw that you are expecting. We're shipping these out now so please drop an email to support if you need to get one for your board.

        Let me know if that helps,

        Thanks!

        Developer Evangelist - Pycom

        1 Reply Last reply Reply Quote 1
        • T Offline
          this.wiederkehr
          last edited by

          @chrisi said in is short period Deep Sleep possible to save power?:

          sipy and pytrack

          @bucknall there should be no need for the deep sleep shield if he is using the pytrack

          @chrisi: If you are using the pytrack the procedure to go to sleep is different:

          see here for reference on the current draw:
          https://forum.pycom.io/topic/1460/power-consumption-deep-sleep-pysense-pytrack

          Basically do:

          from pytrack import Pytrack
          time.sleep(10)
          py = Pytrack()
          py.setup_sleep(30)
          py.go_to_sleep()
          

          I'm also interested in the answers to your questions as I have the need for short sleep periods (<1 sec) as well.

          B E 2 Replies Last reply Reply Quote 2
          • B Offline
            bucknall @this.wiederkehr
            last edited by

            @this.wiederkehr @chrisi

            This is correct; I missed the fact that you said you have a Pytrack. You can use the Pytrack Libraries to achieve deep sleep.

            Developer Evangelist - Pycom

            1 Reply Last reply Reply Quote 0
            • E Offline
              Eric24 @this.wiederkehr
              last edited by

              @this.wiederkehr I'm not sure this is the right approach for very short sleep periods (especially < 1 second), since there is latency in entering and waking up from deep-sleep (mostly when waking). I believe there is planned future support for a sleep mode that essentially just "pauses" the device, but I haven't seen anything about this recently, and in fact, it may not work with the current generation of pycom modules (those that require the support of a shield for deep-sleep). For short sleep periods, something like that is probably a better solution, since it should enter/leave sleep mode almost instantaneously.

              I'd be interested to hear from others that have experimented with deep-sleep, and what kind of latency you're seeing on wake-up.

              1 Reply Last reply Reply Quote 1
              • B Offline
                BetterAuto Pybytes Beta
                last edited by

                On the ESP8266 there were "light sleep" and "modem sleep" modes that were actually more efficient than deep sleep for cycles under 2 seconds, per Espressif, due to as Eric said the long wake latency. Waking from deep sleep is the same as a reset. I can't speak to Sigfox latency but Wi-Fi latency is several seconds. Maybe these two modes are available on Pycom modules? I haven't looked. Also look at machine.idle().

                E 1 Reply Last reply Reply Quote 1
                • E Offline
                  Eric24 @BetterAuto
                  last edited by

                  @BetterAuto It's my understanding that "modem sleep" is achieved by simply turning off the WiFi and Bluetooth radios. "Light sleep" is the mode that I think is not yet supported by pycom (which I believe is the machine.sleep() function, per the micropython docs). As for "machine.idle()", it only gates the CPU clock until the next interrupt, but (at least) the system timer interrupt is running at a fairly short interval, it won't have much of an effect (frankly, I haven't seen any difference in power consumption between this and the utime.sleep*() functions; I haven't dug into the source code, so that may be because the utime functions are actually using machine.idle() under the covers, or because machine.idle() doesn't actually get the CPU clock, or possibly because the reduction in power is too small for me to measure).

                  1 Reply Last reply Reply Quote 2
                  • J Offline
                    jmarcelino @chrisi
                    last edited by jmarcelino

                    The SiPy takes about 1.9 seconds from the Pytrack deep-sleep wakeup (effectively power on) until it's running the first command (in boot.py) so this style of sleep isn't suitable for very frequent actions. Also the power-on current is particularly high - I haven't done the math yet but my feeling is if you're deepsleeping for less than 30s it's not worth doing it.

                    Until all the ESP32 functionality is available (sleep modes, true deep-sleep, ULP) a good strategy is to do what Pycom did on the Pytrack and Pysense: use a separate low power microcontroller for small repetitive tasks and only wake up the main processor when necessary.

                    C 3 Replies Last reply Reply Quote 1
                    • C Offline
                      chrisi @jmarcelino
                      last edited by

                      @jmarcelino Thanks, a separate low power microcontroller is exactly what I am now planning to do now until they bring out the ability to use the UPL for small tasks.

                      1 Reply Last reply Reply Quote 0
                      • C Offline
                        chrisi @jmarcelino
                        last edited by

                        This post is deleted!
                        1 Reply Last reply Reply Quote 0
                        • C Offline
                          chrisi @jmarcelino
                          last edited by

                          @jmarcelino I have done what you have suggested and used a separate low power microcontroller for small repetitive tasks (MSP430). I was wondering if you have any I2C example code to which can communicate between the 2 devices? Or do you think SPI or another was to comunicate would be better?

                          B 1 Reply Last reply Reply Quote 0
                          • B Offline
                            BetterAuto Pybytes Beta @chrisi
                            last edited by

                            @chrisi Or what about good old UART?

                            1 Reply Last reply Reply Quote 1

                            Hello! It looks like you're interested in this conversation, but you don't have an account yet.

                            Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.

                            With your input, this post could be even better 💗

                            Register Login
                            • 1 / 1
                            • First post
                              Last post

                            Pycom on Twitter

                            Pycom