Stufin
Home Quick Cart Profile

ADXL345 Accelerometer Module

Buy Now on Stufin

Component Name

ADXL345 Accelerometer Module

Description

The ADXL345 Accelerometer Module is a highly sensitive and accurate three-axis accelerometer module designed to measure static and dynamic accelerations, such as vibration, inclination, and shock. This module is based on the Analog Devices ADXL345 chip, which is a low-power, high-performance, and cost-effective accelerometer.

Functionality

The ADXL345 Accelerometer Module is used to measure the acceleration forces in three dimensions (x, y, and z axes) and convert them into electrical signals that can be easily read by a microcontroller or other digital devices. The module is capable of measuring both static and dynamic acceleration, making it suitable for a wide range of applications, including

Vibration sensing and monitoring

Inclination and tilt measurement

Motion detection and tracking

Impact and shock detection

Gesture recognition

Key Features

  • High Sensitivity: The ADXL345 Accelerometer Module has a high sensitivity range of 2g, 4g, 8g, or 16g, making it suitable for applications that require high accuracy and precision.
  • Low Power Consumption: The module has a low power consumption of 130 A in normal operation mode and 0.1 A in standby mode, making it suitable for battery-powered devices.
  • High-Resolution Outputs: The module provides high-resolution 10-bit or 13-bit digital output data, making it suitable for accurate measurements.
  • Multiple Output Modes: The module supports multiple output modes, including SPI (3-wire and 4-wire) and I2C, making it compatible with a wide range of microcontrollers and digital devices.
  • Internal Filter: The module has an internal filter that can be configured to remove noise and interference from the output data.
  • Wake-Up and Sleep Modes: The module has built-in wake-up and sleep modes that allow it to automatically wake up and go to sleep based on the acceleration data, reducing power consumption and improving overall system efficiency.
  • Supply Voltage: The module operates on a supply voltage of 2.0 V to 3.6 V, making it suitable for a wide range of power sources.

Dimension

15 mm x 10 mm x 5 mm (L x W x H)

Weight

2 grams

Mounting

The module has four mounting holes for easy attachment to a PCB or other surfaces.

Operating Temperature

-40C to +85C

Applications

The ADXL345 Accelerometer Module is suitable for a wide range of applications, including

Industrial automation and monitoring

Robotics and autonomous systems

Wearable devices and fitness trackers

Gaming and virtual reality

Consumer electronics and appliances

Automotive and aerospace systems

Overall, the ADXL345 Accelerometer Module is a high-performance, low-power, and cost-effective solution for measuring acceleration and orientation in a wide range of applications.

Pin Configuration

  • ADXL345 Accelerometer Module Pinout Explanation
  • The ADXL345 Accelerometer Module is a 3-axis accelerometer that measures static and dynamic acceleration forces. It has a total of 14 pins, which are explained below:
  • Pin 1: VCC
  • Function: Power supply pin
  • Description: Connect to a power source (typically 3.3V or 5V) to power the module.
  • Note: Ensure the power supply voltage is within the recommended range of 2.0V to 3.6V.
  • Pin 2: GND
  • Function: Ground pin
  • Description: Connect to the ground of the system or breadboard.
  • Note: Ensure a stable and clean ground connection for proper module operation.
  • Pin 3: SCL (Clock)
  • Function: I2C clock pin
  • Description: Connect to the clock pin of the microcontroller or other I2C devices.
  • Note: The SCL pin is used to synchronize data transmission between the module and the microcontroller.
  • Pin 4: SDA (Data)
  • Function: I2C data pin
  • Description: Connect to the data pin of the microcontroller or other I2C devices.
  • Note: The SDA pin is used to transmit data between the module and the microcontroller.
  • Pin 5: INT1 (Interrupt 1)
  • Function: Interrupt pin
  • Description: Connect to a digital input pin of the microcontroller.
  • Note: The INT1 pin is used to trigger interrupts when specific events occur, such as data ready or threshold exceeded.
  • Pin 6: INT2 (Interrupt 2)
  • Function: Interrupt pin
  • Description: Connect to a digital input pin of the microcontroller.
  • Note: The INT2 pin is used to trigger interrupts when specific events occur, such as data ready or threshold exceeded.
  • Pin 7: CS (Chip Select)
  • Function: Chip select pin
  • Description: Connect to a digital output pin of the microcontroller.
  • Note: The CS pin is used to select the ADXL345 module when communicating with multiple devices on the same bus.
  • Pin 8: RST (Reset)
  • Function: Reset pin
  • Description: Connect to a digital output pin of the microcontroller.
  • Note: The RST pin is used to reset the module to its default state.
  • Pin 9: XOUT (X-axis output)
  • Function: Analog output pin
  • Description: Connect to an analog-to-digital converter (ADC) or an analog input pin of the microcontroller.
  • Note: The XOUT pin outputs the acceleration data for the X-axis.
  • Pin 10: YOUT (Y-axis output)
  • Function: Analog output pin
  • Description: Connect to an analog-to-digital converter (ADC) or an analog input pin of the microcontroller.
  • Note: The YOUT pin outputs the acceleration data for the Y-axis.
  • Pin 11: ZOUT (Z-axis output)
  • Function: Analog output pin
  • Description: Connect to an analog-to-digital converter (ADC) or an analog input pin of the microcontroller.
  • Note: The ZOUT pin outputs the acceleration data for the Z-axis.
  • Pin 12: SELF (Self-test)
  • Function: Self-test pin
  • Description: Leave unconnected or tie to GND.
  • Note: The SELF pin is used for self-test purposes during manufacturing and is not recommended for user applications.
  • Pin 13: SP (Sleep)
  • Function: Sleep pin
  • Description: Leave unconnected or tie to GND.
  • Note: The SP pin is used to put the module into sleep mode, but it's not recommended for user applications.
  • Pin 14: NC (No Connection)
  • Function: No connection pin
  • Description: Leave unconnected.
  • Note: The NC pin is reserved and should not be connected to any signal.
  • Recommended Connection Structure:
  • 1. Connect VCC to a 3.3V or 5V power source.
  • 2. Connect GND to the system or breadboard ground.
  • 3. Connect SCL to the I2C clock pin of the microcontroller.
  • 4. Connect SDA to the I2C data pin of the microcontroller.
  • 5. Connect INT1 and INT2 to digital input pins of the microcontroller (if using interrupt functionality).
  • 6. Connect CS to a digital output pin of the microcontroller (if using multiple devices on the same bus).
  • 7. Connect RST to a digital output pin of the microcontroller (if using reset functionality).
  • 8. Connect XOUT, YOUT, and ZOUT to analog-to-digital converter (ADC) or analog input pins of the microcontroller.
  • 9. Leave SELF, SP, and NC pins unconnected or tie to GND.
  • Remember to consult the ADXL345 datasheet and the microcontroller's documentation for specific connection requirements and programming guidelines.

