Skip to the content
2 layers43.6 × 43.6 mmEsp32 dron, the printed circuit board in 3D

PCB ESP32 quadcopter: KiCad hardware + Madgwick IMU firmware + WiFi web UI

Size
43.6 × 43.6 mm
Copper layers
2
Thickness
1.6 mm
Parts
75
Nets
92
Pads
256
Tracks, vias
665, 136
Pours
1
Routed
Yes
KiCad
KiCad 10.0 (file 20260206)
Created
22 Aug 2026
Updated
24 Oct 2026

Overview

Esp32 dron is an open-source printed circuit board by Sagaz0501, from the Sagaz0501/esp32-drone repository on GitHub, published under the MIT licence. It is a 2-layer board of 43.6 × 43.6 mm with 75 parts on 92 nets, routed with 665 tracks and 136 vias.

It is built around the ESP32-WROOM-32D-N4, FT231XQ-R and AMS1117-3.3, with the MBR0520L, MPU-6050 and CC0603KRX7R9BB104 among its other parts. Its parts include 28 resistors, 13 capacitors, 8 transistors, 7 diodes and 6 connectors. It belongs with the robots and motor control and radio and wireless boards and the ESP32 boards of this library.

Main components

12

README

README.md

ESP32 Drone

A micro-drone where the PCB is the frame: a small square with four arms, each carrying pads for a coreless brushed motor. I designed the whole thing end-to-end — schematic, PCB layout, fabrication files, my own flight controller firmware and a PC ground-station tool — as a deliberate jump from hardware QA into full-stack embedded development.

Built as a solo learning project. Hardware is adapted from the open-source drone_meishi business-card drone by FumiLab (@fumi_maker); all firmware and tools here are my own.

3D render of the drone PCB


Why this project

It touches the entire embedded stack in one build:

  • Electrical design — schematic capture in KiCad (ESP32 + IMU + motor drivers + USB-UART + power path)
  • PCB layout & DFM — the board doubles as the mechanical frame, ready for JLCPCB turnkey PCBA
  • Real-time firmware — a 500 Hz control loop in C on ESP-IDF/FreeRTOS: sensor fusion, cascaded PID, motor mixing, failsafes
  • Wireless control — a PS5 DualSense gamepad over Bluetooth Classic (Bluepad32 + BTstack)
  • Tooling — a Python/Qt ground station for live telemetry, PID tuning plots, IMU calibration and motor tests

Hardware

SchematicPCB (top)PCB (bottom)

Click the schematic for the full-resolution SVG.

BlockPartNotes
MCU + RadioESP32-WROOM-32DRuns the flight loop (core 1) and Bluetooth (core 0)
IMUMPU-60506-axis, I²C @ 400 kHz (addr 0x68)
Motors4× coreless brushedN-channel MOSFET (AO3400A) low-side + 1N4148W flyback, direct 20 kHz PWM — no ESCs
Power1S LiPo → AMS1117-3.3 LDOmotors run straight off +BATT
ProgrammingUSB-C → FT231XQ (USB-UART)auto-reset via 2× MMBT3904
Power pathAO3401A P-MOSFET + MBR0520 SchottkyUSB-or-battery selection

GPIO map (as built — verified on the real board)

"Front" = the side opposite the USB-C connector.

GPIOFunctionGPIOFunction
IO13Motor M1 — front-right (CCW prop)IO21I²C SDA (MPU-6050)
IO12Motor M2 — front-left (CW prop)IO22I²C SCL (MPU-6050)
IO14Motor M3 — rear-left (CCW prop)IO18LED1
IO15Motor M4 — rear-right (CW prop)IO19LED2
IO32LiPo ADC (10k/10k divider, ÷2)IO0 / ENBoot / Reset

⚠️ The pin map differs from the drone_meishi reference (which uses IO34 for the battery and a different PWM order). The table above matches this PCB.


Flight firmware — firmware/dron_fc/ (ESP-IDF, C)

The main firmware: written from scratch in plain C on ESP-IDF v5.5. Each module keeps its headers in include/ and its sources in src/.

text
main/
├── include/config.h     every pin, limit and default gain in one place
├── src/main.c           boot + the 500 Hz flight loop
├── bluetooth/           DualSense: connection, stick/button mapping, lightbar + rumble
├── sensors/             MPU-6050 driver (raw registers, no library) + battery ADC
├── estimation/          Madgwick quaternion filter → roll / pitch / yaw
├── control/             PID (D-on-measurement, filtered D, anti-windup),
│                        cascaded angle→rate controller, Quad-X mixer with desaturation
├── actuators/           LEDC PWM motors (20 kHz / 11-bit) + status LEDs
└── system/              flight state machine, failsafes, NVS settings,
                         live PID tuning, telemetry, serial commands from the PC

