Close Menu
  • Articles
    • Learn Electronics
    • Product Review
    • Tech Articles
  • Electronics Circuits
    • 555 Timer Projects
    • Op-Amp Circuits
    • Power Electronics
  • Microcontrollers
    • Arduino Projects
    • STM32 Projects
    • AMB82-Mini IoT AI Camera
    • BLE Projects
  • IoT Projects
    • ESP8266 Projects
    • ESP32 Projects
    • ESP32 MicroPython
    • ESP32-CAM Projects
    • LoRa/LoRaWAN Projects
  • Raspberry Pi
    • Raspberry Pi Projects
    • Raspberry Pi Pico Projects
    • Raspberry Pi Pico W Projects
  • Electronics Calculator
Facebook X (Twitter) Instagram
  • About Us
  • Disclaimer
  • Privacy Policy
  • Contact Us
  • Advertise With Us
Facebook X (Twitter) Instagram Pinterest YouTube LinkedIn
How To Electronics
  • Articles
    • Learn Electronics
    • Product Review
    • Tech Articles
  • Electronics Circuits
    • 555 Timer Projects
    • Op-Amp Circuits
    • Power Electronics
  • Microcontrollers
    • Arduino Projects
    • STM32 Projects
    • AMB82-Mini IoT AI Camera
    • BLE Projects
  • IoT Projects
    • ESP8266 Projects
    • ESP32 Projects
    • ESP32 MicroPython
    • ESP32-CAM Projects
    • LoRa/LoRaWAN Projects
  • Raspberry Pi
    • Raspberry Pi Projects
    • Raspberry Pi Pico Projects
    • Raspberry Pi Pico W Projects
  • Electronics Calculator
How To Electronics
Home » Measure Acceleration with Accelerometer ADXL335 & Arduino
Arduino Projects

Measure Acceleration with Accelerometer ADXL335 & Arduino

Mamtaz AlamBy Mamtaz AlamUpdated:June 28, 20254 Comments3 Mins Read
Share Facebook Twitter LinkedIn Telegram Reddit WhatsApp
Acceleration Measurement with Accelerometer ADXL335 & Arduino
Share
Facebook Twitter LinkedIn Pinterest Email Reddit Telegram WhatsApp

Acceleration Measurement with Accelerometer ADXL335 & Arduino:

In this post, we will learn about Acceleration Measurement with Accelerometer & Arduino. We have used ADXL335 3 axis accelerometer for measuring the acceleration in x, y, and z-axis. The measured acceleration is displayed on the 16*2 LCD Display. You can even use ADXL345 Digital Accelerometer with the I2C interface.

Here we will be interfacing ADXL335 Accelerometer with Arduino to measure the acceleration in x, y, and z-axis. But before getting started you can visit our earlier post to learn more about accelerometer.
1. Interface ADXL345 Accelerometer with Arduino & Processing Animation
2. Arduino Earthquake Detector Alarm with Seismic Graph using Accelerometer




Components Required:

  1. Arduino UNO Board
  2. ADXL335 3 Axis Accelerometer
  3. 16×2 LCD Display
  4. Breadboard
  5. Jumper Wires
  6. 5 Volt Power Supply

What is an Accelerometer?

Accelerometers are devices that measure acceleration, which is the rate of change of the velocity of an object. They measure in meters per second squared (m/s2) or in G-forces (g). A single G-force for us here on planet Earth is equivalent to 9.8 m/s2, but this does vary slightly with elevation (and will be a different value on different planets due to variations in gravitational pull). Accelerometers are useful for sensing vibrations in systems or for orientation applications.


ADXL335 3 Axis Accelerometer:

Introduction:

Acceleration Measurement with Accelerometer ADXL335 & Arduino

This Accelerometer module is based on the popular ADXL335 three-axis analog accelerometer IC, which reads off the X, Y, and Z acceleration as analog voltages. By measuring the amount of acceleration due to gravity, an accelerometer can figure out the angle it is tilted at with respect to the earth. By sensing the amount of dynamic acceleration, the accelerometer can find out how fast and in what direction the device is moving. Using these two properties, you can make all sorts of cool projects, from musical instruments (imagine playing and having the tilt connected to the distortion level or the pitch-bend) to a velocity monitor on your car (or your children’s car). The accelerometer is very easy to interface to an Arduino Micro-controller using 3 analog input pins and can be used with most other microcontrollers, such as the PIC or AVR.


