Embedded Avionics Data Logger (C++ / RP2350)
A high-reliability Flight Data Recorder ("Black Box") built for the Raspberry Pi Pico 2 (RP2350).
This project captures real-time motion data from an MPU6050 IMU and logs it to an SD card via the no-OS-FatFS-SD-SDIO-SPI-RPi-Pico library. To guarantee zero data loss during high-latency SPI writes to the SD card, the system leverages FreeRTOS to handle everything in the background. By splitting the work into two independent threads—one that reads the sensor and another that writes to the card—the recorder never drops a single data point.
- Microcontroller: Raspberry Pi Pico 2
- Sensor: MPU6050 (6-axis Gyroscope & Accelerometer)
- Storage: MicroSD Card Module (SPI Mode)
- Interface: Tactile Button & Status LEDs
The project uses an Object-Oriented approach to manage hardware peripherals:
RecorderClass: Encapsulates the file system logic, handling mounting, file creation, and safe data logging.MPU6050Class: manages I2C communication and raw data extraction.UtilsNamespace: button, LED and error handling.
This project utilizes the no-OS-FatFS-SD-SDIO-SPI-RPi-Pico library for robust SD card communication over SPI.
- Library Author: Carl John Kugler III
- Source: https://github.com/carlk3/no-OS-FatFS-SD-SDIO-SPI-RPi-Pico
This project utilizes the FreeRTOS-Kernel library for mutithreading.
- Library Author: FreeRTOS
- Source: https://github.com/FreeRTOS/FreeRTOS-Kernel
Built using the standard Raspberry Pi Pico SDK and CMake
cmake -B build
cmake --build build- Basic SD Card Logging (CSV format)
- Manual Start/Stop Control (Button + LED feedback)
- Gyroscope Data Capture (X/Y/Z)
- Add Accelerometer Data: Expand MPU6050 driver to capture acceleration.
- Error Codes: Instead of just one LED, use different blink patterns.
- Timestamps: Add millisecond precision timestamps to the log.
- FreeRTOS: Refactor the codebase into prioritized Tasks (Sensing vs. Logging) using FreeRTOS to prevent SD card latency.
