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.
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:
-
Connected the MPU9250 to an ESP32 microcontroller.
-
Uploaded Arduino code to interface with the sensor.
-
Wrote a Python code to process the sensor data and plot its orientation in real time.
-
Serial: Facilitates serial communication between ESP32 and the Python script.
-
NumPy: Handles numerical operations, such as parsing sensor data.
-
Matplotlib: Visualizes orientation data in a 3D plot.
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.




Download the arudino ide and run the files.
For simulation:
pip install serial matplotlib numpy
Then you are good to go