Cirkit Designer Logo
Cirkit Designer
Your all-in-one circuit design IDE
Home / 
Component Documentation

How to Use LIS3DSH: Examples, Pinouts, and Specs

Image of LIS3DSH
Cirkit Designer LogoDesign with LIS3DSH in Cirkit Designer

Introduction

The LIS3DSH is a low-power, 3-axis accelerometer that provides digital output via I2C or SPI interfaces. It is designed for motion sensing applications, offering features such as high sensitivity, programmable full-scale ranges, and built-in self-test capabilities. This versatile sensor is ideal for applications requiring precise motion detection, such as wearable devices, gaming peripherals, robotics, and industrial equipment.

Explore Projects Built with LIS3DSH

Use Cirkit Designer to design, explore, and prototype these projects online. Some projects support real-time simulation. Click "Open Project" to start designing instantly!
Lilygo 7670e-Based Smart Interface with LCD Display and Keypad
Image of Paower: A project utilizing LIS3DSH in a practical application
This circuit features a Lilygo 7670e microcontroller interfaced with a 16x2 I2C LCD for display, a 4X4 membrane matrix keypad for input, and an arcade button for additional control. It also includes a 4G antenna and a GPS antenna for communication and location tracking capabilities.
Cirkit Designer LogoOpen Project in Cirkit Designer
ESP32-Based Wi-Fi Controlled Laser Shooting Game with OLED Display
Image of 123: A project utilizing LIS3DSH in a practical application
This circuit is a laser shooting game controlled by a PS3 controller, featuring an ESP32 microcontroller, two photosensitive sensors for light detection, and a motor driver to control two DC motors. The game includes an OLED display for score visualization, and a MOSFET to control an LED bulb, with power supplied by a 12V battery and regulated by a DC-DC step-down converter.
Cirkit Designer LogoOpen Project in Cirkit Designer
Teensy 4.1 Based Biometric Data Acquisition System with AD8232 Heart Rate Monitor and LIS3DH Accelerometer
Image of Teensy 4.1 accelerometer: A project utilizing LIS3DSH in a practical application
This circuit integrates a Teensy 4.1 microcontroller with an Adafruit LIS3DH Triple-Axis Accelerometer and an AD8232 Heart Rate Monitor. The accelerometer communicates with the Teensy via I2C (SCL and SDA lines), while the heart rate monitor's output and lead-off detection (LO+ and LO-) are connected to the Teensy's analog inputs. The circuit is designed to measure both acceleration and heart rate signals, likely for a wearable or health monitoring device.
Cirkit Designer LogoOpen Project in Cirkit Designer
ESP32-S3 and ILI9488 TFT LCD Display for Interactive Graphics
Image of IOT_V1: A project utilizing LIS3DSH in a practical application
This circuit features an ESP32-S3 microcontroller connected to an ILI9488 TFT LCD display. The ESP32-S3 initializes and controls the display, demonstrating basic graphics and text rendering using the TFT_eSPI library.
Cirkit Designer LogoOpen Project in Cirkit Designer

Explore Projects Built with LIS3DSH

Use Cirkit Designer to design, explore, and prototype these projects online. Some projects support real-time simulation. Click "Open Project" to start designing instantly!
Image of Paower: A project utilizing LIS3DSH in a practical application
Lilygo 7670e-Based Smart Interface with LCD Display and Keypad
This circuit features a Lilygo 7670e microcontroller interfaced with a 16x2 I2C LCD for display, a 4X4 membrane matrix keypad for input, and an arcade button for additional control. It also includes a 4G antenna and a GPS antenna for communication and location tracking capabilities.
Cirkit Designer LogoOpen Project in Cirkit Designer
Image of 123: A project utilizing LIS3DSH in a practical application
ESP32-Based Wi-Fi Controlled Laser Shooting Game with OLED Display
This circuit is a laser shooting game controlled by a PS3 controller, featuring an ESP32 microcontroller, two photosensitive sensors for light detection, and a motor driver to control two DC motors. The game includes an OLED display for score visualization, and a MOSFET to control an LED bulb, with power supplied by a 12V battery and regulated by a DC-DC step-down converter.
Cirkit Designer LogoOpen Project in Cirkit Designer
Image of Teensy 4.1 accelerometer: A project utilizing LIS3DSH in a practical application
Teensy 4.1 Based Biometric Data Acquisition System with AD8232 Heart Rate Monitor and LIS3DH Accelerometer
This circuit integrates a Teensy 4.1 microcontroller with an Adafruit LIS3DH Triple-Axis Accelerometer and an AD8232 Heart Rate Monitor. The accelerometer communicates with the Teensy via I2C (SCL and SDA lines), while the heart rate monitor's output and lead-off detection (LO+ and LO-) are connected to the Teensy's analog inputs. The circuit is designed to measure both acceleration and heart rate signals, likely for a wearable or health monitoring device.
Cirkit Designer LogoOpen Project in Cirkit Designer
Image of IOT_V1: A project utilizing LIS3DSH in a practical application
ESP32-S3 and ILI9488 TFT LCD Display for Interactive Graphics
This circuit features an ESP32-S3 microcontroller connected to an ILI9488 TFT LCD display. The ESP32-S3 initializes and controls the display, demonstrating basic graphics and text rendering using the TFT_eSPI library.
Cirkit Designer LogoOpen Project in Cirkit Designer

Common Applications and Use Cases

  • Motion tracking in wearable devices
  • Gesture recognition in gaming controllers
  • Vibration monitoring in industrial systems
  • Tilt sensing in robotics and drones
  • Step counting and activity monitoring in fitness devices

Technical Specifications

