Aliena
Posts: 8
Joined: Wed Feb 22, 2017 8:44 am

Ultrasonic

Wed Feb 22, 2017 8:57 am

Hello,
i want know please how many ultrasonic can I add to a raspberry pi model b, i added one as is written on the tutorial on the official website and everything ok, but i want add other 2 for calculate volume. Thank you!

User avatar
joan
Posts: 14935
Joined: Thu Jul 05, 2012 5:09 pm
Location: UK

Re: Ultrasonic

Wed Feb 22, 2017 9:05 am

Just use a different set of GPIO for each sensor. So the number of sensors you can have is the number of spare GPIO divided by the number needed per sensor.

I would not fire all the sensors at the same instant, you would get confusing echoes. Probably best to fire them in sequence.

User avatar
B.Goode
Posts: 10356
Joined: Mon Sep 01, 2014 4:03 pm
Location: UK

Re: Ultrasonic

Wed Feb 22, 2017 9:11 am

If you mean the common hc-sr04 sensor, each one needs 2 gpio connections: Trigger and Echo.

Since all current RPi model B boards have 26 (I think) gpio connections on the 40-pin header, that suggests you could physically connect up to 13 such sensors.

So connecting 3 should not be an issue...

Edit: unintended echo of what @joan wrote while I was counting gpio pins...

texy
Forum Moderator
Forum Moderator
Posts: 5161
Joined: Sat Mar 03, 2012 10:59 am
Location: Berkshire, England

Re: Ultrasonic

Wed Feb 22, 2017 9:20 am

Well the OP does only state a model B. This could be an early 26-way GPIO port Pi. Then again he has also only stated he needs 3 sensors, so any model should be OK :D
Texy
Various male/female 40- and 26-way GPIO header for sale here ( IDEAL FOR YOUR PiZero ):
https://www.raspberrypi.org/forums/viewtopic.php?f=93&t=147682#p971555

Aliena
Posts: 8
Joined: Wed Feb 22, 2017 8:44 am

Re: Ultrasonic

Wed Feb 22, 2017 9:48 am

ok thanks can i know how connect the other 2 ultrasonic if the first one it's connected in this way http://www.raspberrypi-spy.co.uk/2012/1 ... on-part-1/
I'm not expert so i want calculate the volume with python

User avatar
B.Goode
Posts: 10356
Joined: Mon Sep 01, 2014 4:03 pm
Location: UK

Re: Ultrasonic

Wed Feb 22, 2017 10:03 am

Aliena wrote:ok thanks can i know how connect the other 2 ultrasonic if the first one it's connected in this way http://www.raspberrypi-spy.co.uk/2012/1 ... on-part-1/
I'm not expert so i want calculate the volume with python
You have the example of connecting the first sensor.

Just replicate (repeat, or copy using that example) the circuit and code. You will need different connections on the breadboard (or 2 more breadboards), and you will need to change the coding of the trigger and echo pins in the script to match the new connections you make to the header on your RPi. The Echo connection on each sensor will need its own pair of resistors to control the voltage reaching the RPi.

If this does not make sense because of language problems it might be best if you keep your queries to your duplicate thread in Italiano. viewtopic.php?f=79&t=175190

User avatar
B.Goode
Posts: 10356
Joined: Mon Sep 01, 2014 4:03 pm
Location: UK

Re: Ultrasonic

Wed Feb 22, 2017 10:06 am

texy wrote:Well the OP does only state a model B. This could be an early 26-way GPIO port Pi. Then again he has also only stated he needs 3 sensors, so any model should be OK
Quite so. That's why I tried to clarify by specifying current models, and referring to the 40-pin header.

Aliena
Posts: 8
Joined: Wed Feb 22, 2017 8:44 am

Re: Ultrasonic

Wed Feb 22, 2017 10:20 am

I thought to reply this one but i have 1 breadboard and i would use it for connect each 3 sensors because i have no time to buy another one and I have a competition about IoT for find a new job :D

User avatar
B.Goode
Posts: 10356
Joined: Mon Sep 01, 2014 4:03 pm
Location: UK

Re: Ultrasonic

Wed Feb 22, 2017 10:30 am

i have 1 breadboard and i would use it for connect each 3 sensors

Do you have any specific difficulty using the breadboard in that way that you need help with?

(Thank you for saying that you are in a competition. What you produce should be your own work, not the result of following exact instructions from a forum.)

Aliena
Posts: 8
Joined: Wed Feb 22, 2017 8:44 am

Re: Ultrasonic

Wed Feb 22, 2017 10:39 am

:) my difficult is that when I copy the circuit in a specular way I can put only 2 sensor on a breadboard...I don't know how put the 3th sensor there

texy
Forum Moderator
Forum Moderator
Posts: 5161
Joined: Sat Mar 03, 2012 10:59 am
Location: Berkshire, England

Re: Ultrasonic

Wed Feb 22, 2017 10:49 am

Wouldn't all 3 sensors need to be in different locations, or at least pointing in other directions?
But for proving purposes, you may just need to wire the 3 sensors directly onto the GPIO port if you can't physically fit them all on the breadboard.
Texy
Various male/female 40- and 26-way GPIO header for sale here ( IDEAL FOR YOUR PiZero ):
https://www.raspberrypi.org/forums/viewtopic.php?f=93&t=147682#p971555

Aliena
Posts: 8
Joined: Wed Feb 22, 2017 8:44 am

Re: Ultrasonic

Wed Feb 22, 2017 10:54 am

yes in different directions for calculate volume into a deposit with the same breadboard

User avatar
B.Goode
Posts: 10356
Joined: Mon Sep 01, 2014 4:03 pm
Location: UK

Re: Ultrasonic

Wed Feb 22, 2017 1:15 pm

Aliena wrote::) my difficult is that when I copy the circuit in a specular way I can put only 2 sensor on a breadboard...I don't know how put the 3th sensor there

Unless my thinking is at fault, it seems that each sensor would need connections to 5 numbered columns on the breadboard. (One for each pin on the sensor board, and one more for the voltage divider.) And unless you are using a breadboard with built-in power rails, another 2 columns for shared power and ground connections. And you can use both halves of the board, either side of the gap down the centre.

So at a minimum a breadboard providing 10x6x2 points would be enough.

The board shown in your link with 30x6x2 points plus power rails should have plenty of room for your circuits.

Aliena
Posts: 8
Joined: Wed Feb 22, 2017 8:44 am

Re: Ultrasonic

Wed Feb 22, 2017 2:31 pm

so how can I build the circuit?

User avatar
B.Goode
Posts: 10356
Joined: Mon Sep 01, 2014 4:03 pm
Location: UK

Re: Ultrasonic

Wed Feb 22, 2017 3:44 pm

I will not be contributing any further advice on this topic.

Return to “General discussion”