Cirkit Designer Logo
Cirkit Designer
Your all-in-one circuit design IDE
Home / 
Component Documentation

How to Use ADXL345 Accelerometer: Examples, Pinouts, and Specs

Image of ADXL345 Accelerometer
Cirkit Designer LogoDesign with ADXL345 Accelerometer in Cirkit Designer

Introduction

The ADXL345 is a small, thin, low-power, 3-axis accelerometer capable of high-resolution (13-bit) measurements at up to ±16g. It is designed for applications requiring precise motion sensing, tilt detection, and gesture recognition. The device supports both I2C and SPI communication protocols, making it versatile and easy to integrate into a wide range of projects.

Explore Projects Built with ADXL345 Accelerometer

Use Cirkit Designer to design, explore, and prototype these projects online. Some projects support real-time simulation. Click "Open Project" to start designing instantly!
Arduino Nano and ADXL345 Accelerometer Interface
Image of Interfacing ADXL345 with Nano: A project utilizing ADXL345 Accelerometer in a practical application
This circuit features an Arduino Nano interfaced with an ADXL345 accelerometer for measuring acceleration. The Arduino provides power and I2C communication to the accelerometer, enabling it to capture and process motion-related data.
Cirkit Designer LogoOpen Project in Cirkit Designer
Arduino Leonardo and ADXL345 Accelerometer-Based Motion Detection System
Image of mini project: A project utilizing ADXL345 Accelerometer in a practical application
This circuit interfaces an ADXL345 accelerometer with an Arduino Leonardo via I2C communication. The Arduino provides power and ground to the accelerometer and reads acceleration data through the SDA and SCL lines.
Cirkit Designer LogoOpen Project in Cirkit Designer
Arduino UNO and ADXL345 Accelerometer Data Logger
Image of Accelerometer ADXL345 Circuit Diagram: A project utilizing ADXL345 Accelerometer in a practical application
This circuit features an Arduino UNO microcontroller interfaced with an Adafruit ADXL345 accelerometer for motion detection, powered by two parallel-connected 18650 Li-ion batteries. The accelerometer communicates with the Arduino over I2C, and the system is designed for further code development to utilize the motion sensing capabilities.
Cirkit Designer LogoOpen Project in Cirkit Designer
Arduino UNO with Adafruit ADXL345 Accelerometer Data Logger
Image of ADXL345: A project utilizing ADXL345 Accelerometer in a practical application
This circuit connects an Arduino UNO microcontroller with an Adafruit ADXL345 accelerometer sensor. The Arduino powers the sensor, communicates with it via I2C (using pins A4 and A5 for SDA and SCL respectively), and runs a program to read and output the acceleration data in three axes. The purpose of the circuit is to measure acceleration and provide real-time data for analysis or further processing.
Cirkit Designer LogoOpen Project in Cirkit Designer

Explore Projects Built with ADXL345 Accelerometer

Use Cirkit Designer to design, explore, and prototype these projects online. Some projects support real-time simulation. Click "Open Project" to start designing instantly!
Image of Interfacing ADXL345 with Nano: A project utilizing ADXL345 Accelerometer in a practical application
Arduino Nano and ADXL345 Accelerometer Interface
This circuit features an Arduino Nano interfaced with an ADXL345 accelerometer for measuring acceleration. The Arduino provides power and I2C communication to the accelerometer, enabling it to capture and process motion-related data.
Cirkit Designer LogoOpen Project in Cirkit Designer
Image of mini project: A project utilizing ADXL345 Accelerometer in a practical application
Arduino Leonardo and ADXL345 Accelerometer-Based Motion Detection System
This circuit interfaces an ADXL345 accelerometer with an Arduino Leonardo via I2C communication. The Arduino provides power and ground to the accelerometer and reads acceleration data through the SDA and SCL lines.
Cirkit Designer LogoOpen Project in Cirkit Designer
Image of Accelerometer ADXL345 Circuit Diagram: A project utilizing ADXL345 Accelerometer in a practical application
Arduino UNO and ADXL345 Accelerometer Data Logger
This circuit features an Arduino UNO microcontroller interfaced with an Adafruit ADXL345 accelerometer for motion detection, powered by two parallel-connected 18650 Li-ion batteries. The accelerometer communicates with the Arduino over I2C, and the system is designed for further code development to utilize the motion sensing capabilities.
Cirkit Designer LogoOpen Project in Cirkit Designer
Image of ADXL345: A project utilizing ADXL345 Accelerometer in a practical application
Arduino UNO with Adafruit ADXL345 Accelerometer Data Logger
This circuit connects an Arduino UNO microcontroller with an Adafruit ADXL345 accelerometer sensor. The Arduino powers the sensor, communicates with it via I2C (using pins A4 and A5 for SDA and SCL respectively), and runs a program to read and output the acceleration data in three axes. The purpose of the circuit is to measure acceleration and provide real-time data for analysis or further processing.
Cirkit Designer LogoOpen Project in Cirkit Designer

