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

    Disabling external sensor while in deep sleep on Expansion Board 3.1

    Scheduled Pinned Locked Moved Expansion Board
    6 Posts 3 Posters 238 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.
    • Z Offline
      ZachH
      last edited by

      Hi everyone,
      I'm pretty new to this so apologies if this ends up being something simple. I'm trying to build a remote water level sensor using a LoPy4 along with an expansion board 3.1 and an external ultrasonic sensor connected to the 3.3v power pin on the expansion board.
      I have managed to get everything working, and the whole setup seems to function as expected, however the sensor remains powered while in deep sleep mode (machine.deepsleep()). From what i have read it seems like this command simply puts the LoPy4 to sleep while not affecting the Expansion Board, so I was wondering if there is a way to cut the power to the external sensor similar to the go_to_sleep() function on the Pysense/Pytrack?

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

        @ZachH You could power your sensor with a pin of the LoPy4, and just set it low before going to sleep. Make sure you use a pin which can be "held" at its level during deep sleep.

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

          @jcaron There may be another constraint, which is how much power your sensor needs, as GPIO pins have a limite on how much current they can source. You may need a transistor or something similar if your needs exceed that limit.

          Z 1 Reply Last reply Reply Quote 0
          • Z Offline
            ZachH @jcaron
            last edited by

            @jcaron Ah yeah I was wondering if that would be possible. I'll check on how much current I can get from the pins and hopefully that will be enough

            Z 1 Reply Last reply Reply Quote 0
            • Z Offline
              ZachH @ZachH
              last edited by

              @ZachH Unfortunately it looks like my ultrasonic sensor needs up to 30mA which i believe is a bit high for the GPIO pins. Looks like its going to need a transistor switch

              robert-hhR 1 Reply Last reply Reply Quote 0
              • robert-hhR Offline
                robert-hh @ZachH
                last edited by

                @ZachH Most GPIO Pins can drive up to 40 mA, but then the output level drops to ~2.6V. Using an transistor is the better choice.

                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