Build Your Own Drone for 150 Yuan! Open Source Drone Firmware Using ESP32 Chip and Smartphone Control

Would you like to assemble a mini drone that can fly stably and be controlled by a smartphone using an ESP32 development board and a few expansion modules? Recently, Espressif has brought an exciting project called esp-drone! This is an open-source drone firmware based on ESP32/ESP32-S2/ESP32-S3.

Build Your Own Drone for 150 Yuan! Open Source Drone Firmware Using ESP32 Chip and Smartphone Control

Ultra-Simplified Hardware Composition

Build Your Own Drone for 150 Yuan! Open Source Drone Firmware Using ESP32 Chip and Smartphone ControlBuild Your Own Drone for 150 Yuan! Open Source Drone Firmware Using ESP32 Chip and Smartphone Control

ESP-Drone uses a modular design approach, consisting of a main control board and an expansion board, with a cost of approximately 150 Yuan, where the electronic speed controller (ESC) accounts for a significant portion of the cost.

Main Control Board: Equipped with an ESP32-S2 module and necessary sensors for basic flight, providing hardware expansion interfaces.

Expansion Board: Equipped with additional sensors, can connect to the main control board’s hardware expansion interfaces, supporting advanced flight functions.

Comparison with Traditional Solutions

Core Advantage: Using Espressif’s mature ESP32 chip and open-source ecosystem,

turning “building a drone” from a “professional barrier” into a “DIY project that everyone can try.”

Build Your Own Drone for 150 Yuan! Open Source Drone Firmware Using ESP32 Chip and Smartphone ControlBuild Your Own Drone for 150 Yuan! Open Source Drone Firmware Using ESP32 Chip and Smartphone Control

Hardware + Software

Hardware:

The hardware solution of esp-drone is very flexible, with the basic version requiring only an ESP32 development board and motors/ESC.

IMU Sensor: Measures acceleration/gyroscope (for stable flight)

Barometer: Measures altitude (for altitude hold mode)

Optical Flow Sensor: Position hold (hovering at a fixed coordinate)

Build Your Own Drone for 150 Yuan! Open Source Drone Firmware Using ESP32 Chip and Smartphone ControlBuild Your Own Drone for 150 Yuan! Open Source Drone Firmware Using ESP32 Chip and Smartphone Control

Software:

The esp-drone software is based on Espressif’s official ESP-IDF framework (recommended version 5.0), with a clear code structure that includes:

Flight Control Core: Ported from the classic open-source drone project Crazyflie, supporting algorithms for stabilize mode, altitude hold, etc.;

Communication Protocol: Supports Wi-Fi direct connection to a mobile app or communication with game controllers via ESP-NOW;

Mobile App: Open-source for both iOS/Android platforms, can control flight and view sensor data (search GitHub for `ESP-Drone-iOS`/`ESP-Drone-Android`).

Build Your Own Drone for 150 Yuan! Open Source Drone Firmware Using ESP32 Chip and Smartphone Control

Flight Control Function Testing

Function 1: Stabilize Mode

This is the basic mode, where the flight control adjusts the motor speed based on IMU data to maintain the drone’s balance. Testing results:

– Gently push the throttle (up on the app’s virtual joystick), the drone will ascend steadily;

– Tilt the joystick left/right or forward/backward, the drone will slowly turn or translate;

– Release the joystick, the drone will automatically adjust to a level state (will not “crash”).

Function 2: Height-hold Mode

Requires a barometer! Once activated, the flight control will lock the current height based on pressure data. Testing results:

– After ascending to 1 meter and releasing the throttle, the drone hovers (height fluctuation <10cm);

– Manually pushing down on the drone (simulating external force), the flight control will automatically accelerate the motors to restore the original height.

Function 3: Mobile App Control

The app interface includes:

Virtual joystick: Controls flight direction and throttle;

Data panel: Displays height, angular velocity, and battery level in real-time;

Mode switching: Stabilize mode → Height hold → Position hold (requires optical flow/GPS).

These Scenarios Are Not Suitable

Professional aerial photography: The ESP32’s computing power is limited, unable to support 4K video transmission or complex obstacle avoidance;

Long flight time requirements: A 300mAh battery can only fly for 3-5 minutes (requires a larger battery, but will increase weight);

Harsh environments: No waterproof/dustproof design, not suitable for outdoor heavy rain/dusty conditions.

How to Obtain

Source code and documentation

GitHub repository: espressif/esp-drone (includes flight control code);

https://github.com/espressif/esp-drone

Hardware schematic: Located in the `hardware` folder of the repository (includes expansion board design).

Final Words

The significance of esp-drone lies not only in “building a drone with ESP32” but also in moving “flight control development” from the “laboratory” to the “desktop”—with a development board, a few sensors, and a few lines of code, you can personally touch the core principles of drones.

Click the blue text

Follow us

▼▼▼

This tutorial ends here. If it was useful to you, please give it a thumbs up.

For more information on Home Assistant low-cost modifications, hardware DIY and software tutorials, feel free to follow our public account.

Previous highlights: Your Wi-Fi channels are all occupied!! Build a low-cost Wi-Fi sniffer with ESP32, a hacker-level network monitoring tool!

Build a low-cost smart security camera with ESP32-CAM

Transform a 45 Yuan bathroom heater controller! Remote control in the scorching summer! Start from scratch to integrate the heater into Home Assistant using ESP modules.

Tired of the ordinary Home Assistant interface? A beginner gives Home Assistant an iOS advanced interface!

Leave a Comment