Ping))) general questions
Justin_H
Posts: 4
I have a few questions about the PING))) sonar and am wondering if someone could take a few seconds to answer them. I purchased several of these components (28015 rev a) for a college project and am having trouble getting meaningful results from them. First question, in the PDF documentation the echo hold off is listed as 750 us but on your site it is listed as 350, which is correct?
Second question, I am trying to use the sonars with innovation first’s mini controller and am writing the code in c. the code sends a positive TTL pulse 3us one time. The LED on the sonar turns on and stays on forever, is this correct?
Third question, I am judging distance by having the controller run a timer from the time the signal pin goes high until it drops again (after the signal pulse), is that the correct idea?
Finally I also have the controller writing a line to my computer screen every time the sonar toggles its input which seems to happen several times a second until I turn the robot off, once you signal the sonar one time does it start continually pinging? Is that why the LED stays on all the time? I’d really appreciate any help or direction you can give me. I have read all the docs I could find and the answer to these questions was not immediately obvious to me.
Thank you very much for your time.
Justin_H
Second question, I am trying to use the sonars with innovation first’s mini controller and am writing the code in c. the code sends a positive TTL pulse 3us one time. The LED on the sonar turns on and stays on forever, is this correct?
Third question, I am judging distance by having the controller run a timer from the time the signal pin goes high until it drops again (after the signal pulse), is that the correct idea?
Finally I also have the controller writing a line to my computer screen every time the sonar toggles its input which seems to happen several times a second until I turn the robot off, once you signal the sonar one time does it start continually pinging? Is that why the LED stays on all the time? I’d really appreciate any help or direction you can give me. I have read all the docs I could find and the answer to these questions was not immediately obvious to me.
Thank you very much for your time.
Justin_H
Comments
The LED should "blip" with each trigger/return -- if it looks like it's on all the time then you have a target that is very close.· Have you connected a scope to see what·you're getting?
The return will be a high-going pulse that corresponds to the distance to the target.· Measure this pulse and do the calculation from there.· The BASIC Stamp program can be used as a guide; just keep in mind that the BS2 PULSIN instruction returns the pulse width in 2 uS units.
The Ping))) only pings when you tell it to.· If you're using the trigger pin to do other things you could be triggering the Ping when you don't mean to.
As always, we suggest that you post your current code (even in C) so that others can have a look at what you're doing and uncover anything you might have missed.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Jon Williams
Applications Engineer, Parallax
the pin is only used for the sonar, and as I mentioned before after the sonar has been signalled it continually seems to oscialate its value from high to low and back. Any help is appreciated, just ask if you need more info. I can post all the code as a download if necessary.
Trigger:
· -- make I/O line output high
· -- wait 5 uS (I use 5 to make sure line quality to sensor has no effect -- and sensor is triggered on falling edge)
· -- make I/O pin low
· -- wait 100 uS (this is the approximate instruction load time for the BASIC Stamp)
Echo:
· -- make I/O line an input
· -- wait for I/O line to go high
· -- start timer
· -- wait for I/O line to go low
· -- stop timer
The value in the timer·can be used to calculate the distance to the target.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Jon Williams
Applications Engineer, Parallax
Another quick question "wait 100 uS (this is the approximate instruction load time for the BASIC Stamp)" can you explain what this means so i can find the equivelent time on my controller. I am unser what happens during the "instruction load time" and I am not very familiar with the basic stamp. my controller runs at 10mhz if that influences the load time.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Jon Williams
Applications Engineer, Parallax
~Justin_H
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Happy new year
They do when you ship them in the same box.
Hope that clarifies things.
Cheers,
Peter (pjv)
Please stop hijacking threads -- when you have question that veers off the original topic (in this case it was Ping interfacing, not any accessories that may or may not come with it), start a new thread.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Jon Williams
Applications Engineer, Parallax
I'm just going to get a 5 pack and spread them along the walk, and maybe 1 in the porch area.
OK now the questions.
1. I'd like to use a single BS2 to control all of them, but that means the signals might run up to 20 feet. Is the signal from the BS2 and then back from the PING going to be strong enough to get a good measurment? Or should I use some kind of buffer? If so, suggestions? (I MIGHT have enough BS1s to control each sensor if this can't be done)
2. I was told by tech support to keep the temp above 32 degrees, so will a small insulated case with heating in the cold weather work? I thought I'd just put a temp sensor at the BS2, and turn the heat on for all if needed. (12volts thru a resistor, maybe)
Thanks in advance.
Welcome, and please see my post to Batman above -- please start a new thread if your questions and not directly related to the original thread topic.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Jon Williams
Applications Engineer, Parallax