Still a prototype.
No RC control, altitude sensor, battery monitor, or independent motor kill input. A timed PWM ramp cannot guarantee a controlled landing.
A drone built from scratch, right down to the code that talks to the hardware.
That question became a summer project.
Over summer break in 2025, I set out to build a drone and understand the system beneath it. The firmware is written from scratch, including the peripheral drivers. Only the startup and linker files are reused.
This is the record of that process: a bare-metal quadcopter, from the first register writes to the motor-control loop.
ARMAN ISLAM / BUILDER & DEVELOPER
A compact frame. Four brushed motors. A controller with nothing hidden behind a library.
A driver is the translator between software and electronics. In this project, I wrote that translator myself: C code writes directly to the STM32’s hardware registers, which configure the peripherals connected to the drone.
motor_set(0, 500);
Ask motor 0 for 50% PWM duty.
Write 1800 into the timer’s compare register.
The timer produces a 20 kHz waveform. The motor driver switches power to the motor.
This is what “bare metal” means: the driver touches the hardware registers directly. There’s no HAL doing the register configuration for you.
This diagram explains the signal path; it does not control a drone. Actual motors stay off in the default firmware build.
See this driver on GitHub ↗The current firmware supports an opt-in timed attitude-control run. Sensor errors, excessive tilt or rotation, and late loop iterations stop the motors. Controller gains still need bench tuning.
No RC control, altitude sensor, battery monitor, or independent motor kill input. A timed PWM ramp cannot guarantee a controlled landing.
RC control and additional assertions and safety cases are planned. Validation starts with propellers removed, followed by a restrained rig and external power cutoff.
Firmware, wiring, frame files, and project notes.