Parts
This is the list of what goes into the drone. Some parts have purchase links, which are affiliate links: if you buy through them, I earn a commission and you pay the same price. Listings change, so check the specs before you buy.
The values are the ones I used, as a reference: you can use equivalents, and a lot of this can come from scrap, like motherboards, PC power supplies and old toys. Where there are alternatives, they are listed with the part.
Board and sensor
- ESP32-C3-Zero
Runs the flight control and creates the Wi-Fi network. Waveshare or another board with the same pinout.
The AliExpress listing also sells the S3-Zero, which won't work here. Pick the C3-Zero option.
1× - MPU6050
GY-521 module. Measures tilt and rotation. Some modules sold under this name carry another chip from the same family; the firmware recognizes the most common ones.
1×
Motors and propellers
- Kit with 4 brushed 716 motors, 3.7 V, and 4 propellers
One kit is enough: it comes with the motors and the propellers. Check the propeller size: this tutorial uses 55 mm, 2 CW and 2 CCW.
1×
Battery and charging
- LiPo battery, 1S, 3.7 V, 1000 mAh
I used a 102050. Check the discharge rate (C), not just the capacity: the four motors together can draw more than 4 A, so a 1000 mAh battery needs at least 4C.
Alternatives: another single-cell (1S) LiPo with similar capacity and enough discharge. Old drones and toys often have one.
Don't use a swollen or dented battery, or one below 3 V.
1× - TP4056 charger module with protection
Charges the battery through the ESP32's USB and powers the ESP32 in flight. The module's USB-C connector is removed. On AliExpress, pick the quantity: one unit is enough.
These modules usually charge at about 1 A, or 1C on this 1000 mAh battery. With a smaller battery, check its charge limit. Don't leave it charging unattended, and don't wire the motors to the OUT pins: the protection can cut the power mid-flight.
1× - 1N5817 Schottky diode
Connects the TP4056's OUT+ to the ESP32's 5V pin. Keeps the 5 V from USB from flowing straight back into the battery.
Alternatives: a Schottky rated 1 A or more, such as 1N5819 or SS14.
1× - SS12D10 slide switch
Sits between the TP4056's OUT+ and the 1N5817. Turns the ESP32 on and off when USB is unplugged.
Alternatives: any small switch rated 500 mA or more.
1×
Motor circuit
One set per motor.
- 9T16GH N-channel MOSFET
Switches the motor on and off with the GPIO's 3.3 V.
Alternatives: an N-channel MOSFET that fully turns on with 3.3 V on the Gate, rated 20 V or more and 2.5 A or more, such as AO3400A, SI2302, IRLML2502 or IRLML6344. PC motherboards often have parts like these.
IRF520, IRFZ44 and other common MOSFETs won't work: they need much more than the GPIO's 3.3 V on the Gate.
4× - FR102 fast diode (1 A, 100 V)
Absorbs the voltage spike the motor creates when it switches off.
Alternatives: a fast or Schottky diode rated 1 A or more and 20 V or more, such as SS34, SS24, 1N5819 or 1N5822. A regular diode like the 1N4007 is too slow for this job.
4× - 1 kΩ resistor
Between the GPIO and the Gate; limits the current.
Alternatives: 100 Ω to 1 kΩ.
On AliExpress, the listing is the same as for the 10 kΩ resistor: pick the 1 kΩ value when you buy.
4× - 10 kΩ resistor
Between the Gate and the Source; keeps the motor off while the ESP32 boots.
Alternatives: 10 kΩ to 47 kΩ.
On AliExpress, the listing is the same as for the 1 kΩ resistor: pick the 10 kΩ value when you buy.
4× - 100 nF ceramic capacitor
Marked 104. Goes between the Drain and B−. It has no polarity.
Alternatives: ceramic, 47 nF to 220 nF.
4×
Recommended for flying
You can bench-test without it. In flight, it makes a difference.
- 470 µF low-ESR electrolytic capacitor
Not shown in the diagram. Wired between B+ and B−, close to the MOSFETs, it reduces the voltage drop when the motors speed up.
Alternatives: 330 µF to 1000 µF, rated 6.3 V or more. PC motherboards and power supplies often have low-ESR capacitors.
1×
You'll also need a soldering iron, a multimeter with a continuity test, a USB-C cable and wire. The frame has to be light and stiff, X-shaped, with the four motors aligned.
Wiring diagram
This is the complete wiring drawing. The steps below go through each part, and the circuit marked 4X repeats for each motor.
Step 1
Build each motor channel
Each motor has its own circuit, repeated four times. The ESP32 only drives the MOSFET Gate; the motor current comes straight from the battery. Never connect a motor directly to a GPIO.
- Motor: + terminal to battery positive, − terminal to the Drain.
- 9T16GH: Source to battery negative, at the TP4056 B−. All four Sources share this point.
- Gate: 1 kΩ resistor to the GPIO and 10 kΩ resistor to the Source.
- FR102: striped end to the motor +, plain end to the Drain.
- 100 nF: between the Drain and B−.
Danger
On the 9T16GH, with the text facing up and the legs pointing down, the order is Gate, Drain, Source. With another MOSFET, check the datasheet before soldering: don't go by the package shape alone.
Step 2
Place the motors and propellers
The reference is the ESP32's USB connector: it points to the rear. Matching propellers always sit on the diagonal.
| Motor | Position | Rotation | Prop | GPIO |
|---|---|---|---|---|
| M1 | Front left | Clockwise | A | 3 |
| M2 | Front right | Counter-clockwise | B | 2 |
| M3 | Rear left | Counter-clockwise | B | 20 |
| M4 | Rear right | Clockwise | A | 4 |
- If a motor spins the wrong way, swap its two wires.
- The A and B letters vary from brand to brand. What matters is the blade pitch: every propeller has to push air down.
- Leave the propellers off for now. They only go on in step 8.
Step 3
Wire the ESP32 and the MPU6050
| ESP32-C3-Zero | Connects to |
|---|---|
GPIO3 | 1 kΩ → M1 Gate |
GPIO2 | 1 kΩ → M2 Gate |
GPIO20 | 1 kΩ → M3 Gate |
GPIO4 | 1 kΩ → M4 Gate |
GPIO6 | MPU6050 SDA |
GPIO7 | MPU6050 SCL |
3V3 | MPU6050 VCC |
5V | TP4056 IN+ and, through the 1N5817, TP4056 OUT+ |
GND | MPU6050 GND and AD0, TP4056 OUT− and IN− |
- GPIO2 also takes part in the ESP32-C3 boot, so its 10 kΩ resistor is required.
- GPIO20 is the UART RX. To flash and read logs, use the board's USB.
- Mount the MPU with the chip facing up and the row of pins facing forward. The firmware expects this orientation.
- Stick the MPU down with firm foam tape, near the center and away from the motors. Mine sat on the nose, and the vibration distorted the readings in flight.
Step 4
Set up the power
The ESP32's USB does both jobs: when it's plugged in, it powers the ESP32 and charges the battery through the TP4056. Without it, the battery powers the ESP32 through the 1N5817. That's why you remove the TP4056's USB-C connector before wiring it.
| From | To |
|---|---|
| Battery + | TP4056 B+ and the + of all four motors |
| Battery − | TP4056 B− and the MOSFET Sources |
| ESP32 5V pin | TP4056 IN+ |
| TP4056 OUT+ | Switch, then the 1N5817 to the ESP32 5V pin, with the stripe on the ESP32 side |
| ESP32 GND | TP4056 OUT− and IN− |
Danger
The diode drops about 0.3 V, and the 5V pin is specified from 3.7 V, so charge the battery before flying. The motors run straight from the battery, and the module doesn't protect it from over-discharge: land when the power starts to fade. Use short, thick wires from the battery to the MOSFETs.
The switch only cuts the battery's power to the ESP32. The motors stay connected to the battery, but they don't spin without a command, and USB charging works with the switch off. To work on the circuit, unplug the battery.
Step 5
Check everything with the multimeter
With the battery unplugged and the multimeter on continuity, confirm that:
- there's no short between battery + and −;
- every Source is connected to B−;
- every FR102 stripe faces battery +;
- the 1N5817 stripe is on the ESP32 5V pin side;
- the switch is on the wire coming out of OUT+, before the 1N5817;
- if you use the 470 µF capacitor, its + and − are the right way round;
- no Gate is floating or wired straight to the battery.
Step 6
Flash the firmware
- In the Arduino IDE, install the esp32 by Espressif Systems package, version 3.x.
- In the Library Manager, install ESP Async WebServer 3.12.1 and Async TCP 3.5.0, both by ESP32Async. Watch out for old forks with similar names.
- Extract the zip and open
DroneFlight/DroneFlight.ino.Config.h,FlightLink.handbuild_opt.hmust stay in the same folder;Config.hopens as a tab next to the sketch. - In the
Config.htab, section 1, change the drone network password inAP_PASSWORD, with at least 8 characters. The network ships as Drone-C3-Voo with the passworddrone123, which is printed in this tutorial, so anyone can know it. - Select an ESP32-C3 board, enable USB CDC On Boot and pick the USB port.
- Upload. If it doesn't start, hold BOOT, press RESET and release BOOT.
- Keep the drone level and still when it powers up: the initial calibration takes about 4 seconds.
Everything you can tune lives in Config.h, with a comment explaining each value: network, pins, safety limits, control gains and the sensor. You don't need to touch DroneFlight.ino. If a value doesn't add up, like fewer than four motor pins, the sketch refuses to compile and says why.
The firmware in the zip ships with PRE_FLIGHT_MODE = true, which limits the throttle to 25% and each motor to 35%. Keep this lock on until step 8.
Step 7
Test without propellers
This test uses the flight firmware itself, still with the pre-flight lock on.
The control page is in Portuguese. These are the labels you will use:
| On screen | Meaning |
|---|---|
| SOCKET AO VIVO | Live connection with the drone |
| ARMAR | Arm |
| PARAR E DESARMAR | Stop and disarm (emergency stop) |
| CALIBRAR NÍVEL | Calibrate level |
| Aceleração | Throttle |
| Direção | Direction stick (pitch and roll) |
| Girar à esquerda / à direita | Yaw left / right |
| Giro Z | Yaw rate |
| Máximo dos motores | Motor output limit |
| M1–M4 | Fine-tuning screen: per-motor trim and level trim |
| ZERAR TRIM / ZERAR TUDO | Reset trim / Reset everything |
| Tela cheia | Full screen |
- Connect your phone to the Drone-C3-Voo network, with the password you set, and open
http://192.168.4.1. Hold the phone sideways and wait for SOCKET AO VIVO. - Tilt the drone and check the signs: nose down gives a negative Pitch, right side down gives a positive Roll, and turning it clockwise, seen from above, gives a positive Giro Z.
- Tap ARMAR, set the throttle to 15–20% and move the drone by hand, checking the table below.
- Finish with PARAR E DESARMAR, always before touching the circuit.
| Movement | Motors that should speed up |
|---|---|
| Lower the right side | M2 and M4 |
| Lower the left side | M1 and M3 |
| Lower the nose | M1 and M2 |
| Lower the tail | M3 and M4 |
| Turn clockwise | M1 and M4 |
| Turn counter-clockwise | M2 and M3 |
Only move on if the motors react as in the table and the battery and MOSFETs stay cool. If a motor doesn't react, check its channel from step 1: the Gate resistor and solder joint, the MOSFET and the diode.
To follow a test with the drone plugged into the computer, open the Arduino IDE Serial Monitor at 115200: every second it shows the attitude, the motors, the commands received and the reason for any disarm.
Step 8
First flight
Danger
- In
Config.h, setPRE_FLIGHT_MODEtofalseand flash again. Set it back totruewhenever you change motors, propellers, pins or the MPU position. - Charge the battery and fit the propellers: M1 and M4 clockwise, M2 and M3 counter-clockwise.
- Unplug USB, keep the drone level and still, turn on the switch, connect the phone and set Máximo dos motores to 70%.
- Arm and raise the throttle until the drone gets light. Take off decisively, to 20 or 30 cm: scraping along the ground confuses the controller.
- Let go of the stick and watch for 5 to 10 seconds. A slow drift is normal: the MPU keeps the drone level, but it doesn't measure position.
- Land by bringing the throttle all the way down. If it tilts or oscillates hard, tap PARAR E DESARMAR.
After at least 2 seconds in the air, when you land by lowering the throttle, the firmware learns the drone's imbalance (center of mass off the middle, a weaker motor) and saves it to memory. The next flight starts already compensated, even after a power cycle. Stopping with the button mid-flight doesn't save it.
Fine-tuning on the M1–M4 screen
Tap M1–M4 at the top of the page to open the adjustments. Throttle, direction, ARMAR and the stop button keep working.

