Skip to content

ADXL345 3‐axis MEMS accelerometer

John O'Sullivan edited this page Dec 14, 2025 · 2 revisions

ADXL345 3-axis MEMS accelerometer

Introduction

The ADXL345 is a small, thin, low power, 3-axis MEMS accelerometer with high resolution (13-bit) measurement at up to +/-16 g. Digital output data is formatted as 16-bit two's complement and is accessible through either an SPI (3- or 4-wire) or I2C digital interface.

The single and double tap sensing detects when a single, or two simultaneous, acceleration events occur. Activity and inactivity sensing detect the presence or lack of motion. Free-fall sensing compares the acceleration on all axes with the threshold value to know if the device is falling. All thresholds levels that trigger the activity, free-fall, and single tap/double tap events are user-set levels. These functions can also be mapped to one of two interrupt output pins. An integrated, patent pending 32-level first in, first out (FIFO) buffer can be used to store data to minimize host processor intervention.

image
Mnemonic Description
GND This pin must be connected to ground
VCC Supply Voltage
CS Chip Select
INT1 Interrupt 1 Output
INT2 Interrupt 2 Output
SDO Serial Data Output (SPI 4-Wire) / I2C Address Select
SDA / SDI / SDIO Serial Data I2C / Serial Data Input (SPI 4-Wire) / Serial Data Input and Output (SPI 3-Wire)
SCL / SCLK Serial Communications Clock

Connecting 3 Wire SPI

In SPI mode, the CS pin is controlled by the bus master. For SPI, either 3- or 4- wire configuration is possible.

Note: When using 3-wire SPI, it is recommended that the SDO pin be pulled up to VDD I/O or pulled down to GND via a 10 kΩ resistor. Please refer to page 15 of the ADXL345 Datasheet for additional information.

The following is a table describing which pins on the Arduino should be connected to the pins on the accelerometer for SPI 4-wire communication.

Arduino Pin ADXL345 Pin
GND GND
3V3 VCC
10 CS
12 SDO
11 SDA
13 SCL

Chinese Variant

image

Supports 5V/3.3V voltage input, on-board RT9161 power chip, lower pressure drop faster than the 1117, faster load speed of response, very suitable for high-noise power supply environment.

Pin Name Type Function Notes
GND Power Ground Connects to the Ground pin of your microcontroller (e.g., Arduino/Raspberry Pi).
Vs (or VIN) Power Input Supply Voltage This is the main power input. Connect this to 3v3 on your microcontroller. This appears to be connected to the 3V3 pin
3V3 Power 3.3V Output/Input Output: Regulated 3.3V from the onboard regulator (can power small 3.3V components). Input: If your microcontroller runs at 3.3V, you can often power the board directly here instead of Vs.
5V Power 5V Input (Sometimes) Sometimes labeled instead of Vs as the primary 5V input, or used as the input to the level shifter. Treat as the main VCC input for a 5V system.
CS Control Chip Select (SPI Mode) / Mode Select (I²C) SPI: Driven LOW to enable communication. I²C: Typically tied HIGH (often to 3V3) to select I²C mode.
SCL Digital I/O Serial Clock (I²C) / SCK (SPI Clock) Connects to the SCL/SCK pin on your microcontroller.
SDA Digital I/O Serial Data (I²C) / MOSI (SPI Data Input) Connects to the SDA/MOSI pin on your microcontroller.
SDO Digital I/O Serial Data Output (SPI MISO) / I²C Alternate Addr SPI: Data output to the controller. I²C: Selects the I²C address; tying to GND or 3V3 changes the last address bit (commonly 0x53 ↔ 0x1D).
IN1 Interrupt Interrupt Output 1 Configurable interrupt pin for motion events (e.g., free-fall, activity/inactivity, tap detection).
IN2 Interrupt Interrupt Output 2 Second configurable interrupt output pin.

Features

  • Supply Voltage: 2.0 - 3.6 VDC
  • Ultra Low Power: As low as 23 uA in measurement mode, 0.1uA in standby mode at 2.5V
  • SPI or I2C Communication
  • Single Tap / Double Tap Detection
  • Activity / Inactivity Sensing
  • Free-Fall Detection

References

Clone this wiki locally