Dear DRE and BTE-ian,
notes on serial data communication | notes on reading MPU6050 data.
This week, you’ve gone thru to one of the most exciting aspects of embedded systems and sensor-based computing: collecting, processing, and logging motion data using the MPU6050 sensor. Working with the LilEx3 – our in-house Raspberry Pi Pico–based picosatellite simulator, you explored how real satellites interpret motion, orientation, and attitude information through microcontrollers and built-in algorithms.
This activity was designed not only to strengthen understanding of Python programming on microcontrollers, but also to demonstrate how sensor data can be captured, logged, and interpreted, a fundamental skill in IoT, robotics, aerospace, and scientific computing.
1. Introducing the MPU6050 Sensor

The MPU6050 combines a 3-axis accelerometer and 3-axis gyroscope, allowing us to detect:
-
-
-
-
Linear acceleration (AX, AY, AZ)
-
Angular velocity (GX, GY, GZ)
-
Motion patterns
-
Orientation of a device in space
-
-
-
In satellite engineering, this type of sensor is crucial for:
-
-
-
-
Attitude determination
-
Stabilisation
-
Orientation control
-
Deployment sequence monitoring
-
-
-
For our LiLex3 picosatellite simulator, this data helps you to understand how satellites “sense” their position and respond to environmental changes.
2. Python Programming on the Raspberry Pi Pico
Acomplishing the task, you wrote MicroPython code to:
-
-
-
Initialise the I2C communication bus
-
Read real-time sensor values
-
Display values on the Thonny console
-
Log data into a
.txtfile for later analysis
-
-

This hands-on exercise strengthened key Python concepts:
- Variables & Data Types
- You handled multiple numeric readings and stored them in variables such as
ax,ay,az.
- You handled multiple numeric readings and stored them in variables such as
- Functions & Modular Code
- They used functions like
mpu.values()and learned how functions return multiple sensor readings at once.
- They used functions like
- Loops
- A continuous
while True:loop was used to collect real-time data every second.
- A continuous
- File Handling
- One of the most important skills today was learning how to open, write, and save data to a file—essential for logging experiments.
- Example snippet:
- This allowed the Pico to create a growing dataset, which you can later open in Excel for plotting or further analysis.
- Printing to Console
- The real-time values were also displayed in the Thonny console, helping you can visualize live changes as they physically moved the LiLex3 module.
3. Experiencing Motion: Determining Roll, Pitch, and Yaw
Rather than reading just “raw numbers,” you were tasked to interpret meaning behind the MPU6050 readings.

Through controlled physical movement of the LiLex3:
-
-
-
-
Pitch changed when tilting forward/backward
-
Roll changed when tilting left/right
-
Yaw changed when rotating horizontally (similar to turning a compass)
-
-
-
By observing accelerometer and gyroscope patterns, you began to understand how flight controllers, drones, and satellites estimate their orientation in space.
This experience reinforces why MPU data is vital in aerospace applications:
-
-
-
CubeSat attitude determination
-
Drone flight stabilization
-
Rocket telemetry
-
Robotics navigation
-
VR/AR motion tracking
-
-
Then you were encouraged to mark down the sensor readings corresponding to specific movements and attempt simple calculations for roll/pitch/yaw using standard trigonometric formulas (e.g., atan2).

4. Data Logging: Building a Dataset for Analysis
One of the biggest takeaways was the importance of data logging.
By saving values into a .txt file, you learned how to:
-
-
-
- Record experimental data
- Align timestamps and readings
- Import the file into Excel
- Plot sensor graphs (AX vs. time, pitch changes, etc.)
- Observe patterns corresponding to movement
-
-
This introduces to real scientific data workflows used in:
-
-
-
-
Research experiments
-
IoT sensor monitoring
-
Engineering testing
-
Satellite mission data collection
-
-
-
The logged dataset becomes the “flight log” for their miniature picosatellite simulator.
5. Conclusion: Why Today’s Activity Matters
Today’s class was not just about wiring a sensor and reading numbers. It was about understanding how real systems sense, interpret, and record the world around them.
You learned:
-
-
-
-
Embedded Python programming
-
Real-time sensor acquisition
-
Data logging techniques
-
Interpreting physical motion through numerical patterns
-
Satellite-style orientation measurement
-
-
-
By the end of the session, every student had generated their own dataset and gained insight into how satellites determine roll, pitch, and yaw—all through hands-on experimentation with the LiLex3 and MPU6050.
This activity bridges classroom concepts with real aerospace and IoT engineering, preparing you for more advanced missions involving filtering (Kalman), attitude determination, and flight-control algorithms.










































































































