ESP32/IoT B.Tech/Diploma Intermediate

ESP32 IoT Vehicle Motion Analyzer with MPU6050 & LIS3MDL

IoT ESP32 Vehicle Motion Analyzer with MPU6050 Accelerometer Gyroscope & LIS3MDL Magnetometer with Live Monitoring with PCB & Code

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

About this project

Overview
In this project, we develop an
ESP32-based IoT Vehicle Motion Analyzer
that monitors and analyzes driving behavior using motion sensors. The system utilizes the
MPU6050 accelerometer
and
gyroscope
along with the LIS3MDL magnetometer to measure vehicle movement, orientation, and directional heading in real time.
The MPU6050 sensor provides
acceleration and angular velocity data
, enabling the detection of events such as
rapid acceleration, harsh braking
, and
sharp turns
. Meanwhile, the LIS3MDL magnetometer acts as a
digital compass
, helping determine the vehicle’s heading and improving motion analysis by providing directional information.
An
ESP32 microcontroller
processes the sensor data and identifies driving patterns. The device displays key motion parameters such as
forward acceleration, lateral acceleration, yaw rate,
and
heading
on an
OLED display
. In addition, the system features a
Wi-Fi enabled web interface
, allowing users to monitor vehicle motion in real time from a smartphone.
The analyzer also includes a
data logging system
, enabling users to start and stop logging sessions and download the recorded motion data in
CSV format
for further analysis.
Block Diagram of ESP32 Vehicle Motion Analyzer
The block diagram of the
ESP32 Vehicle Motion Analyzer
shows how the main components interact to monitor vehicle motion.
At the center is the
ESP32 microcontroller
, which acts as the main processing unit. It receives motion data from two sensors: the
MPU6050
(accelerometer and gyroscope) and the
LIS3MDL magnetometer
. These sensors communicate with the ESP32 through the I²C interface, allowing the controller to collect and process real-time motion information.
The processed data is displayed on an
OLED screen
for real-time viewing. The ESP32 also uses its built-in
Wi-Fi connectivity
to send the data to a
mobile web dashboard
, enabling remote monitoring through a smartphone. In addition, the system supports
CSV data logging
, allowing motion data to be stored and downloaded later for analysis. All components are powered by a
power supply module
, which provides the required energy for the system to operate.
Circuit Diagram & Schematic Details
Let’s take a look at the
circuit diagram of this project
. The circuit consists of multiple sections, including the
power supply, switches, battery charger, buck converters, sensors, ESP32 microcontroller
, and
OLED display
, along with many other
active
and
passive components
required for proper system operation.
Each section plays an important role in powering the device, processing sensor data, and displaying and transmitting the vehicle motion information. Let us learn about them in detail. You can download the complete schematic file from here:
Download Schematic for Pitch Roll Yaw Measurement
BQ24092 Battery Charger
Fig: Battery Charger Schematic
This section of the circuit is used for
charging the battery
using the
BQ24092
battery charger IC
. The
5V USB input
provides power, which is filtered by capacitors and protected by a fuse. The charging current is set to
500 mA
using a resistor connected to the
ISET pin
The IC automatically controls the charging process for the Li-ion battery.
LED1 and LED2
indicate the
charging status and power status.
Other components like resistors and capacitors help ensure stable and proper operation of the charger circuit.
USB-to-UART (CP2104)
Fig: CP2104 USB-to-UART Converter
This section uses the
CP2104 USB-to-UART converter
to communicate between the computer and the ESP32. The
USB data lines (D+ and D−)
connect to the CP2104, which converts USB signals to
UART signals (TXD and RXD)
for programming and debugging the ESP32. Transistors
Q1 and Q2
automatically control the
boot and reset pins
, allowing the ESP32 to enter programming mode during firmware upload.
Battery Sensing
Fig: Battery Sensing Circuit
This circuit is used to
measure the battery voltage
using the ESP32’s ADC. Resistors
R2 and R4
form a
voltage divider
that scales down the battery voltage to a safe level for the ESP32 ADC pin
(BAT_ADC)
. Capacitor C5 filters noise to provide a stable voltage reading.
ESP32 MCU
Fig: ESP32-S3 Module Schematic
The
ESP32-S3 microcontroller
is the main controller of the system. It reads data from sensors, processes the vehicle motion information, and communicates with the OLED display and web dashboard. The
SDA and SCL pins
are used for I²C communication, while other pins handle serial communication, battery sensing, and sensor interrupts.
Buck-Boost Converter (3.3V)
Fig: 3.3V Buck Converter Schematic
This section generates a
stable 3.3V supply
for the system using the
TPS63020
buck-boost converter
. It can step the battery voltage
up or down
to maintain a constant 3.3V output. Inductor
L2
, resistors, and capacitors help regulate and filter the power supply.
USB-C Connector
Fig: USB-C Port
The
USB-C port
provides
5V power and USB data connectivity
. It allows the device to be powered from USB and enables communication with the CP2104 USB-to-UART converter. Resistors are used to properly configure the USB-C interface. Using this the battery can be charged as well
Battery Section
Fig: Battery Connector
This section connects the
Li-ion battery
to the circuit. The battery provides the main power source for the system. A
switch (S1)
is used to turn the device on or off by controlling the battery output (VBAT_OUT).
MPU6050 (Accelerometer + Gyroscope)
Fig: MPU6050 Schematic
This section uses the
MPU6050
motion sensor
, which contains a
3-axis accelerometer and 3-axis gyroscope
. It measures the
vehicle’s acceleration
and
rotational movement
. The sensor communicates with the ESP32 through the
I²C interface (SDA and SCL)
. Capacitors are used for
power filtering
, and the
INT pin
sends an interrupt signal
(INT_MPU)
to the ESP32 when new sensor data is available.
LIS3MDL (Magnetometer)
Fig: LIS3MDL Magnetometer Schematic
This section uses the
LIS3MDL
magnetometer
, which measures the
Earth’s magnetic field
to determine the
heading or direction of the vehicle.
It also communicates with the ESP32 using the
I²C bus (SDA and SCL)
. Capacitors help stabilize the power supply, and the
INT pin (INT_LIS3)
notifies the ESP32 when new magnetic data is ready.
I²C Pull-Up Resistors
Fig: I2C Pull-up Resistors
Resistors
R8 and R9 (4.7kΩ)
are used as
pull-up resistors for the SDA and SCL lines
of the I²C communication bus. These resistors ensure proper signal levels and reliable communication between the
ESP32, MPU6050, LIS3MDL,
and
OLED.
OLED Display (0.96″)
Fig: OLED Display
This section shows the
0.96-inch OLED display
, which is used to show real-time vehicle motion data such as
heading, acceleration, and turning information
. The display operates on
3.3V power
and communicates with the ESP32 using the
I²C interface (SDA and SCL)
PCB Designing & Gerber Files
Based on the schematic shown above, a
4-layer PCB
was designed for this project. The
top layer
contains all the components required for assembly. The
first inner layer
is used as a
ground (GND) plane
, while the
second inner layer
is dedicated to
signal routing
. Additional routing is also performed on the
top and bottom layers
Proper ground connections are maintained between all layers to ensure a
solid ground plane
, which helps reduce noise and electromagnetic interference. This improves signal integrity and ensures reliable operation of the circuit.
Here is the
3D view of the PCB
, showing all the components assembled on the
top side of the board
. This view provides a clear visualization of the component placement and overall layout of the circuit.
Here are the link of files that you can download for PCB manufacturing and PCB assembly services.
Gerber File Link:
Download
BOM File Link:
Download
Pick & Place File:
Download
PCB Ordering Online & Assembly
The
Gerber file
for this
ESP32 Vehicle Motion Analyzer
is provided above. You can download

Technologies used

ESP32BLEMPU6050OLEDAngularI2CUARTADC

Hardware components

  • ESP32
  • OLED
  • 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.