Tricopter Drone
A Real-Time Flight Control System for a Tricopter.
Author: Codita Andrei
GitHub Project Link: https://github.com/UPB-PMRust-Students/fils-project-2026-andreicodita
Description
A Real-Time Flight Control System written in Rust for a drone of type "Tricopter" build on a STM32U545RE-Q that reads data from multiple sensors such as: BMP280 for athmospheric pressure, CM-20948 as an inertial measurement unit. For communication through Wi-Fi/Bluetooth an ESP32-C3 FH4 super mini will be used. The ESP32 will receive the movement desired for the tricopter and will pass it to the Nucleo. A metal-gear servo is used to control the tilt of the rear motor and stabilize the drone. The frame is custom made from readily available materials.
Motivation
I always liked drones, wanted to build one but the classic quadcopter felt a bit too common. I chose the tricopter because of the way it achieves the yaw control, through a servo, by tilting the rear motor instead of relying on differential thrust as quadcopters do. I also wanted a challenge for the hardware part, building it from scratch.
Architecture
Block Diagram
[POWER SECTION] [CONTROL SECTION]
+-----------------------+ +-----------------------+
| 11.1V LiPo Battery | | HOST PC |
| 2200mAh 30C (3S) | | (Debugging) |
+-----------+-----------+ +-----------+-----------+
| ^
| (Raw Power) [USB]
v |
+-------------------+ v
| Matek Mini PDB | +----------------------------+
| (12V / 5V Regs) | | NUCLEO STM32U545RE-Q |
+---+-------+-------+ +---------->| (Main Microcontroller) |
| | | +---+--------+--------+------+
| | [5V REG] | | | |
| +-----------+ | [I2C] [SPI]
| | | |
| [12V] | v v
| | +-------+ +---------+
v | |BMP280 | |ICM-20948|
+--------------+ | +-------+ +---------+
| 3x ESC 30A |<-------- [PWM SIGNALS] ---+
| (w/ BEC) | | +---------------+
+---+---+------+ | | ESP32-C3 FH4 |
| | +<-->| (Wi-Fi/UART) |
| | [3-WIRE PHASE] | +---------------+
| v |
| +--------------+ | +---------------+
| | 3x BRUSHLESS | | | HC-SR04 |
| |1000kV MOTORS | +--- | (Trig/Echo) |
| +--------------+ | +---------------+
| |
| [5V BEC Out] | +---------------+
| (Servo Power) +--- |Buzzer Modules |
v | | (GPIO) |
+--------------+ | +---------------+
| S007 Servo |<-------- [PWM SIGNAL]-----+
+--------------+
Pin Mapping
+-----------------------+ +----------------------------+
| 11.1V LiPo Battery | VBAT | Matek Mini PDB |
| 2200mAh 30C (3S) +--------->| High Current Input |
+-----------------------+ +----------------------------+
+-----------------------+ +----------------------------+
| Matek Mini PDB | 5V Reg | NUCLEO-U545RE-Q |
| (Power Distribution) +--------->| 5V/GND Pins |
+-----------+-----------+ +----------------------------+
|
| 12V / VBAT Out / GND +----------------------------+
+--------------------->| 3x ESC 30A |
| (Motor Controllers) |
+-------------+--------------+
|
v
3x Brushless Motors
+-----------------------+ +----------------------------+
| 3x ESC 30A | PWM1 <--+ PA1 - Timer PWM Output |
| (Signal Controllers) | PWM2 <--+ PB5 - Timer PWM Output |
| | PWM3 <--+ PA6 - Timer PWM Output |
+-----------------------+ +----------------------------+
+-----------------------+ +----------------------------+
| S007 Servo | PWM <--+ PA0 - Timer PWM Output |
| (Tilt/Yaw) | 5V <--+ ESC 5V BEC (Power) |
+-----------------------+ +----------------------------+
+-----------------------+ +----------------------------+
| ICM-20948 | SCK <--+ pin TBD |
| (9-Axis IMU) | MOSI <--+ pin TBD |
| | MISO -->+ pin TBD |
| | CS <--+ pin TBD |
+-----------------------+ +----------------------------+
+-----------------------+ +----------------------------+
| BMP280 | SCL <---+ pin TBD |
| (Barometer) | SDA <-->+ pin TBD |
+-----------------------+ +----------------------------+
+-----------------------+ +----------------------------+
| ESP32-C3 FH4 | TX -->+ pin TBD |
| (Wi-Fi/BT) | RX <--+ pin TBD |
+-----------------------+ +----------------------------+
+-----------------------+ +----------------------------+
| HC-SR04 | Trig <--+ pin TBD |
| (Ultrasonic) | Echo -->+ pin TBD |
+-----------------------+ +----------------------------+
+-----------------------+ +----------------------------+
| Buzzer Modules | SIG <--+ pin TBD |
| | | |
+-----------------------+ +----------------------------+
Log
Week 4-5
I documented about the hardware and software part of the project, chose the components and ordered them.
Week 6-7
Took measurements of the hardware, builded the frame from scratch and soldered all the wires I needed, the sensors, voltage dividers.
Week 8
Connected the motors, servo, sensors to the STM32 to check they are working as intended.
Hardware
The main component is the Nucleo STM32U545RE-Q board that acts as the flight controller with data based from: BMP280 - measures the air pressure and determines how high is it, CM-20948 9 axis to get the acceleration, gyroscope and compass data, HC-SR04 to measure distance at low altitudes. ESP32-C3 FH4 super mini handles the Wi-Fi and Bluetooth connectivity in order to control the drone remotely. Three 30Amps ESCs to control each 2212 1000kV brushless motor. All of them are powered from a 2200mAh 11.1V 30C battery through a Matek Mini Power Hub and a voltage divider is put at the exit of the power distribution board to measure the voltage that comes out of the battery. Two passive buzzers are used to alert when battery is below a certain limit.
Photos

