Skip to the content
4 layers102.5 × 45 mmESC v2, the printed circuit board in 3D

Building a quadcopter from scratch. Hardware and software. Developed using STM32 microcontroller and FreeRTOS.

Size
102.5 × 45 mm
Copper layers
4
Thickness
1.61 mm
Parts
150
Nets
89
Pads
516
Tracks, vias
614, 316
Pours
83
Routed
Yes
KiCad
KiCad 8.0 (file 20240108)
Created
13 Sep 2024
Updated
7 Oct 2026

Overview

ESC v2 is an open-source printed circuit board by nikphillydev, from the nikphillydev/NP1_DRONE repository on GitHub, published under the MIT licence. It is a 4-layer board of 102.5 × 45 mm with 150 parts on 89 nets, routed with 614 tracks and 316 vias.

It is built around the STM32G474CET6, SN65HVD232DR-JSM and IRS21867STRPBF, with the TLV75533PDBVR-MS, TPH1R306P1,L1Q and S2B-PH-K-S-GW among its other parts. Its parts include 49 capacitors, 41 resistors, 25 diodes, 9 ICs and 7 connectors. It belongs with the robots and motor control boards and the STM32 boards of this library.

Main components

9

README

README.md

NP1 DRONE

I am attempting to build a quadcopter from scratch, both the PCB hardware (using KiCAD) and software (C/C++ on STM32).

I am a computer software engineering student at the University of Alberta. I started this project in early 2024 to push myself with embedded systems. Since its inception, I have learned a ton about PCB design and FreeRTOS firmware on STM32 microcontrollers.

Everything I make in this project is from scratch. The STM32-based circuit boards are designed with KiCAD and ordered from JLCPCB with assembly. I am using FreeRTOS for the software because of its scalability in complex embedded projects. I have written all the device drivers from scratch, and wholly designed the multi-threaded architecture for each of the drone's sub-systems.

Each sub-system presents its own set of challenges. As an overview, there are 3 sub-systems of the NP1 Drone:

text
                     (Over-The-Air Messaging)                               (CANBUS)
[RC CONTROLLER]   <---------------------------->  [Flight Controller]   <--------------->  [Electronic Speed Controller] x4
1. Flight Controller Overview

The Flight Controller (FCC) is a custom PCB design whose software runs the control system for the drone. In order to achieve this, it must 1) receive pilot input from the RC Controller, and 2) estimate its attitude and heading (roll, pitch, yaw). These inputs enter the onboard PID controller in order to calculate the necessary motor commands to send to the Electronic Speed Controllers (ESCs).

The FCC is equipped with a multitude of sensors, namely an IMU, magnetometer, barometer, optical flow sensor, and range finder. It performs sensor fusion through the use of an Extended Kalman Filter (EKF) and a few other custom algorithms. When it receives Over-The-Air (OTA) messages from the RC Controller, it monitors for a HEARTBEAT signal to detect LOSS-OF-LINK and perform flight termination. The control system interprets pilot input and sets the target roll, pitch, and yaw accordingly depending on flight mode (various flight modes still WIP).

Flight Controller
Figure 1: The Flight Controller (FCC) sitting on a Lego frame. The USB powers the board and enables logging to my laptop; jumper wires connect the external range finder and optical flow sensor; the green and yellow twisted pair connect to the ESCs using CANBUS.

2. RC Controller Overview

The RC Controller is simple: receive pilot input from various joysticks and buttons and send those values Over-The-Air (OTA) to the FCC. A custom OTA messaging protocol (modelled after MAVLINK) has been developed to facilitate this communication. The physical inputs of the RC Controller are fairly WIP right now. Currently, its a breadboard with push-buttons and a potentiometer, (hopefully) soon it will be a PS4 controller.

RC Controller
Figure 2: The RC Controller, in its current state. Spare hardware is used to capture pilot input.

3. Electronic Speed Controller Overview

The Electronic Speed Controller (ESC) requires a strong understanding of Brushless DC (BLDC) motor control. The custom PCB design and software are designed around the (sensorless) 6-Step Trapezoidal control method, where a Back Electromotive Force (BEMF) measurement from the floating motor phase is measured in order to know when to switch the commutation to the next step. In order to perform proper closed-loop control in this method, the motor must be spinning fast enough to generate a sufficient BEMF. I designed the ESC to operate in a software defined state-machine. Here are the states:

  1. STAND-BY: ESC is not commanding a rotation of the motor.
  2. ARMING: Align-and-Go Step. ESC commands an open-loop ramp up of the motor to obtain sufficient BEMF measurements. Lasts for about 0.8 sec.
  3. ARMED: ESC is commanding true closed-loop, 6-Step commutation with BEMF zero-crossing detection.

