Skip to content

Instantly share code, notes, and snippets.

@legap
Last active May 1, 2016 13:30
Show Gist options
  • Save legap/3ac09d86b32a27a0d00f4d7f0ed12498 to your computer and use it in GitHub Desktop.
Save legap/3ac09d86b32a27a0d00f4d7f0ed12498 to your computer and use it in GitHub Desktop.

Wiring and accessing an ADXL345 3-axis accelerometer with a Raspberry Pi (Zero)

ADXL345 Pinout

ADXL345_Pinout_Image

Pin No. Mnemonic Description
1 VDD I/O Digital Interface Supply Voltage.
2 GND Must be connected to ground.
3 Reserved Reserved. This pin must be connected to VS or left open.
4 GND Must be connected to ground.
5 GND Must be connected to ground.
6 VS Supply Voltage.
7 CS Chip Select.
8 INT1 Interrupt 1 Output.
9 INT2 Interrupt 2 Output.
10 NC Not Internally Connected.
11 Reserved Reserved. This pin must be connected to ground or left open.
12 SDO/ALT ADDRESS Serial Data Output/Alternate I2C Address Select.
13 SDA/SDI/SDIO Serial Data (I2C)/Serial Data Input (SPI 4-Wire)/Serial Data Input and Output (SPI 3-Wire).
14 SCL/SCLK Serial Communications Clock.
Datasheet Source

Connecting the ADXL345

A simple and to the point description on how to wire and access the ADXL345can be found at Martin O'Hanlon's project blog. His solution uses a python library provided by Pimoroni Ltd.

A more indepth explanation can be found on Analogs ADXL345 Linux Driver page.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment