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

    Original LoPy and DeepSleep shield machine.sleep current consumption

    Scheduled Pinned Locked Moved LoPy
    4 Posts 4 Posters 28 Views 4 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
      Duane Kaufman
      last edited by

      Dear All,
      I searched the forum for previous discussions, but I think I am wanting to use a Lopy 1 with a DeepSleep shield and expansion board in a way that it is not normally used.
      I want to build a monitor for my rather long driveway to detect vehicles and report to the house (using LoRa) when they are approaching. This will be battery powered.
      Right now, I am thinking I want to wake up the LoPy rather often (2-5 times per second) to read the magnetometer (through I2C), decide whether the sensor has detected a vehicle, and report (via LoRa) if it has.
      From what I have read about DeepSleep, I don't think I can use it because of the time needed to boot the LoPy will not allow me to wake up 5 times per second.
      I have looked at machine.sleep (https://docs.pycom.io/firmwareapi/pycom/machine/), but I have not seen any data on current consumption when using this. Has anyone measured this?

      Is machine.sleep what I should be looking at using, or is there another way to minimize current consumption when waking up multiple times per second?

      Thanks,
      Duane

      L J 2 Replies Last reply Reply Quote 0
      • L Offline
        livius @Duane Kaufman
        last edited by

        @Duane-Kaufman
        Currently i suppose only way is to use sleep and idle.
        Look also at this: https://forum.pycom.io/topic/7026/ulp-testing-pycom-firmware-with-ulp-support

        think about people first, then computers

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

          @Duane-Kaufman you definitely won’t be able to deep sleep and wake up that often, and any other sleep modes will substantially increase power consumption.

          So unless you have a permanent power source or are prepared to change batteries extremely often, you need another way, using a sensor which draws very little power and can trigger a wake up of the LoPy when an event arises.

          This could be an entirely passive sensor (think something which has an open contact most of the time, and the contact is closed when a vehicle approaches), or a sensor with a very low power mode which can by itself monitor at regular intervals and trigger an interrupt when some condition is met.

          Look at vehicle counting systems for hints of the types of sensors you could use. This article lists quite a few. I believe the most common for temporary installations (I.e. not needing digging into the ground) are the pneumatic tubes, not sure what kind of sensor would be needed at the end of one if those, possibly a very simple spring-loaded button of some sort.

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

            Perhaps you could use another type of magnetometer with a digital interrupt (or use an analog output and comparator circuit) that you could use to trigger a wakeup on the Lopy's deepsleep shield. My experience with the thing is limited, but according to this page: https://docs.pycom.io/datasheets/expansionboards/deepsleep/ you should be able to use P17 and P18 to trigger a wakeup. Once the wakup is triggered, all you need to do is send a lora packet and go back to sleep.

            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