The ESC receives ARM, DISARM, and THROTTLE CANBUS messages from the FCC to transition between its internal states and increase / decrease motor RPM.

Electronic Speed Controller
Figure 2: The Electronic Speed Controller (ESC), connected to the FCC via CANBUS.
Motor Test Stand
Figure 3: The motor test stand; an ESC and BLDC motor mounted onto a wooden lever.

System Demo

This demo showcases the RC Controller sending my input Over-The-Air (OTA) to the FCC. The FCC receives these commands and uses its estimated state to calculate motor commands in its control system. The resulting commands are sent via CANBUS to the ESC on the motor test stand, controlling the BLDC motor.

https://github.com/user-attachments/assets/3e73fd2b-c005-44b4-9096-01581734d467

In-Depth Design

For more detailed design, please see the hardware and software folders.

Here is the hardware overview.

Here is the software overview.

A Note on the Use of AI

When I started the project in 2024, zero AI was used. Now, from 2026 onward, AI is obviously much better. However, this is a PASSION PROJECT. The goal of this project is to LEARN. I will not be able to effectively achieve that goal if I use AI. The intelligence you gain from AI is artificial. Therefore, I write all the code MYSELF. If there are bugs or I want some review / feedback of my work, I will use AI to do so. In this way, AI is the reviewer and I formulate my own thoughts first.

Parts

150
QtyValueFootprintReferences
13100nFCapacitors:CAP_0603_1608MetricC2, C9, C12, C18, C27, C28, C31, C39, C42, C44, C45, C47, C49
1210kResistors:RES_0603_1608MetricR4, R5, R9, R14, R15, R17, R22, R23, R25, R27, R34, R35
91uFCapacitors:CAP_0805_2012MetricC3, C13, C19, C29, C30, C33, C36, C38, C40
7TestPointTestPoint:TestPoint_THTPad_D2.5mm_Drill1.2mmTP1, TP2, TP3, TP4, TP5, TP6, TP11
610RResistors:RES_0805_2012MetricR2, R3, R12, R13, R20, R21
668kResistors:RES_0603_1608MetricR8, R16, R24, R37, R38, R39
6LEDDiodes:LED_0603_1608MetricD17, D18, D19, D23, D24, D25
6TPH1R306P1,L1QDiodes:PQFN-8-EP_6x5mm_P1.27mm_GenericD3, D4, D7, D8, D11, D12
510nFCapacitors:CAP_0603_1608MetricC10, C16, C22, C37, C41
510uFCapacitors:CAP_1206_3216MetricC6, C14, C20, C23, C26
54.7uFCapacitors:CAP_0805_2012MetricC1, C8, C11, C17, C43
41kResistors:RES_0603_1608MetricR33, R36, R40, R41
4BZX84C3V3-7-FDiodes:DiodesINC_SOT23-3D5, D9, D13, D22
4D1213A-02SOL-7Diodes:DiodesINC_SOT23-3D2, D16, D20, D21
4MountingHoleMountingHole:MountingHole_3.2mm_M3_ISO7380_PadH1, H2, H3, H4
4TestPointTestPoint:TestPoint_Pad_2.0x2.0mmTP7, TP8, TP9, TP10
310RResistors:RES_0603_1608MetricR10, R18, R26
31nFCapacitors:CAP_0603_1608MetricC7, C15, C21
32.2RResistors:RES_1206_3216MetricR1, R11, R19
3IRS21867STRPBFICs:SOIC-8U1, U3, U4
3MBR0580S1-7Diodes:DiodesINC_SOD123D1, D6, D10
211pFCapacitors:CAP_0402_1005MetricC46, C48
2120RResistors:RES_0603_1608MetricR6, R7
222uFCapacitors:CAP_0805_2012MetricC34, C35
2330uFCapacitors:CAP_ALUM_HORIZONTALC24, C25
247pFCapacitors:CAP_0603_1608MetricC4, C5
25.76kResistors:RES_0603_1608MetricR29, R31
2S2B-PH-K-SConnectors:CONN_JST_S2B-PH-K-SJ1, J2
2SMAJ28CADiodes:Littelfuse_SMAD14, D15
1100kResistors:RES_0603_1608MetricR28
1100pFCapacitors:CAP_0603_1608MetricC32
115uHInductors:L_6045SL1
12x2-1.27MMConnectors:CONN_MALE_TH_1.27MM_2x2J3
12x5-1.27MMConnectors:CONN_MALE_SMT_1.27MM_2x5J6
13kResistors:RES_0603_1608MetricR32
14.7kResistors:RES_0603_1608MetricR30
1LM66200DRLRICs:TI_SOT-5X3U7
1LM7805MPX/NOPBICs:TI_SOT223-4U5
1MT60Connectors:CONN_MALE_TH_MT60J7
1NTC 10kResistors:RES_0603_1608MetricTH1
1NX2520SA-16MHzCrystalsAndOscillators:NDK_NX2520SAX1
1SKRPARE010Switches:TACT_SKRPS1
1SN65HVD232DRICs:SOIC-8U2
1STM32G474CET6ICs:STM_LQFP48U9
1TLV75533PDBVRICs:TI_SOT23-5U8
1TPS54302DDCRICs:TI_SOT23-6U6
1USB TYPE-AConnectors:USB2.0_4P_AMPHENOL_87583-2010BLFJ5
1XT60PW-MConnectors:CONN_MALE_TH_XT60PWJ4

