NewPing Library: HC-SR04, SRF05, SRF06, DYP-ME007, Parallax PING))) - v1.7

sbright33:
Interesting discussion Tim. I disagree about timestamps. Here's how to synchronize 2 Uno's to 2us.
As you can see they stay in sync even without GPS once initialized.
http://arduino.cc/forum/index.php/topic,120288.0.html

Synchronizing two are not the issue, it's knowing when the ping was sent so you know how long it took to get there. How do you know WHICH ping you're getting? Without knowing when the ping was sent, how can you possibly know how long it took to get there?

Let's say that you've synced two ATmega's to within 15 microseconds (that accuracy would be plenty). One starts sending out pings every 2 millisecond which the other would receive. Even though they're synced, how does the receiving unit know when that ping was sent to be able to calculate the time and therefore the distance? Without the start time reference, I can't see how you would measure distance. For the sake of argument, the receiving unit gets the ping, what values are you using to calculate for distance? You have receive ping time, so what's the start time? You need both start and end time to calculate the time it took to send the ping. You know the pings are 2ms apart, but where do you get the start time?

You could measure acceleration/deceleration by measuring the time between the pings. But, that wouldn't need the two units to be time synced anyway, and would do nothing to measure distance. Only "hotter" or "colder" would be known.

Tim