Skip to the content
2 layers84.3 × 50.8 mmBase, the printed circuit board in 3D

Drone design for automatic position in space with UWB

Size
84.3 × 50.8 mm
Copper layers
2
Thickness
1.6 mm
Parts
32
Nets
64
Pads
194
Tracks, vias
266, 50
Pours
1
Routed
Yes
KiCad
KiCad 7 (file 20221018)
Created
12 Feb 2023
Updated
17 Sep 2026

Overview

Base is an open-source printed circuit board by rmingon, from the rmingon/drone-uwb repository on GitHub. It is a 2-layer board of 84.3 × 50.8 mm with 32 parts on 64 nets, routed with 266 tracks and 50 vias.

It is built around the ESP32-WROOM-32, DWM1000 and BMP280, with the TPS63001DRC, WS2812B and LPS4012-103MRB among its other parts. Its parts include 9 resistors, 7 capacitors, 5 diodes, 4 ICs and 2 connectors. It belongs with the robots and motor control boards and the ESP32 boards of this library.

Main components

6

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

32
QtyValueFootprintReferences
610KResistor_SMD:R_0603_1608MetricR1, R2, R3, R4, R5, R6
50.1uFCapacitor_SMD:C_0603_1608MetricC1, C2, C6, C7, C8
3100Resistor_SMD:R_0603_1608MetricR7, R8, R9
21N4007Diode_SMD:Nexperia_CFP3_SOD-123WD4, D5
2CCapacitor_SMD:C_0603_1608MetricC4, C5
2SW_Push_OpenButton_Switch_SMD:SW_SPST_CK_RS282G05A3SW1, SW2
2WS2812BLED_SMD:LED_WS2812B_PLCC4_5.0x5.0mm_P3.2mmD1, D2
1104318650:BAT_1043BT1
1BMP280Package_LGA:Bosch_LGA-8_2x2.5mm_P0.65mm_ClockwisePinNumberingU3
1Conn_01x06Connector_PinHeader_2.54mm:PinHeader_1x06_P2.54mm_VerticalJ2
1DWM1000RF_Module:DWM1000DWM1
1ESP32-WROOM-32RF_Module:ESP32-WROOM-32U1
1LEDLED_SMD:LED_0603_1608MetricD3
1LPS4012-103MRBLPS4012:IND_LPS4012-103MRBL1
1MCP73831-3-OTPackage_TO_SOT_SMD:SOT-23-5U2
1TPS63001Package_SON:Texas_DRC0010J_ThermalViasU4
1USB_B_MicroConnector_USB:USB_Micro-B_Molex-105017-0001J1

More from rmingon/drone-uwb

3
  • 2 layers115 × 115 mmDrone, the printed circuit board in 3D

    Drone

    rmingon/drone-uwb

    Drone design for automatic position in space with UWB

    49 parts13
  • 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 × 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 layers132.7 × 75.8 mmTablet, the printed circuit board in 3D

    Tablet

    rmingon/arm-tablet

    Arm tablet with FSMC bus and STM32F407 mcu

    49 parts
  • 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 layers85 × 56 mmSAFMC FC, the printed circuit board in 3D

    SAFMC FC

    radityankn/SAFMC_FC

    125 parts
  • 2 layers98.7 × 60.2 mmAny Screen Touch Screen AnchorMod, the printed circuit board in 3D

    Any Screen Touch Screen AnchorMod

    Sakhiyuvio/Any-Screen-to-Touch-Screen

    Making any screen of any device to become touch-screen. Utilizing UWB transceivers for location distinction with triangulation and TWR algorithms. Our pen enclosure communicates to host device via Bluetooth HID.

    46 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 layers100 × 100 mmDrone, the printed circuit board in 3D

    Drone

    rmingon/drone-vision

    Drone uses machine vision to stabilize itself

    61 parts
  • 2 layers98.5 × 98.5 mmDrone swarm(old), the printed circuit board in 3D

    Drone swarm(old)

    ManhTi3012/MiniDrone

    A mini drone based on ESP32

    78 parts4MIT

Questions

How big is the Base PCB?

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

What parts does the Base use?

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

From the rmingon/drone-uwb repository on GitHub, at the commit this page was made from: the board is base/base_with_battery/base.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 Base design in my own project?

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