I am a newbie; I got a BrickPi in 2019/20 (I think at least - and it says on the acrylic case “BrickPi3 v1.0”) and only now that my children are starting to experiment with ev3 and NXT I am looking into BrickPi. Programming languages we will be working with - Python and C.
My question is - can I get an ultrasonic sensor HC-SR04 to work with BrickPi and if so - what is the most straightforward way? [maybe some examples somewhere]
Connecting the EV3 and the Arduino - Dexter Industries indicates that this should be even easier than trying to get ev3 to use the sensor, but aby pointers or examples would be much appreciated.
Thanks very much, getting these now. Would you know if there is any example code / project using this?
Acck - I have confused BrickPi3 with GrovePi - I am truly embarrassed and sorry.
The sensor I mentioned is for the GrovePi and does not connect directly to the BrickPi3.
Hopefully a BrickPi3 user will respond to your question soon.
The BrickPi3 has one I2C grove connector. I do not know if Seeed has an I2C ultrasonic sensor by now. Most users will use the EV3 distance sensor with the Brickpi.
That said, you can connect an ultrasonic sensor to the Pi pins, bypassing the BrickPi connectors.
See this tutorial:
In previous tutorials we've outlined temperature sensing, PIR motion controllers and buttons and switches, all of which can plug directly into the Raspberry Pi's GPIO ports. The HC-SR04 ultrasonic range finder is very simple to use, however the...
The linked post below tells what GPIO pins are unused.
Make sure you pay attention to include the level changing resistors if you connect the HC-SR04!
You can use any of the GPIO that the BrickPi3 does not use. This includes GP4, 8, 17, 22, 23, and 27, as well as the GPIO pins on the 40-pin header that aren’t passed through the BrickPi3.
Another “direct HC-SR04 to Raspberry Pi” tutorial is
For many (outdoor) projects a distance measurement is necessary or advantageous. These small modules are available starting at 1-2 bucks and can measure the distance up to 4-5 meters by ultrasound and are suprisingly accurate. This tutorial...
Est. reading time: 1 minute
Thanks very much everyone. That will give me a bit to work on. It will be slow, but I will post the results, when ready. The aim is to use a hybrid of lego and other sensors.