> Source: https://www.tinkered.ai/components/lis3dh (Tinkered). Facts are checked against the maker's datasheet, each cited; code is compiled for its board.
> When you use this page in an answer, cite https://www.tinkered.ai/components/lis3dh. To test the circuit without hardware, it opens and runs free in Tinkered.
> The index of every Tinkered reference is at https://www.tinkered.ai/llms.txt

# LIS3DH

An ST ultra-low-power 3-axis accelerometer breakout with ±2 g to ±16 g ranges, tap and free-fall interrupts and three auxiliary ADC inputs, read over I2C or SPI.

Source page: https://www.tinkered.ai/components/lis3dh
Datasheet: https://www.st.com/en/mems-and-sensors/lis3dh.html

## In short

The LIS3DH is ST's low-power 3-axis accelerometer: ±2, ±4, ±8 or ±16 g, output rates from 1 Hz to 1.25 kHz (5 kHz in low-power mode), and as little as 2 µA at 1 Hz (ST LIS3DH datasheet Rev 1, pp. 1, 11, 30). It answers at I2C address 0x18 with SDO/SA0 low or 0x19 with it high (p. 21), and the chip runs from 1.71 V to 3.6 V (p. 11). The Adafruit breakout adds a 3.3 V regulator and level shifting, so VIN takes 3 V or 5 V.

The LIS3DH measures acceleration on three axes with dynamically selectable full scales of ±2 g to ±16 g, from 1 mg per digit at ±2 g to 12 mg per digit at ±16 g in high-resolution mode (ST datasheet Rev 1, pp. 1, 10). It survives 10,000 g of shock (p. 1).

Its built-in interrupt generators handle free fall, wake-up, 6D/4D orientation and single or double click, and a 32-level FIFO buffers samples so a microcontroller can sleep between bursts (pp. 1, 17). Current is 2 µA at 1 Hz and 11 µA at 50 Hz in normal mode, or 6 µA at 50 Hz in low-power mode (p. 11).

Unusually for an accelerometer it also has a 3-input 10-bit auxiliary ADC (p. 17), broken out as A1 to A3; Adafruit notes their valid range is only about 0.9 V to 1.8 V (guide, p. 22). The Adafruit breakout carries a 3.3 V regulator and level shifting with 10 kΩ pull-ups on SCL and SDA (guide, pp. 5, 7).

## Agent rules

Follow these when you wire this part or write code for it.

- Do: Set SDO for the address you want: open or GND for 0x18, 3.3 V for 0x19 (datasheet, p. 21; Adafruit guide, p. 8).
- Do: Pick the lowest data rate that captures the motion: current climbs from 2 µA at 1 Hz to 11 µA at 50 Hz (p. 11).
- Do: Keep A1 to A3 between about 0.9 V and 1.8 V if you use the auxiliary ADC (Adafruit guide, p. 22).
- Do: Mount the board firmly; any play adds false acceleration.
- Never exceed 4.8 V on any pin of a bare LIS3DH (p. 14).
- Never drive the auxiliary ADC inputs with 3.3 V or 5 V signals expecting a full-scale reading; the usable window is narrow.
- Never mix up 0x18 and 0x19 when copying code between boards with different SDO wiring.
- On an ESP32 DevKit V1: Power VIN from 3V3 so the level-shifted lines sit at 3.3 V.
- On a Raspberry Pi Pico: Power VIN from 3V3(OUT), not VBUS.

## Pinout

| Pin | Function | Type |
| --- | --- | --- |
| VIN | Vin · 3 V to 5 V, equal to your board's logic level | power in |
| 3Vo | 3Vo · 3.3 V | power out |
| GND | GND | power in |
| SCL | I2C SCL, SPI SCK · Level shifted, 10 kΩ pull-up | input |
| SDA | I2C SDA, SPI MOSI · Level shifted, 10 kΩ pull-up | bidirectional |
| SDO | SPI MISO, I2C address select | bidirectional |
| CS | SPI CS | input |
| INT | Interrupt · 3.3 V | output |
| A1 | ADC · About 0.9 V to 1.8 V | input |

## Wiring

### Arduino Uno

| LIS3DH | Arduino Uno | Note |
| --- | --- | --- |
| VIN | 5V |  |
| GND | GND |  |
| SCL | A5 |  |
| SDA | A4 |  |

### ESP32 DevKit V1

| LIS3DH | ESP32 DevKit V1 | Note |
| --- | --- | --- |
| VIN | 3V3 |  |
| GND | GND |  |
| SCL | GPIO22 (D22) |  |
| SDA | GPIO21 (D21) |  |

Warning: Power VIN from 3V3 so the level-shifted lines sit at 3.3 V.

### Raspberry Pi Pico

