Q: Can a Ping sensor be used as Doppler device (=> speed acceleration?)

A ping sensor works by sending one pulse and wait for the echo. With a ping sensor I can make two distance measurements after each other with a defined time interval to calculate the average speed of an object (in one direction).

Q: Is it possible to send multiple pulses with the PING sensor, e.g. 20 uSec apart and check the arrival of this pulse train? (measure Doppler effect)
// speed of sound is 29.5 uSec/cm ~~ a few pulses of 5uSec High 15 uSec LOW should be possible if the distance > 5 cm
Did anybody try this?

If this work one could determine speed much faster.

The line of thoughts I 'm thinking of are..

// loosely based upon - http://arduino.cc/en/Tutorial/Ping - 
  ...
  // 3 pulses
  pinMode(pingPin, OUTPUT);
  digitalWrite(pingPin, LOW);
  delayMicroseconds(2);
  for (i=0; i< 3; i++)
  {
    digitalWrite(pingPin, HIGH);
    delayMicroseconds(5);
    digitalWrite(pingPin, LOW);
    delayMicroseconds(10);
  }

  pinMode(pingPin, INPUT);
  duration[0] = pulseIn(pingPin, HIGH)  + 45;  // formula needs time adjustments as reading starts not directly after pulse
  // need to reset line here? 
  // how?
  // pinMode(pingPin, OUTPUT);
  // digitalWrite(pingPin, LOW);
  // pinMode(pingPin, INPUT);

  duration[1] = pulseIn(pingPin, HIGH) + 30;

  // idem
  duration[2] = pulseIn(pingPin, HIGH) + 15;


  int v1 = (duration[1] - duration[0]) /29 / (duration[0] + duration[1]);  
  int v2 = (duration[2] - duration[1]) /29 / (duration[1] + duration[2]);

  if (v1 == 0) => static object

  int a = v2 - v1;

  if (a < 0) => deceleration
  if (a > 0) => acceleration
  if (a == 0) => constant speed
 ...

No sensor nearby so cannot test this idea...

Is it possible to send multiple pulses with the PING sensor, e.g. 20 uSec apart

One cycle of a 40kHz signal is 25us, so I guess the answer is "no".

The cheap devices like Ping don't maintain any frequency from the received signal, just trigger the echo signal as soon as sufficient signal strength is achieved.

your math makes sense, so at least I have to adjust my numbers (and expectations :wink:

The cheap devices like Ping don't maintain any frequency from the received signal, ...

That's why I wanted to send 3 pulses short after each other and then clock the arrival times.
Thinking about it, even if it would work, what kind of movements/speed could I detect?

Think I have to elaborate the math in more detail ...

Thanks,

You're going to run into the standard problem of simple sonars; you can't tell if a given return is from a particular pulse, or a more distant return from an earlier pulse.

Edit: in fact, some sonars limit the maximum transmit pulse repetition rate to prevent this,

yeah, familiar with that problem. If I send 3 pulses and the first returns before the last pulse is sent I already have this problem. That reduces the minimal working distance a lot.

Some other math is more killing:
Suppose it would work and I could sent 3 pulses within 100usec, and I found a displacement of 1 cm (minimum) in 30us.
That would imply a speed of 30.000 cm /sec == 300 m/sec or almost speed of sound O(1000KM/h)
That is much faster than I had in mind by a factor 100 - 1000 (gestures).

The opportunistic idea is overruled by reality :wink:

Surely a better way would be to send a fairly long 40kHz burst and measure the frequency of the received signal? You'd need hack the ping sensor to get at the raw received signal, or else build a system from one or two 40kHz transducers instead of a ping sensor.

This is probably a really dumb question, but... why don't you send a ping, wait for the echo, send another ping, wait for the echo, and based on the different echo return times calculate speed? Does it just take too long?

Does it just take too long?

If you could guarantee that the first return is the only return, probably not.
But normally you can't. See reply #3

AWOL:

Does it just take too long?

If you could guarantee that the first return is the only return, probably not.
But normally you can't. See reply #3

You mean one ping could result in multiple returns from multiple surfaces (echoes off walls)? I guess you'd need to sample all the returns for a set length of time time and select only the strongest, discarding the others. Then send your second pulse and do the same thing.

I guess this would lead to a pretty long time between pings, would that be too long to sense speed with any accuracy?

I guess you'd need to sample all the returns for a set length of time time and select only the strongest, discarding the others

That's a good approach, but most cheap devices like the Ping generally give up on receiving after the first return.
Generally, they have no means whatsoever of measuring return strength.

I think there's an I2C device from Devantech (or used to be) that gives the ranges of multiple returns.

AWOL:
most cheap devices like the Ping generally give up on receiving after the first return.

Gotcha. I'm assuming these things have a maximum range though -- at some point the return becomes to faint to detect. So, whatever distance that is, and whatever ping "round trip flight time" that results in, that's your interval to safely calculate speed based on two ping + return cycles.

I'm assuming these things have a maximum range though

Ironically, yes, the less sensitive (and hence the lower maximum range), the higher the potential pulse repetition rate is.

But "maximum range" is generally what sells these devices.

tylernt:
This is probably a really dumb question, but... why don't you send a ping, wait for the echo, send another ping, wait for the echo, and based on the different echo return times calculate speed? Does it just take too long?

The initial idea was that while waiting for the pulse of the ping))) to return, I could sent additional pulses to make multiple measurements in almost the same time. Make it more efficient but even if possible I didn't have the math right.