Shop OBEX P1 Docs P2 Docs Learn Events
resolution of PING))) module? — Parallax Forums

resolution of PING))) module?

timbaktimbak Posts: 3
edited 2011-12-27 09:08 in Accessories
Hello! Sorry for this question, but i haven't found an answer in datasheet. What resolution of PING))) module and what width of pulse for 1 cm?

Thank you!

Comments

  • Mike GreenMike Green Posts: 23,101
    edited 2011-10-30 07:45
    You won't find the resolution information in the datasheet because the PING is effectively an analog device and the resolution depends on what you connect it to. The PING))) produces a pulse of ultrasonic sound which reflects off objects within the "view" of the sensor as shown on page 4 of the documentation. The PING))) produces an output pulse starting approximately 750us after the end of its trigger pulse, then turns off its output pulse when the first echo is received. Your microcontroller has to measure the width of this pulse. The Basic Stamp can measure this width with a resolution of 2us. Some other Stamp models can measure it to a resolution of 0.8us.

    You have to convert the time measurement to a distance measurement by using the speed of sound in the medium (air) which is highly dependent on temperature as shown in the formula on page 3 of the documentation. All of the demo programs use a "room temperature" estimate. For best accuracy, you need to know the temperature over the path of the ultrasonic signal. Chapter 2 of the Smart Sensors and Applications tutorial goes into detail on this. Download it and have a look at Chapter 2 as mentioned in the PING)))'s documentation.
  • timbaktimbak Posts: 3
    edited 2011-10-30 09:02
    Thank you for response!) I mean, in other datasheets for the same devices i saw something like this:

    Detecting range: 4cm-5m
    Resolution: 1cm
    PWM - PWM Output 0-25000US. Every 50US represent 1cm
  • Mike GreenMike Green Posts: 23,101
    edited 2011-10-30 12:51
    I don't know what device you're referring to, but those numbers would be different for the PING))). For a start, the range of the PING))) is different and the maximum pulse width is 18.5ms. In addition, as I described, 50us per 1cm probably requires a specific temperature for the air between the sensor and the object. The PING))) is not the same as competing ultrasonic sensors and the specs are different.
  • ercoerco Posts: 20,256
    edited 2011-11-01 15:12
    That PDF says it has temperature correction, pretty cool (pun intended). It has lots of other onboard features listed there, too. How much do they sell for? Some other fun ultrasonic goodies to consider:

    http://www.gadgetgangster.com/find-a-project/56?projectnum=138 Prop Sonar
    http://www.gadgetgangster.com/find-a-project/56?projectnum=361 Ping reflector
    http://www.ebay.com/itm/270810920267 $4.50 BIN Ebay SRF-04 sensor
  • Jack HidleyJack Hidley Posts: 4
    edited 2011-12-22 11:34
    Mr Green,

    You mentioned above that some of the Stamp micros have a time resolution of 0.4us of the input pins.

    On page 343 of the current Basic Stamp Reference, the BS2sx, BS2p and BS2px are all listed as having 0.8us resolution with the Pulsein command. Is there another Stamp micro that has 0.4us resolution?

    Jack Hidley
  • Mike GreenMike Green Posts: 23,101
    edited 2011-12-23 23:04
    Thanks for mentioning. That was a mistake on my part. PULSIN indeed has a best resolution for some Stamp models of 0.8us. You would have to use a Propeller, like a SpinStamp to get better resolution. I've corrected the earlier post.
  • Duane DegnDuane Degn Posts: 10,588
    edited 2011-12-24 11:38
    Jack and others,

    While I'm a huge fan of Propeller chips and I don't use any of the Basic Stamps any more, I don't think trying to gain resolution from a Ping in a good reason to switch to a Prop (there are lots of other good reasons though).

    At 25C sound travels 0.27716mm in 0.8us. I don't think you're timing ability will be the limiting factor with the Ping's accuracy. I think other factors (mainly temperature) will play a larger role in causing a lack of resolution in the Ping's ability to measure distance.

    I recently played with my Ping and found it to be dead on accurate (down to the mm). I found it harder to accurately measure distances with my tape measure than with my Ping. I used nice flat hard surfaces as targets for the Ping in these tests.
  • Jack HidleyJack Hidley Posts: 4
    edited 2011-12-24 12:06
    Duane,

    I'm planning on incorporating a thermistor into the hardware so the micro will compensate for the air temperature when calculating the distance.

    The acoustic environment that the distance measurements are taken in is 100% controlled. I need to get as much distance resolution as possible. 0.002" is the minimum acceptable, so it looks like I need to use a Propeller.
  • PublisonPublison Posts: 12,366
    edited 2011-12-24 16:35
    Duane,

    I'm planning on incorporating a thermistor into the hardware so the micro will compensate for the air temperature when calculating the distance.

    The acoustic environment that the distance measurements are taken in is 100% controlled. I need to get as much distance resolution as possible. 0.002" is the minimum acceptable, so it looks like I need to use a Propeller.

    Jack,

    I'm not sure 0.002" is going to be achievable with a PING sensor. That sounds more like a job for a Laser Inerferometer.

    You might want to contact (PM) Ed_T here on the forums, as he has a Propeller based Acoustic Distance Sensor.

    User Manual

    A
    s it is more robust that the PING, Ed might be able to tell you the accuracy of his product.
  • Ed TEd T Posts: 50
    edited 2011-12-27 09:08
    I agree with Publison that this accuracy is going to be achieved by something like a laser interferometer not an acoustic sensor.
    Just a couple of checks:
    If you are trying to measure to .002" at 1 foot that is 0.017% error. My calcs show that the speed of sound changes about 0.17%/degC at room temp. So you would need to measure your temp to 1/10 deg C and have that temp over the path of the sound. I certainly don't achieve that on my lab bench. Also at the 40kHz frequency of the PING or PADS sensor the wavelength of the sound is about 0.33". So your .002" requires measuring the distance to 1/165th of the sound wavelength or about 2deg of phase. The PING and the PADS both use the magnitude of the signal to determine the distance. The PING timing is determined by when the trigger level is first exceeded. So changes in the transmitted signal or its reflection will affect where on the slope of the sound pulse magnitude the trigger is exceeded and thus the distance measurement. The P.A.D.S does a little better than this by sensing the rising edge of an echo pulse exceeding a trigger level and then finding the time of the peak magnitude of that echo. But this is certainly not accurate to 1/165 of a wavelength. The P.A.D.S is measuring phase sensitive quadrature signals as part of its calcs and they are available to the user. However from what I have seen these jump around quite a bit in standard measurements meaning that the phase is changing hundreds of degrees. I have wanted to take a closer look at the phase signals, if I get a chance I will.
    --Ed
Sign In or Register to comment.