Page 1 of 1

Ultrasonic

Posted: Wed Feb 22, 2017 8:57 am
by Aliena
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!

Re: Ultrasonic

Posted: Wed Feb 22, 2017 9:05 am
by joan
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.

Re: Ultrasonic

Posted: Wed Feb 22, 2017 9:11 am
by B.Goode
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...

Re: Ultrasonic

Posted: Wed Feb 22, 2017 9:20 am
by texy
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

Re: Ultrasonic

Posted: Wed Feb 22, 2017 9:48 am
by Aliena
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

Re: Ultrasonic

Posted: Wed Feb 22, 2017 10:03 am
by B.Goode
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

Re: Ultrasonic

Posted: Wed Feb 22, 2017 10:06 am
by B.Goode
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.

Re: Ultrasonic

Posted: Wed Feb 22, 2017 10:20 am
by Aliena
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

Re: Ultrasonic

Posted: Wed Feb 22, 2017 10:30 am
by B.Goode
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.)

Re: Ultrasonic

Posted: Wed Feb 22, 2017 10:39 am
by Aliena
:) 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

Re: Ultrasonic

Posted: Wed Feb 22, 2017 10:49 am
by texy
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

Re: Ultrasonic

Posted: Wed Feb 22, 2017 10:54 am
by Aliena
yes in different directions for calculate volume into a deposit with the same breadboard

Re: Ultrasonic

Posted: Wed Feb 22, 2017 1:15 pm
by B.Goode
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.

Re: Ultrasonic

Posted: Wed Feb 22, 2017 2:31 pm
by Aliena
so how can I build the circuit?

Re: Ultrasonic

Posted: Wed Feb 22, 2017 3:44 pm
by B.Goode
I will not be contributing any further advice on this topic.