Disabling external sensor while in deep sleep on Expansion Board 3.1
-
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? -
@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.
-
@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.
-
@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
-
@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
-
@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.
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