AccelDig Accelerometer Info and Examples
Written by Pascal Stang | Updated:
Sunday February 20, 2011
Board Overview:

- LIS3LV02DQ sensor datasheet [PDF]
Sensor Operation:
- NOTE: These steps are meant as a quick quide to getting the sensor running
with any controller device.
If you are using an AVR processor, see the examples below
and the LIS3L02 code library provided with AVRlib
- Initialization
- Check for device ID
WHO_AM_I: Read this register to verify device is present on the bus. Should
read as 0x3A.
- Enable the device
CTRL_REG1: set bits PD0, Xen, Yen, Zen
- Set the sampling decimation rate
CTRL_REG1: set DF1, DF0 as appropriate for 40, 160, 640, or 2560 Hz sampling
- Set desired accelerometer scale
CTRL_REG2: clear/set FS bit for +/-2g or +/-6g range respectively
- Set data output options
CTRL_REG2: set BDU and DAS as needed for the application
- Basic Operation
- Read acceleration output registers any time
OUTX_L/H, OUTY_L/H, and OUTZ_L/H
- Nyquist-accurate Operation
- Monitor data-ready bits to see if new sample is ready
STATUS_REG: read and wait for ZYXDA to become '1'
- Read acceleration output registers
OUTX_L/H, OUTY_L/H, and OUTZ_L/H
- Goto step 1
Code Examples: **
- Digital Level Example - Basic
digital level application using the XL-Dig board (prints raw acceleration
values and X,Y angular tilt)
** Note: Examples require a current version of AVRlib available [here].
Written by Pascal Stang | Updated:
Sunday February 20, 2011