Skip to the content
2 layers115 × 115 mmDrone, the printed circuit board in 3D

Drone design for automatic position in space with UWB

Size
115 × 115 mm
Copper layers
2
Thickness
1.6 mm
Parts
49
Nets
88
Pads
245
Tracks, vias
456, 103
Pours
1
Routed
Yes
KiCad
KiCad 8.0 (file 20240108)
Created
12 Feb 2023
Updated
17 Sep 2026

Overview

Drone is an open-source printed circuit board by rmingon, from the rmingon/drone-uwb repository on GitHub. It is a 2-layer board of 115 × 115 mm with 49 parts on 88 nets, routed with 456 tracks and 103 vias.

It is built around the CH340C, DWM1000 and ESP32-WROOM-32, with the BMP280, LM1117MP-3.3 and MPU-6050 among its other parts. Its parts include 16 resistors, 9 capacitors, 6 ICs, 6 diodes and 6 transistors. It belongs with the robots and motor control boards and the ESP32 boards of this library.

Main components

10

README

README.md

AUTOMATIC DRONE FLY PROJECT

A quadcopter that knows where it is, to the centimetre, without GPS.

Ultra wide band anchors on the ground, a tag on the drone, and time of flight ranging between them.

ESP-IDF Arduino Bun Vue KiCad

Demos

First flight · With motors · Ready to fly


How it works

GPS stops at the door and drifts by metres. Ultra wide band does not: a DW1000 timestamps a radio pulse to 15.65 picoseconds, which is 4.7 mm of flight time. Measure the round trip between two radios and you get a distance, not a guess from signal strength.

Architecture

The ranging cycle

Anchors are chained. A tag walks the whole chain on every cycle and comes out with one distance per anchor:

text
   drone (tag)                anchors
        |
        |  blink  ------------------------------->  main anchor
        |  <---------------  short address  ------  main anchor
        |                                             |
        |  <====  two way ranging  ====>  anchor 1     | measures, reports
        |  <====  two way ranging  ====>  anchor 2     | measures, reports
        |  <====  two way ranging  ====>  anchor 3     | measures, reports
        |                                             |
        |  <-------------  back to blinking  -------  last anchor

Every anchor computes its own distance and pushes it to the server over UDP. Three clear distances are enough to place the drone on a plane, four to place it in space.

The anchors also measure each other

Between tag cycles, each anchor plays tag towards its peers. That gives the distance matrix of the installation itself, and the server turns it into coordinates, so nobody has to measure a room with a tape:

text
   anchor 1 ---- 5.50 m ---- anchor 2        first anchor  -> origin
      |  \                    /  |           second       -> on the X axis
   5.10   7.00          4.62    7.23         third        -> in the XY plane
      |        \      /         |            the rest     -> trilaterated
   anchor 4 ---- 5.37 m ---- anchor 3

Distances alone cannot tell a layout from its mirror image, so the convention above is part of the answer rather than a measurement.

Why the distance can be trusted

Time of flightThe distance comes from an asymmetric two way ranging exchange, not from RSSI. Typical accuracy is around 10 cm once calibrated.
Bias correctionThe APS011 range bias table is applied to every measurement, worth 10 to 20 cm at short range.
Median filterEach anchor reports the median of its last 5 exchanges, so a single multipath reflection cannot move the result.
Line of sight checkA measurement whose first path power sits more than 6 dB below the total receive power is flagged, and the server keeps it out of the position fix.
Antenna delay calibrationStored per board in NVS and pushed over the network, see below.

Repository map

PathWhat it is
base/codeAnchor firmware, ESP-IDF. Runs the ranging chain and reports distances.
base/Anchor board, with and without battery (KiCad)
code/droneDrone firmware, Arduino. Flight control, plus the UWB tag on its own task.
code/serverBun server. Collects distances, solves the layout and the drone positions.
code/frontWeb interface, Vue and TresJS 3D view
drone_with_escDrone board with 30 A ESCs (KiCad)
droneDrone board with integrated drivers (KiCad)
drone_2sDrone board for a 2S battery (KiCad)

Quick start

Anchors

Flash one board per anchor, each with its own address. One of them, and only one, is the main anchor.

sh
cd base/code
$EDITOR src/config.h     # wifi, server, ANCHOR_ADDRESS, ANCHOR_IS_MAIN
pio run -t upload
pio device monitor

The chain is described entirely in src/config.h. The last anchor sets ANCHOR_NEXT_ADDRESS to 0, which sends the tag back to blinking:

c
// anchor 1              anchor 2              anchor 3 (last)
ANCHOR_ADDRESS      1    ANCHOR_ADDRESS      2    ANCHOR_ADDRESS      3
ANCHOR_IS_MAIN      1    ANCHOR_IS_MAIN      0    ANCHOR_IS_MAIN      0
ANCHOR_NEXT_ADDRESS 2    ANCHOR_NEXT_ADDRESS 3    ANCHOR_NEXT_ADDRESS 0

