Customizable Flight Controller for RC planes and gliders

Today I will show you how to build your own flight controller for RC planes and gliders.
You might ask, "Why?" – well, it’s simple. With your own flight controller, you can create whatever functionality you want. And for a basic flight controller, you don’t even need to write any code.
As the communication protocol between the remote control and the aircraft, we’ll use ELRS – an open-source protocol supported by many RC electronics brands like RadioMaster.
This guide is part of a series about building an RC glider with GPS and FPV.
What We’ll Use
- RadioMaster Pocket – ELRS transmitter.
- ELRS receiver – to forward messages from the RadioMaster Pocket to the flight controller and to power all servos. You can use any ELRS receiver with UART.
- ESP32-S3-based development board – I’ll use the T-SIM7080G S3, which includes a card reader, GPS, and even an LTE modem. This board also has built-in battery management, so you can power it with an additional battery. The downside, as with most development boards, is the size – it’s a bit large and heavy, suitable for planes and gliders with 1m+ wingspan.
- ESC with built-in BEC – this controls a BLDC motor and steps down voltage from the battery to 5V.
- GY-87 module – includes gyroscope, magnetometer, and barometer sensors.
- MadFlight firmware – a flight controller firmware without a user interface (UI); you configure it using a configuration file. It’s Arduino-based, so it can be easily uploaded to an ESP32-S3 board without complex installations.
The total cost of this setup is around $50–$60 (excluding the remote controller), which is a great price for a flight controller with GPS, barometer, and receiver.
Prepare the Receiver
You can use any ELRS receiver with PWM and UART or just UART. We won’t use the PWM outputs, but we will use UART to forward messages from the transmitter to the flight controller and to send messages back from the flight controller to the transmitter.
Power and test a receiver
- Connect 5V and GND on the receiver with a voltage step-down module. I’ll use an ESC with a built-in voltage regulator to drop down battery voltage to 5V. Most receivers operate on 5V and don’t have built-in regulators (only LDO to dropdown from 5V to 3.3V required for MCU on a receiver), so it’s best to supply them with a clean 5V source.
- Once connected, power your step-down module or ESC and check everything works.
- To test, connect a servo motor to channel 1 (or any other channel) and try to control it from your remote controller.
- If everything works, proceed to connect the receiver to the ESP32-S3 board.
Prepare the ESP32-S3 Board
As mentioned, I’ll use the Lilygo T-SIM7080G board (with GPS, LTE, battery management, memory card reader). However, you can use any other ESP32-S3 board. Just make sure to connect GPS, memory card reader, and LTE modules if you need those features.
ESP32-S3 Connections
- Use any available GPIOs, but update the GPIO numbers in the configuration file (explained in the "Upload Firmware" section).
- Connect servo motor data lines to GPIO pins on the board (e.g., GPIO …). You can control as many servos as you have GPIOs and your step-down module or ESC can supply enough current.
- Connect the GY-87 module using I2C.
- Connect PWM input from the BLDC/DC motor ESC to a GPIO on the ESP32-S3 (e.g., GPIO …).
- Connect vsys (5V) on the ESP32-S3 to the 5V input on the receiver.
- Ensure TX and RX on the receiver are connected to GPIOs on the ESP32-S3.
Upload the Firmware
The final step is uploading the firmware. This may seem complicated at first, but it’s almost as easy as syncing files to an iPhone using iTunes back in the day.
- Install the Arduino IDE and ESP tools. (Check this guide for detailed steps.)
- Download the MadFlight project from GitHub:
https://github.com/qqqlab/madflight/archive/refs/heads/main.zip - Open Examples → 03.Plane.ino in Arduino IDE.
- Update the
madflight_config.h
file with your chosen GPIO pins. - Upload the firmware to the ESP32-S3 board.
- Power your plane with a battery and check that everything works as expected.
- Do a test flight with a test plane or glider.
That's it for today. In the next part we will check how to track live GPS coordinates. Feel free to contact us at hey@tinkerflight.com in case any questions.