

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
6ESP32-WROOM-32
SMD,18x25.5mm-40℃~+85℃ -98dBm 2.4GHz 2.7V~3.6V 20dBm Bluetooth4.2 ESP32-DOWDQ6 UART、SDIO、SPI、I2C、GPIO、PWM、ADC、DAC SMD,25.5x18mm WiFi Modules ROHSEspressif SystemsWiFi ModulesDWM1000
SMDSMD RF Modules ROHSDecaWaveRF ModulesBMP280
LGA-8(2x2.5)-40℃~+85℃ 0.12hpa 1.5pa/K 1.71V~3.6V 1hpa 300nA 30Kpa~1.1bar I2C、SPI Integrated ADC and digital interface、On-chip calibration and non-volatile storage、Standby mode、On-chip temperature output LGA-8(2x2.5) Pressure Sensors ROHSBoschPressure SensorsTPS63001DRC
VSON-10-EP(3x3)-40℃~+85℃@(TA) 1 1.5MHz 1.8V~5.5V 3.3V 50uA Buck-Boost Buck-Boost Built-in Fixed Yes VSON-10-EP(3x3) DC-DC Converters ROHSTexas InstrumentsDC-DC ConvertersWS2812B
5mm X 5mm Surface Mount RGB LED with Intelligent ControlWorldsemiUncategorisedLPS4012-103MRB
IND-SMD_L3.9-W3.9IND-SMD_L3.9-W3.9 New Arrivals ROHSCoilcraftPower Inductors
README
README.mdAUTOMATIC 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.
Demos
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.

The ranging cycle
Anchors are chained. A tag walks the whole chain on every cycle and comes out with one distance per anchor:
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 anchorEvery 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:
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 3Distances 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 flight | The distance comes from an asymmetric two way ranging exchange, not from RSSI. Typical accuracy is around 10 cm once calibrated. |
| Bias correction | The APS011 range bias table is applied to every measurement, worth 10 to 20 cm at short range. |
| Median filter | Each anchor reports the median of its last 5 exchanges, so a single multipath reflection cannot move the result. |
| Line of sight check | A 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 calibration | Stored per board in NVS and pushed over the network, see below. |
Repository map
| Path | What it is |
|---|---|
base/code | Anchor firmware, ESP-IDF. Runs the ranging chain and reports distances. |
base/ | Anchor board, with and without battery (KiCad) |
code/drone | Drone firmware, Arduino. Flight control, plus the UWB tag on its own task. |
code/server | Bun server. Collects distances, solves the layout and the drone positions. |
code/front | Web interface, Vue and TresJS 3D view |
drone_with_esc | Drone board with 30 A ESCs (KiCad) |
drone | Drone board with integrated drivers (KiCad) |
drone_2s | Drone 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.
cd base/code
$EDITOR src/config.h # wifi, server, ANCHOR_ADDRESS, ANCHOR_IS_MAIN
pio run -t upload
pio device monitorThe chain is described entirely in src/config.h. The last anchor sets
ANCHOR_NEXT_ADDRESS to 0, which sends the tag back to blinking:
// 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 0Drone
cd code/drone
$EDITOR src/config.h # wifi, websocket endpoint
pio run -t uploadServer and front
cd code/server && bun install && bun run src/index.ts
cd code/front && bun install && bun run devThe 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.

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 rate | 110 kbps | 850 kbps |
| Preamble | 2048 symbols | 256 symbols |
| Pulse frequency | 64 MHz | 16 MHz |
| SFD | Decawave (non standard) | standard |
| Preamble code | 9 | 3 |
| Frame airtime | about 4 ms | about 0.5 ms |
| Link budget | about 6 dB better | baseline |
| Usable range | roughly 2x | baseline |
| Air time per cycle | roughly 8x more | baseline |
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.
- Put an anchor and the drone at a known distance, in clear line of sight, both antennas in the same orientation.
- Read what the anchor reports on its serial monitor.
- 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:
echo -n '{"antenna_delay": 16450}' | nc -u -w1 <anchor ip> 7051- 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": {...}}:
| type | data | when |
|---|---|---|
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 |
peer | same shape, address being another anchor | every completed exchange with a peer anchor |
Server to anchor:
| payload | effect |
|---|---|
{"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-IDF | builds, not yet flown |
| Two way ranging, both ends | builds, awaiting bench validation |
| Anchor self survey | builds, not yet flown |
| Distance collection on the server | working, covered by tests |
| Anchor layout and drone position | working, covered by tests |
| Web interface | working, 3D view of anchors, distances and drones |
| Autonomous flight | the goal |
Hardware
Anchors

Board views
Schematic

PCB

3D

Drone with 30 A ESCs

Board views
Schematic

PCB

3D

Drone with integrated drivers

Board views
Schematic

PCB

3D

Real board

Drone for a 2S battery

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| Qty | Value | Footprint | References |
|---|---|---|---|
| 6 | 10K | Resistor_SMD:R_0603_1608Metric | R1, R2, R3, R4, R5, R6 |
| 5 | 0.1uF | Capacitor_SMD:C_0603_1608Metric | C1, C2, C6, C7, C8 |
| 3 | 100 | Resistor_SMD:R_0603_1608Metric | R7, R8, R9 |
| 2 | 1N4007 | Diode_SMD:Nexperia_CFP3_SOD-123W | D4, D5 |
| 2 | C | Capacitor_SMD:C_0603_1608Metric | C4, C5 |
| 2 | SW_Push_Open | Button_Switch_SMD:SW_SPST_CK_RS282G05A3 | SW1, SW2 |
| 2 | WS2812B | LED_SMD:LED_WS2812B_PLCC4_5.0x5.0mm_P3.2mm | D1, D2 |
| 1 | 1043 | 18650:BAT_1043 | BT1 |
| 1 | BMP280 | Package_LGA:Bosch_LGA-8_2x2.5mm_P0.65mm_ClockwisePinNumbering | U3 |
| 1 | Conn_01x06 | Connector_PinHeader_2.54mm:PinHeader_1x06_P2.54mm_Vertical | J2 |
| 1 | DWM1000 | RF_Module:DWM1000 | DWM1 |
| 1 | ESP32-WROOM-32 | RF_Module:ESP32-WROOM-32 | U1 |
| 1 | LED | LED_SMD:LED_0603_1608Metric | D3 |
| 1 | LPS4012-103MRB | LPS4012:IND_LPS4012-103MRB | L1 |
| 1 | MCP73831-3-OT | Package_TO_SOT_SMD:SOT-23-5 | U2 |
| 1 | TPS63001 | Package_SON:Texas_DRC0010J_ThermalVias | U4 |
| 1 | USB_B_Micro | Connector_USB:USB_Micro-B_Molex-105017-0001 | J1 |
More from rmingon/drone-uwb
3Similar boards
- 2 layers132.7 × 75.8 mm

- 2 layers97 × 97 mm

- 4 layers85 × 56 mm

- 2 layers94 × 71 mm

- 2 layers98.7 × 60.2 mm

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 mm

MotorDriver
Kmshanley/MiniRobots
Firmware and PCB desgin for mini robots with UWB localization and lidar mapping
50 parts1 - 2 layers100 × 100 mm

- 2 layers98.5 × 98.5 mm
.kicad_pcb.jpg?size=s&soon)
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.

