Skip to content
IMU / Accelerometer

ADXL345 Digital Accelerometer

Low-power 3-axis accelerometer with tap/double-tap and freefall detection for wearables.

A compact, low-power accelerometer used for tilt sensing, tap/double-tap detection, and freefall detection in wearable projects.

Specifications

Type3-axis MEMS digital accelerometer
InterfaceI2C (up to 400kHz) or SPI (up to 5MHz), selectable via the CS pin
Measurement rangeSelectable ±2g / ±4g / ±8g / ±16g, set via register
Resolution10-bit standard, up to 13-bit in full-resolution mode (~3.9 mg/LSB at full resolution)
Output data rateProgrammable, 0.1 Hz to 3200 Hz
Supply voltage2.0V–3.6V (breakout modules commonly accept 3.3-5V via onboard regulation)
Current draw~23 µA standby, ~140 µA in measurement mode (typical)
Built-in featuresTap/double-tap detection, free-fall detection, activity/inactivity detection, 32-sample FIFO buffer
I2C address0x53 default, 0x1D if the ALT ADDRESS pin is pulled HIGH

Pinout

PinNameDescription
1VCCPower, 3.3–5V DC depending on breakout
2GNDGround
3CSChip select — tie HIGH (to VCC) to force I2C mode; drive LOW as part of SPI transactions to use SPI mode
4INT1Programmable interrupt output 1 (e.g. tap, free-fall, activity events)
5INT2Programmable interrupt output 2 — can route different event sources than INT1
6SDO / ALT ADDRESSIn I2C mode: pull HIGH for address 0x1D, leave LOW/floating for default 0x53. In SPI mode: serial data output
7SDAI2C data line (SPI: MOSI/SDI depending on breakout labeling)
8SCLI2C clock line (SPI: SCK)

CS pin determines the bus mode — this trips people up because it's not obviously a "mode select" pin from the silkscreen. Tie CS to VCC for I2C; if you leave it floating on some breakout revisions, the chip can default to SPI mode and I2C reads will silently fail.

SDO doubles as the I2C address pin — this is the same physical pin used for SPI data output, repurposed in I2C mode as an address selector. Floating or grounding it gives 0x53; pulling it to VCC gives 0x1D. Useful for running two ADXL345s on one I2C bus without a multiplexer.

Full-resolution mode matters for the ±g range you pick — in 10-bit mode, selecting a wider range (±16g) trades away resolution at low-g movements. If fine tilt sensitivity matters, use full-resolution mode, which keeps ~3.9mg/LSB sensitivity regardless of the selected range.

Interrupts save you from polling — tap/double-tap/free-fall detection is computed on-chip; wiring INT1 or INT2 to a GPIO interrupt is far more responsive and power-efficient than continuously polling axis registers and computing thresholds in software.

Variants

Use the ADXL345 when a project genuinely only needs acceleration/tilt/tap data — it's cheaper and simpler than the alternatives. If the project needs to track orientation or rotation rate (drones, balancing robots, gesture devices), the MPU6050 is usually a better fit despite the similar price, since it adds a gyroscope on the same bus.

VariantTemp rangeHum rangeAccuracyProtocolPrice
ADXL345 (GY-291 breakout)~$2-4
MPU6050~$2-4
MPU9250~$5-8

Board Integration

Library

Adafruit ADXL345by Adafruit

Search "Adafruit ADXL345" in Library Manager (Sketch > Include Library > Manage Libraries)

Wiring

Component pinBoard pinNote
VCC5V (breakout regulates to 3.3V) or 3.3VCheck your breakout — most have an onboard regulator and level shifting for 5V logic
GNDGND
CSVCCTie high to force I2C mode
SDAA4 (SDA)Uno's hardware I2C data pin
SCLA5 (SCL)Uno's hardware I2C clock pin

Code

C++

Notes

The Adafruit library also needs the "Adafruit Unified Sensor" dependency — the Library Manager will prompt to install it automatically. Default I2C address is 0x53; it becomes 0x1D if you pull SDO/ALT ADDRESS high.