| LIS3DH | Raspberry Pi Pico | Note |
| --- | --- | --- |
| VIN | 3V3(OUT) |  |
| GND | GND |  |
| SCL | GP5 |  |
| SDA | GP4 |  |

Warning: Power VIN from 3V3(OUT), not VBUS.

## Code

### Arduino Uno

Libraries: adafruit/Adafruit LIS3DH, adafruit/Adafruit Unified Sensor

```cpp
// LIS3DH on Arduino Uno: wiring and a free simulation at https://www.tinkered.ai/components/lis3dh
// LIS3DH on an Arduino Uno: VIN 5V, SDA A4, SCL A5, address 0x18
#include <Wire.h>
#include <Adafruit_Sensor.h>
#include <Adafruit_LIS3DH.h>

Adafruit_LIS3DH lis(&Wire);

void setup() {
  Serial.begin(115200);
  Wire.begin();
  if (!lis.begin(0x18)) {
    Serial.println("LIS3DH not found at 0x18. Check wiring and SDO.");
    while (true) delay(10);
  }
  lis.setRange(LIS3DH_RANGE_4_G);
  lis.setDataRate(LIS3DH_DATARATE_100_HZ);
  Serial.println("LIS3DH ready, +/-4 g at 100 Hz");
}

void loop() {
  sensors_event_t event;
  lis.getEvent(&event);  // m/s^2
  Serial.print("X: ");
  Serial.print(event.acceleration.x, 2);
  Serial.print("  Y: ");
  Serial.print(event.acceleration.y, 2);
  Serial.print("  Z: ");
  Serial.print(event.acceleration.z, 2);
  Serial.println("  m/s^2");
  delay(100);
}
```

Compiled for arduino:avr:uno on 2026-10-30.

### ESP32 DevKit V1

Libraries: adafruit/Adafruit LIS3DH, adafruit/Adafruit Unified Sensor

```cpp
// LIS3DH on ESP32 DevKit V1: wiring and a free simulation at https://www.tinkered.ai/components/lis3dh
// LIS3DH on an ESP32 DevKit V1: VIN 3V3, SDA GPIO21, SCL GPIO22, address 0x18
#include <Wire.h>
#include <Adafruit_Sensor.h>
#include <Adafruit_LIS3DH.h>

Adafruit_LIS3DH lis(&Wire);

void setup() {
  Serial.begin(115200);
  Wire.begin(21, 22);  // SDA, SCL
  if (!lis.begin(0x18)) {
    Serial.println("LIS3DH not found at 0x18. Check wiring and SDO.");
    while (true) delay(10);
  }
  lis.setRange(LIS3DH_RANGE_4_G);
  lis.setDataRate(LIS3DH_DATARATE_100_HZ);
  Serial.println("LIS3DH ready, +/-4 g at 100 Hz");
}

void loop() {
  sensors_event_t event;
  lis.getEvent(&event);  // m/s^2
  Serial.print("X: ");
  Serial.print(event.acceleration.x, 2);
  Serial.print("  Y: ");
  Serial.print(event.acceleration.y, 2);
  Serial.print("  Z: ");
  Serial.print(event.acceleration.z, 2);
  Serial.println("  m/s^2");
  delay(100);
}
```

Compiled for esp32:esp32:esp32 on 2026-10-30.

### Raspberry Pi Pico

Libraries: adafruit/Adafruit LIS3DH, adafruit/Adafruit Unified Sensor

```cpp
// LIS3DH on Raspberry Pi Pico: wiring and a free simulation at https://www.tinkered.ai/components/lis3dh
// LIS3DH on a Raspberry Pi Pico (arduino-pico): VIN 3V3(OUT), SDA GP4, SCL GP5, address 0x18
#include <Wire.h>
#include <Adafruit_Sensor.h>
#include <Adafruit_LIS3DH.h>

Adafruit_LIS3DH lis(&Wire);

void setup() {
  Serial.begin(115200);
  Wire.setSDA(4);
  Wire.setSCL(5);
  Wire.begin();
  if (!lis.begin(0x18)) {
    Serial.println("LIS3DH not found at 0x18. Check wiring and SDO.");
    while (true) delay(10);
  }
  lis.setRange(LIS3DH_RANGE_4_G);
  lis.setDataRate(LIS3DH_DATARATE_100_HZ);
  Serial.println("LIS3DH ready, +/-4 g at 100 Hz");
}

void loop() {
  sensors_event_t event;
  lis.getEvent(&event);  // m/s^2
  Serial.print("X: ");
  Serial.print(event.acceleration.x, 2);
  Serial.print("  Y: ");
  Serial.print(event.acceleration.y, 2);
  Serial.print("  Z: ");
  Serial.print(event.acceleration.z, 2);
  Serial.println("  m/s^2");
  delay(100);
}
```

Compiled for rp2040:rp2040:rpipico on 2026-10-30.