More from nikphillydev/NP1_DRONE

1
  • 4 layers55.3 × 70.2 mmFCC KiCAD, the printed circuit board in 3D

    FCC KiCAD

    nikphillydev/NP1_DRONE

    Building a quadcopter from scratch. Hardware and software. Developed using STM32 microcontroller and FreeRTOS.

    116 parts3MIT

Similar boards

  • 4 layers26 × 42 mmESP32-C3-breakout, the printed circuit board in 3D

    ESP32-C3-breakout

    vagarthgaurav/ESP32-C3-breakout-board

    A simple breakout board for the ESP32-C3 Microcontroller. It uses a chip antenna for wifi and bluetooth. It has an RGB LED on pin 10.

    47 parts
  • 4 layers394 × 110 mmGpu cluster backplane, the printed circuit board in 3D

    Gpu cluster backplane

    antmicro/gpu-cluster-backplane

    This project contains open hardware design files for a PCB supporting power distribution in a cluster composed of GPUs. This board has been derived from an open source d1600e-psu-breakout created by Antmicro.

    616 parts4Apache-2.0
  • 4 layers80 × 30 mmLogic board, the printed circuit board in 3D

    Logic board

    jbush001/HeadphoneGuitarPracticeAmp

    Portable headphone amplifier/effects processor for electric guitar practice.

    55 parts4Apache-2.0
  • 2 layersDC DC psu, the printed circuit board in 3D

    DC DC psu

    mirtcho/Kicad

    Kicad workspace /sandbox

    66 parts
  • 2 layers40 × 60 mmJoint controller board rev d power, the printed circuit board in 3D

    Joint controller board rev d power

    aliahumanoid/alia-humanoid-core

    Humanoid research project (Phase 0): firmware, host software, STL files and electronics for tendon-driven joints inside real human proportions. GPLv3 software, CC BY-NC-ND hardware files.

    40 parts12GPL-3.0
  • 2 layersSmd aio, the printed circuit board in 3D

    Smd aio

    freeDSP/freeDSP-ALLinONE

    All-in-One Version with amp and ADAU1701

    434 parts17
  • 6 layers100 × 70 mmCanardBoard, the printed circuit board in 3D

    CanardBoard

    waterloo-rocketry/canhw

    Hardware monorepo avionics PCB

    280 parts15GPL-3.0
  • 2 layers80 × 95 mmLaserBoard, the printed circuit board in 3D

    LaserBoard

    matthewSorensen/pewpew-laserboard

    LaserBoard is an open source controller for fiber laser marking systems, based around a Teensy 4.1 MCU board. LaserBoard provides a USB interface compatible with most low-cost fiber laser sources and XY-100-speaking…

    123 parts10CERN-OHL-S-2.0

Questions

How big is the ESC v2 PCB?

It measures 102.5 × 45 mm and has 4 copper layers, 1.61 mm thick.

What parts does the ESC v2 use?

150 parts, built around the STM32G474CET6, SN65HVD232DR-JSM, IRS21867STRPBF and TLV75533PDBVR-MS. 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 ESC v2 KiCad files?

From the nikphillydev/NP1_DRONE repository on GitHub, at the commit this page was made from: the board is hardware/Electronic Speed Controller/ESC_v2/ESC_v2.kicad_pcb and its schematic hardware/Electronic Speed Controller/ESC_v1/ESC_v1.kicad_sch. PCBKit opens the board in the browser, with nothing to install.

Can I use the ESC v2 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).