Code Examples

ADXL345 Accelerometer Module Documentation
Overview
The ADXL345 Accelerometer Module is a small, low-power, 3-axis accelerometer with high sensitivity and resolution. It measures acceleration in three axes (X, Y, Z) and provides a digital output. The module is ideal for applications such as vibration monitoring, motion detection, and gesture recognition.
Pinouts
| Pin | Function |
| --- | --- |
| VCC | Power supply (3.3V or 5V) |
| GND | Ground |
| SCL | I2C clock |
| SDA | I2C data |
| INT1 | Interrupt output 1 |
| INT2 | Interrupt output 2 |
Communication
The ADXL345 Accelerometer Module communicates with a microcontroller or single-board computer using the I2C protocol.
Code Examples
### Example 1: Basic Accelerometer Reading with Arduino
This example shows how to read the acceleration values from the ADXL345 module using an Arduino board.
```c++
#include <Wire.h>
// Define the ADXL345 I2C address
#define ADXL345_ADDRESS 0x53
void setup() {
  Serial.begin(9600);
  Wire.begin();
}
void loop() {
  // Read the acceleration values
  int x, y, z;
  Wire.beginTransmission(ADXL345_ADDRESS);
  Wire.write(0x32); // X-axis register
  Wire.endTransmission();
  Wire.requestFrom(ADXL345_ADDRESS, 1);
  x = Wire.read();
Wire.beginTransmission(ADXL345_ADDRESS);
  Wire.write(0x33); // Y-axis register
  Wire.endTransmission();
  Wire.requestFrom(ADXL345_ADDRESS, 1);
  y = Wire.read();
Wire.beginTransmission(ADXL345_ADDRESS);
  Wire.write(0x34); // Z-axis register
  Wire.endTransmission();
  Wire.requestFrom(ADXL345_ADDRESS, 1);
  z = Wire.read();
// Print the acceleration values
  Serial.print("Acceleration (g): ");
  Serial.print("X = ");
  Serial.print(x);
  Serial.print(", Y = ");
  Serial.print(y);
  Serial.print(", Z = ");
  Serial.println(z);
delay(500);
}
```
### Example 2: Motion Detection with Raspberry Pi (Python)
This example demonstrates how to use the ADXL345 module to detect motion using a Raspberry Pi with Python.
```python
import smbus
import time
# Define the ADXL345 I2C address and bus
ADXL345_ADDRESS = 0x53
bus = smbus.SMBus(1)
# Set the ADXL345 to measure acceleration in 2g range
bus.write_byte_data(ADXL345_ADDRESS, 0x2C, 0x08)
while True:
    # Read the acceleration values
    x = bus.read_byte_data(ADXL345_ADDRESS, 0x32)
    y = bus.read_byte_data(ADXL345_ADDRESS, 0x33)
    z = bus.read_byte_data(ADXL345_ADDRESS, 0x34)
# Calculate the acceleration magnitude
    magnitude = (x2 + y2 + z2)  0.5
# Check for motion
    if magnitude > 0.5:
        print("Motion detected!")
    else:
        print("No motion detected.")
time.sleep(0.1)
```
Additional Resources
ADXL345 Datasheet: [www.analog.com/media/en/technical-documentation/data-sheets/ADXL345.pdf](http://www.analog.com/media/en/technical-documentation/data-sheets/ADXL345.pdf)
 Arduino Library for ADXL345: [github.com/adafruit/Adafruit_ADXL345](http://github.com/adafruit/Adafruit_ADXL345)
 Raspberry Pi Python Library for ADXL345: [github.com/martinohanlon/py_i2c_axdl345](http://github.com/martinohanlon/py_i2c_axdl345)