ESP32 Aviation Flight Recorder

Updated 30 November 2026

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.

Finished recorder

ESP32 aviation flight recorder in its black 3D printed enclosure with the OLED display lit

Module status

Front of the flight recorder with the OLED showing module status beside the start/stop pushbutton

The Story Behind It

What inspired me to build it?

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.

What roadblocks did I run into?

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.

What do I intend to do with the data?

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.

Prototype

Flight recorder prototype wired with jumper wires to a 6×AA battery pack

Bench testing

Flight recorder prototype powered up on a table during bench testing

How It Works

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.

Inside view

Inside the enclosure showing the ESP32 on its breakout board, sensors, GPS antenna and wiring

Fitted out

Inside the enclosure from the front with the GPS antenna, wiring and OLED display fitted

Main Recording Process

  1. The ESP32 starts and checks the connected modules.

  2. The BME280 performs its initial pressure calibration for approximately 10 seconds.

  3. The system establishes a reference atmospheric pressure for barometric altitude calculations.

  4. The OLED displays the status of the connected modules.

  5. Pressing the start/stop button starts recording.

  6. Sensor measurements are collected continuously while the recorder is operating.

  7. Recorded data is written to the microSD card at approximately 1 Hz.

  8. The display cycles through module status, recording status and flight data.

  9. Pressing the button again stops the recording.

  10. The completed CSV file remains on the SD card for later analysis.

Four OLED screens from the flight recorder: module status, altitude calibration, flight data and recording status

Display showing the recorder operating

Parts List

PartPurposeProduct Code
u-blox NEO-6M GPS modulePosition and GPS flight dataCE05949
MPU6050 moduleAcceleration and gyroscope measurements018-MPU-6050
microSD card moduleData storageCE09444
6×AA battery packPortable powerADA248
128×64 I2C OLED displayUser interface and system statusCE09226
ESP32 WROOM development boardMain microcontrollerSee note below
Breakout boardComponent mountingSee note below
BME280 modulePressure, temperature and barometric altitudeADA2652 (equivalent, see note below)
Jumper wires (F/F)Electrical connectionsCE05098
microSD cardStores CSV flight filesCE04628 (see note below)
Momentary pushbutton (IP67 Rated)Start/stop recordingCE07539

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)

  1. Freenove ESP32 Development Board ESP32 Kit

  2. Freenove Breakout Board for ESP32 ESP32-S3 Development Board Protoboard

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

Wiring / Pinout

The following pin assignment is the configuration used by the current flight recorder firmware.

OLED

PinESP32 connection
SDAGPIO 25
SCLGPIO 26
GNDGND
VCC3.3V

BME280

PinESP32 connection
SDAGPIO 21
SCLGPIO 22
CSB3.3V
SDOGND
GNDGND
VCC3.3V

MPU6050

PinESP32 connection
SDAGPIO 13
SCLGPIO 14
XDA-
XCL-
AD0-
INT-
GNDGND
VCC3.3V

GPS

PinESP32 connection
RXGPIO 16
TXGPIO 17
VCC3.3V
GNDGND

SD card

PinESP32 connection
SCKGPIO 18
MISOGPIO 19
MOSIGPIO 23
CSGPIO 32
GNDGND
3.3V3.3V

Start/Stop button

PinESP32 connection
SignalGPIO 27
SignalGND

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.


Firmware

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:

SettingValue
Sensor interval250 ms (4 Hz)
Recording interval1000 ms (1 Hz)
Health/status interval2000 ms
Screen interval3000 ms
Pushbutton debounce60 ms
BME280 calibration10 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

Software and Libraries

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.

Build Steps

  1. Prepare the ESP32, sensors, GPS, OLED, SD-card module, button, power source and jumper wires.

  2. Connect the OLED to its dedicated I2C pins.

  3. Connect the BME280 to its dedicated I2C pins.

  4. Connect the MPU6050 using the software-I2C pins defined by the firmware.

  5. Connect the NEO-6M GPS to the ESP32 serial pins.

  6. Connect the SD-card module to the ESP32 SPI pins.

  7. Connect the start/stop button to GPIO 27 and the appropriate ground/reference connection.

  8. Check every power, ground and signal connection before applying power.

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

  10. Insert a compatible microSD card into the SD-card module.

  11. Upload the flight recorder firmware using the Arduino IDE.

  12. Open the Serial Monitor at the baud rate specified by the firmware to check startup messages.

  13. Confirm that the display, sensors, GPS and SD card are detected.

  14. Allow the BME280 calibration process to complete.

  15. Press the button to begin recording and verify that data is being written to the SD card.

  16. Stop the recording and confirm that the CSV file has been saved.

  17. Transfer the CSV file to a computer for analysis.

Enclosure

Black 3D printed flight recorder enclosure with a vented lid

Cut-outs

Enclosure showing the cut-outs for the OLED display and the pushbutton

Base and lid

Empty 3D printed enclosure base beside its vented lid

Top view

Top view of the empty enclosure base and vented lid

Testing

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

Data Recorded

  • 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

A View of the Raw Data

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.

Spreadsheet of the first 50 seconds of recorded flight data from the CSV file

Flight Analysis

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.

The Data Viewer in Operation

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.

Flight analysis program overview with maximum altitude, speed, G-force, climb and descent statistics

Flight analysis graph of GPS and barometric altitude over time

Altitude

Flight analysis graph of GPS ground speed over time

Ground speed

Flight analysis graph of total G-force over time

G-force

Flight analysis graph of barometric vertical rate over time

Vertical rate

Flight analysis graph of temperature and pressure over time

Temperature and pressure

Flight analysis graph of GPS satellite count over time

GPS satellites

Flight analysis graphs of X and Y axis acceleration over time

Acceleration X and Y

Flight analysis graphs of Z axis acceleration and X axis gyroscope over time

Acceleration Z, gyroscope X

Flight analysis graphs of Y and Z axis gyroscope over time

Gyroscope Y and Z

Recorded flight path displayed in Google Earth

There is a link in my program that loads the flight data into a Google Earth program for another version of the map

Raw data view in the flight analysis program

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)


Recreating the Project

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.

Project Structure

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

Safety and Limitations

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.

Attribution

SourceUse in projectLink
Adafruit librariesUsed for interfacing with the SSD1306 OLED and BME280 sensor.https://github.com/adafruit
TinyGPSPlusUsed for parsing GPS data from the NEO-6M receiver.https://github.com/mikalhart/TinyGPSPlus
Arduino / ESP32 ecosystemProvides the development framework and board support used by the firmware.https://www.arduino.cc/
EspressifProvides the ESP32 hardware and software ecosystem.https://www.espressif.com/

Have a question? Ask the Author of this guide today!

Please enter minimum 20 characters

Your comment will be posted (automatically) on our Support Forum which is publicly accessible. Don't enter private information, such as your phone number.

Expect a quick reply during business hours, many of us check-in over the weekend as well.

Tags:
esp32 diy datalogger aviation

Comments


Loading...
Feedback

Please continue if you would like to leave feedback for any of these topics:

  • Website features/issues
  • Content errors/improvements
  • Missing products/categories
  • Product assignments to categories
  • Search results relevance

For all other inquiries (orders status, stock levels, etc), please contact our support team for quick assistance.

Note: click continue and a draft email will be opened to edit. If you don't have an email client on your device, then send a message via the chat icon on the bottom left of our website.

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