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

How to Use Triple Axis Accelerometer Breakout - ADXL345: Examples, Pinouts, and Specs

Image of Triple Axis Accelerometer Breakout - ADXL345
Cirkit Designer LogoDesign with Triple Axis Accelerometer Breakout - ADXL345 in Cirkit Designer

Introduction

The Triple Axis Accelerometer Breakout - ADXL345 by SparkFun is a compact and versatile sensor designed to measure acceleration in three axes: X, Y, and Z. It is capable of detecting both static acceleration (e.g., gravity) and dynamic acceleration (e.g., motion or vibration). With its small form factor and low power consumption, the ADXL345 is ideal for applications such as motion detection, orientation sensing, gaming devices, robotics, and wearable technology.

This breakout board simplifies interfacing with the ADXL345 sensor, making it easy to integrate into your projects. It supports both I2C and SPI communication protocols, offering flexibility for various microcontroller platforms.

Explore Projects Built with Triple Axis Accelerometer Breakout - ADXL345

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 Triple Axis Accelerometer Breakout - ADXL345 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 Triple Axis Accelerometer Breakout - ADXL345 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 with Adafruit ADXL345 Accelerometer Data Logger
Image of ADXL345: A project utilizing Triple Axis Accelerometer Breakout - ADXL345 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
Teensy 4.1 Based Biometric Data Acquisition System with AD8232 Heart Rate Monitor and LIS3DH Accelerometer
Image of Teensy 4.1 accelerometer: A project utilizing Triple Axis Accelerometer Breakout - ADXL345 in a practical application
This circuit integrates a Teensy 4.1 microcontroller with an Adafruit LIS3DH Triple-Axis Accelerometer and an AD8232 Heart Rate Monitor. The accelerometer communicates with the Teensy via I2C (SCL and SDA lines), while the heart rate monitor's output and lead-off detection (LO+ and LO-) are connected to the Teensy's analog inputs. The circuit is designed to measure both acceleration and heart rate signals, likely for a wearable or health monitoring device.
Cirkit Designer LogoOpen Project in Cirkit Designer

Explore Projects Built with Triple Axis Accelerometer Breakout - ADXL345

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 Triple Axis Accelerometer Breakout - ADXL345 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 Triple Axis Accelerometer Breakout - ADXL345 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 ADXL345: A project utilizing Triple Axis Accelerometer Breakout - ADXL345 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
Image of Teensy 4.1 accelerometer: A project utilizing Triple Axis Accelerometer Breakout - ADXL345 in a practical application
Teensy 4.1 Based Biometric Data Acquisition System with AD8232 Heart Rate Monitor and LIS3DH Accelerometer
This circuit integrates a Teensy 4.1 microcontroller with an Adafruit LIS3DH Triple-Axis Accelerometer and an AD8232 Heart Rate Monitor. The accelerometer communicates with the Teensy via I2C (SCL and SDA lines), while the heart rate monitor's output and lead-off detection (LO+ and LO-) are connected to the Teensy's analog inputs. The circuit is designed to measure both acceleration and heart rate signals, likely for a wearable or health monitoring device.
Cirkit Designer LogoOpen Project in Cirkit Designer

Technical Specifications

Key Features

  • Supply Voltage: 3.3V to 5V
  • Communication Protocols: I2C (up to 400kHz) and SPI (up to 10MHz)
  • Measurement Range: ±2g, ±4g, ±8g, ±16g (configurable)
  • Resolution: 13-bit (4mg/LSB at ±2g)
  • Operating Temperature: -40°C to +85°C
  • Power Consumption:
    • Normal Mode: 40µA
    • Standby Mode: 0.1µA
  • Dimensions: 20.3mm x 20.3mm (0.8" x 0.8")

Pin Configuration and Descriptions

The breakout board has 8 pins, as described in the table below:

Pin Name Description
VCC Power supply input (3.3V to 5V).
GND Ground connection.
SDA I2C data line (connect to microcontroller's SDA pin).
SCL I2C clock line (connect to microcontroller's SCL pin).
CS Chip Select for SPI communication (active low). Tie to GND for I2C mode.
SDO SPI data output (or I2C address select: GND = 0x53, VCC = 0x1D).
SDI SPI data input.
INT1 Interrupt 1 output (configurable for motion detection, free-fall, etc.).

Usage Instructions

Connecting the ADXL345 to an Arduino UNO

To use the ADXL345 with an Arduino UNO, follow these steps:

  1. Wiring:

    • Connect the VCC pin of the ADXL345 to the 3.3V or 5V pin on the Arduino.
    • Connect the GND pin of the ADXL345 to the GND pin on the Arduino.
    • Connect the SDA pin of the ADXL345 to the A4 pin on the Arduino (I2C data line).
    • Connect the SCL pin of the ADXL345 to the A5 pin on the Arduino (I2C clock line).
    • Tie the CS pin to GND to enable I2C mode.
    • Optionally, connect the INT1 pin to a digital pin on the Arduino for interrupt-based applications.
  2. Install Required Libraries:

    • Install the "Adafruit_ADXL345" library from the Arduino Library Manager.
  3. Example Code: Below is an example 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 sensor
      if (!accel.begin()) {
        Serial.println("Failed to find ADXL345 chip");
        while (1); // Halt if sensor initialization fails
      }
      Serial.println("ADXL345 initialized successfully!");
    
      // Set measurement range to ±4g
      accel.setRange(ADXL345_RANGE_4_G);
      Serial.println("Range set to ±4g");
    }
    
    void loop() {
      sensors_event_t event;
      accel.getEvent(&event);
    
      // Print acceleration data
      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); // Delay for readability
    }
    

Important Considerations

  • Power Supply: Ensure the ADXL345 is powered within its specified voltage range (3.3V to 5V).
  • Pull-Up Resistors: If using I2C, ensure pull-up resistors (typically 4.7kΩ) are present on the SDA and SCL lines. Some breakout boards include these resistors by default.
  • I2C Address: The default I2C address is 0x53 when the SDO pin is tied to GND, or 0x1D when tied to VCC.
  • Interrupts: Configure the INT1 pin for advanced features like motion detection or free-fall detection.

Troubleshooting and FAQs

Common Issues

  1. No Data Output:

    • Ensure the wiring is correct and matches the pin configuration.
    • Verify that the ADXL345 is powered and the Arduino is properly connected.
    • Check the I2C address in your code. Use an I2C scanner sketch to confirm the address.
  2. Incorrect or Noisy Readings:

    • Ensure the ADXL345 is securely mounted to avoid vibrations affecting measurements.
    • Verify that the measurement range is correctly configured in the code.
    • Use proper decoupling capacitors near the power supply pins to reduce noise.
  3. Sensor Initialization Fails:

    • Confirm that the ADXL345 is in I2C mode (CS pin tied to GND).
    • Check for library compatibility and ensure the correct library is installed.

FAQs

Q: Can the ADXL345 detect free-fall?
A: Yes, the ADXL345 has a built-in free-fall detection feature. You can configure it using the appropriate registers or library functions.

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

Q: Can I use the ADXL345 with a 5V microcontroller?
A: Yes, the breakout board includes level-shifting circuitry, allowing it to interface with both 3.3V and 5V systems.

Q: How do I switch between I2C and SPI modes?
A: To use I2C, tie the CS pin to GND. For SPI, connect the CS pin to a digital pin on your microcontroller and configure it in your code.

By following this documentation, you can effectively integrate the ADXL345 into your projects for reliable motion and orientation sensing.