UltraWideLock
Walk up. It Unlocks.
One timestamp tick is 15.65 ps, which light crosses in
4.692 mm. The bound is ULTRAWIDELOCK_UNLOCK_RANGE_CM.
A relay can add delay and nothing else, which is why arming one moves the
measurement away from the door rather than toward it.
Install
A C compiler and
python3 run the whole host suite. Nothing phones home.
git clone https://github.com/ultrawidelock/ultrawidelock.git
cd ultrawidelock
make check # 7 suites, about 2 minutes
With a Qorvo DWM3001CDK plugged in, five commands take you from clone to a lock on the bench:
make dfu-key # once per clone · image-signing key
make bootstrap # once per machine · NCS v3.3.0
make build # -> build/cdk-matter
make flash # over the on-board J-Link
make monitor # console, over RTT
No board on hand? The web flasher writes a prebuilt ESP32 image over WebSerial, straight from the browser.
How a door opens
Five steps, in the order they happen. The bolt moves on the last one.
- 1BLE
the phone finds the credential service
0xFFF2 - 2auth AUTH0, AUTH1, EXCHANGE — both ends now hold the URSK
- 3UWB key ladder to STS, then the DS-TWR round above
- 4gate range consistency agrees, and the bolt moves
- 5Matter lock state over Thread, into Apple Home
Local only. No app, no account, no cloud round trip. The credential is verified on the lock itself, so there is no remote verifier to compromise.
All of it on one nRF52833
512 KB of flash and 128 KB of RAM carry the reader, the DW3110 radio, an OpenThread MTD and a hand-written Matter node at the same time. The Matter node is written by hand rather than built on CHIP, which is what makes it fit.
- readerAUTH0 / AUTH1 / EXCHANGE, key ladder, STS, DS-TWR
- matterhand-written node, not CHIP
- threadOpenThread MTD, joins a real network
- classifierline-of-sight vs obstructed, 776 B of flash
Both bars are amber because both are tight. That is the point of the number, not a warning about it.
| Toolchain | NCS v3.3.0, Zephyr 4.3.99 |
|---|---|
| Signing | ECDSA-P256, verified by MCUboot |
Repository defaults are bench defaults. Keys and identities in the tree are for development. Do not secure valuables with it.
Is the door in the way?
Distance alone cannot tell a phone in your hand from a phone through a wall. Both can measure one metre. What separates them is the shape of the arrival: a direct path lands as one sharp edge, while a path through a door arrives late, spread and weaker.
A decision tree reads the DW3000's own receive diagnostics and answers, in 776 bytes of flash with no interpreter and no allocation.
| Model | depth-2 decision tree, generated by emlearn |
|---|---|
| Cost | 776 B flash, 0 B RAM, 28 B stack |
| Input | five CIA registers plus the measured range |
| Gate | the host suite certifies the C matches the trained model |
Hardware targets
| Application | Hardware | Connectivity |
|---|---|---|
dwm3001cdk-lock | DWM3001CDK, nRF52833 + DW3110 | UWB, Matter over Thread |
dwm3001cdk-lock-freertos | the same board, no Zephyr | UWB, Matter over Thread |
nrf5340dk-lock | nRF5340 DK, DWM3000EVB, NFC12A1 | UWB and NFC, Matter over Thread |
esp32-matter-lock | ESP32-S3 / C5 / C6 with DWM3000EVB | UWB, Matter over Wi-Fi |
Try it without hardware
The ranging stack itself, compiled to WASM and running in the page. Walk a phantom phone at the lock, add noise, spoof a relay, and single-step a real DS-TWR round.
Plug an ESP32-S3, C5 or C6 into USB and install a merged image from this page. No ESP-IDF, no command line. The page detects which chip you plugged in.
Specification
| UWB | DS-TWR under an STS session, channels 5 and 9 |
|---|---|
| Resolution | one tick is about 15.65 ps, roughly 4.692 mm |
| BLE | credential service 0xFFF2, AUTH0 / AUTH1 / EXCHANGE |
| NFC | ECP, on the nRF5340 DK target |
| Matter | hand-written node over Thread, or over Wi-Fi on ESP32 |
| Updates | signed delta over BLE, applied from inside MCUboot |
| Ports | Zephyr, ESP-IDF, and a Zephyr-free FreeRTOS port |
| License | ISC. The vendored Qorvo UWB driver is LicenseRef-QORVO-2 |