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

    reference design for low power sleep (please!)

    Scheduled Pinned Locked Moved LoPy
    6 Posts 5 Posters 133 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.
    • H Offline
      hdemeillon
      last edited by

      Re: lopy4 RTC

      @Martinnn asked for this a year ago, here is another try :

      I have the impression that many people here are struggling with low power deep sleep designs. It would be great if pycom could provide some reference designs for a device that wakes up every xx minutes/hours, sends some data (like from an analog input) via Lora/Sigfox/LTE NB and runs off a battery (like a LiTCL D size https://ch.rs-online.com/web/p/d-batterien/6684550/ ) for a year or two.

      Did you end up with a design you're happy with @Martinnn ?

      1 Reply Last reply Reply Quote 2
      • G Offline
        Gijs
        last edited by Gijs

        @hdemeillon said in reference design for low power sleep (please!):

        have the impression that many people here are struggling with low power deep sleep designs. It would be great if pycom could provide some reference designs for a device that wakes up every xx minutes/hours, sends some data (like from an analog input) via Lora/Sigfox/LTE NB and runs

        Hi,
        I am currently working on providing an example for machine.deepsleep():

        import machine
        import time
        (wake_reason, gpio_list) = machine.wake_reason()
        print("Device running for: " + str(time.ticks_ms()))
        print("Remaining sleep time: " + str(machine.remaining_sleep_time()) + "ms" )
        if wake_reason == machine.PWRON_WAKE:
            print("Woke up by reset button")
            #stop the sleep loop here
            while True:
                machine.idle()
        
        elif wake_reason == machine.PIN_WAKE:
            print("Woke up by external pin (external interrupt)")
            print(*gpio_list, sep=", ")
        elif wake_reason == machine.RTC_WAKE:
            print("Woke up by RTC (timer ran out)")
        elif wake_reason == machine.ULP_WAKE:
            print("Woke up by ULP (capacitive touch)")
        
        machine.pin_sleep_wakeup(('P3', 'P4'), mode=machine.WAKEUP_ANY_HIGH, enable_pull=True)
        #use a network to send some things
        
        machine.deepsleep(1000*60) #sleep for 1 minute
        print("This will never be printed")
        

        Is this something you were looking for?

        A 1 Reply Last reply Reply Quote 1
        • A Offline
          abhishek2101 @Gijs
          last edited by

          @Gijs how much current data a being used in deep sleep using this code ?

          rcolisteteR 1 Reply Last reply Reply Quote 0
          • G Offline
            Gijs
            last edited by Gijs

            That depends highly on the variant of expansion board and development board you are using, whether you disable the LEDs etc. The final power should be in the order of 10s of micro-amperes.

            You can go even more low power by using the py.go_to_sleep() method on the Pytrack or Pysense, this will cut the power to the module alltogether leaving only the PIC on the board running in a low power state, keeping track of the time to wake up. Im not sure about the sleep current here, but it should be even lower.

            Best,
            Gijs

            1 Reply Last reply Reply Quote 0
            • rcolisteteR Offline
              rcolistete @abhishek2101
              last edited by

              @abhishek2101 See my "Guide/Tutorial/Reference about Expansion Board".

              My "MicroPython Samples". My "MicroPython Firmwares" with many options (double precision, ulab, etc).

              1 Reply Last reply Reply Quote 0
              • S Offline
                somervda
                last edited by

                FYI: I made this https://github.com/somervda/lopybase repository for testing out deepsleep/lorawan etc on lopy4 - it seems to work for me . I also have a video that walks though some of the code here https://youtu.be/5pBcGdR8pR4 . It may be useful :)

                1 Reply Last reply Reply Quote 0

                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