Control loop (every 2 ms): IMU → Madgwick → gamepad → failsafe + state machine → cascaded PID (ANGLE self-level by default, ACRO optional) → mixer → motors.

Safety: arming only with zero throttle, a level drone, a working IMU and a connected gamepad; motors cut on gamepad loss (>250 ms), IMU failure, or a crash/flip (>70° sustained); a dedicated KILL button; low/critical battery warnings.

PS5 DualSense controls

ControlActionControlAction
L2 (analog)ThrottleR2Arm
Left stick XYawR1Disarm
Right stickRoll / pitch✕KILL (always cuts motors)
D-padLive PID tuning (±10%)○Level calibration
OptionsSave PID to flash□Motor test mode
△ANGLE ↔ ACROCreateCSV telemetry on/off

Build & flash

Bluepad32 (with its BTstack submodule) lives outside the repo:

powershell
git clone --recurse-submodules https://github.com/ricardoquesada/bluepad32.git "$env:USERPROFILE\esp\bluepad32"
cd firmware/dron_fc
idf.py set-target esp32
idf.py -p COM7 flash monitor     # console runs at 921600 baud

See firmware/dron_fc/README.md for the bring-up phases (Bluetooth → IMU axes → motor test → first flight → PID tuning). That README is in Spanish.

Interesting bugs fixed along the way:

  • btstack_stdio_init() reconfigures the console UART on the 1 MHz REF_TICK clock for any baud ≤ 1 Mbaud, which can't produce 921600 → everything after Bluetooth init came out as garbage. Fixed by re-applying the UART config on the APB clock right after it.
  • The IMU mounting is handled with proper rotations only (never flipping a single axis), because a single-axis flip mirrors the frame and breaks the gyro (angular velocity is a pseudovector).

Ground station — tools/dron_monitor/ (Python + Qt)

Live telemetry over USB serial: flight state, artificial horizon, per-motor output, battery, setpoint-vs-actual plots for PID tuning, the PID table, an event console and CSV recording.

  • Calibration & motors tab: one-click IMU level calibration, and a motor test with hold-to-spin buttons, an automatic M1→M4 sequence, and checkboxes to verify each motor's corner and spin direction. Commands go to the firmware over serial (CMD CAL_LEVEL, CMD MTEST ON/OFF, CMD MOTOR n pct). There is a 30% power cap, and a 400 ms watchdog stops a motor if the PC stops refreshing the command.
  • --demo mode simulates a drone, so the UI can be explored without hardware.
bash
cd tools/dron_monitor
pip install -r requirements.txt
python main.py --demo          # no hardware
python main.py --port COM7     # with the drone

Legacy firmware — firmware/imu_web_ui/ (Arduino/PlatformIO)

The first bring-up firmware: IMU + Madgwick + LEDs + a WiFi Access Point with a WebSocket artificial-horizon web page. Kept as a reference. Note that its pin map predates the verified table above.

bash
cd firmware/imu_web_ui
pio run -t upload

Repository layout

text
esp32-drone/
├── firmware/
│   ├── dron_fc/          # flight controller — ESP-IDF, C (current)
│   └── imu_web_ui/       # first bring-up firmware — PlatformIO (legacy)
├── tools/
│   └── dron_monitor/     # Python/Qt ground station
├── hardware/
│   ├── kicad/            # KiCad schematic + PCB + symbol/footprint libs
│   ├── gerbers/          # fabrication gerbers + drill
│   └── esp32_dron_board.step
├── bom/                  # bill of materials (prototype + JLCPCB variants)
└── docs/images/          # schematic + PCB renders

Status & roadmap

  • Reference design studied, BOM analyzed
  • Schematic captured in KiCad
  • PCB layout + gerbers exported
  • Bring-up firmware: IMU + Madgwick + WiFi web UI
  • Flight controller in ESP-IDF/C: PS5 gamepad, cascaded PID, mixer, failsafes — running on the board
  • Ground-station tool with calibration and motor tests
  • Verify motor corners and spin directions, then tune the PID
  • First stable hover

License

Firmware and tools released under the MIT License. Hardware adapted from the open-source drone_meishi reference design — see credits above. Bluepad32 and BTstack are used under their own licenses (BTstack is free for non-commercial use).

Parts

