Accelerometer data


The Accelerometer Data application gives you direct access to the iPhone accelerometer data. The data can be streamed to your computer using UDP, or the accelerometer data can be captured, and transferred off the iPhone as a CSV (comma-separated) data file.

Use the app for:

  1.     Science fair projects

  2.     Physics labs

  3.     Home experiments

  4.     Collection of shock / acceleration data while moving sensitive instrumentation

Difference between Accelerometer Data and the Pro version:

  1. 1.The base Accelerometer Data application collects the data in memory which creates a limit for the number of samples that can be collected.   The collected data is not available when the application is restarted.

  2. 2.The Pro version stores the collected data on the Flash file system on the device, allowing a very large amount of data to be collected, up to the free space limit of the device. This data file is available via a web browser when the application is restarted.

  3. 3.The Pro version has a library capability to collect and manage multiple trace captures, from both the iPhone/iTouch as well as a computer web browser.

iPhone Accelerometer Introduction

The iPhone contains three accelerometers, one along each of the primary axes of the device. You can use these accelerometers to measure the device’s current orientation relative to gravity, as well as the movements of the device.

The x-axis measures along the short side of the iPhone, the y-axis measures along the long side of the iPhone, and the z-axis is a line perpendicular to the iPhone (through the middle). Values are represented in terms of “g”, where 1 g represents the force of gravity.

Use Cases

There are three primary uses for this application:

  1. 1. [Capture Mode] You wish to use the 3D accelerometers in the iPhone for data collection. This is finding use in acceleration-oriented experiments in science classes, for science fair projects, collecting shock/acceleration data while moving sensitive instrumentation, and other uses related to acceleration data collection. In Capture mode, you can define the rate of sampling, and number of samples to collect. The application creates an internal web server, allowing you to attach to the iPhone with a web browser, and download the collected sample data as a CSV file.

  1. 2.[Streaming Mode] You wish to use the 3D accelerometers for data collection, but you wish to collect the data continuously and in real-time. The Streaming Mode will continually send the acceleration data to your application via a UDP port.

  1. 3.[Streaming Mode] You are an iPhone developer and are using the simulator. A limitation of the iPhone simulator is that it doesn’t support the simulation of the accelerometers. With a simple modification of your application, this application can allow you to stream the acceleration data from your iPhone device to the iPhone simulator for use in testing your app.

Acceleration Data Filtering

The iPhone/iTouch accelerometer data include the effect of gravity. As an example, if your iPhone is laying flat on the table and not moving, you will get X and Y acceleration values close to 0, and a Z acceleration value close to -1 (i.e. 1g - the force of gravity).

Filtering modes are provided to allow you to more easily isolate the data of interest.

There are 3 data filtering modes supported:

  1. None - No data filtering is provided - the application provides the raw data from the accelerometers.

  2. Low Pass Filter - Used to focus on the gravity and orientation aspect of the device, reducing the effect of instantaneous and momentary accelerations. A simple low pass filter (filter constant= 0.1) is used to reduce the effect of momentary accelerations and provide your application smoothed values.

  3. High Pass Filter - Used to filter out the influence of gravity, and focus on the instantaneous acceleration effects. This simple high-pass filter implementation subtracts the low-pass filter value from the instantaneous acceleration - giving you more easily the instant movements of the device.

Example Experimental Projects:

Following are some example experimental uses that are appropriate for a science fair project or a physics lab project.

Note: Obviously be careful in using your iPhone/iTouch as an acceleration data collection device for experiments. Do not subject it to impact or unusual / significant forces.

  1. 1. Use the iPhone/iTouch as the bob of a pendulum, collecting the acceleration data from the pendulum.

  2. 2. Use the iPhone/iTouch on a “sled” down a ramp, collecting the acceleration data from the pendulum.

  3. 3. Measure motions of elevators.

  4. 4. Measure motions of roller coasters.

  5. 5. Measure motions during sky diving.

  6. 6. Compute angular orientation of device (hint: low pass filter the data, then take arc-tangent of x and y)

Usage Instructions