While GPS works for long distance changes, I would like to measure a shorter distance by using the iPhone's accelerometer.
Say I want to measure a height of a box using an iPhone application. You'd start the application, press a button to start measurement at the bottom of a box, move your iPhone from to the top of the box, then press a button to stop measurement. The application would then calculate and display the height of the box.
How would I use the accelerometer to perform this kind of measurement?
It is possible to do this, as I have implemented a more complex system on a sparkfun IMU.
There are a few components to do what you require accurately.
1) You need to filter the accellerometers signal using a low pass filter. This removes any noise that is not caused by your slow moving arm.
2) Integrate the 3 seperate acceleration values twice to go from acceleration to velocity, and then from velocity to distance.
3) The above method must be performed by keeing the phone in the same plane when you move it from the bottom of the box to the top. Any pitch/roll/yaw will disrupt the measurement(hint)
4) From above, to compensate for the pitch/roll/yaw, you can then include the built in gyro =]. Use this to map the vector obtained from the accellerometer to the starting point. Using this methodology you can measure the distance "through and object" by walking around it. (remember this gyro needs filtering too).
The final result depends on many factors such as, the effectiveness of your filter, the accuracy and sampling rates of your accellerometer and gyro, and the awsomeness of your mathematics and linnear algebra skills.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With