ESP32/IoT B.Tech/Diploma Beginner

Acceleration Measurement with ADXL375 Accelerometer & ESP32

Interfacing ADXL375 ±200g Accerometer with ESP32 microcontroller & reading Accelerometer in x, y, z axis with calibrated C++ Code

  • Suitable forB.Tech/Diploma ESP32/IoT students
  • Build time1-2 weeks
  • LevelBeginner
  • Available atAjvika Labs, Kakinada

About this project

Overview
This tutorial explains how to interface the ADXL375 Accelerometer module with the ESP32 Microcontroller to measure acceleration in the X, Y, and Z axes.
Today, we will introduce you to a very powerful and highly advanced accelerometer called ADXL375, which can measure acceleration up to ±200 g. You might be familiar with accelerometer modules like ADXL335 or ADXL345, as well as MPU6050. Well, these modules are good for simpler projects but fail miserably when working on applications that require high precision, high resolution, and extreme ranges.
Fig: ADXL375 Accelerometer Module
This is the ADXL375 module, which is a digital MEMS accelerometer from Analog Devices. The sensor is small and thin, with ultra-low power consumption as low as 35 µA in measurement mode. The best thing about this sensor is that it can measure acceleration up to ±200 g. Imagine reading such a high gravitational pull of the Earth or measuring the acceleration of a very fast-moving object—here, the ADXL375 is perfect.
In this tutorial, we will first go through the ADXL375 features, capabilities, pinout, and other details. Then, we will show you how you can use this sensor with ESP32o using C++ code. You may follow the

ADXL375 Arduino

guide as well as ADXL375 Raspberry Pi Pico guide.
Components Required
The following are the components required for this tutorial.
S.N.
Components Name
Quantity
Purchase Link

ESP32 Board

Amazon
AliExpress

ADXL375 Accelerometer

Amazon
AliExpress

Connecting Wires

Amazon
AliExpress

Breadboard

Amazon
AliExpress
ADXL375 Accelerometer
The ADXL375 is a small, thin, 3-axis accelerometer that provides low power consumption and high resolution measurement up to ±200 g.
Fig: ADXL375 Accelerometer Module
The digital output data is formatted as 16-bit, two’s complement data and is accessible through a SPI or I2C digital interface. It supports a bandwidth of up to 1 Kilo Hertz. The bandwidth is selectable via Serial Command. An integrated memory management system with a 32-level FIFO buffer can be used to store data to minimize host processor activity and lower overall system power consumption.
Fig: ADXL375 Functional Diagram
The sensor has the ability to determine shock, even, or could be used in an activity or inactivity monitoring system. One shocking thing to notice about this module is, it has a 10,000g shock survival, which is amazing. According to the datasheet, it could be used for concussion and head trauma detection, and also for high-force event detection. To learn more about the ADXL375 Module, you may go through the
ADXL375 Datasheet
ADXL375 Features & Specifications
Measurement Range:
±200 g (fixed) with 13-bit two ’s-complement output
Sensitivity:
49 mg/LSB (0.049 g/LSB) → ~0.4805 mg resolution when converted to m/s²
Power Consumption:
Measurement mode:
35 µA typical
Standby mode:
0.1 µA typical (VS = 2.5 V)
Note:
Supply current varies with output data rate/bandwidth setting
Output Data Rate / Bandwidth:
User-selectable via serial registers
Bandwidth up to 1 kHz (ODR up to 1 kHz)
FIFO Buffer:
32-sample watermark FIFO reduces host-processor load
Event Detection:
Single-tap / double-tap (impulse) detection
Activity/inactivity monitoring with programmable thresholds & durations
Digital Interfaces:
I²C (7-bit address = 0x53 when ALT_ADDRESS = LOW)
SPI (3- or 4-wire)
Supply Voltage:
2.0 V to 3.6 V
I/O Voltage Range:
1.7 V to VS
Operating Temperature:
–40 °C to +85 °C
Shock Survivability:
10,000 g (non-operating)
Package / RoHS:
3 × 5 × 1 mm LGA, RoHS-compliant
Hardware Connection between ESP32 & ADXL375 Accelerometer
First, let’s perform basic testing of ADXL375 with the ESP32 Microcontroller Board. Here is the simple schematic
We can connect the ADXL375 to the ESP32 via the I²C interface. In most of the ESP32 board, the SDA and SCL pins are D21 and D22 respectively.
We can simplify the breadboard wiring with jumper cables and ensure the ADXL375 is oriented as shown on the breakout board.
Source Code/Program: Getting ADXL325 ESP32 Acceleration Readings
To develop firmware, we can use the well-written
ADXL375 Adafruit library
/a>. You can download the repository from GitHub and add it to the Arduino IDE via the Library Manager.
Next, the following code is the modified example sketch for I²C mode.

