Accelerometer (LSM303) | LabJack
« Close

Datasheets and User Guides

App Notes

Software & Driver


Accelerometer (LSM303)

This script configures the accelerometer inside the LSM303, which behaves as a separate device from the magnetometer. The accelerometer can measure acceleration up to ±16g in each axis. The main purpose of this unit is for a tilt-compensated compass, although it can be used for a variety of functions, such as free fall detection or tap detection. The LSM303 on a breakout board is available here:

The data obtained from the accelerometer is published to USER_RAM registers, which can be accessed by any other programs connected to the T-Series device. This allows a program to be doing one task while the device simultaneously obtains the accelerometer data.

The datasheet is extremely useful for determining the setting on the device, such as low-power mode and range ( ±2g,  ±4g,  ±8g, or  ±16g)

The other functionalities of this device, like configurable interrupts, fall detection, and tap detection can be configured just as the range is configured, although these specialized functions are outside the scope of this example.

Below is the LSM303, as a part of the Adafruit 10DOF board.

The 10 DOF board requires very few components to run, a 3.3V supply is provided by the LJTick-LVDigitalIO.

The accelerometer can be tested by rotating it at angles to the earth, where +1.0g and -1.0g can be measured. Below is a graph of the accelerometer data (X is white, Y is red, Z is green) as the module is rotated.