LIS302dl is a 3 axis I2C accelerometer. There is a convenient breakout board from sparkfun which has since been retired. Looking to buy or find the datasheet. Look here.
You can still get the device in many places so dont dispair.
The features are as follows:
- 2.16-3.6V @ 0.3mA
- I2C Interface
- +/-2g / +/-8g selectable
- 8-bit resolution
- Click and double click recognition
- Programmable interrupt generator
- Free fall detection
Wiring it up to the arduino is really easy. You can see that the labelling on the breakout board is somewhat confusing.
The SDA output from the LIS302dl is labelled MOSI on the brteakout board. Also the SD0 output is labelled MISO.
These PINS are intended as labelled on the chip. So SDA connects to the arduino SDA and the SD0 is for selecting the I2C adress.
The chip has an adress of 0x28 when SD0 is pulled to GND and 0x29 when connected to 3V.
The CS pin selects between I2C 3V and SPI GND. This means we need to connect to 3V.
Thats it basically.
The software comes from Marcus Nowoty and can be found of his site listed below.
The output is from his example showing some slow movement of the accelerometer.
The software talks about powering the device from arduino PIN13 and having the interrupt connected to PIN2.
I did not connect the interrupt and hardwired the board to power leaving the software the same.
You can more or less see the connections in the picture below.
GND to arduino GND
MOSI to arduino SDA