Drone

sh
cd code/drone
$EDITOR src/config.h     # wifi, websocket endpoint
pio run -t upload

Server and front

sh
cd code/server && bun install && bun run src/index.ts
cd code/front  && bun install && bun run dev

The interface shows the anchors, the distances they measure between themselves and the drones, in 3D. With no hardware running, open it with ?demo=1 to see it against generated data.

Interface


Radio profiles

Both ends of every link have to agree on every radio setting, so the profile lives in a single file that is kept identical in base/code/src/uwb_profile.h and code/drone/src/uwb_profile.h.

long range (default)fast
Data rate110 kbps850 kbps
Preamble2048 symbols256 symbols
Pulse frequency64 MHz16 MHz
SFDDecawave (non standard)standard
Preamble code93
Frame airtimeabout 4 msabout 0.5 ms
Link budgetabout 6 dB betterbaseline
Usable rangeroughly 2xbaseline
Air time per cycleroughly 8x morebaseline

Switch by flipping UWB_PROFILE_LONG_RANGE and UWB_PROFILE_FAST in that header, on every board. The channel (5) is the same on both, so the two profiles share the same spectrum, just not the same air time.

Changing profile invalidates the antenna delay. It depends on the pulse frequency, so a board calibrated at 16 MHz is not calibrated at 64 MHz. The anchors store the value under a per profile key so the two calibrations never get mixed up, but each one still has to be measured.


Calibrating an anchor

Antenna delay is the single largest source of constant error. One unit is about 4.7 mm, so a board left on the generic 16436 is easily half a metre off, and no amount of filtering will fix a constant offset.

  1. Put an anchor and the drone at a known distance, in clear line of sight, both antennas in the same orientation.
  2. Read what the anchor reports on its serial monitor.
  3. Correct it. Roughly 213 units per metre of error, and a longer delay reports a shorter range, so increase it when the anchor reads long:
sh
echo -n '{"antenna_delay": 16450}' | nc -u -w1 <anchor ip> 7051
  1. Repeat until it settles. The value lands in NVS and survives reboots.

DW1000_ANTENNA_DELAY in src/config.h is only the fallback for a board that has never been calibrated.

Getting the rest of the accuracy

Calibration and filtering only go so far; the antenna installation does the rest.

  • No ground plane under the DWM1000 antenna, module on the board edge, 1 cm of clearance around it.
  • Same antenna orientation on anchors and drone. Ninety degrees of rotation costs several dB of polarisation mismatch.
  • Anchors high, with a direct view of the flight volume, not flat against a wall or on the floor.
  • Solid decoupling: the DW1000 draws peaks of about 160 mA while transmitting.
  • For a 3D fix, four anchors that are not coplanar. A barometer on the drone fixes the altitude and brings that back down to three.

Protocol

Anchors talk to the server over UDP on port 7051, in both directions.

Anchor to server, wrapped in {"uniq": "<anchor mac>", "type": ..., "data": {...}}:

typedatawhen
anchor{"address": 1, "main": true}at boot
tag{"eui": "aabbccddeeff0001", "address": 5}main anchor, when it hands a short address to a tag
range{"address": 5, "range": 3.42, "raw_range": 3.51, "rx_power": -82.3, "fp_power": -85.1, "los": true}every completed exchange with a tag
peersame shape, address being another anchorevery completed exchange with a peer anchor

Server to anchor:

payloadeffect
{"reboot": true}restarts the board
{"antenna_delay": 16450}stores a calibration in NVS and applies it

A secondary anchor only ever sees the short address the main anchor handed out, which is why the main anchor publishes the address to EUI mapping. The drone announces the same EUI when it connects, and that is what ties a distance back to a drone.


Status

Anchor firmware, ESP-IDFbuilds, not yet flown
Two way ranging, both endsbuilds, awaiting bench validation
Anchor self surveybuilds, not yet flown
Distance collection on the serverworking, covered by tests
Anchor layout and drone positionworking, covered by tests
Web interfaceworking, 3D view of anchors, distances and drones
Autonomous flightthe goal

Hardware

Anchors

Anchors

Board views

Schematic

Schematic

PCB

PCB

3D

3D

Drone with 30 A ESCs

Top Bottom

Board views

Schematic

Schematic

PCB

PCB

3D

3D

Drone with integrated drivers

3D drone

Board views

Schematic

Schematic

PCB

PCB

3D

3D

Real board

PCBWay

Drone for a 2S battery

3D


Credits

Thank you to PCBWay for sponsoring the PCB production of this prototype. The boards turned out very nicely: the green solder mask looks solid and the grill holes are perfect.