- Trim: if the drone drifts to one side on its own, correct it gradually, 0.5° per tap, up to 4°. Drifting forward, ▼; backward, ▲; right, ◀︎; left, ▶︎.
- M1 to M4: add or remove power on a single motor, 0.5% per tap, up to ±5%. Adjust in pairs: if the tail lifts first and the nose moves forward, +0.5% on M1 and M2; right side low, M2 and M4; left side low, M1 and M3.
- ZERAR TRIM clears the trim, and ZERAR TUDO clears the trim and the motors. The adjustments are saved in the phone's browser: on another phone, tune again.
Fine-tuning makes up for small differences. It won't fix a reversed propeller, a misaligned motor or heavy vibration.
The firmware also cuts the motors on its own in two cases: 3 seconds without commands from the phone, or a tilt above 45° for 100 ms (above 70°, immediately). The control gains were tuned for my drone, so yours may need different values.
Common problems
| Symptom | What to check |
|---|---|
| The page shows MPU OFF | Check VCC on 3V3, GND, SDA on GPIO6, SCL on GPIO7 and AD0 on GND. Then restart the board. |
| The MPU only comes back when I move the drone | A bad solder joint or loose wire on VCC, GND, SDA or SCL. |
| Always drifts the same way | Calibrate on a level surface, center the battery and use the trim on the M1–M4 screen, 0.5° per tap. |
| Turns the same way on takeoff | Propeller direction and motor positions. Redo the reaction table from step 7. |
| One motor always works harder than the others (see M1 to M4 on the page) | A weak propeller or motor in that corner. The compensation eats into the power headroom. |
| Wobbles slowly, about once per second | Raise RATE_P and RATE_D by 30%. They are in Config.h, section 4. |
| Fast shaking or buzzing | Lower RATE_P and RATE_D by 20%. |
To truly hold its position, the drone still needs to measure its own movement, with optical flow and distance to the ground. That's the natural next step for this project. I share the progress on TikTok.

