0% found this document useful (0 votes)
3 views

Interfacing ADXL345 Accelerometer with Arduino UNO (1)

The document discusses interfacing the ADXL345 accelerometer with an Arduino UNO for measuring acceleration in three axes. It includes hardware and software requirements, application areas, and provides a code example for implementation. The results demonstrate the sensor's effectiveness in detecting motion and orientation, with potential applications in various fields.

Uploaded by

AMEYA NALAVADE
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
3 views

Interfacing ADXL345 Accelerometer with Arduino UNO (1)

The document discusses interfacing the ADXL345 accelerometer with an Arduino UNO for measuring acceleration in three axes. It includes hardware and software requirements, application areas, and provides a code example for implementation. The results demonstrate the sensor's effectiveness in detecting motion and orientation, with potential applications in various fields.

Uploaded by

AMEYA NALAVADE
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 3

Interfacing ADXL345 Accelerometer with Arduino UNO

1. Introduction
We all know about accelerometer and gyroscope; they are primarily used to detect
acceleration. While Accelerometer can measure linear acceleration, the gyroscope
can help find the rotational acceleration. A gyroscope is used to measure angular
velocity that uses the earth’s gravity to determine the orientation of the object in
motion. There is a sensor like MPU6050 which has both accelerometer and
gyroscope and it works as an Inertial Measurement Unit (IMU) to find the orientation,
position, and velocity.
Here we are discussing about ADXL345 Accelerometer which is used to measure
the acceleration or change in velocity in x, y, and z-axis. These small sensors areF
used in cars and bikes to detect accidents to deploy the airbags and are also used in
mobile phones for a variety of applications like compass and location tracking.
2. System design
2.1 Hardware and software requirements
• Arduino UNO
• ADXL345 Accelerometer
• Male-female wires
• Breadboard
2.2 Block diagram
2.3 Circuit diagram

2.4 Application area


• Vehicle Accident Alert System
• Hand Gesture Controlled Robot using Arduino
• Earthquake Detector Alarm
• Ping Pong Game
3 Implementation and result
3.1 Code

#include <Wire.h> #include <Adafruit_Sensor.h> #include


<Adafruit_ADXL345_U.h> Adafruit_ADXL345_Unified accel =
Adafruit_ADXL345_Unified(); void setup(void) { Serial.begin(9600);

if(!accel.begin()) { Serial.println("No valid sensor found"); while(1); } } void


loop(void) { sensors_event_t event; accel.getEvent(&event); Serial.print("X: ");
Serial.print(event.acceleration.x); Serial.print(" "); Serial.print("Y: ");
Serial.print(event.acceleration.y); Serial.print(" "); Serial.print("Z: ");
Serial.print(event.acceleration.z); Serial.print(" "); Serial.println("m/s^2 ");
delay(500); }
3.2 Results
Open Serial monitor and you will see acceleration readings in x, y, z-axis as shown
below

3.3 Conclusion
In this experiment, the ADXL345 accelerometer was successfully interfaced with
the Arduino UNO, allowing real-time measurement of acceleration in the X, Y,
and Z axes. The sensor was configured using I2C communication, and the acquired
data was processed and displayed using the Arduino serial monitor. The results
demonstrated the ADXL345's capability to detect motion, tilt, and orientation with
high sensitivity and accuracy. The experiment also highlighted the importance of
proper wiring, sensor calibration, and data filtering techniques to improve
measurement precision. This setup can be further extended for applications such as
motion tracking, vibration analysis, and gesture recognition.

You might also like