The DW1000 driver is a port of F-Army/arduino-dw1000-ng (MIT), vendored in base/code/components/DW1000Ng.

Parts

49
QtyValueFootprintReferences
10R_SmallResistor_SMD:R_0603_1608MetricR1, R2, R3, R4, R5, R6, R14, R15, R16, R17
9CCapacitor_SMD:C_0603_1608MetricC1, C2, C3, C4, C5, C6, C7, C8, C9
410KResistor_SMD:R_0603_1608MetricR7, R8, R9, R10
41N5819Diode_THT:D_DO-41_SOD81_P10.16mm_HorizontalD1, D2, D3, D4
4Conn_01x02Connector_PinHeader_2.54mm:PinHeader_1x02_P2.54mm_VerticalJ3, J4, J5, J6
4Si2319CDSPackage_TO_SOT_SMD:SOT-23Q1, Q2, Q3, Q4
2100KResistor_SMD:R_0603_1608MetricR12, R13
2BSS138Package_TO_SOT_SMD:SOT-23Q5, Q6
11N4148WDiode_SMD:D_SOD-123D6
1BMP280Package_LGA:Bosch_LGA-8_2x2.5mm_P0.65mm_ClockwisePinNumberingU4
1CH340CPackage_SO:SOIC-16_3.9x9.9mm_P1.27mmU6
1Conn_01x02Connector_AMASS:AMASS_XT30U-F_1x02_P5.0mm_VerticalJ2
1DWM1000RF_Module:DWM1000U3
1ESP32-WROOM-32RF_Module:ESP32-WROOM-32U1
1LM1117MP-3.3Package_TO_SOT_SMD:SOT-223-3_TabPin2U5
1MPU-6050Sensor_Motion:InvenSense_QFN-24_4x4mm_P0.5mmU2
1USB_B_MicroConnector_USB:USB_Micro-B_Amphenol_10118194_HorizontalJ7
1WS2812BLED_SMD:LED_WS2812B_PLCC4_5.0x5.0mm_P3.2mmD5

More from rmingon/drone-uwb

3
  • 2 layers50.8 × 50.8 mmDrone, the printed circuit board in 3D

    Drone

    rmingon/drone-uwb

    Drone design for automatic position in space with UWB

    47 parts13
  • 2 layers84.3 × 50.8 mmBase, the printed circuit board in 3D

    Base

    rmingon/drone-uwb

    Drone design for automatic position in space with UWB

    32 parts13
  • 2 layers84.3 × 34 mmBase, the printed circuit board in 3D

    Base

    rmingon/drone-uwb

    Drone design for automatic position in space with UWB

    21 parts13

Similar boards

  • 2 layers97 × 97 mmDrone, the printed circuit board in 3D

    Drone

    rmingon/air-mesh-drone

    Drone who use 2s battery and simple motor.

    43 parts
  • 4 layers82 × 100 mmFalcon Edge, the printed circuit board in 3D

    Falcon Edge

    rmingon/Falcon-Edge

    A 3D-printable flying-wing airframe with a custom ESP32 flight computer—open hardware you can solder, screw together, and fly.

    48 parts11
  • 2 layers100 × 100 mmDrone, the printed circuit board in 3D

    Drone

    rmingon/drone-vision

    Drone uses machine vision to stabilize itself

    61 parts
  • 2 layers56 × 65 mmMainBoard V1, the printed circuit board in 3D

    MainBoard V1

    banbatakumi/AutonomousCar

    自律走行ミニカー SURGE Mark.2 の STM32 ファームウェアと基板(回路)。

    122 parts
  • 4 layers26.5 × 57.4 mmMotorDriver, the printed circuit board in 3D

    MotorDriver

    Kmshanley/MiniRobots

    Firmware and PCB desgin for mini robots with UWB localization and lidar mapping

    50 parts1
  • 2 layers151.6 × 151.7 mmDron V1, the printed circuit board in 3D

    Dron V1

    FrancoStrappazzon/Drones

    Repositorio para proyectos de drones, desde el más simple hasta mas complejos

    70 parts
  • 2 layers50 × 50 mmEsp32 drone, the printed circuit board in 3D

    Esp32 drone

    saravanan-x/esp32-drone-pcb_design

    61 parts

Questions

How big is the Drone PCB?

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

What parts does the Drone use?

49 parts, built around the CH340C, DWM1000, ESP32-WROOM-32 and BMP280. 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 Drone KiCad files?

From the rmingon/drone-uwb repository on GitHub, at the commit this page was made from: the board is drone_2s/drone.kicad_pcb and its schematic base/base_with_battery/base.kicad_sch. PCBKit opens the board in the browser, with nothing to install.

Can I use the Drone design in my own project?

Its repository states no licence, so its author keeps all rights: ask rmingon before reusing the design.