Component guide · Beginner · 3 min read
LIS3DH Accelerometer

Pinout, Wiring, Tap Detection and Code
By Geekobot Learning Team · Updated 29 Oct 2026
On this page
The ST LIS3DH is a low-power 3-axis accelerometer with ±2 to ±16 g ranges on I2C (address 0x18 or 0x19) or SPI. It has built-in tap (click), double-tap, free-fall and motion interrupts, plus three ADC inputs. Drawing as little as 2 µA, it suits wearables, wake-on-shake gadgets and tilt sensing on battery power.
Key specs at a glance
- Range
- ±2, ±4, ±8, ±16 g
- Resolution
- Up to 12-bit (high-resolution mode)
- Data rate
- 1 Hz to 5.3 kHz
- Interface
- I2C (0x18 or 0x19) or SPI
- Supply
- 1.71 to 3.6 V (breakouts 3.3 to 5 V)
- Current
- From 2 µA at 1 Hz
Models in this guide
These are alternatives. Pick the one that fits your project; you only need one.
Option 1Adafruit LIS3DH Triple-Axis Accelerometer ±2/4/8/16g – I2C/SPI, STEMMA QT/Qwiic₹799
Option 2SparkFun Triple Axis Accelerometer Breakout LIS3DH SEN-20659 With Headers₹1,079
Option 3RAKwireless WisBlock 3-Axis Acceleration Sensor Module RAK1904 – LIS3DH, ±2g to ±16g, I2C/SPI₹559
Option 4STMicroelectronics LIS3DH 3-Axis Digital Accelerometer, ±2/4/8/16g, Low Power MEMS Sensor – I²C/SPI, LGA Package₹151
Option 5STMicroelectronics LIS3DHTR LGA-16 3-Axis Accelerometer Sensor₹149
What the LIS3DH accelerometer is
An accelerometer measures gravity as well as motion, so when still it tells you which way is down: that gives tilt and orientation. Short spikes show taps, knocks and steps.
The LIS3DH can watch for these events by itself and raise an interrupt pin, so the microcontroller can sleep until something happens.
LIS3DH accelerometer pinout
The pins on the LIS3DH accelerometer and what each one does.
| Pin | Function |
|---|---|
| VIN / VCC | Supply (3.3 or 5 V on breakouts) |
| GND | Ground |
| SDA / SCL | I2C data and clock (SDI/SCK on SPI) |
| SDO / SA0 | I2C address select (0x18 or 0x19) or SPI data out |
| CS | SPI chip select (high for I2C) |
| INT1 / INT2 | Interrupts for click, motion and free-fall |
| ADC1 to ADC3 | Auxiliary analog inputs |
- VIN / VCC
- Supply (3.3 or 5 V on breakouts)
- GND
- Ground
- SDA / SCL
- I2C data and clock (SDI/SCK on SPI)
- SDO / SA0
- I2C address select (0x18 or 0x19) or SPI data out
- CS
- SPI chip select (high for I2C)
- INT1 / INT2
- Interrupts for click, motion and free-fall
- ADC1 to ADC3
- Auxiliary analog inputs
Wiring the LIS3DH accelerometer
Most breakouts have pull-up resistors and a regulator, so they run from 3.3 V or 5 V. Bare sensor ICs are 3.3 V (or 1.8 V) only: solder them to a breakout first and use a level shifter with 5 V boards.
| LIS3DH accelerometer pin | Arduino Uno | ESP32 |
|---|---|---|
| VCC | 5V (or 3.3V) | 3V3 |
| GND | GND | GND |
| SDA | A4 | GPIO 21 |
| SCL | A5 | GPIO 22 |
- VCC
- Arduino Uno:
- 5V (or 3.3V)
- ESP32:
- 3V3
- GND
- Arduino Uno:
- GND
- ESP32:
- GND
- SDA
- Arduino Uno:
- A4
- ESP32:
- GPIO 21
- SCL
- Arduino Uno:
- A5
- ESP32:
- GPIO 22
Example code
Lower the click threshold for lighter taps; raise it if every bump counts. Try address 0x19 if 0x18 is not found.
#include <Adafruit_LIS3DH.h>
Adafruit_LIS3DH lis;
void setup() {
Serial.begin(115200);
if (!lis.begin(0x18)) { Serial.println("LIS3DH not found"); while (1); }
lis.setRange(LIS3DH_RANGE_4_G);
lis.setClick(1, 80); // single tap, threshold
}
void loop() {
sensors_event_t e;
lis.getEvent(&e);
Serial.printf("x %.2f y %.2f z %.2f m/s2\n", e.acceleration.x, e.acceleration.y, e.acceleration.z);
if (lis.getClick() & 0x30) Serial.println("Tap!");
delay(100);
}Setup and tuning
±2 g gives the finest tilt resolution; ±16 g for impacts.
tune it on the final enclosure, which changes how taps feel.
set a low data rate and wake on INT1 from deep sleep.
with the board flat, Z should read about 9.8 m/s².
What you need
Shop this list8 of 9 found in our store · ₹3,314
Adafruit LIS3DH Triple-Axis Accelerometer ±2/4/8/16g – I2C/SPI, STEMMA QT/Qwiic: the part this guide coversAdafruit LIS3DH Triple-Axis Accelerometer ±2/4/8/16g – I2C/SPI, STEMMA QT/Qwiic₹799
SparkFun Triple Axis Accelerometer Breakout LIS3DH SEN-20659 With Headers: another version this guide coversSparkFun Triple Axis Accelerometer Breakout LIS3DH SEN-20659 With Headers₹1,079
RAKwireless WisBlock 3-Axis Acceleration Sensor Module RAK1904 – LIS3DH, ±2g to ±16g, I2C/SPI: another version this guide coversRAKwireless WisBlock 3-Axis Acceleration Sensor Module RAK1904 – LIS3DH, ±2g to ±16g, I2C/SPI₹559
STMicroelectronics LIS3DH 3-Axis Digital Accelerometer, ±2/4/8/16g, Low Power MEMS Sensor – I²C/SPI, LGA Package: another version this guide coversSTMicroelectronics LIS3DH 3-Axis Digital Accelerometer, ±2/4/8/16g, Low Power MEMS Sensor – I²C/SPI, LGA Package₹151
STMicroelectronics LIS3DHTR LGA-16 3-Axis Accelerometer Sensor: another version this guide coversSTMicroelectronics LIS3DHTR LGA-16 3-Axis Accelerometer Sensor₹149
ESP32-WROOM-32 38-pin development board: for Wi-Fi logging and dashboardsESP32-WROOM-32 38-Pin Development Board₹389- Uno R3 development board: the controller used in the wiring tableFind this part
0.96 inch OLED display 128x64: to show readings without a computer0.96" OLED Display 128x64₹139Closest match, check the specs
Dupont jumper wires: for the connectionsDupont Jumper Wires (40 pcs)₹49Closest match, check the specs
Alternatives and when to choose them
- ADXL345 accelerometer: a popular alternative with similar features.
- Accelerometers compared: ADXL345, LIS3DH, ADXL335 and MMA8452.
- LSM6DSO IMU: adds a gyroscope for rotation.
Try it: I2c pullup calculator
Change the values and the diagram and results update as you type.
Common mistakes to avoid
- Trying the wrong address (0x18 vs 0x19).
- Setting the tap threshold so low that every bump triggers.
- Expecting it to measure rotation speed; it has no gyroscope.
- Powering a bare chip from 5 V.
Frequently asked questions
What is the LIS3DH address?
0x18, or 0x19 with SDO high.
Can it detect taps?
Yes, single and double taps, in the sensor.
LIS3DH or ADXL345?
Both work well; the LIS3DH uses less power.
Does it measure angle?
Tilt angle from gravity while still, yes; rotation while moving needs a gyroscope.
Does it work at 3.3 V?
Yes; breakouts also accept 5 V.
Parts for this guide
Calculators
Keep learning
Sources
Written by the Geekobot team from manufacturer datasheets. Always check the datasheet for the exact part and variant you buy.

