A tiny DIY quadcopter built around an ESP32, brushed coreless motors, and a hand-written flight controller.
The project is split in two firmware images, both built with ESP-IDF:
firmware/drone: runs on the drone (IMU, PID stabilisation, motor PWM)firmware/controller: runs on the handheld remote (joystick via ADC)
Warning
Testing phase. This project is under active development. Expect bugs and breaking changes, and always test with the propellers removed until you trust the flight controller.
Drone/
├── firmware/
│ ├── components/ # Shared code between drone and controller
│ ├── controller/ # Remote control firmware
│ │ └── main/ # adc, joystick, main
│ ├── drone/ # Drone firmware
│ │ └── main/ # i2c, ledc, motors, mpu, pid, main
│ └── settings.h # Settings shared by both firmwares
├── schematics/ # Wiring and PCB files
├── LICENSE
└── README.md
Software:
- Linux or macOS (Windows works too, but the commands below are for a Unix shell)
- ESP-IDF v5.x
Hardware:
- An ESP32 dev board for the drone and one for the controller
- A USB cable that carries data (not charge-only)
- 4 Motors
- 4 Mosfets
- 4 joysticks
- MPU
- Battery
What i used:
- ESP32 C3 pro mini for the drone
- ESP32 S3 for the controller
- 8520 Motors x4
- 55mm propelers x4
- AO3400 Mosfets x4
- 6500 MPU x1
- Joysticks x2
- Battery
Install ESP-IDF by following the official guide, and select the ESP32 target when it asks for one: https://docs.espressif.com/projects/esp-idf/en/stable/esp32/get-started/index.html#installation
Important: you must load the ESP-IDF environment in every new terminal before using
idf.py. If you skip this,idf.pywill not be found.
git clone https://github.com/NasriAnis/Drone Drone
cd DroneGo into the drone project:
cd firmware/droneSet the chip target. This only needs to be done once per project (it resets build/ and regenerates the config):
idf.py set-target <your-dev-board>Build flash and monitor for errors:
idf.py build flash monitor -p <esp-port>To leave the monitor, press Ctrl+] then disconnect the device.
Do the same steps for the firmware/controller folder.
Shared values (pins, PID gains, limits, communication parameters) live in firmware/settings.h. After editing it, rebuild both firmwares and flash them again so they stay in sync.
To get proper completion and diagnostics, point clangd at the generated compile_commands.json. After a build, link it to the repo root:
ln -sf firmware/drone/build/compile_commands.json compile_commands.jsonSee LICENSE.