Working of ADXL335 Accelerometer:

The most commonly used device is the piezoelectric accelerometer. As the name suggests, it uses the principle of piezoelectric effect. The device consists of a piezoelectric quartz crystal on which an accelerative force, whose value is to be measured, is applied.

Acceleration Measurement with Accelerometer ADXL335 & Arduino

Due to the special self-generating property, the crystal produces a voltage that is proportional to the accelerative force. The working and the basic arrangement is shown in the figure below.


Circuit Diagram & Connection for Acceleration Measurement:

Here is a circuit diagram for interfacing ADXL335 3 Axis Accelerometer with Arduino for measuring Acceleration. Assemble the circuit as shown in the figure below.

Circuit diagram for Acceleration Measurement with Accelerometer ADXL335 & Arduino




Source Code/ Programs:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
#include <LiquidCrystal.h>
LiquidCrystal lcd(12, 11, 5, 4, 3, 2);
int Xread;
int Xrest;
 
int Yread;
int Yrest;
 
int Zread;
int Zrest;
 
double Gx;
double Gy;
double Gz;
 
int xpin = 0;
int ypin = 1;
int zpin = 2;
 
int t1;
 
void setup()
{
Serial.begin(9600);
lcd.begin(16, 2);
digitalWrite(13,HIGH);
delay(1000);
Xrest=analogRead(xpin);
Serial.print(Xrest);
Yrest=analogRead(ypin);
Serial.print(Yrest);
Zrest=analogRead(zpin);
Serial.print(Zrest);
digitalWrite(13,LOW);
}
void loop()
{
Serial.print("Time ");
t1=millis();
Serial.println(t1*0.001);
 
Xread = analogRead(xpin)-Xrest;
Yread=analogRead(ypin)-Yrest;
Zread=analogRead(zpin)-Zrest;
 
Gx=Xread/67.584;
Gy=Yread/67.584;
Gz=Zread/67.584;
 
Serial.print("Acceleration X :");
Serial.print(Gx);
Serial.print("Acceleration Y :");
Serial.print(Gy);
Serial.print("Acceleration Z :");
Serial.print(Gz);
Serial.print("\n");
 
lcd.setCursor(0, 0);
lcd.print("gx:");
lcd.print(Gx);
lcd.setCursor(8, 0);
lcd.print("gy:");
lcd.print(Gy);
lcd.setCursor(0, 1);
lcd.print("gz:");
lcd.print(Gz);
delay(1000);
lcd.clear();
}


Video Tutorial & Explanation:

Acceleration Measurement with Accelerometer and Arduino
Watch this video on YouTube.

A better way to measure acceleration is using the ADXL375 accelerometer which is a 200g accelerometer.

Share. Facebook Twitter Pinterest LinkedIn Tumblr Email Reddit Telegram WhatsApp
Previous ArticleArduino Based Calculator using Keypad & LCD for Calculation
Next Article RFID Based Attendance System using Arduino, RTC & LCD Display

Related Posts

DC Energy Meter using Arduino

Build a DC Energy Meter using Arduino – 32V/5A

Updated:August 26, 20252K
Interfacing ADXL375 Accelerometer with Arduino

Interfacing ADXL375 Accelerometer with Arduino (±200g)

Updated:June 28, 2025
PZEM-004T Arduino Energy Meter

DIY AC Energy Meter using PZEM-004T & Arduino

Updated:March 6, 20258K
Interfacing BMI160 Accelerometer & Gyroscope with Arduino

Interfacing BMI160 Accelerometer & Gyroscope with Arduino

Updated:February 2, 20259K
Password Based Door Lock Security System Using Arduino & Keypad

Password Based Door Lock Security System Using Arduino & Keypad

Updated:February 2, 20252436K
Earthquake Detector Alarm with with Accelerometer & Arduino

Earthquake Detector Alarm with Accelerometer & Arduino

Updated:February 2, 2025661K
View 4 Comments

4 Comments

  1. Zahraa on November 8, 2019 1:17 PM

    can you explain more about the variation ?

    Reply
  2. swethatsunil on April 23, 2020 11:34 PM

    from where did you get the value 67.584?

    Reply
  3. george veropoulos on June 30, 2020 1:55 PM

    hi how you find the value 67.584?

    Reply
  4. richard on April 22, 2021 7:02 PM

    can i display this on TFT using a bubble

    Reply

