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

    Power saving during active cycle

    Scheduled Pinned Locked Moved Discussion
    power saving
    7 Posts 3 Posters 1.8k Views 3 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.
    • D Offline
      danielm
      last edited by

      In my battery powered device I have a CO2 sensor connected via UART. The sensor streams readings each 500ms and is filtering measurements internally. It is necessary to wait for it to perform several measurements to get reasonably accurate measurement. In my case it is 5 measurements which take approx. 2.5s. During this time a lot of energy is wasted by CPUs doing nothing useful. 128uWh are consumed during this time period out of 205uWh of complete active cycle. I would like to save some of this energy. Basically it would be suficient to keep peripherals running (UART with buffer) and put CPUs into sleep. Is this possible to achieve with current state of esp-idf and Pycom MicroPython port?

      0_1517513044106_active_cycle_1.jpg

      J 1 Reply Last reply Reply Quote 0
      • J Offline
        jcaron @danielm
        last edited by

        @danielm just out of curiosity, which tool did you use to get those measurements?

        1 Reply Last reply Reply Quote 0
        • D Offline
          danielm
          last edited by

          @jcaron
          It's Otii Arc and their software for PC:
          https://www.qoitech.com/

          1 Reply Last reply Reply Quote 1
          • D Offline
            daniel
            last edited by

            @danielm there's definitely something that we can do to improve that. We are looking into using the ESP32 lightsleep modes for that.

            1 Reply Last reply Reply Quote 0
            • D Offline
              daniel
              last edited by

              @danielm looking again at how lightsleep works, what can be done is to receive a reading from the sensor, the setup a timer of like 450ms for the lightsleep wake-up, enter light sleep, when it wakes up wait for the next reading and repeat the process again until you can go to deepsleep. Unfortunately there's not a way to put the CPU's to sleep and just keep the UARTs running, but I think that what I propose can already help save most of the energy that you are wasting at the moment. Views?

              Cheers,
              Daniel

              J 1 Reply Last reply Reply Quote 0
              • D Offline
                danielm
                last edited by

                @daniel
                Making light-sleep mode available from MicroPython API would definitely help. Is it feasible to implement it with current state of esp-idf?

                Another useful feature might be if machine.freq() could set (lower) CPU frequency.

                1 Reply Last reply Reply Quote 0
                • J Offline
                  jcaron @daniel
                  last edited by

                  @daniel Would the LoRa chip on a LoPy stay active during light sleep? If so, the same kind of trick could help save quite a bit of energy when sending a packet: the time until RX2 usually does not need the CPU to be doing anything, so one could easily save 2 seconds of CPU awake time.

                  When using the slowest data rates, the CPU could also be sleeping during the TX phase itself, I suppose.

                  Even if light sleep is not possible, what about machine.idle? I understand it’s not currently working as intended, but if there’s a way to fix that it could probably help as well.

                  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