The LIS3DSH accelerometer is packed with features that make it suitable for a wide range of applications. Below are its key technical specifications:

Parameter Value
Supply Voltage (Vdd) 1.71V to 3.6V
I/O Voltage (Vdd_IO) 1.8V to 3.6V
Power Consumption 2 µA in power-down mode, 11 µA in low-power mode
Measurement Range ±2g, ±4g, ±6g, ±8g, ±16g (programmable)
Output Data Rate (ODR) 3.125 Hz to 1.6 kHz
Interface I2C (up to 400 kHz) or SPI (up to 10 MHz)
Operating Temperature Range -40°C to +85°C
Sensitivity 0.061 mg/LSB (±2g range)
Built-in Features FIFO buffer, self-test, interrupt signals

Pin Configuration and Descriptions

The LIS3DSH is typically available in a 16-pin LGA package. Below is the pinout and description:

Pin Name Description
1 Vdd Power supply (1.71V to 3.6V)
2 Vdd_IO I/O interface voltage (1.8V to 3.6V)
3 GND Ground
4 CS Chip Select (SPI mode)
5 SCL/SPC I2C Clock / SPI Serial Port Clock
6 SDA/SDI/SDO I2C Data / SPI Data In/Out
7 INT1 Interrupt 1 output
8 INT2 Interrupt 2 output
9-16 NC Not connected (reserved for future use)

Usage Instructions

The LIS3DSH can be used in a variety of circuits, and its interface flexibility (I2C or SPI) makes it compatible with many microcontrollers, including the Arduino UNO. Below are the steps to use the LIS3DSH in a circuit:

Connecting the LIS3DSH to an Arduino UNO (I2C Mode)

  1. Power the Sensor: Connect the Vdd pin to the Arduino's 3.3V pin and the GND pin to the Arduino's GND.
  2. I2C Communication:
    • Connect the SCL pin of the LIS3DSH to the Arduino's A5 pin (I2C clock).
    • Connect the SDA pin of the LIS3DSH to the Arduino's A4 pin (I2C data).
  3. Pull-up Resistors: Add 4.7kΩ pull-up resistors on the SCL and SDA lines if not already present on the breakout board.
  4. Interrupts (Optional): Connect INT1 or INT2 to any digital pin on the Arduino if you plan to use interrupts.

Sample Arduino Code

The following code demonstrates how to initialize the LIS3DSH in I2C mode and read acceleration data:

#include <Wire.h>

// LIS3DSH I2C address
#define LIS3DSH_ADDR 0x1D

// Register addresses
#define CTRL_REG4  0x20
#define OUT_X_L    0x28

void setup() {
  Wire.begin(); // Initialize I2C communication
  Serial.begin(9600); // Initialize serial communication for debugging

  // Configure LIS3DSH
  Wire.beginTransmission(LIS3DSH_ADDR);
  Wire.write(CTRL_REG4); // Select control register 4
  Wire.write(0x67); // Enable X, Y, Z axes and set ODR to 100 Hz
  Wire.endTransmission();

  Serial.println("LIS3DSH initialized.");
}

void loop() {
  int16_t x, y, z;

  // Read X-axis acceleration (low and high bytes)
  x = readAxis(OUT_X_L);
  y = readAxis(OUT_X_L + 2); // Y-axis register is 2 bytes after X
  z = readAxis(OUT_X_L + 4); // Z-axis register is 4 bytes after X

  // Print acceleration values
  Serial.print("X: "); Serial.print(x);
  Serial.print(" Y: "); Serial.print(y);
  Serial.print(" Z: "); Serial.println(z);

  delay(500); // Wait 500ms before the next reading
}

int16_t readAxis(uint8_t reg) {
  Wire.beginTransmission(LIS3DSH_ADDR);
  Wire.write(reg | 0x80); // Set MSB to enable auto-increment
  Wire.endTransmission(false);
  Wire.requestFrom(LIS3DSH_ADDR, 2);

  int16_t value = Wire.read(); // Read low byte
  value |= (Wire.read() << 8); // Read high byte and combine
  return value;
}

Important Considerations and Best Practices

  • Voltage Levels: Ensure the LIS3DSH operates within its specified voltage range. Use a level shifter if interfacing with a 5V microcontroller.
  • Pull-up Resistors: Always use pull-up resistors on the I2C lines if not already included on the breakout board.
  • Interrupts: Configure the interrupt pins (INT1 and INT2) for advanced features like motion detection or free-fall detection.
  • Mounting: Securely mount the sensor to minimize noise and ensure accurate readings.

Troubleshooting and FAQs

Common Issues

  1. No Communication with the Sensor

    • Cause: Incorrect I2C address or wiring.
    • Solution: Verify the I2C address (default is 0x1D) and check all connections.
  2. Inconsistent or Noisy Readings

    • Cause: Loose connections or external vibrations.
    • Solution: Ensure secure connections and minimize external vibrations.
  3. Sensor Not Responding

    • Cause: Incorrect power supply voltage.
    • Solution: Verify that Vdd and Vdd_IO are within the specified range.

FAQs

Q: Can the LIS3DSH operate in SPI mode with the Arduino UNO?
A: Yes, the LIS3DSH supports SPI communication. Connect the CS, SCL, and SDA pins to the appropriate SPI pins on the Arduino (CS, SCK, MOSI, and MISO).

Q: How do I change the measurement range?
A: Modify the CTRL_REG4 register to set the desired full-scale range (±2g, ±4g, etc.).

Q: Is the LIS3DSH suitable for battery-powered applications?
A: Yes, its low power consumption makes it ideal for battery-powered devices. Use the power-down or low-power mode to conserve energy.