The ESP32 Aviation Flight Recorder is a portable electronic system designed to record flight-related data for later analysis. It combines an ESP32 microcontroller with a BME280 barometric sensor, MPU6050 inertial measurement unit, u-blox NEO-6M GPS receiver, microSD card storage, an OLED display, and a pushbutton to start and stop the system operations.
The recorder is designed to collect data without controlling the aircraft. During a recording, measurements are periodically collected and written to a CSV file on the microSD card. After the flight, the CSV file can be transferred to a computer and processed by the flight analysis software to produce graphs, statistics, mapping and access to the raw data. If someone else were to recreate this project I would be happy to send them the application for the analysis of the data. It is too large to attach in this document.
The idea came from an interest in aviation and wanting to create something that could collect real flight data rather than simulate it. I have always wanted to make projects that relate to aviation, but now that I am training to become a pilot, one of the most important things is being able to analyse and understand what happened during the flight, and where I can improve for the next time. I wanted to build a small, portable device that could work like an aircraft black box, with the idea to record information about a flight so it could be analysed afterwards.
There were quite a few challenges during development. One of the biggest was getting several different sensors and modules to work reliably. The GPS, BME280, MPU6050, OLED and SD card all had different requirements, so getting the wiring, communication and software working together took a lot of testing. The SD card caused issues when testing the data saving onto it, as the file would become corrupted every time I shut the power off. This is why I am using a pushbutton, to open and close the file.
The physical design was another challenge. I wanted the electronics to be secure while still being removable, and the enclosure needed to hold the battery, ESP32, sensors, display and wiring without wasting space. This led to several changes to the 3D-printed design, including changing the location of each module and any mounting points. There were also software challenges. I needed the recorder to continue operating if an individual sensor temporarily stopped responding, rather than having one failed sensor stop the entire recording. I also had to develop the pressure-height calibration process, module health monitoring, CSV file creation and the system that safely closes the file when recording finishes. These each took weeks of coding and testing to ensure that they will work perfectly every time.
The main purpose of the data is post-flight analysis. The recorder saves the measurements to a CSV file on the SD card, which can then be loaded into the computer-side flight analysis program I have created. The program is intended to turn the raw measurements into something much easier to understand, including an interactive flight map, graphs of things such as altitude, speed and G-force, statistics and access to the original CSV data.
The ESP32 is the central controller. It communicates with the sensors, GPS and display, manages the recording state and writes the collected information to the SD card.
BME280 — Measures temperature and atmospheric pressure. Pressure is used to calculate barometric altitude relative to a reference pressure established during calibration.
MPU6050 — Measures acceleration and angular velocity. The acceleration readings are used to calculate total acceleration in G.
u-blox NEO-6M GPS — Provides latitude, longitude, GPS altitude, ground speed, course and satellite information when a valid GPS solution is available.
microSD card — Stores the recorded measurements in CSV format so they can be analysed after the flight.
OLED display — Shows module status, recording status and flight information.
Start/Stop pushbutton — Controls the beginning and end of a recording. It also ensures that the file on the microSD card closes properly so no data becomes corrupted.
ESP32 — Coordinates all components, reads the sensors, manages the user interface and records the data.
The ESP32 starts and checks the connected modules.
The BME280 performs its initial pressure calibration for approximately 10 seconds.
The system establishes a reference atmospheric pressure for barometric altitude calculations.
The OLED displays the status of the connected modules.
Pressing the start/stop button starts recording.
Sensor measurements are collected continuously while the recorder is operating.
Recorded data is written to the microSD card at approximately 1 Hz.
The display cycles through module status, recording status and flight data.
Pressing the button again stops the recording.
The completed CSV file remains on the SD card for later analysis.