Common Applications

  • Motion sensing in mobile devices
  • Tilt detection in gaming controllers
  • Gesture recognition in wearable devices
  • Vibration monitoring in industrial equipment
  • Step counting and activity tracking in fitness devices

Technical Specifications

The ADXL345 offers a robust set of features and specifications that make it suitable for various applications. Below are the key technical details:

Key Specifications

Parameter Value
Supply Voltage (VDD) 2.0V to 3.6V
I/O Voltage (VDDIO) 1.7V to VDD
Power Consumption 40 µA in measurement mode
Measurement Range ±2g, ±4g, ±8g, ±16g
Resolution 13-bit
Communication Protocols I2C, SPI
Operating Temperature -40°C to +85°C
Data Output Rate 0.1 Hz to 3200 Hz

Pin Configuration

The ADXL345 is typically available in a 14-pin LGA package. Below is the pinout description:

Pin Number Pin Name Description
1 VDD Power supply (2.0V to 3.6V)
2 GND Ground
3 CS Chip Select (SPI mode) or I2C Address Select
4 INT1 Interrupt 1 output
5 INT2 Interrupt 2 output
6 SCL/SCLK I2C Clock / SPI Clock
7 SDA/SDI/SDO I2C Data / SPI Data In / Data Out
8-14 NC No Connection (leave unconnected)

Usage Instructions

The ADXL345 can be used in a variety of circuits and applications. Below are the steps to integrate and use the component effectively:

Connecting the ADXL345 to an Arduino UNO

  1. Wiring: Connect the ADXL345 to the Arduino UNO as follows:

    • VDD to 3.3V on the Arduino
    • GND to GND on the Arduino
    • SCL to A5 (I2C Clock)
    • SDA to A4 (I2C Data)
    • Leave CS unconnected or pull it high for I2C mode.
  2. Install Required Libraries: Use the Adafruit_ADXL345 library for easy integration. Install it via the Arduino Library Manager.

  3. Example Code: Below is a sample Arduino sketch to read acceleration data from the ADXL345:

#include <Wire.h>
#include <Adafruit_Sensor.h>
#include <Adafruit_ADXL345_U.h>

// Create an ADXL345 object
Adafruit_ADXL345_Unified accel = Adafruit_ADXL345_Unified(12345);

void setup() {
  Serial.begin(9600);
  // Initialize the ADXL345
  if (!accel.begin()) {
    Serial.println("Failed to find ADXL345 chip");
    while (1); // Halt if the sensor is not detected
  }
  Serial.println("ADXL345 initialized successfully!");
  
  // Set range to ±16g for maximum sensitivity
  accel.setRange(ADXL345_RANGE_16_G);
}

void loop() {
  sensors_event_t event;
  accel.getEvent(&event); // Get acceleration data
  
  // Print acceleration values for X, Y, and Z axes
  Serial.print("X: "); Serial.print(event.acceleration.x); Serial.print(" m/s^2 ");
  Serial.print("Y: "); Serial.print(event.acceleration.y); Serial.print(" m/s^2 ");
  Serial.print("Z: "); Serial.print(event.acceleration.z); Serial.println(" m/s^2");
  
  delay(500); // Wait for 500ms before the next reading
}

Important Considerations

  • Power Supply: Ensure the ADXL345 is powered with a voltage between 2.0V and 3.6V. Using 5V directly may damage the device.
  • Pull-Up Resistors: For I2C communication, ensure pull-up resistors (typically 4.7kΩ) are connected to the SDA and SCL lines.
  • Range Configuration: Set the measurement range (±2g, ±4g, ±8g, or ±16g) based on your application requirements for optimal sensitivity and resolution.

Troubleshooting and FAQs

Common Issues and Solutions

  1. No Data Output

    • Cause: Incorrect wiring or communication protocol mismatch.
    • Solution: Double-check the connections and ensure the correct protocol (I2C or SPI) is selected.
  2. Inconsistent Readings

    • Cause: Noise or improper grounding.
    • Solution: Use decoupling capacitors near the power pins and ensure a solid ground connection.
  3. Device Not Detected

    • Cause: Incorrect I2C address or faulty sensor.
    • Solution: Verify the I2C address (default is 0x53) and try replacing the sensor.

FAQs

Q: Can the ADXL345 operate at 5V?
A: No, the ADXL345 operates at a maximum of 3.6V. Use a voltage regulator or level shifter if interfacing with a 5V system.

Q: How do I switch between I2C and SPI modes?
A: The communication mode is determined by the CS pin. Pull CS high for I2C mode or low for SPI mode.

Q: What is the maximum sampling rate of the ADXL345?
A: The ADXL345 supports a maximum data output rate of 3200 Hz.

By following this documentation, you can effectively integrate and use the ADXL345 accelerometer in your projects.