CommentsCancel reply

Latest Posts

ESP32 Fingerprint Attendance System with Live Web Dashboard

June 14, 2026
IoT Based PM & Air Quality Monitoring System using ESP32

IoT Based PM & Air Quality Monitoring System using ESP32

June 14, 2026
DIY ESP32 MLX90640 IR Thermal Camera with Live Web Display

DIY ESP32 MLX90640 IR Thermal Camera with Live Web Display

May 10, 2026
IoT Activity Tracker with ESP32 & Accelerometer Gyroscope

IoT Activity Tracker with ESP32 & Accelerometer/Gyroscope

May 2, 2026
A Guide to Sourcing Obsolete ICs for Vintage Projects

Beyond AliExpress: A Guide to Sourcing Obsolete ICs for Vintage Projects

April 21, 2026

ESP32 IoT Vehicle Motion Analyzer with MPU6050 & LIS3MDL

April 27, 2026
Building a Smart Sensor Node with a BLE Microcontroller

Building a Smart Sensor Node with a BLE Microcontroller

February 26, 2026
High-Accuracy Pitch, Roll, Yaw with ESP32 & BNO08x IMU

High-Accuracy Pitch, Roll, Yaw with ESP32 & BNO08x IMU

April 27, 2026
Top Posts & Pages
  • IoT Based PM & Air Quality Monitoring System using ESP32
    IoT Based PM & Air Quality Monitoring System using ESP32
  • 12V DC to 220V AC Inverter Circuit & PCB
    12V DC to 220V AC Inverter Circuit & PCB
  • Buck Converter: Basics, Working, Design & Application
    Buck Converter: Basics, Working, Design & Application
  • ECG Graph Monitoring with AD8232 ECG Sensor & Arduino
    ECG Graph Monitoring with AD8232 ECG Sensor & Arduino
  • How to use INA219 DC Current Sensor Module with Arduino
    How to use INA219 DC Current Sensor Module with Arduino
  • IoT AC Energy Meter with PZEM-004T & ESP32 WebServer
    IoT AC Energy Meter with PZEM-004T & ESP32 WebServer
  • Designing of MPPT Solar Charge Controller using Arduino
    Designing of MPPT Solar Charge Controller using Arduino
  • L293D Dual H-Bridge Motor Driver IC Pins, Circuit, Working
    L293D Dual H-Bridge Motor Driver IC Pins, Circuit, Working
Categories
  • Arduino Projects (197)
  • Articles (60)
    • Learn Electronics (19)
    • Product Review (15)
    • Tech Articles (28)
  • Electronics Circuits (46)
    • 555 Timer Projects (21)
    • Op-Amp Circuits (7)
    • Power Electronics (13)
  • IoT Projects (205)
    • ESP32 MicroPython (7)
    • ESP32 Projects (82)
    • ESP32-CAM Projects (15)
    • ESP8266 Projects (76)
    • LoRa/LoRaWAN Projects (22)
  • Microcontrollers (38)
    • AMB82-Mini IoT AI Camera (4)
    • BLE Projects (18)
    • STM32 Projects (19)
  • Raspberry Pi (93)
    • Raspberry Pi Pico Projects (57)
    • Raspberry Pi Pico W Projects (12)
    • Raspberry Pi Projects (24)
Follow Us
  • Facebook
  • Twitter
  • Pinterest
  • Instagram
  • YouTube
About Us

“‘How to Electronics’ is a vibrant community for electronics enthusiasts and professionals. We deliver latest insights in areas such as Embedded Systems, Power Electronics, AI, IoT, and Robotics. Our goal is to stimulate innovation and provide practical solutions for students, organizations, and industries. Join us to transform learning into a joyful journey of discovery and innovation.

Copyright © How To Electronics. All rights reserved.
  • About Us
  • Disclaimer
  • Privacy Policy
  • Contact Us
  • Advertise With Us

Type above and press Enter to search. Press Esc to cancel.

Ad Blocker Enabled!
Ad Blocker Enabled!
Looks like you're using an ad blocker. Please allow ads on our site. We rely on advertising to help fund our site.