Distance Measuring
From Openmoko
| Not implemented: This article or section documents one or more features that are not implemented and which may never be implemented. |
Using ultrasound
Using the loudspeaker and the microphone send out a ping and measure the time until it returns. See [1]
This might also be used for measuring the distance to the head: If the distance is very short then you are probably speaking and the display can be turned off.
Using accelerometer
| Special hardware: This article or section documents one or more features that require special hardware that is not available on all smartphones and may not be available on any smartphone. |
An accelerometer with gyros can in theory precisely compute short distances. Using this you can mark a start position and an end position and get the distance between the two. You can even mark several positions, have the positions roughly displayed on the screen with the distanced on each line segment.
The gyros are needed to see if the phone is changing orientation. With consumer level devices that can fit in a phone (though still cost around $30) this will not work for more than a couple of seconds movement. The uncertainty after a minute is many tens of meters.