Schematics
Place your KiCAD or similar schematics here in SVG format.
Bill of Materials
| Device | Usage | Price |
|---|---|---|
| STM32U545RE-Q | The main microcontroller used | 106.59 RON |
| ESP32-C3 FH4 super mini | Wi-Fi/Bluetooth communication module | 26.03 RON |
| BMP280 | Atmospheric pressure sensing | 7.54 RON |
| CM-20948 9 axis | Inertial measurement unit (IMU) | 36.72 RON |
| 3 * Brushless motors A2212/13T 1000KV | Propulsion motors | 149.8 RON |
| Matek Mini Power Hub PDB | Power distribution board | 32.57 RON |
| DSPOWER S007M Mini Servo | Tilts rear motor for stabilization/yaw control | 67.85 RON |
| 3 * 1045 Gemfan Propellers ABS | Propellers | 26.91 RON |
| 2 * XT60 connectors | Power connectors | 15.74 RON |
| 3 * ESC 30A | Electronic speed controllers | 138.24 RON |
| LiPo Battery 11.1V - 30C 3S1P | Powering the hardware | 100 RON |
| HC-SR04 Sensor | Ultrasonic sensor to measure distance | 6.73 RON |
| 2 * Passive Buzzer Module | Sounds for alerts such as low battery | 6.44 RON |
Software
| Library | Description | Usage |
|---|---|---|
| icm20948 | Driver for IMU | Decodes raw electrical signals |
| bmp280-rs | Barometer driver | Converts raw air pressure readings |
| pid | Loop Control | It calculates thrust to stabilize the drone |
| micromath | Advanced math library | Provides optimized math functions to calculate tilt and orientation |
| ahrs | Sensor data fusion | Combines Accelerometer, Gyro and Magnetometer data filtering out noise |
| cortex-m | Cortex low-level support | Low-level CPU features on the STM32U545RE-Q |
| cortex-m-rt | Cortex-M runtime | Startup/interrupt |
| defmt | Logging framwork | Structured logging from firmware |
| defmt-rtt | RTT logging transport | Sends defmt logs via RTT |
| panic-probe | Panic handler | Printing panic info |
| embedded-hal | Hardware abstraction | Standard traits used by drivers |
| embassy-executor | Async task executor | Run async tasks |
| embassy-time | Timers and delays | Timeouts, delays |
| embassy-sync | Async synchronization | Channels to pass sensor data safely |
| embassy-stm32 | STM32 Hal | Hardware control |
| embassy-embedded-hal | Embassy enbedded-hal adapters | Lets embedded-hal based drivers work with Embassy objects |