Program reviewed: Sonar
There are several programs for Android to help you measure distance.
They generally work either based either on GPS, or on some simple trigonometry made workable with the help of the gravity sensors (accelerometers) that your phone typically has.
But you phone has another card that you might not have expected: it has a microphone and a speaker. What do those have to do with distance, you say?
Well, it’s quite simple: a microphone and a speaker are the basic components of a sonar.
Some types of sonar work by producing ultrasonic waves, that is sound that is too high-pitched for humans to hear (and for your speaker to produce, mostly), but it’s perfectly possible to use sound waves in a range that a human can hear and a speaker can produce, too. They will just “bounce” differently on different materials.
And that’s what Sonar does. It produces a row of “click” sounds and see how long they take to be echoed back into the microphone. It makes a graph with time (or, interchangeably, distance) on the x-axis and amplitude on the y-axis, and if you look at the peaks, you’ll know how distant the phone is from surfaces that let the sound “bounce” back.
The program is even as handy as to look where the main peaks are by itself, and print the distance in meters that they represent.
So you ask, how well does the program actually work? Well, that will depend a lot on your phone. Ideally, the microphone and the speaker should be very close together, or at least pointing in the same direction. That’s not the case on my Milestone: the speaker is on the back, while the microphone is on the front.
For me, the behavior is erratic, with sometimes the wall I’m directly pointing towards appearing to be totally missed by the program; but when it does work, it is remarkably accurate for short distances, especially shorter than about 1.5 meters, getting it right to the centimeter.
Keep in mind that the program really should be used with walls or other hard and broad surfaces; it won’t measure the distance to just anything. Also, obviously enough, there must be silence around you when the program is used.
All in all, I’m sure I wouldn’t use this program to actually measure distances reliably, but it has a definite “wow” factor that will probably make me keep it installed, and it’s quite amazing that Android allows real-time audio to be employed with such precision as to allow something like this program to exist.