Sonar Ruler !
This app has been kicking around the labs for about 6 months and it finally came out. Basically it uses the iPhone’s speaker to send out a short click sound and it then measures how long it takes for that sound to bounce off of something in the environment. It can be quite accurate to within an inch or so when used in the right situations. I’ll say right upfront it’s not perfect, and cannot measure something small like a person. It works best on a large flat surface that is perpendicular to the iphone (like a large wall.) Things like temperature and even wind can affect the values, so I don’t recommend using the measurements it spits out for anything other than your entertainment. (itunes link: here)
The principles used in the app are actually pretty simple, it just took a lot of experimenting to figure out the right approach. I initially tried using FFT analysis to pick out the echo from the microphone signal, but it produced results that were pretty similar to just plain old maximum value detection. Throwing in some averaging and filters made it fairly tolerant to noise also. I may revisit the FFT technique as it is probably the more robust way to go, I just don’t have time to mess with it right now (it’s still in the source, it’s just not enabled.)
There is a short how-to video within the app, or you can check out another video here:
Sonar Ruler Demo from cc laan on Vimeo.
For German or Japanese subtitles, try the YouTube version.
I think a lot of things could be improved in the app like better echo detection or user interface. I’d like to post the code up here, but it’s kind of mangled right now so I may wait until I can clean it up a bit. Email me cc at laan dot com if you’re interested in checking out the source or making your own version. Also, follow us on twitter @laanlabs
How to hold the phone:

hold your free hand at a 45 degree angle next to the speaker/mic
Some more random shots:

Fun with photoshop..

Old school logo..


40 Comments