Features:
- 3-Axis Sensing: Measures acceleration in X, Y, and Z directions
- Measurement Ranges: ±2g, ±4g, ±8g, ±16g (user-selectable)
- Interface: Supports I2C and SPI communication protocols
- Resolution: 10 to 13-bit resolution depending on range
- Low Power Consumption: Ideal for battery-operated and portable devices
- Free-Fall Detection: Built-in functionality to detect sudden drops
- FIFO Buffer: 32-level FIFO to store data and reduce CPU overhead
- Tap/Double Tap Detection: Detects user input for interactive devices
- Activity and Inactivity Monitoring: Intelligent motion tracking
Specifications:
Parameter |
Value |
Chip |
ADXL345 |
Operating Voltage |
3V to 5V |
Communication |
I2C and SPI |
Measurement Range |
±2g, ±4g, ±8g, ±16g |
Resolution |
Up to 13-bit |
FIFO Buffer |
32-level |
Power Consumption |
Low power, configurable modes |
Pinout Description:
Pin |
Description |
GND |
Ground (connect to system GND) |
VCC |
Power supply input (3V - 5V) |
CS |
Chip Select (used for SPI communication) |
INT1 |
Interrupt Output 1 (for motion events) |
INT2 |
Interrupt Output 2 (for other user-defined events) |
SDO |
Serial Data Out (SPI); also used to set I2C address |
SDA |
Serial Data (I2C), Serial Data Input/Output (SPI) |
SCL |
Serial Clock (I2C/SPI) |
Applications:
- Orientation sensing and tilt detection
- Motion-activated user interfaces
- Gaming motion controllers
- Fall detection in safety devices
- Step counting and wearable activity tracking
- Vibration monitoring
Example Arduino Connection (I2C Mode):
- VCC → 3.3V or 5V
- GND → GND
- SDA → A4 (on Arduino Uno)
- SCL → A5 (on Arduino Uno)
Library Required:
You can use the Adafruit ADXL345 library or Wire library for basic I2C interfacing.
Sample Arduino Code (I2C):
#include <Wire.h>
#include <Adafruit_ADXL345_U.h>
Adafruit_ADXL345_Unified accel = Adafruit_ADXL345_Unified(12345);
void setup() {
Serial.begin(9600);
if (!accel.begin()) {
Serial.println("No ADXL345 detected.");
while (1);
}
accel.setRange(ADXL345_RANGE_2_G);
Serial.println("ADXL345 Initialized");
}
void loop() {
sensors_event_t event;
accel.getEvent(&event);
Serial.print("X: "); Serial.print(event.acceleration.x); Serial.print(" m/s² ");
Serial.print("Y: "); Serial.print(event.acceleration.y); Serial.print(" m/s² ");
Serial.print("Z: "); Serial.print(event.acceleration.z); Serial.println(" m/s²");
delay(500);
}
Features:
- 3-Axis Sensing: Measures acceleration in X, Y, and Z directions
- Measurement Ranges: ±2g, ±4g, ±8g, ±16g (user-selectable)
- Interface: Supports I2C and SPI communication protocols
- Resolution: 10 to 13-bit resolution depending on range
- Low Power Consumption: Ideal for battery-operated and portable devices
- Free-Fall Detection: Built-in functionality to detect sudden drops
- FIFO Buffer: 32-level FIFO to store data and reduce CPU overhead
- Tap/Double Tap Detection: Detects user input for interactive devices
- Activity and Inactivity Monitoring: Intelligent motion tracking
Specifications:
Parameter |
Value |
Chip |
ADXL345 |
Operating Voltage |
3V to 5V |
Communication |
I2C and SPI |
Measurement Range |
±2g, ±4g, ±8g, ±16g |
Resolution |
Up to 13-bit |
FIFO Buffer |
32-level |
Power Consumption |
Low power, configurable modes |
Pinout Description:
Pin |
Description |
GND |
Ground (connect to system GND) |
VCC |
Power supply input (3V - 5V) |
CS |
Chip Select (used for SPI communication) |
INT1 |
Interrupt Output 1 (for motion events) |
INT2 |
Interrupt Output 2 (for other user-defined events) |
SDO |
Serial Data Out (SPI); also used to set I2C address |
SDA |
Serial Data (I2C), Serial Data Input/Output (SPI) |
SCL |
Serial Clock (I2C/SPI) |
Applications:
- Orientation sensing and tilt detection
- Motion-activated user interfaces
- Gaming motion controllers
- Fall detection in safety devices
- Step counting and wearable activity tracking
- Vibration monitoring
Example Arduino Connection (I2C Mode):
- VCC → 3.3V or 5V
- GND → GND
- SDA → A4 (on Arduino Uno)
- SCL → A5 (on Arduino Uno)
Library Required:
You can use the Adafruit ADXL345 library or Wire library for basic I2C interfacing.
Sample Arduino Code (I2C):
#include <Wire.h>
#include <Adafruit_ADXL345_U.h>
Adafruit_ADXL345_Unified accel = Adafruit_ADXL345_Unified(12345);
void setup() {
Serial.begin(9600);
if (!accel.begin()) {
Serial.println("No ADXL345 detected.");
while (1);
}
accel.setRange(ADXL345_RANGE_2_G);
Serial.println("ADXL345 Initialized");
}
void loop() {
sensors_event_t event;
accel.getEvent(&event);
Serial.print("X: "); Serial.print(event.acceleration.x); Serial.print(" m/s² ");
Serial.print("Y: "); Serial.print(event.acceleration.y); Serial.print(" m/s² ");
Serial.print("Z: "); Serial.print(event.acceleration.z); Serial.println(" m/s²");
delay(500);
}