The goal is to measure acceleration due to gravity using a pendulum. The variations in the accelerometer reading are used to automatically count the oscillations. After counting the total time for a preset number of oscillations, the time period is calculated. The acceleration due to gravity g is extracted from this.
Step 1: Physical Setup
Get a 30 cm or 1 foot plastic scale. Make a hole in it (with heat or by drilling) on one end such that it fits a nail or a hook in the wall.
Download the app called AccelerationG from the play store.
Stick the phone to the other end using a double sided tape.
Step 2: Experiment
Enter the number of oscillations you would like to count and the distance from the point of suspension to center of mass. Displace the system reasonably (30 deg) from equilibrium, press start and release. After the preset counts, the app calculates total time from which the time period and hence the acceleration due to gravity are calculated.
There is also an option to press measure to calculate the y acceleration from the accelerometer when stationary and vertical for comparison.