Proximity Sensor - sonar
javelin
Posts: 18
Hello all
I'm looking at starting my first project with sonar.
If I want to implement 2 or more sonar, what board and module should I use?
Thanks,
jav
I'm looking at starting my first project with sonar.
If I want to implement 2 or more sonar, what board and module should I use?
Thanks,
jav
Comments
You did not mention your budget. To Arlo is on sale with four (PING) sensors included:
https://www.parallax.com/product/28966
https://www.parallax.com/product/28231
to drive these:
https://www.parallax.com/product/28962
and add these:
https://www.parallax.com/product/28015
What kind of platform are you looking at?
I'm looking at starting very small and I'm not trying to build a robot. My first project will just be a simple sonar system using PING.
At first, I thought of starting with one PING to try out and learn the programming. I may need 2 or more PINGs later so instead of buying the basic boards and module to run one PING, I thought it's more economical to buy the board and module that can run multiple PINGs now.
I'm using Windows but do have Linux server to use if needed. Suggestion is welcome.
How about these? Will this board and module run 2 or more PINGs?
Board:
https://www.parallax.com/product/28850
Module:
https://www.parallax.com/product/bs2pe
PING: starting with one for now
https://www.parallax.com/product/28015
Please know this is my first ever project of this kind but I welcome the challenge...I have to start somewhere : )
Thanks,
jav
I have a generic buzzer I like to incorporate with my little project. It's a solid-state 4-8V DC / 25mA buzzer.
When I hook it up to the Propeller board, it buzzes but the sound is very weak. If I hook it up directly to the 3.3V or 5v, the
buzz is loud. So what am I doing wrong?
Here's my code:
freqout(12, 1000, 1500); // pin, duration, frequency
Again, there's a sound coming off pin 12 but it's very weak. I have to bring the piezo close to my ear to even
hear it.
Any advice or suggestion is appreciated.
Thanks,
jav
How do you have the buzzer connected on the Activity board?
Also, do you have the PWR switch on the Activity board set to 2?
Not knowing much else about the buzzer you are using, you might have to add a transistor to the circuit to power the buzzer properly.
The PWR switch is set on 1 and the result is the same if I set PWR switch on 2.
The 3.3 and 5v pins readings have the correct voltages so I think that tells me the voltage regs are working properly.
So, why am I not getting 3.3v on the i/o pins?
Any suggestion or comment is appreciated.
Thanks
jav
The reason your output pin registers 1.65 volts is that's it's being driven at a 50% duty cycle, and 1.65V is half of 3.3V.
-Phil
The high/low trick worked like a charm. Thanks to PhiPi for pointing that out.
As for the multi-PING, I think it can be done reliably or maybe efficiently using individual cogs to manage each device separately. Will need to read up more on that since these are all new to me.
Thank you!
jav
-Phil
To echo this with a helpful timing tip from Mike Green, "...you really only want one U/S pulse echoing around at a time. Maximum "time of flight" for the PING is around 20ms. I would allow 50-100ms for echoes to die down before triggering another (or the same) PING."
Thanks to Mike and Phil both!
My goal is to run at least two(2) PING. If I can drive three(3 max) PING on the same board, that would be even better. Since the prop board allows cogs to drive devices independently; eg PING, this makes it ideal to run multi-PING with little or no interference, that is if I understand it correctly. Reason why I think this will work is because each pulse will be processed or handled separately by each cog regardless how the PING are positioned. Will test this soon.
I'm a little confused how the I/O pin works. When the PWR is set to 1 or 2, it initializes the board and the pins. At that point, is there any voltage on those pins? It looks like there are low voltage running on them and they seem to behave like an electronic relay switch. Or, are the I/O pins only get powered when a function call is made?
Sorry for the many newbie questions.
Thanks again.
jav
The secret to running multiple Ping)))s with no interference is to cycle them one after the other in a single cog, leaving at least 100ms between triggers. The interference you will get otherwise is an echo from one Ping))) registering in another that's awaiting its own echo, yielding a false distance reading.
-Phil
Actually, it would be better and easier to keep multiple pings from interfering with each other if they all run in the same cog. If you are using "C" just put a "pause(100);" between the the code segments that take a ping reading.
If they run in separate cogs, I'm not sure how you would synchronize them so they don't interfere.
When the Propeller resets (or turns on) and starts to run a program, all of the pins are set to "input". The pin has to be set, by the program to be an "output". Then it will be a "low" output (0 volts). To get a voltage on the pin, it has to be set to "output" and "high", which will put 3.3v on the pin.
The Propeller C library has function that do that.
There are also functions that do "high" and "low" in separate steps of setting either input or output and
There are other functions for using the pins. They are listed in the simpletools library reference
https://cdn.rawgit.com/parallaxinc/propsideworkspace/master/Learn/Simple%20Libraries/Utility/libsimpletools/Documentation%20simpletools%20Library.html
If you are programming in Spin, I'd recommend this book:
https://parallax.com/sites/default/files/downloads/122-32305-PE-Kit-Labs-Fundamentals-Text-v1.2.pdf
Regardless of which computer language you are using, I recommend reading the first 12 pages of that pdf to get a better idea of how the propeller works.
Tom
For the Propeller, I'm using C so I'll be checking out the libraries often. I will start testing again soon after I get my hands on another PING. So far, I have one PING, two LED(yellow and red), and a buzzer on that one board.
If the second PING works, a third PING perhaps...it's going to be tight on that little board : )
Thanks,
jav
Ken Gracey
-Phi
No, it's little. Can't you see?
Ken Gracey
Hot dang! Now there's something to get excited about! :-D
Way to not let these guys (or these guys, etc) eat your lunch! Hmmm...maybe I can hawk my Kickstarter Scanse on Ebay and not need that RPi connection after all? I can hear the chanting from deep in the salt mines already, "We need more crunching POWER, bring on the P2!" haha
To any would-be competitors: ToF toenails!
I didn't think you'd notice that little chunk of squid dropped into the red triangle, but this is proof that you really don't miss anything of interest. We're happy to have you and all of your friends listed above on our team.
Ken Gracey
I'll leave it to Whit to post those infamous two words and exclamation point.
A small-footprint laser PING is even better. I already bought another two-ear PING for testing and it's on its way but it's OK. The program should also work with little or no modification with this new laser PING, right?
Thanks!
jav
100%.
KG
Is there an anti-grav module coming? PLEASE make it 3.3/5V compatible.
But wow! This is a game changer. Between this and the Servo360, one wonders what else Parallax has up their sleeves.
-Phil