75
QtyValueFootprintReferences
1410Kesp32_dron:R0603R2, R4, R6, R8, R11, R16, R19, R20, R21, R22, R23, R24, R26, R27
100.1uesp32_dron:C0603C1, C2, C3, C4, C5, C8, C9, C11, C12, C13
101Kesp32_dron:R0603R1, R3, R5, R7, R9, R10, R12, R14, R15, R25
41N4148Wesp32_dron:SOD-123F_L2.7-W1.6-LS3.8-RDD1, D2, D3, D4
4AO3400Aesp32_dron:SOT-23-3_L2.9-W1.3-P1.90-LS2.4-BRQ1, Q2, Q3, Q4
4Conn_01x02_Pinesp32_dron:MotorPad_SMD_1x02J1, J2, J3, J4
310uesp32_dron:C0603C6, C7, C10
22.1Kesp32_dron:R0603R17, R18
25.1Kesp32_dron:R0603R28, R29
2MMBT3904esp32_dron:SOT-23-3_L2.9-W1.3-P1.90-LS2.4-BRQ6, Q7
2TS-1187Aesp32_dron:SW-SMD_4P-L5.1-W5.1-P3.70-LS6.5-TL_H1.5SW1, SW2
1AMS1117-3.3esp32_dron:SOT-223-3_L6.5-W3.4-P2.30-LS7.0-BRU2
1AO3401Aesp32_dron:SOT-23_L2.9-W1.3-P1.90-LS2.4-BRQ5
1BLM18PGesp32_dron:L0603L1
1Blue_LEDesp32_dron:LED0603-RD_BLUELED3
1Conn_01x03_SocketConnector_PinSocket_2.00mm:PinSocket_1x03_P2.00mm_VerticalJ5
1ESP32-WROOM-32Desp32_dron:WIFIM-SMD_39P-L25.5-W18.0-P1.27-BLU4
1FT231XQ-Resp32_dron:QFN-20_L4.0-W4.0-P0.50-BL-EP2.2U3
1Green_LEDesp32_dron:LED0603-RD_GREENLED2
1LiPo_Connesp32_dron:CONN-TH_B2B-PH-K-SCN1
1MBR0520Lesp32_dron:SOD-123_L2.7-W1.6-LS3.7-RD-1U1
1MMBT3904-C20526esp32_dron:SOT-23-3_L2.9-W1.3-P1.90-LS2.4-BRQ8
1MPU-6050_C24112esp32_dron:QFN-24_L4.0-W4.0-P0.50-BL-EP2.7U5
1Red_LEDesp32_dron:LED-SMD_L1.6-W0.8-R-RDLED1
1TYPE-C 16PIN 2MDesp32_dron:USB-C-SMD_TYPE-C-16PIN-2MD-073USB1

The 71 most common of 75 parts.

Similar boards

  • 4 layers44.7 × 64.6 mmBlinky, the printed circuit board in 3D

    Blinky

    hdsjulian/sparkles-old

    Autonomous blinky devices that triangulate via soundd

    97 parts2Apache-2.0
  • 2 layers43 × 64.5 mmBlinky, the printed circuit board in 3D

    Blinky

    hdsjulian/sparkles

    This repo theoretically contains everything to build, assemble and run the sparkling forests light installation.

    72 parts
  • 4 layers160 × 145 mmCarrier, the printed circuit board in 3D

    Carrier

    OrbitalCommons/gumstick

    Gumstick: ESP32 + iCE40UP5K FPGA module (v1 DF40 board-to-board, v2 M.2 gold-finger draft) and its programming carrier. KiCad 10.

    222 parts1MIT
  • 2 layers104 × 66 mmVallox rs485-controller, the printed circuit board in 3D

    Vallox rs485-controller

    Miroeilola/vallox-rs485-controller

    Replacement control panel for legacy Vallox SE ventilation units. Vallox DIGIT RS-485 protocol, bus-powered, ESP32, Home Assistant.

    65 parts
  • 2 layers101.4 × 69.4 mmPanel, the printed circuit board in 3D

    Panel

    4project-co-il/PlugAndPlay-SAMD21

    Plug-n-Play SAMD21 Development Board

    85 partsMIT
  • 2 layers100 × 41 mmChessbot, the printed circuit board in 3D

    Chessbot

    vuktacic/chessler

    51 partsMIT
  • 2 layers137.2 × 83.8 mmPWA REV2, the printed circuit board in 3D

    PWA REV2

    PubInv/krake

    The Krake™ is a Wi-Fi–enabled server using an MQTT broker, which means it can be controlled remotely by other devices ("clients") via the internet.

    215 parts9AGPL-3.0

Questions

How big is the Esp32 dron PCB?

It measures 43.6 × 43.6 mm and has 2 copper layers, 1.6 mm thick.

What parts does the Esp32 dron use?

75 parts, built around the ESP32-WROOM-32D-N4, FT231XQ-R, AMS1117-3.3 and MBR0520L. The full list of its parts is on this page, with links to each part's symbol and footprint where PCBKit's library has them.

Where can I download the Esp32 dron KiCad files?

From the Sagaz0501/esp32-drone repository on GitHub, at the commit this page was made from: the board is hardware/kicad/esp32_dron.kicad_pcb and its schematic hardware/kicad/esp32_dron.kicad_sch. PCBKit opens the board in the browser, with nothing to install.

Can I use the Esp32 dron design in my own project?

Its repository publishes it under the MIT licence: you may reuse it on that licence's terms (keep the author's notice, and for a copyleft licence share your changes alike).