Skip to content

Track the real-time orientation of MPU and transmit data it to a particular server using ESP32 WiFi

Notifications You must be signed in to change notification settings

kumar-ayush32/Orientation-Tracking-using-MPU9250

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

17 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Orientation-Tracking-using-MPU9250

Objective

The objective of the project is to Track the real-time orientation of MPU and plot it in Matplotlib and transmit data it to a particular server using ESP32's inbuilt WiFi.

Methodology

The MPU9250 is a versatile 9-axis MotionTracking device, combining a 3-axis gyroscope, 3-axis accelerometer, and 3-axis magnetometer in a single package. This allows it to measure orientation, motion, and magnetic fields, making it a powerful sensor for robotics, IoT, and navigation applications.

In this project, I:

  1. Connected the MPU9250 to an ESP32 microcontroller.

  2. Uploaded Arduino code to interface with the sensor.

  3. Wrote a Python code to process the sensor data and plot its orientation in real time.

Software tools

Arduino IDE: Used for writing, compiling, and uploading code to the ESP32.

Python Environment: Python code processes the data sent by the ESP32.

Key libraries:

  1. Serial: Facilitates serial communication between ESP32 and the Python script.

  2. NumPy: Handles numerical operations, such as parsing sensor data.

  3. Matplotlib: Visualizes orientation data in a 3D plot.

Real-Time Plotting:

Matplotlib’s 3D plotting capabilities help visualize real-time orientation. Quiver plots dynamically display the acceleration vector.

Select the correct board (Tools > Board > ESP32 Dev Module) and port (Tools > Port > COMx)

Open the Serial Monitor (Tools > Serial Monitor) and set the baud rate to 115200. You should see accelerometer and gyroscope data being printed.

Hardware Circuit

Circuit

Data send to Laptop

Screenshot (146)

Results

Screenshot (182) Screenshot (151) Video1 Video2

How to run the code

Download the arudino ide and run the files.

For simulation:

pip install serial matplotlib numpy

Then you are good to go

About

Track the real-time orientation of MPU and transmit data it to a particular server using ESP32 WiFi

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published