- Notifications
You must be signed in to change notification settings - Fork89
Making an ESP32-based quadcopter from scratch
okalachev/flix
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
Flix (flight + X) — making an open source ESP32-based quadcopter from scratch.
Version 1.1 (3D-printed frame) | Version 0 |
![]() | ![]() |
- Dedicated for education and research.
- Made from general-purpose components.
- Simple and clean source code in Arduino.
- Control using remote control or smartphone.
- Precise simulation with Gazebo.
- Wi-Fi and MAVLink support.
- Wireless command line interface and analyzing.
- Textbook on flight control theory and practice (in development).
- Position control (using external camera) and autonomous flights¹.
¹ — planned.
See detailed demo video:https://youtu.be/hT46CZ1CgC4.
Version 0 demo video:https://youtu.be/8GzzIQ3C6DQ.
See theuser builds gallery.
The simulator is implemented using Gazebo and runs the original Arduino code:
- Assembly instructions.
- Building and running the code.
- Troubleshooting.
- Firmware architecture overview.
- Log analysis.
- User builds gallery.
Type | Part | Image | Quantity |
---|---|---|---|
Microcontroller board | ESP32 Mini | ![]() | 1 |
IMU (and barometer²) board | GY‑91, MPU-9265 (or other MPU‑9250/MPU‑6500 board) ICM‑20948³ GY-521 (MPU-6050)³⁻¹ | ![]() ![]() ![]() | 1 |
(Recommended) Buck-boost converter | To be determined, output 5V or 3.3V, seeuser-contributed schematics | ![]() | 1 |
Motor | 8520 3.7V brushed motor (shaft 0.8mm). Motor with exact 3.7V voltage is needed, not ranged working voltage (3.7V — 6V). | ![]() | 4 |
Propeller | Hubsan 55 mm | ![]() | 4 |
MOSFET (transistor) | 100N03A oranalog | ![]() | 4 |
Pull-down resistor | 10 kΩ | ![]() | 4 |
3.7V Li-Po battery | LW 952540 (or any compatible by the size) | ![]() | 1 |
Battery connector cable | MX2.0 2P female | ![]() | 1 |
Li-Po Battery charger | Any | ![]() | 1 |
Screws for IMU board mounting | M3x5 | ![]() | 2 |
Screws for frame assembly | M1.4x5 | ![]() | 4 |
Frame main part | 3D printed⁴:flix-frame-1.1.stl flix-frame-1.1.step Recommended settings: layer 0.2 mm, line 0.4 mm, infill 100%. | ![]() | 1 |
Frame top part | 3D printed:esp32-holder.stl esp32-holder.step | ![]() | 1 |
Washer for IMU board mounting | 3D printed:washer-m3.stl washer-m3.step | ![]() | 2 |
RC transmitter (optional) | KINGKONG TINY X8 (warning: lacks USB support) or other⁵ | ![]() | 1 |
RC receiver (optional) | DF500 or other⁵ | ![]() | 1 |
Wires | 28 AWG recommended | ![]() | |
Tape, double-sided tape |
² — barometer is not used for now.
³ — changeMPU9250
toICM20948
inimu.ino
file if using ICM-20948 board.
³⁻¹ — MPU-6050 supports I²C interface only (not recommended). To use it change IMU declaration toMPU6050 IMU(Wire)
.
⁴ — this frame is optimized for GY-91 board, if using other, the board mount holes positions should be modified.
⁵ — you may use any transmitter-receiver pair with SBUS interface.
Tools required for assembly:
- 3D printer.
- Soldering iron.
- Solder wire (with flux).
- Screwdrivers.
- Multimeter.
Feel free to modify the design and or code, and create your own improved versions of Flix! Send your results to theofficial Telegram chat, or directly to the author (E-mail,Telegram).
Motor connection scheme:
You can see a user-contributedvariant of complete circuit diagram of the drone.
Seeassembly guide for instructions on assembling the drone.
Power ESP32 Mini with Li-Po battery using VCC (+) and GND (-) pins.
Connect the IMU board to the ESP32 Mini using VSPI, power it using 3.3V and GND pins:
IMU pin ESP32 pin GND GND 3.3V 3.3V SCL(SCK) SVP (GPIO18) SDA(MOSI) GPIO23 SAO(MISO) GPIO19 NCS GPIO5 Solder pull-down resistors to the MOSFETs.
Connect the motors to the ESP32 Mini using MOSFETs, by following scheme:
Motor Position Direction Wires GPIO Motor 0 Rear left Counter-clockwise Black & White GPIO12 (TDI) Motor 1 Rear right Clockwise Blue & Red GPIO13 (TCK) Motor 2 Front right Counter-clockwise Black & White GPIO14 (TMS) Motor 3 Front left Clockwise Blue & Red GPIO15 (TD0) Counter-clockwise motors have black and white wires and clockwise motors have blue and red wires.
Optionally connect the RC receiver to the ESP32's UART2:
Receiver pin ESP32 pin GND GND VIN VCC (or 3.3V depending on the receiver) Signal (TX) GPIO4⁶
⁶ — UART2 RX pin waschanged to GPIO4 in Arduino ESP32 core 3.0.
Default IMU orientation in the code isLFD (Left-Forward-Down):
In case of using other IMU orientation, modify therotateIMU
function in theimu.ino
file.
SeeFlixPeriph documentation to learn axis orientation of other IMU boards.
Subscribe to the Telegram channel on developing the drone and the flight controller (in Russian):https://t.me/opensourcequadcopter.
Join the official Telegram chat:https://t.me/opensourcequadcopterchat.
Detailed article on Habr.com about the development of the drone (in Russian):https://habr.com/ru/articles/814127/.
See the information on the obsolete version 0 in thecorresponding article.
This is a fun DIY project, and I hope you find it interesting and useful. However, it's not easy to assemble and set up, and it's provided "as is" without any warranties. There’s no guarantee that it will work perfectly — or even work at all.
About
Making an ESP32-based quadcopter from scratch
Topics
Resources
Uh oh!
There was an error while loading.Please reload this page.