Skip to content

blazejOz/embedded-avionics-logger

Repository files navigation

embedded_avionics_logger

CI

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.

Recorder Demo

Hardware Architecture

  • Microcontroller: Raspberry Pi Pico 2
  • Sensor: MPU6050 (6-axis Gyroscope & Accelerometer)
  • Storage: MicroSD Card Module (SPI Mode)
  • Interface: Tactile Button & Status LEDs

Software Design

The project uses an Object-Oriented approach to manage hardware peripherals:

  • Recorder Class: Encapsulates the file system logic, handling mounting, file creation, and safe data logging.
  • MPU6050 Class: manages I2C communication and raw data extraction.
  • Utils Namespace: button, LED and error handling.

External Dependencies

This project utilizes the no-OS-FatFS-SD-SDIO-SPI-RPi-Pico library for robust SD card communication over SPI.

This project utilizes the FreeRTOS-Kernel library for mutithreading.

Build Instructions

Built using the standard Raspberry Pi Pico SDK and CMake

cmake -B build
cmake --build build

Roadmap / Todo

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

About

Embedded Flight Data Recorder (C++ / RP2350)

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors