Adafruit Industries ADXL345 Manual

Digital accelerometer

Advertisement

Quick Links

ADXL345 Digital Accelerometer
Created by Bill Earl
Last updated on 2018-12-07 07:32:33 PM UTC

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the ADXL345 and is the answer not in the manual?

Questions and answers

Summary of Contents for Adafruit Industries ADXL345

  • Page 1 ADXL345 Digital Accelerometer Created by Bill Earl Last updated on 2018-12-07 07:32:33 PM UTC...
  • Page 2: Table Of Contents

    Calibration Sketch: Typical Calibration Output: Library Reference Constructor: Initialization() Sensor Details: Getting and Setting the operating range: Getting and Setting the Data Rate: Reading Sensor Events: Downloads Files Schematic & Fabrication Print © Adafruit Industries https://learn.adafruit.com/adxl345-digital-accelerometer Page 2 of 17...
  • Page 3: Overview

    Breakout boards for these modules feature on-board 3.3v voltage regulation and level shifting which makes them simple to interface with 5v microcontrollers such as the Arduino. The ADXL345 features 4 sensitivity ranges from +/- 2G to +/- 16G. And it supports output data rates ranging from 10Hz to 3200Hz.
  • Page 4 © Adafruit Industries https://learn.adafruit.com/adxl345-digital-accelerometer Page 4 of 17...
  • Page 5: Assembly And Wiring

    Assembly: Position the Header: Cut the header to size if necessary. Then plug the header - long pins down - into a breadboard to stabilize it for soldering. © Adafruit Industries https://learn.adafruit.com/adxl345-digital-accelerometer Page 5 of 17...
  • Page 6: Add The Breakout

    I2C Wiring: The ADXL345 Breakout has an I2C address of 0x53. It can share the I2C bus with other I2C devices as long as each device has a unique address. Only 4 connections are required for I2C communication: GND->GND VIN->+5v...
  • Page 7 © Adafruit Industries https://learn.adafruit.com/adxl345-digital-accelerometer Page 7 of 17...
  • Page 8: Programming And Calibration

    Programming and Calibration Install the Library: Download the ADXL345 library (https://adafru.it/aZn) and install it. You will also need the Adafruit Sensor Library (https://adafru.it/aZm) if you do not already have it installed. This guide (https://adafru.it/aYM) will help you with the install process.
  • Page 9: Gravity As A Calibration Reference

    The material is not important as long as it is fairly rigid. Load the Calibration Sketch: Load and run the Calibration sketch below. Open the Serial Monitor and wait for the prompt. © Adafruit Industries https://learn.adafruit.com/adxl345-digital-accelerometer Page 9 of 17...
  • Page 10: Position The Block

    Turn the block so a different side is flat on the table and type another key to measure that axis. (https://adafru.it/c5g) Repeat: Repeat for all six sides of the block to measure the positive and negative aspects of each axis. © Adafruit Industries https://learn.adafruit.com/adxl345-digital-accelerometer Page 10 of 17...
  • Page 11: Calibration Results

    Once all six sides have been sampled, the values printed in the Serial Monitor will represent actual measurements for +/- 1G forces on each axis. These values can be used to re-scale readings for better accuracy. Calibration Sketch: © Adafruit Industries https://learn.adafruit.com/adxl345-digital-accelerometer Page 11 of 17...
  • Page 12 Serial.begin(9600); Serial.println("ADXL345 Accelerometer Calibration"); Serial.println(""); /* Initialise the sensor */ if(!accel.begin()) /* There was a problem detecting the ADXL345 ... check your connections */ Serial.println("Ooops, no ADXL345 detected ... Check your wiring!"); while(1); void loop(void) Serial.println("Type key when ready..."); while (!Serial.available()){}...
  • Page 13: Typical Calibration Output

    Typical Calibration Output: ADXL345 Accelerometer Calibration Type key when ready... Accel Minimums: 0.00 0.00 0.00 Accel Maximums: 0.12 0.20 1.14 Type key when ready... Accel Minimums: 0.00 0.00 0.00 Accel Maximums: 0.12 0.20 1.14 Type key when ready... Accel Minimums: 0.00 0.00...
  • Page 14: Library Reference

    Adafruit_ADXL345(int32_t sensorID = -1) Constructs an instance of the ADXL345 device driver object. 'sensorID' is a device identifier. It will be returned in the sensor_event in each call to getEvent(). The sensorID has no effect on the operation of the driver or device, but is useful in managing sensor events in systems with multiple sensors.
  • Page 15: Reading Sensor Events

    X, Y and Z axis readings from the accelerometer. For more information about sensor_events, see the ReadMe file (https://adafru.it/aZm) for the Adafruit Sensor Library. © Adafruit Industries https://learn.adafruit.com/adxl345-digital-accelerometer Page 15 of 17...
  • Page 16: Downloads

    Downloads Files ADXL345 datasheet (https://adafru.it/c5e) Fritzing object in the Adafruit Fritzing Library (https://adafru.it/aP3) EagleCAD PCB files on GitHub (https://adafru.it/rEH) Schematic & Fabrication Print © Adafruit Industries https://learn.adafruit.com/adxl345-digital-accelerometer Page 16 of 17...
  • Page 17 © Adafruit Industries Last Updated: 2018-12-07 07:32:32 PM UTC Page 17 of 17...

Table of Contents