#include <Wire.h>
#include <Adafruit_Sensor.h>
#include <Adafruit_ADXL375.h>
// ——— I²C SETUP ———
// Use the “default Wire” constructor (just the sensor ID)
Adafruit_ADXL375
accel
=
Adafruit_ADXL375
(
12345
)
;
// If you ever need to override the address, you can call begin(0x53) below.
// ALT_ADDRESS pin tied to GND → 0x53.
void
displayDataRate
(
void
)
{
Serial
(
"Data Rate: "
)
;
switch
(
accel
getDataRate
(
)
)
{
case
ADXL343_DATARATE_3200_HZ
:
Serial
(
"3200 "
)
;
break
;
case
ADXL343_DATARATE_1600_HZ
:
Serial
(
"1600 "
)
;
break
;
case
ADXL343_DATARATE_800_HZ
:
Serial
(
"800 "
)
;
break
;
case
ADXL343_DATARATE_400_HZ
:
Serial
(
"400 "
)
;
break
;
case
ADXL343_DATARATE_200_HZ
:
Serial
(
"200 "
)
;
break
;
case
ADXL343_DATARATE_100_HZ
:
Serial
(
"100 "
)
;
break
;
case
ADXL343_DATARATE_50_HZ
:
Serial
(
"50 "
)
;
break
;
case
ADXL343_DATARATE_25_HZ
:
Serial
(
"25 "
)
;
break
;
case
ADXL343_DATARATE_12_5_HZ
:
Serial
(
"12.5 "
)
;
break
;
case
ADXL343_DATARATE_6_25HZ
:
Serial
(
"6.25 "
)
;
break
;
case
ADXL343_DATARATE_3_13_HZ
:
Serial
(
"3.13 "
)
;
break
;
case
ADXL343_DATARATE_1_56_HZ
:
Serial
(
"1.56 "
)
;
break
;
case
ADXL343_DATARATE_0_78_HZ
:
Serial
(
"0.78 "
)
;
break
;
case
ADXL343_DATARATE_0_39_HZ
:
Serial
(
"0.39 "
)
;
break
;
case
ADXL343_DATARATE_0_20_HZ
:
Serial
(
"0.20 "
)
;
break
;
case
ADXL343_DATARATE_0_10_HZ
:
Serial
(
"0.10 "
)
;
break
;
default
:
Serial
(
"???? "
)
;
break
;
}
Serial
println
(
"Hz"
)
;
}
void
setup
(
void
)
{
Serial
begin
(
115200
)
;
while
(
!
Serial
)
delay
(

)
;
Serial
println
(
"ADXL375 I²C Accelerometer Test"
)
;
// Initialize I2C
Wire
begin
(
)
;
// Try to start the sensor on address 0x53
if
(
!
accel
begin
(
0x53
)
)
{
Serial
println
(
"Ooops, no ADXL375 detected ... Check your wiring!"
)
;
while
(

)
delay
(

)
;
}
// (Optional) change data rate — default is 100 Hz
accel
setDataRate
(
ADXL343_DATARATE_100_HZ
)
;
// Note: range is fixed at ±200 g on the ADXL375
Serial
println
(
)
;
accel
printSensorDetails
(
)
;
displayDataRate
(
)
;
Serial
println
(
)
;
}
void
loop
(
void
)
{
sensors_event_t
event
;
accel
getEvent
(
&
event
)
;
Serial
(
"X: "
)
;
Serial
(
event
acceleration
)
;
Serial
(
" "
)
;
Serial
(
"Y: "
)
;
Serial
(
event
acceleration
y
)
;
Serial
(
" "
)
;
Serial
(
"Z: "
)
;
Serial
(
event
acceleration
z
)
;
Serial
println
(
" m/s^2"
)
;
delay
(

)
;
}
Upload this code to the ESP32 Board and then open the Serial monitor. You will see the Acceleration data on the serial monitor for all the x, y, and z axes.
Fig: ADXL375 ESP32 Readings
The x and y data should be almost zero as the sensor is placed on a flat surface. The z-axis data should be almost 9.8 m/s2 due to the gravitational pull of the Earth. But it’s showing some offset readings. That’s why you modified the code for auto calibration.
Source Code/Program: Read ADXL375 Acceleration with Auto Calibration
Here is another code for reading the correct values of acceleration in the x, y, and z axis using the ESP32 and ADXL375
We first average 100 readings with the board held flat to compute
x_offset
y_offset
, and
z_offset = avg_z – 9.80665 m/s²
. Then, on each loop, we subtract those offset

Technologies used

ESP32ArduinoRaspberry PiBLEMPU6050I2CSPIArduino IDEC++

Hardware components

  • ESP32
  • Arduino
  • Raspberry Pi
  • MPU6050

Software & tools

  • Arduino IDE

What you get

  • Working project / hardware kit, tested before delivery
  • Complete source code with explanation
  • Project demo and guidance for your viva
  • Project report, PPT and IEEE paper support (on request)
Delivery & Payment
Delivery takes a minimum of two weeks from the date your inquiry is confirmed. Payment is in two parts: • 50% advance to start the project • Remaining 50% before delivery Note: • Documentation and PPT are not included by default • If you need documentation/PPT, it can be arranged for extra time and cost We'll confirm the exact timeline and cost with you after reviewing your requirements.