Display showing the recorder operating
| Part | Purpose | Product Code |
|---|---|---|
| u-blox NEO-6M GPS module | Position and GPS flight data | CE05949 |
| MPU6050 module | Acceleration and gyroscope measurements | 018-MPU-6050 |
| microSD card module | Data storage | CE09444 |
| 6×AA battery pack | Portable power | ADA248 |
| 128×64 I2C OLED display | User interface and system status | CE09226 |
| ESP32 WROOM development board | Main microcontroller | See note below |
| Breakout board | Component mounting | See note below |
| BME280 module | Pressure, temperature and barometric altitude | ADA2652 (equivalent, see note below) |
| Jumper wires (F/F) | Electrical connections | CE05098 |
| microSD card | Stores CSV flight files | CE04628 (see note below) |
| Momentary pushbutton (IP67 Rated) | Start/stop recording | CE07539 |
Note that I had a microSD card left over from other projects. I am using a 64GB microSD card. This is much more than what is required. I suggest that it is a minimum of 8GB. I have included the code of one that will work for this project above in the table.
I also had an ESP32, breakout board, and BME280 left over that I could use. I got them all off Amazon and I have listed them all below. It is possible to replicate this project with other brands’ versions (as long as the wiring is the same/similar)
Freenove ESP32 Development Board ESP32 Kit
Freenove Breakout Board for ESP32 ESP32-S3 Development Board Protoboard
BME280 sensor module 3.3V
Core Electronics note: the BME280 linked in the table above is an equivalent module from our catalogue, not the exact one used in this build, so check its pin labels against the wiring table before connecting.
The following pin assignment is the configuration used by the current flight recorder firmware.
OLED
| Pin | ESP32 connection |
|---|---|
| SDA | GPIO 25 |
| SCL | GPIO 26 |
| GND | GND |
| VCC | 3.3V |
BME280
| Pin | ESP32 connection |
|---|---|
| SDA | GPIO 21 |
| SCL | GPIO 22 |
| CSB | 3.3V |
| SDO | GND |
| GND | GND |
| VCC | 3.3V |
MPU6050
| Pin | ESP32 connection |
|---|---|
| SDA | GPIO 13 |
| SCL | GPIO 14 |
| XDA | - |
| XCL | - |
| AD0 | - |
| INT | - |
| GND | GND |
| VCC | 3.3V |
GPS
| Pin | ESP32 connection |
|---|---|
| RX | GPIO 16 |
| TX | GPIO 17 |
| VCC | 3.3V |
| GND | GND |
SD card
| Pin | ESP32 connection |
|---|---|
| SCK | GPIO 18 |
| MISO | GPIO 19 |
| MOSI | GPIO 23 |
| CS | GPIO 32 |
| GND | GND |
| 3.3V | 3.3V |
Start/Stop button
| Pin | ESP32 connection |
|---|---|
| Signal | GPIO 27 |
| Signal | GND |
Note that since the pushbutton switch (Start/Stop button) uses metal legs and not header pins, you will need to strip the head of the wire and solder it on. Most different types of pushbuttons will work the same, however it is worth considering a better quality one depending on the conditions that the project will be operating in.
The recorder firmware is written in C++ for the Arduino framework and runs on the ESP32. The current program uses separate I2C buses for the OLED and BME280 and software I2C for the MPU6050 so the devices can operate using the selected pin arrangement.
Important firmware timing values:
| Setting | Value |
|---|---|
| Sensor interval | 250 ms (4 Hz) |
| Recording interval | 1000 ms (1 Hz) |
| Health/status interval | 2000 ms |
| Screen interval | 3000 ms |
| Pushbutton debounce | 60 ms |
| BME280 calibration | 10 seconds (used to determine the atmospheric pressure at the start of the recording to base altitude off using the pressure height formula) PH = (1013-QNH) x 30 + Elevation |
The project is intended to be developed using the Arduino IDE and an ESP32 board support package. The firmware uses libraries for I2C communication, the OLED display, BME280, GPS parsing and SD-card access.
Arduino core / ESP32 board support
Wire
SPI
Adafruit GFX
Adafruit SSD1306
Adafruit BME280
TinyGPSPlus
SD
Install the required libraries through the Arduino IDE Library Manager where available, and select the correct ESP32 development-board configuration before compiling and uploading.
To use the microSD card in this project, it is highly likely that you will need to change the format of the card. Most of the time, it is originally formatted in exFAT. You want this in FAT32. To change the format, download Rufus and follow the required steps to change it.
Prepare the ESP32, sensors, GPS, OLED, SD-card module, button, power source and jumper wires.
Connect the OLED to its dedicated I2C pins.
Connect the BME280 to its dedicated I2C pins.
Connect the MPU6050 using the software-I2C pins defined by the firmware.
Connect the NEO-6M GPS to the ESP32 serial pins.
Connect the SD-card module to the ESP32 SPI pins.
Connect the start/stop button to GPIO 27 and the appropriate ground/reference connection.
Check every power, ground and signal connection before applying power.
Screw the breakout board into the box. It is strongly suggested that this is done after wiring everything as it is hard to insert the wires into the pins after the board is in the box.
Insert a compatible microSD card into the SD-card module.
Upload the flight recorder firmware using the Arduino IDE.
Open the Serial Monitor at the baud rate specified by the firmware to check startup messages.
Confirm that the display, sensors, GPS and SD card are detected.
Allow the BME280 calibration process to complete.
Press the button to begin recording and verify that data is being written to the SD card.
Stop the recording and confirm that the CSV file has been saved.
Transfer the CSV file to a computer for analysis.
Confirm the ESP32 boots correctly.
Confirm the OLED displays module status.
Confirm the BME280 provides temperature and pressure readings.
Confirm barometric altitude is calculated.
Confirm the MPU6050 provides acceleration and gyroscope readings.
Confirm the GPS receives valid data when it has an adequate satellite signal.
Confirm the SD card is detected.
Confirm a recording can be started with the button.
Confirm data continues to be written during recording.
Confirm a recording can be stopped with the button.
Open the resulting CSV and verify that the recorded fields contain data.
If the microSD card was not inserted when the module is powered on, the status updater may not pick it up, even if it is then inserted. To ensure that the microSD card is working, use the reset button on the ESP32 dev board to reset the program and this should allow the screen to show SD: OK
The test code for each module is available upon request.
Timestamp / recording time
Temperature
Atmospheric pressure
Barometric altitude
Reference pressure
GPS latitude and longitude
GPS altitude
GPS speed
GPS course
GPS satellite count
Accelerometer X, Y and Z
Gyroscope X, Y and Z
Total acceleration / G
I have included a screenshot of the first 50 seconds of recording data. The system creates one new line of data per second. The actual file contains 5170 lines. It can be seen that the GPS satellite count is four. It usually takes around 30 seconds to one minute to reach values around 10-11, where it generally stabilises.
The computer-side analysis program is separate from the ESP32 recorder. It operates on the completed CSV file after the flight and does not control the aircraft or the recorder.
The analysis workflow is intended to provide a professional flight report containing an interactive map, separate graphs for important measurements such as speed, altitude and G-force, calculated statistics and access to the underlying raw data.
I have included images of how the program uses the data and how it displays it. The data that can be seen above has been imported into the analysis program, and I have included screenshots of that below.
The raw data part shows the first 1000 lines of data. The full raw data can be viewed by opening the .CSV file (this can be found on the microSD card)
A maker wishing to recreate the project should obtain the listed hardware, create the box, reproduce the pin connections, install the required Arduino software and libraries, upload the firmware, and complete the testing procedure. The exact firmware version and wiring documentation should be kept together so future changes to the hardware can be matched to the software.
flight_recorder.ino — ESP32 flight recorder firmware
README.md — GitHub project documentation
.gitignore — ignores Arduino/IDE temporary files
analysis program — computer-side CSV flight analysis software
The first three files are available for download at my GitHub repository (free to download and use): https://github.com/MasterMiniBuilds/ESP32-Flight-Data-Recorder
The fourth is available by request and will need to be directly emailed. It needs to be used with a set of data as otherwise nothing comes up on any of the sections.
This project is an experimental, non-certified data-recording device. It is not intended to replace certified aircraft instruments, flight data recorders or required aviation equipment. The recorder does not provide aircraft control or autopilot functionality.
The device should be securely mounted so that it cannot interfere with aircraft controls, occupants or other equipment. Its power system and enclosure should be checked before use. Operation aboard an aircraft should only be undertaken where permitted by the aircraft operator, pilot and applicable aviation rules.
| Source | Use in project | Link |
|---|---|---|
| Adafruit libraries | Used for interfacing with the SSD1306 OLED and BME280 sensor. | https://github.com/adafruit |
| TinyGPSPlus | Used for parsing GPS data from the NEO-6M receiver. | https://github.com/mikalhart/TinyGPSPlus |
| Arduino / ESP32 ecosystem | Provides the development framework and board support used by the firmware. | https://www.arduino.cc/ |
| Espressif | Provides the ESP32 hardware and software ecosystem. | https://www.espressif.com/ |

Makers love reviews as much as you do, please follow this link to review the products you have purchased.