Digital Accelerometer ADXL345 Module
Digital Accelerometer ADXL345 Module
Contents
Introduction
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 two’s complement and is accessible through either an SPI (3- or 4-wire) or I2C digital interface.
The ADXL345 is well suited to measure 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 the inclination change measurement by less than 1.0°. And the excellent sensitivity (3.9mg/LSB @2g) provides a high-precision output of up to ±16g.
In this experiment, I2C digital interface is used.
See the following figure for the schematic diagram. There is a 3.3v voltage regulator chip in the circuit, so you can power the module with 5V or 3.3V.
ADXL345 works like this:
When you place the module face up, Z_OUT is at the maximum which is +1g; face down, Z_OUT is at the minimum. No matter of face, as long as it's placed on a level surface, X_OUT increases along the Ax axis direction, so does Y_OUT along the Ay axis. See the picture below. Thus, when you rotate the module, you can see the changes of X_OUT, Y_OUT, and Z_OUT.
Features
Ultra low power: 25 to 130 µA at VS = 2.5 V (typ)
Power consumption scales automatically with bandwidth
User selectable fixed 10-bit resolution or 4mg/LSB scale
factor in all g-ranges, up to 13-bit resolution at ±16 g
32 level output data FIFO minimizes host processor load
Built in motion detection functions
• Tap/Double Tap detection
• Activity/Inactivity monitoring
• Free-Fall detection
Supply and I/O voltage range: 1.8 V to 3.6 V
SPI (3 and 4 wire) and I2C digital interfaces
Flexible interrupt modes – Any interrupt mappable to either
interrupt pin
Measurement ranges selectable via serial command
Bandwidth selectable via serial command
Wide temperature range (-40 to +85°C)
10,000 g shock survival
Pb free/RoHS compliant
Small and thin: 3 × 5 × 1 mm LGA package
Schematic
Test
To use the ADXL345 with Arduino, you can take the following steps.
Step1:Connecting circuit 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.
- ADXL345 ------- Arduino Uno/Mega2560
- GND --------- GND
- 3.3V ------- 3.3V
- SCL ------- A5 Uno/pin21 Mega2560
- SDA ------- A4 Uno/pin20 Mega2560
- ADXL345 ------- Arduino Uno/Mega2560
Step2: Open the code file(15 ADXL345\code\ADXL345)
Step3: Select correct Board and Port
Step4: Upload the sketch to the SunFounder Uno board After uploading, open Serial Monitor, where you can see the data detected. When the acceleration of the module changes, the figure will change accordingly on the window.