LIS2DW12 Accelerometer
Contents
Description
The LIS2DW12 from STMicroelectronics is described in the datasheet (P1) as an ultra-low-power high-performance three-axis linear accelerometer belonging to the "femto" family, which leverages on the robust and mature manufacturing processes already used for the production of micromachined accelerometers
.
STM have provided two sources of documentation. The datasheet is quite general. For driver development it's necessary to refer to AN5038 Application Note which provides a much more detailed discussion of the sensor than the datasheet.
The LIS2DW12 has impressive resolution, sensitivity and low power consumption specifications, all in a tiny package.
This accelerometer is described as being suitable for motion detection wearables, free-fall detection, tap/double-tap recognition, display orientation, gesture recognition (gaming), motion enabled metering devices (pedometers), hearing aids, portable health care devices, wireless sensor nodes, etc.
The LIS2DW12 measures acceleration with a capacitive type sensor.
The values in the following table have been sourced from the product datasheet.
| Parameter | DIS3DH |
|---|---|
| Package and size | 12-lead LGA package, footprint 2mm x 2mm x 0.7mm. |
| Operating voltage range | 1.62V to 3.6V |
| Supply current high-performance mode (typically) |
ODR: 12.5Hz to 1600Hz = 90 µA |
| Supply current Low-Power mode 1 (typically) |
ODR: 1.6Hz = 0.38µA ODR: 100Hz = 5µA |
| Supply current Power-down mode (typically) |
50 nA |
| Zero-g level offset accuracy | Typically ±20 mg |
| Measurement ranges | ±2g, ±4g, ±8g, ±16g. Default is ±2g. |
| Output resolution | Low-power mode 1: 12-bit All other power mode: 14-bit |
| Sensitivity (low-power mode 1) | 0.976 mg/LSB (±2g) to 7.808 mg/LSB (±16g) |
| Sensitivity (all other power modes) | 0.244 mg/LSB (±2g) to 1.952 mg/LSB (±16g) |
| Output data rate (ODR) | All Low-power modes: 1.6Hz to 200Hz High-performance mode: 12.5Hz to 1600Hz |
| Serial interfaces | I2C, SPI (4-wire and 3-wire). |
I2C and SPI (4-wire & 3-wire) are available. I2C is selected by tying the CS pin to High. The I2C interface can also be disabled by setting the I2C_DISABLE bit in the CTRL2 register.
I2C supports standard (100HkHz) and fast data (400kHz) transfer modes.
There is a choice of two I2C addresses depending upon the state of the SDO pin:
- 0x18 : SDO pin connected to GND
- 0x19 : SDO pin connected to VDDIO i.e operating voltage.
Acceleration Sampling Options
This accelerometer has a useful set of sampling options that the user may choose to configure.
Power Modes
-
Power-down Mode
Very low current consumption mode (typically 0.05 µA) where data conversions are stopped but the serial interface is still available. This is the default mode after the power-up sequence has completed. -
Low-power Modes
There are four low-power modes; LP1, LP2, LP3, LP4.
LP1 is a very low power mode with 12-bit resolution and highest signal noise of all modes.
LP2, LP3 and LP4 are all 14-bit resolution. They provide a tradeoff between increased power consumption and lower signal noise. -
High-performance mode
This mode has 14-bit resolution. It provides the lowest signal noise of all power modes.
Additional User Selections
-
Acceleration ranges
Ranges available: ±2g, ±4g, ±8g, ±16g. Default is ±2g. -
Output data rate (ODR)
Low-power modes: 1.6Hz to 200Hz in nine steps.
High-performance mode: 12.5Hz to 1600Hz in nine steps.
Setting ODR = 0Hz places the accelerometer into power-down mode. -
Low-noise
The low-noise setting, if turned on, reduces signal noise in all power modes even further but at the expense of slightly higher power consumption. Low-noise is off by default. -
Bandwidth filters
The LIS2DW12 has two low-pass filters (LPF1 and LPF2) and one high-pass filter (HP). All measurements are routed through LPF1. Optionally the signal can then, at the user's discretion, either:- Bypass LPF2 and HP
- Route through LPF2
- Route through HP
Measuring Acceleration
The LIS2DW12 measures both static and dynamic acceleration. Acceleration is reported in units of g where 1g = 9.81 m/s2 i.e. the acceleration due Earth's gravity.
Static acceleration is that which is imparted upon the sensor by the Earth's gravitational field. If the sensor is laid horizontally on a (perfectly) flat surface and is completely motionless then the acceleration along the X-axis and Y-axis will be 0g The z-axis acceleration will be 1g
Dynamic acceleration refers to the component of acceleration resulting from the motion or changes in velocity experienced by the sensor over time.
The raw acceleration value is read from two 8-bit registers. The two bytes are combined to a single binary representation with size dependant upon the resolution (12-bit 0r 14-bit). This is converted from its Two's Complementary format to a signed integer.
This is then scaled by simple division with the divisor being the sensitivity (LSB/g). The sensitivity depends upon the measurement range and power mode. The float type result is the acceleration value in units of g.
FIFO Queue
The FIFO is a queue mechanism (First In - First Out) that when activated automatically begins storing datasets of raw acceleration values. This is a common feature on most of these styles of sensor.
The FIFO stores X-axis, Y-axis and Z-axis acceleration values. Unlike some other accelerometers on the market the LIS2DW12 does not offer any selectivity options i.e. all three DOF values are always stored. The FIFO can hold up to a maximum of 32 complete X, Y and Z samples.
The FIFO give the microcontroller host "breathing space" to carry on with other tasks as the sensor continues to produce acceleration samples. A configurable interrupt is available that will alert the host when the FIFO is near full. At this time the entire FIFO contents can be burst read and processed.
Refer to the datasheet for further details of the FIFO. It's operation is quite simple compared to some of the LIS2DW12's competitors.
Sensor Generated Interrupts
Many intelligent digital accelerometer sensors offer a set of functional interrupts. The LIS2DW12 is no exception. STMicroelectronics refer to these as embedded function interrupt signals.
These embedded functional interrupts include:
- Free-fall interrupt
This is occurs when the device is in free-fall and is triggered by acceleration from all axis falling below a very low threshold value for a given period of time. - Wake-up interrupt
This is triggered when acceleration value(s) exceed set threshold(s). It's a simple enough concept but there are many user settings that must be considered in setting up this interrupt. - 6D/4D orientation detection
The 6D orientations are face-up, face-down and the four basic portrait/landscape orientations.
The 4D orientations are a subset of the 6D orientation set; the four basic portrait/landscape orientations. - Activity/inactivity recognition
This algorithm uses low-power 1 mode in an even lower power sleep state at the lowest possible ODR to detect activity with user defined threshold and timing parameters.
Stationary/motion detection is a special case of the activity/inactivity functionality. - Single-tap and double-tap recognition
This has many applications on battery powered devices; wake-up, input uses such as selection and so on.
The LIS2DW12 has two output pins; INT1 and INT2. These two pins have various uses:
- Device status signals
- Embedded function interrupts
- FIFO notification signals
The embedded function interrupts discussed above can be turned on by setting the INTERRUPTS_ENABLE bit in the CTRL7 register. The interrupts can then be routed to the INT1 pin by writing to the CTRL4_INT1_PAD_CTRL register.
Temperature Sensor
The LIS2DW12 has an internal temperature sensor, possibly used as part of the acceleration measurement conversion process. The temperature can be read as either a 12-bit value or 8-bit value.
The temperature value returned (in two's complement form) is actually an offset from a given base value. The base value is typically but not guaranteed to be 25°C.
LIS2DW12 Chip ID
LIS2DW12 chips have a product ID value written to non-volatile memory at point of manufacture.
This value can be read from the WHO_AM_I register and should return 0x44.
LIS2DW12 MicroPython Driver for micro:bit
An LIS2DW12 MicroPython driver specifically written for the BBC micro:bit has been developed as part of this series on MicroPython for the micro:bit. The driver webpage also provides a detailed description of the driver's methods and properties with sample code.
The driver implements the base functionality:
- Setting ODR, measurement range (FS), power mode and low noise (on/off)
- Acceleration readings and data ready status
- Temperature reading
- Chip ID
- Angle measurements in the X and Y axis.
The FIFO and all interrupts (with the exception of Data Ready) are not available in this driver.
Inertial Measurement, Magnet Field Sensing
How they work
Weather Station Sensors
How they work
Pressure, Humidity, Temperature
Distance Sensors
Images
LIS2DW12 breakout board
Unlike the breakout boards of most other accelerator chips, the Y-axis on LIS2DW12 boards run parallel to the row of board pins.
It is more usual for the X-axis of the accelerometer to be positioned parallel to the pins.
Micrograph of the LIS2DW12 sensor chip on the breakout board
Low Dropout (LDO) voltage regulator, 1.8V, on LIS2DW12 breakout board
LIS2DW12 breakout board's 10kΩ SCL/SDA pullup resistors