I am trying to measure distance between two objects that move around in an area that is around 30 feet in diameter. I am thinking of using the speed of sound right now, but because speed moves so fast (roughly 1,100 feet per second), it is going to be hard for me to get an accurate reading I think since Arduino only goes down to milliseconds and each millisecond is roughly one foot of distance.
Does anyone know another type of "wave" that goes slower than sound but still goes really fast, for example, maybe 200-300 feet per second? Or even better yet, does anyone know of a Arduino shield or some other tool that I could put on the two objects to get pretty good distance measurements?
Use micros() for this kind of measurement. No, there is not another medium that travels freely through the air at a constant speed that is slower than sound.
The OP is concerned with the low resolution of millisecond timing to determine distance with sound. The obvious solution is to use microseconds, which increases the resolution considerably. This is normally how ping sensors are used.
I agree with everyone above - an ultrasonic sensor is really the way to go. Unfortunately, though, a HC-SR04 ping sensor isn't suitable for a range of 30 feet / almost 10 metres, they're only good for up to about 4 metres.
Some of the MaxBotix "MaxSonar" ultrasonic sensors have a range of up to 10 metres, but they aren't cheap.
There are a couple toward the bottom of this page:- MaxBotix Ultrasonic Sensors
maxbotix has some crazy prices on some of their sensors. you can buy an ultrasonic tape measure for around $10. but , are you talking on knowing were your device is inside of an area of fighting robots ? or do you have one unit, with clear view all around ?
it might be possible to have an array of sendors that all output at the same time, and your unit receiving the signals and comparing arrival times to determine location.
Thank you all for the feedback, especially those who suggested "Micros". I didn't even think the Arduino could do calculations more detailed than the millisecond, this completely solves the problem. Thank you ChrisTenone and for those others contributing. Question resolved.
Increasing resolution will only increase the precision.
OP seemed concerned with accuracy...or is this another one of those general language vs technical term issues?
Re-read and it seems they do have a resolution issue. They may find a precision and accuracy issue later...but for now...microseconds() will nudge them along.
Try this. The usual ultrasonic sensors we can readily buy in the Arduino world are limited in range. In addition, they must be oriented at the object of interest, and I have discovered by experiment that they don't do well if there other objects in the near background. In my home sentry system, I use radar, which seems to be foolproof.
So, the real problem here is they are relying on an echo. You claim only two objects are involved. In that case, if one of them emits a beep (either audible or ultrasonic) detected by the other, the beep travels straight line between them, resolution about .888 ms/ft. and the reflection problem of the usual sensors goes away. But, how do I synchronize clocks in my platform? The receiving unit and the transmitting unit must have a common clock, so that the receiving unit knows (relative to the common clock), when the beep commenced. You could use decent RTC's provided you synchronize them in advance. Another possibility not requiring advance sync would be an internal timer to flash a bright UV LED on the top of of one unit. The light travels fast enough so that the at most 30 ns. pass in the delay. You need some omnidirectional light sensor on the receiving unit, which maybe could just be a 45 deg. conical mirror point down, centered above an appropriate UV detector (same on the emitter). The UV LED's are used everywhere in remote controls.
There is a slight error possible, limited to 30 ns. max. (light travels about 1 ft./ns.). Sound travels 1,126 ft./ sec., or 1 ft./ .888 ms. Worst case, say 1 ft. separation, would be 30/888,000 = .003%. , not much to worry about.
It isn't that hard to train an Arduino to detect a frequency within a narrow band, say 30 Hz. This technique would probably be extendable to several objects emitting different beep frequencies.