Overview

The ADXL345 is a 3-axis digital accelerometer that measures acceleration forces in X, Y, and Z directions. It's ideal for motion detection, orientation sensing, and gesture recognition applications. The sensor offers high-resolution output with configurable ranges and built-in functions such as tap detection, activity monitoring, and free-fall detection.

Technical Specifications

Operating Voltage: 2.0–3.6 V (Core), 1.7–3.6 V (I/O)
Supply Current: 23 µA (typ), 0.1 µA (standby)
Measurement Range: ±2 g / ±4 g / ±8 g / ±16 g
Resolution: 13-bit (≈4 mg/LSB @ ±2 g)
Output Data Rate: 0.1–3200 Hz
Interface: I²C (≤400 kHz), SPI (≤5 MHz)
Operating Temperature: −40 °C to +85 °C
Package: 14-lead LGA, 3 × 5 × 1 mm

Key Features

  • 3-axis acceleration measurement (X, Y, Z)
  • Selectable measurement ranges
  • High resolution up to 13-bit
  • Built-in motion detection functions
  • Tap and double-tap detection
  • Activity and inactivity monitoring
  • Free-fall detection
  • Ultra-low power consumption

Wiring Diagram

I2C Connection (Arduino Uno)

ADXL345 Pin Arduino Pin
VCC 3.3 V
GND GND
SCL A5 (SCL)
SDA A4 (SDA)

Note: Use a 3.3 V supply. Add 4.7 kΩ pull-up resistors on SDA and SCL lines if required.

Common Applications

Motion Detection

Movement and activity monitoring

Gesture Recognition

Motion-based user interfaces

Orientation Sensing

Tilt and position detection

Gaming Controllers

Motion-controlled gaming systems

Quick Info

Difficulty: Beginner
Price Range: ₹150–400
Interface: I²C / SPI

Sample Code

#include <Wire.h>

#define ADXL345_ADDRESS 0x53
#define POWER_CTL 0x2D
#define DATAX0 0x32

void setup() {
  Serial.begin(9600);
  Wire.begin();

  Wire.beginTransmission(ADXL345_ADDRESS);
  Wire.write(POWER_CTL);
  Wire.write(0x08);
  Wire.endTransmission();

  Serial.println("ADXL345 Accelerometer");
}

void loop() {
  Wire.beginTransmission(ADXL345_ADDRESS);
  Wire.write(DATAX0);
  Wire.endTransmission(false);
  Wire.requestFrom(ADXL345_ADDRESS, 6);

  int16_t x = Wire.read() | (Wire.read() << 8);
  int16_t y = Wire.read() | (Wire.read() << 8);
  int16_t z = Wire.read() | (Wire.read() << 8);

  Serial.print("X: "); Serial.print(x);
  Serial.print(" Y: "); Serial.print(y);
  Serial.print(" Z: "); Serial.println(z);

  delay(500);
}