Shop OBEX P1 Docs P2 Docs Learn Events
What should be the minimum delay between two measurements for the PING sensor? — Parallax Forums

What should be the minimum delay between two measurements for the PING sensor?

u.asifu.asif Posts: 21
edited 2012-09-26 21:31 in Robotics
Hi,

I am reading a PING sensor over a serial port in a continuous loop. What should be the minimum delay between two measurements for the PING sensor? Even if I do not put any delay in my code, the sensor measurement is accurate and updates very quickly however, the sensor light blinking rate gets tremendously fast and appears like always ON. Is this the correct way to read the sensor or should I put some delay (like 50 or 100ms) between two successive serial out commands?

Please advise.
Thanks.

Comments

  • Mike GreenMike Green Posts: 23,101
    edited 2012-09-26 07:07
    It depends on what you're measuring. The PING generates a pulse of ultrasound, then starts an output pulse. This pulse ends when the first echo is received. The maximum pulse width is roughly 20ms (look at the documentation for details). Depending on the environment, there may be echos and these can cause false triggering on subsequent pulses ... the PING sends out a new pulse and a strong echo from the previous pulse returns before the echo from the new one comes back. You have to allow time for these echos to die down. A few times the maximum pulse width should be enough in most circumstances.
  • ratronicratronic Posts: 1,451
    edited 2012-09-26 08:43
    I have used a 10ms delay between Ping measurements but if you want to be safe from echo returns it takes ~17 to 18ms for the sound pulse to travel the Ping's rated distance of 3.3 meters and reflect/return to the Ping.

    Edit changed Pings rated distance amount
  • u.asifu.asif Posts: 21
    edited 2012-09-26 21:19
    ratronic wrote: »
    I have used a 10ms delay between Ping measurements but if you want to be safe from echo returns it takes ~17 to 18ms for the sound pulse to travel the Ping's rated distance of 3.3 meters and reflect/return to the Ping.

    Edit changed Pings rated distance amount

    Thanks for the advice. Actually, the measurements are accurate and fairly the same whether I use a 20ms delay or don't. The thing which bothers me is the blinking rate of PING light which seems almost ON when no delay is used. Though the measurements are fairly good but I am just worried if this fast polling (without any delay) might not adversely affect its hardware or microcontroller. I am new to programming and sensors and therefore request expert opinion on this.

    Thanks.
  • Mike GreenMike Green Posts: 23,101
    edited 2012-09-26 21:31
    Page 2 of the PING documentation tells you all you need to know. The holdoff time (from the trigger until the echo timing pulse) is 750us. The minimum distance pulse is 115us. The minimum time to the next measurement is 200us. That's a total of about 1.1ms minimum time from measurement to measurement. There's nothing in the documentation that sets any other minimum times, so you should be good at that rate (roughly 900 per second). Whether that measurement rate is useful or not is another thing.
Sign In or Register to comment.