Gravity: I2C Triple Axis Accelerometer - LIS2DH SKU:SEN0224

From DFRobot Electronic Product Wiki and Tutorial: Arduino and Robot Wiki-DFRobot.com

Category.png Home > Sensors & Modules > Sensors > IMU Sensors

Introduction

DFRobot presents the ultra low-power Arduino triple axis accelerometer! This device is based around a MEMS LIS2DH chip solution and has high-performance ultra-low power mode. The module is fitted with a Gravity I2C interface for easy plug and play integration in to your projects. The build in LDO power management chip gives you a wide range of input voltages, from 3.3 – 5V. The on-board I2C level conversion also makes it compatible with 3.3 and 5V devices.
Compared to traditional ADXL345, The LIS2DH accelerometer has advantages such as extra stability and more efficient power consumption. Low power mode requires only 2μA, while normal mode requires 11μA. At maximum the module supports an output frequency of 5.3KHz. Sensitivity levels are adjustable to either +-2g, +-4g, +-8g or +-16g and the module supports 16-bit data outputs. There are 2 independent programmable interrupt generators for free-fall and motion detection, that will activate interrupt wake-up. This module has many potential applications including wearable tech, display orientation and impact recognition.

Application

  • Motion-activated
  • Display orientation
  • Shake control
  • Pedometer
  • Gaming and virtual reality input devices
  • Impact recognition and logging


Features

  • Gravity plug and play interface
  • Ultra-low power (2uA)
  • Fast response rate (up to 400KHz)
  • Low price
  • Compact and easy to install


Specification

  • Operating Voltage: 3.3V ~ 5V
  • Operating Current: 2uA (low-power mode 50Hz ODR) / 11uA (normal mode 50Hz ODR)
  • Interface: Gravity-I2C interface
  • Adjustable Sensitivity: ± 2g / ± 4g / ± 8g / ± 16g
  • Frequency: 1Hz ~ 5.3KHz
  • 16-bit data output
  • 2 independent programmable interrupt generators for free-fall and motion detection
  • 6D/4D orientation detection
  • Embedded Temperature Sensor
  • Embedded FIFO
  • 1 million grams of high impact resistance
  • Operating Temperature: -40 ℃ ~ +85 ℃
  • Module Size: 26.2 × 26.2 (mm) /1.03 x 1.03 (inches)
  • Weight: 12 g


Tutorial

In this tutorial, we'll show you how does the sensor work.

Requirements

  • Hardware
    • DFRduino UNO (or similar) x 1
    • Gravity: I2C Triple Axis Accelerometer - LIS2DH x1
    • M-M/F-M/F-F Jumper wires


Connection Diagram

Arduino LIS2DH 3 Axis Accelerometer


LIS2DH Arduino
VCC 5V / 3V3
GND GND
SDA A4(SDA)
SCL A5(SCL)


Sample Code

Click to download Arduino LIS2DH Library
How to install Libraries in Arduino IDE

/*!
 * @file testLIS2DH12.ino
 * @brief DFRobot's Read LIS2DH12 data
 * @n This example is in order to achieve the serial port to receive LIS2DH12 back to the data
 *
 * @copyright	[DFRobot](http://www.dfrobot.com), 2016
 * @copyright	GNU Lesser General Public License
 * @author [Wuxiao](xiao.wu@dfrobot.com)
 * @version  V1.0
 * @date  2016-10-13
 * @https://github.com/DFRobot/DFRobot_LIS2DH12
 */

#include <Wire.h>
#include <DFRobot_LIS2DH12.h>


DFRobot_LIS2DH12 LIS; //Accelerometer

void setup(){
  Wire.begin();
  Serial.begin(115200);
  while(!Serial);
  delay(100);
  
  // Set measurement range
  // Ga: LIS2DH12_RANGE_2GA
  // Ga: LIS2DH12_RANGE_4GA
  // Ga: LIS2DH12_RANGE_8GA
  // Ga: LIS2DH12_RANGE_16GA
  while(LIS.init(LIS2DH12_RANGE_16GA) == -1){  //Equipment connection exception or I2C address error
    Serial.println("No I2C devices found");
    delay(1000);
  }
}

void loop(){
  acceleration();
}

/*!
 *  @brief Print the position result.
 */
void acceleration(void)
{
  int16_t x, y, z;

  delay(100);
  LIS.readXYZ(x, y, z);
  LIS.mgScale(x, y, z);
  Serial.print("Acceleration x: "); //print acceleration
  Serial.print(x);
  Serial.print(" mg \ty: ");
  Serial.print(y);
  Serial.print(" mg \tz: ");
  Serial.print(z);
  Serial.println(" mg");
}


Expected Results

Open the Serial monitor, you'll get the following data.

SEN0224 Accekeration data.png


FAQ

For any questions, advice or cool ideas to share, please visit the DFRobot Forum.


More



DFshopping car1.png Shopping from Gravity: I2C Triple Axis Accelerometer - LIS2DH or DFRobot Distributor.