Tripple Axis Accelerometer - LIS302DL
From bildr
- Manufacturer: STMicroelectronics
- Voltage: 3.3V
- Communication: I2C/SPI
- Doc Sheet
Contents |
Hooking it up
Pin descriptions:
- 1.Vdd_IO
- 2.GND
- 3.Reserved (connect to Vdd)
- 4.GND
- 5.GND
- 6.Vdd
- 7.CSSPI enable (logic high = I2C mode,logic low = SPI enabled)
- 8.INT1
- 9.INT2
- 10.GND
- 11.Reserved (connect to Gnd)
- 12.SDOSPI serial Data Out,I2C least significant bit of the device address
- 13.SDAI2C Serial Data, SDISPI Serial Data Input,SDO3-wire interface Serial Data Output
- 14.SCLI2C Serial Clock, SPCSPI Serial Port Clock
Code
-
Basic register setup
- CTRL_REG1 (20H)
- For 100Hz, and +-8g, use 011000111b, or C7h.
- For 400Hz, and +-2g, use 10000111b, or 87h.
-
Basic data registers
- WHO_AM_I (0Fh) should always return 3Bh.
- OUT_X (29h) the most recent data from the X axis.
- OUT_Y (2Bh) the most recent data from the Y axis.
- OUT_Z (2Dh) the most recent data from the Z axis.
(note, the data registers are NOT sequential, care should be taken when accessing them. Also the data is stored as 2's complement.)
Other registers provide more information and controls of interrupts and data availability, however they are not necessary for basic functionality.
-
Obtaining g values
- Depending on the range selected, the accelerometer will have a different sensetivity, 18mg/LSB for +-2g and 72mg/LSB for +-8g. To obtain a g reading the value of the data registers needs to be multiplied by this sensitivity. For example if the OUT_Z register has a value of 1000 then the g force in the Z axis is <math>1000 \times 18=18000mg </math> for a +-2g range.
External Links
This page is a Component on bildr. Components are pages about specific parts, and include connection details and code when available.
