Precision Indoor Positioning with the Arduino Stella and UWB

Ultra-wideband, UWB for short, is a new form of wireless communication that utilizes an extensive frequency range. In the case of Arduino UWB, the technology is deployed due to its ability to perform indoor positioning with an accuracy of 5 to 10 cm.
Understanding the Arduino UWB Ecosystem
UWB positioning requires the presence of two compatible devices. One is stationary, while the mobile one is positioned -- among other things -- in relationship to its stationary colleagues. The mobile device, often referred to as the controller or initiator, then sends a message to a base station, commonly called a controllee or responder. The responder sends out a specified data package, whose transmission time is measured to get more information about the relative position of the two systems.
As of this writing, Arduino provides two UWB development boards. Product one is the Stella discussed here; product two is called Portenta UWB Shield and is an expansion for the Portenta C33 baseboard. Its DCU150 wireless chipset can act both as an initiator and responder -- for complete experiments, one of each is recommended.
A Nordic Semiconductor nRF52840-Powered Evaluation Board
Powered from a USB-C plug, the Arduino Stella -- also orderable under its SKU ABX00131 -- provides a computing core based on Nordic Semiconductor's classic and well-liked 32-bit wireless microcontroller. This means that most Arduino libraries will work with the Stella out of the box. Wireless communication is enabled via an NXP SR040 wireless transceiver; sensor data can be collected via a Silan SC7A20 accelerometer. Thanks to the included USB interface, no external programming device is required.

Developers seeking to take advantage of their Arduino board need to deploy the StellaUWB library, which is available in the repositories. After that, a simple initiator sketch can be constructed by following the steps outlined at https://docs-content.arduino.cc/tutorials/stella/user-manual/. It can be used with any UWB-enabled smartphone for reflector duty.
Most of the code located there, however, is housekeeping logic for tracking the number of devices.
The Arduino IDE provides an event-driven implementation of the UWB protocol stack: if a ranging message gets received, the sketch is informed via the invocation of a message handler.
void rangingHandler(UWBRangingData &rangingData) {
if (rangingData.measureType()==(uint8\_t)uwb::MeasurementType::TWO\_WAY) {
RangingMeasures twr = rangingData.twoWayRangingMeasure();
// \...
if (twr\[j\].status==0 && twr\[j\].distance!=0xFFFF) {
Serial.print(\"- Distance: \");
Serial.println(twr\[j\].distance);
}
}
}
Conclusion
If a UWB initiator can benefit from Arduino IDE-based programmability, deploying the Arduino Stella is a no-brainer. Its affordable price, reliable wireless module, and fast processor ensure that demanding algorithms can be run effortlessly, while the wildly popular Sketch programming environment reduces the learning curve...