Introduction
Breakout board for the Analog Device ADXL345. The ADXL345 is a small, thin, low power, 3-axis accelerometer with high resolution (13-bit) measurement at up to ±16 g. Digital output data is formatted as 16-bit twos complement and is accessible through either a SPI (3- or 4-wire) or I2C digital interface. The ADXL345 is well suited to measures the static acceleration of gravity in tilt-sensing applications, as well as dynamic acceleration resulting from motion or shock. Its high resolution (4 mg/LSB) enables measurement of inclination changes less than 1.0°.
Several special sensing functions are provided. Activity and inactivity sensing detect the presence or lack of motion and if the acceleration on any axis exceeds a user-set level. Tap sensing detects single and double taps. Free-fall sensing detects if the device is falling. These functions can be mapped to one of two interrupt output pins. An integrated, patent pending 32-level first in, first out (FIFO) buffer can be used to store data to minimize host processor intervention. Low power modes enable intelligent motion-based power management with threshold sensing and active acceleration measurement at extremely low power dissipation.
Specification
- Working voltage: 3.3~6V
- Current consumption @2.5v: 40uA / working mode, 0.1uA / standby mode
- Communication interface: I2C / SPI (3 or4 lines)
- Size: 20x15mm
Application
- Tap/Double Tap Detection
- Free-Fall Detection
- Selecting Portrait and Landscape Modes
- Tilt sensing
Connection Diagram
This diagram is an IIC connection method suitable with Arduino UNO. It would be differen if you use other Arduino Controllers which the SCL & SDA pin might be different. And if you want to use SPI interface, please refer to ADXL345 datasheet for more info.
Sample Code
Upload the sample sketch bellow to UNO or your board to check the 3-axis acceleration data and the module's tilt information.
For Arduino
For Micropython
By the way, we have collected some useful 3-axis data processing methods: How to Use a Three-Axis Accelerometer for Tilt Sensing.
Result
Open the Serial monitor to see the 3-axis acceleration data and Roll-Pitch angle. See changs as you sway the Accelerometer.
FAQ
For any questions, advice or cool ideas to share, please visit the DFRobot Forum.