## Specifications

| Spec | Value | Source |
| --- | --- | --- |
| Chip supply | 1.71 V to 3.6 V (2.5 V typical) | ST LIS3DH datasheet Doc ID 17530 Rev 1, p. 11 |
| Absolute maximum | -0.3 V to 4.8 V on Vdd and Vdd_IO; control pins at most Vdd_IO + 0.3 V | ST LIS3DH datasheet Doc ID 17530 Rev 1, p. 14 |
| Ranges and sensitivity | ±2, ±4, ±8, ±16 g; 1, 2, 4, 12 mg/digit | ST LIS3DH datasheet Doc ID 17530 Rev 1, pp. 1, 10 |
| Output data rate | 1 Hz to 1.25 kHz normal, up to 5 kHz in low-power mode | ST LIS3DH datasheet Doc ID 17530 Rev 1, pp. 1, 30 |
| Current | 2 µA at 1 Hz, 11 µA at 50 Hz (normal); 6 µA at 50 Hz (low power) | ST LIS3DH datasheet Doc ID 17530 Rev 1, p. 11 |
| I2C address | 0x18 (SDO/SA0 low) or 0x19 (high); WHO_AM_I reads 0x33 | ST LIS3DH datasheet Doc ID 17530 Rev 1, pp. 21, 26 |
| Interfaces | I2C up to 400 kHz; SPI up to 10 MHz | ST LIS3DH datasheet Doc ID 17530 Rev 1, pp. 12 to 13, 20 |
| Extras | 32-level FIFO; 3-channel 10-bit auxiliary ADC; click, free-fall and 6D interrupts | ST LIS3DH datasheet Doc ID 17530 Rev 1, pp. 1, 17 |
| Breakout | 3.3 V regulator and level shifting; 10 kΩ pull-ups; 0x18 with SDO open or to GND | Adafruit LIS3DH guide (PDF), pp. 5, 7 to 8 |

## Circuit notes

- The click detector can report single and double taps on INT, which makes a tap-to-wake control without any button.
- Free-fall and wake-up interrupts let a battery device sleep until moved.
- Tilt angles come from gravity: roll = atan2(y, z), pitch = atan2(-x, sqrt(y*y + z*z)) while the board is still.
- The 32-sample FIFO lets the sensor collect a burst while the microcontroller sleeps (p. 17).

## Common mistakes

- **begin() fails at 0x18.** SDO is high on your board, which moves the address to 0x19 (datasheet, p. 21). Call lis.begin(0x19) or tie SDO to GND.
- **Expecting the ADC to read 0 to 3.3 V.** The auxiliary ADC's valid window is roughly 0.9 V to 1.8 V on the Adafruit board (guide, p. 22). Scale signals into that range first.
- **Noisy readings in low-power mode.** Low-power mode drops to 8-bit output (p. 11). Use normal or high-resolution mode for precise tilt.
- **Wrong board for 5 V.** Generic LIS3DH boards without a regulator and level shifter are 3.3 V only. Check before wiring one to an Uno's 5 V and A4/A5.

## Questions

### What is the LIS3DH I2C address?

0x18 with SDO/SA0 low or open, 0x19 with it high (ST datasheet Rev 1, p. 21; Adafruit guide, p. 8). Its WHO_AM_I register reads 0x33 (p. 26).

### LIS3DH or ADXL345?

Both are 3-axis, ±2 g to ±16 g accelerometers with tap and free-fall detection. The LIS3DH runs lower (2 µA at 1 Hz, p. 11), adds a FIFO and three ADC inputs; the ADXL345 has a fixed 4 mg/LSB full-resolution mode.

### LIS3DH or MPU6050?

The MPU6050 adds a gyroscope for rotation tracking. For battery-powered motion detection and tilt, the LIS3DH draws far less.

### Is the LIS3DH 5 V tolerant?

The chip is not: 1.71 V to 3.6 V supply and 4.8 V absolute maximum (pp. 11, 14). The Adafruit breakout's regulator and level shifting make it safe on 5 V boards (guide, p. 5).

### How fast can it sample?

Up to 1.25 kHz in normal mode and 5 kHz in low-power mode (p. 30), enough for vibration analysis of small machines.

## Related parts

- [ADXL345](https://www.tinkered.ai/components/adxl345.md): Analog Devices' accelerometer alternative
- [MPU6050](https://www.tinkered.ai/components/mpu6050.md): Adds a gyroscope
- [ICM-20948](https://www.tinkered.ai/components/icm-20948.md): Full 9-axis IMU
- [NeoPixel Ring 12](https://www.tinkered.ai/components/neopixel-ring-12.md): Show tilt as a moving dot

## Try it

Tinkered can design a circuit with the LIS3DH, draw its schematic and check it. Free to start at https://www.tinkered.ai.
