Ultrasonic distance sensor breakout

Hi folks,

I bought this sensor: https://shop.pimoroni.com/products/ultrasonic-distance-sensor-breakout

and want to add it to a Raspberry Pi 3 robot buggy. The info says it uses pin 4. I have the small I2C Breakout Garden


but I really want a cable too so that the breakout garden and USD can go on the front of the robot buggy at about 10cm from the Pi. The buggy motor controller board from the CamJam kit 3 (from 4tronix) uses the first 26 pins of the R Pi3.

Which pin/s can I use on the Pi for the USD? What sort of cable would I need to attach it?

If it’s i2c my best guess is as follows
V is V+ likely 3.3v
D is Data SDA
C is Clock SCL
S is I don’t know? INT maybe?
G is Ground.
There is this that plugs into the breakout garden

Then just use female jumpers or something? You may have to solder wires to the sensor pads.

1 Like

Thank you very much K @alphanumeric . That helps no end! I now have a soldering iron so I’ll use the method you’ve explained. Thanks again. Anne

If you use the female to female jumpers, you could remove the black plastic shell from one end. Then just solder the connector to the pads on the sensor. No having to cut and strip the ends. If you lift the little locking tab up with a pin or needle you can slid it off. Do it carefully and you can reuse them / put them back on if you change your mind.

1 Like

Ops, somehow I missed this bit.

This breakout is fully compatible with Pimoroni’s [breakout garden], so you can plug it into any of the I2C connectors and use it on GPIO pin 4.

It is a single pin, 3.3V sensor breakout. So the Ping and the Echo are on the same pin.

Code it using standard HC-SR04 code.

You could use this, and not have to solder at all.

Really sorry about that, with whats going on covid wise, my brain doesn’t always fire on all cylinders. Soldering may be a less bulky cleaner look though.

1 Like

Thanks very much for your help K @alphanumeric . I am learning so much by doing this and hope to be able to show you a robot buggy that avoids walls with the USD sensor, on Twitter, in a while. Thanks again. Anne

I have an older version of that sensor that was for the RoboBit Mk2. I hooked it up long enough to make sure it was functional, then got sidetracked on another project. My plan was to use it with an Arduino and have it on a servo. Have it work kind of like a forward facing radar.

1 Like

Thank you K that’s interesting. I think one of these will do the job for me as the USD sensor is a breakout designed for the garden. https://shop.pimoroni.com/products/breakout-extender .

Thanks, Anne

The one I linked too above has both bits.
One plugs into the breakout garden > Jumper > other end plugs onto sensor.
The one you linked too will still work. You’d just solder your wires to that extra row of solder pads on the breakout garden. Or solder a header to the breakout garden and plug your jumpers into that. A single row male header will do, you only need those first 5 pins.
Where it says 3V3, SDA, SCL, Int, GND, etc.

Aren’t these extenders just like the slots on the breakout garden - so with the sensor I’ve got (see image at top) I can do without the garden all together? I only need one slot. Then I would need a female to male jumper to go from the extender to the motor controller’s pin 4. See image of motor controller above.

Lilac jumper (on the left of the image) in pin 4 is ready to go into the connector/extender to the sensor.

If your not using any other Breakout Garden boards, then no you don’t need the Breakout Garden Mini. I was assuming (maybe incorrectly) you already had one and had some breakouts in it.
That looks like it should work Ok. Near as I can tell from the photo’s anyway.

I have a couple of two wheel rovers built around the Explorer Phat. No collision avoidance on them, not yet anyway. I just control them with a wireless keyboard.

Thanks K that’s great!. I actually bought the Breakout Garden mini for an indoor air quality set up so I can put the AQ set-up back together. It’s got a BME680 Volatile Organic Compound breakout and an 11 x 7 matrix on - and it has a smiley face which turns to a blank face when the air goes bad, ie. when

the AQ score goes below a certain percentage. It’s one project I loved doing because I learnt so much python from it!

I have the Mini i2c + SPI. It currently has the Trackball breakout, 1.3 LCD display and RV3028 RTC. At some point I plan on swapping the trackball for a BME280.

I have a couple of what I call Weather clocks, one stand alone and one portable. Pi A+, Sense Hat, RTC and assorted sensors. They display the Day, date, time, temp, humidity, pressure is a scrolling message on the Sense hat LED matrix. Its 8x8 RGB LED’s. The color of the text changes based on conditions. Temperatures at or above 25c show in Red for example. I learned a ton of python on that project. The protable one has a BME680 mounted externally on the bottom of the case and an Si1145 UV light sensor on top.
Build pictures are here in my Public Onedrive folder

1 Like

Re: Build pics They are so interesting! Thanks for letting me in on them. I might need to refer back to them sometime to look at how you’ve done things. Anne

Most of my Pi project pictures are here if you want a look see.

There might be some Arduino or BBC Microbit stuff in there too.
Check out the rover folder. ;)

1 Like

Yes, I’ll keep an eye on your rover folder while I’m doing my build, thanks. :)

From the picture you posted your going two wheel drive with a caster. Mine are all two wheel drive. I’ve had the odd glitch but for the most part that works well.
Any time I’ve tried to go with 4 powered wheels it didn’t work right. I might need a more powerful motor driver though. Might also be the 1 A limit of the PowerBoost 1000c.
Anyway, have fun. =)

1 Like