Ultrasonic sensor on a Kitronik motor driver board

G’day,

I am trying to make an obstacle avoiding robot using an R-Pi Pico, a Kitronik Motor Driver Board for the Pico, and an HC-SR04 ultrasonic sensor. When its powered by a USB connected to my computer, the HC-SR04 works fine and returns a distance. However; when its powered from a battery it does not. I used a multimeter and confirmed there’s voltage to it when its powered by the battery, the same voltage as when its powered by the USB. Any ideas why it might not be working?

Hi @James292715

That is definitely odd behaviour from your setup, are you able to give us some more info about the type of battery it is that you’re using and how you have it connected to the Pico?

Hi Dan,

Ive tried several batteries from alkaline, to lipo to 9v. All plugged into the screw terminals of the kitronik board. The pico itself is just inserted into the board.

Hi @James292715

What pins was it that you were using to connect up to the Ultrasonic sensor? And do you have any other sensors/motors connected while you have the Kitronik board running from the battery?

pins 26 and 27. There’s no other sensors connected but I do have 2 DC motors connected. When I disconnect them and run only the driver for the ultrasonic sensor it still doesn’t work.

Hey @James292715,

Would it be possible for you to post a few photos of your setup? It sounds like the ultrasonic sensor may not be getting enough current to run from the motor driver board, but does get enough when the power comes directly from the Pico.

If you could share a few photos of your setup we may be able to figure this out with you. :slight_smile:

1 Like

I am not very experienced and have not used the sensor you are using but your issue reminded me of an issue I had recently. See:-
Pico code runs from Thony but will not run on battery or USB power - Core Electronics Forum
Is your code running from Thonny when you are connected to the computer? If so, my thread might give you some clues. I never found the explanation but did find a work around.
Otherwise, just ignore this.
Ian

1 Like