Maker.io main logo

Building a UWB Distance Monitoring and Alert System with Arduino UNO

98

2026-10-15 | By Vaani Jain

Share

License: Apache License, Version 2.0

Distance measurement is an important part of many embedded systems, from proximity alerts and robotics to asset monitoring and indoor positioning. While Bluetooth and Wi-Fi can help detect nearby devices, estimating distance from signal strength can be unreliable when the environment changes. Ultra-Wideband (UWB) provides another approach by using radio-signal timing to measure the separation between devices.

This project demonstrates a practical UWB distance monitoring system built around an Arduino UNO and two REYAX RYUW122_Lite UWB modules. The system displays the measured distance on a 16×2 I2C LCD and activates a buzzer when the distance exceeds a configurable threshold, set to 200 cm in this implementation.

Beyond the application itself, the project illustrates several useful embedded-system concepts: UART communication, AT-command configuration, logic-level compatibility, wireless ranging, and threshold-based event handling.

System Architecture

The design uses two UWB modules with different roles.

The Anchor connects to the Arduino UNO over UART. The Arduino also interfaces with the LCD and buzzer. The Tag operates as the remote ranging device and requires a separate regulated power supply; it does not need its own Arduino.

The Arduino sends a ranging request to the Anchor. The Anchor exchanges wireless messages with the Tag and returns a response containing the measured distance. The Arduino processes that response, updates the LCD, and checks whether the measurement has crossed the 200 cm threshold.

This architecture keeps the remote Tag simple while allowing the Arduino to handle the user interface and alert logic.

Why Use UWB for Distance Measurement?

UWB is a wireless technology designed for applications that benefit from precise ranging and positioning. Its wide signal bandwidth supports accurate timing measurements, which can be used to estimate the distance between two devices.

In Time of Flight (ToF) ranging, a system measures the time associated with radio-signal propagation between devices. Since radio waves travel at approximately the speed of light, timing accuracy is critical to obtaining useful distance measurements. Practical ranging protocols account for message exchanges and timing delays rather than treating a single received signal as a direct distance measurement.

UWB is therefore useful when an application needs distance information rather than only a wireless connection or a rough proximity estimate. Its performance still depends on antenna placement, obstacles, multipath propagation, module configuration, and the ranging method implemented by the devices.

REYAX RYUW122_Lite: Key Features

The REYAX RYUW122_Lite is a UWB transceiver module with an integrated antenna and UART interface. It supports Anchor and Tag modes and can be configured using AT commands.

The relevant specifications for this project are:

  • UWB standards: IEEE 802.15.4-2015 and IEEE 802.15.4z BPRF mode

  • Supported channels: Channel 5 at 6489.6 MHz and Channel 9 at 7987.2 MHz

  • Stated ranging accuracy: approximately 10 cm under open-field conditions

  • Stated open-field communication range: up to 100 m

  • Security: AES-128

  • Default UART baud rate: 115200 bps

  • Supported UART baud rates: 9600, 57600, and 115200 bps

  • Operating voltage: 2.4–3.6 V

  • Operating temperature: −40°C to +85°C

  • Low-power sleep mode

The stated range and accuracy should be treated as operating-condition-dependent specifications, not guaranteed results for every installation.

Hardware Requirements

The project requires an Arduino UNO R3, two REYAX RYUW122_Lite modules, a 16×2 I2C LCD, an active-low buzzer, a suitable logic-level shifter, breadboards, jumper wires, and a regulated 3.3 V supply arrangement for the Tag.

A USB-to-TTL converter with 3.3 V-compatible logic is also required to configure the modules before integrating them with the Arduino. The software setup uses the Arduino IDE and the LiquidCrystal_I2C library by Frank de Brabander, version 1.1.2.

Configuring the UWB Modules

The modules must be configured separately before the complete system is assembled. Connect a USB-to-TTL converter to the module's UART interface, using TX-to-RXD and RX-to-TXD connections, a common ground, and a suitable 3.3 V supply. Ensure the converter's signal levels are compatible with the module.

Open the serial monitor at 115200 bps and select Both NL and CR as the line ending. Send AT and check for the expected +OK response.

Set the same Network ID on both modules:

AT+NETWORKID=1

Configure the Anchor with:

AT+MODE=1

AT+ADDRESS=ANC

AT+IPR=9600

Configure the Tag with:

AT+MODE=0

AT+ADDRESS=TAG

The Anchor is configured for 9600 bps to match the Arduino's SoftwareSerial communication settings. Both devices must use the same Network ID, but each must have its own address.

To test ranging, send the following command to the Anchor:

AT+ANCHOR_SEND=TAG,2,Hi

The command should return +OK. A received ranging response may look like:

+ANCHOR_RCV=TAG,2,Hi,50 cm

The 50 cm value is illustrative; the actual measurement depends on the distance and test environment.

Hardware Interface and Pin Connections

Anchor side wiring

The Arduino UNO operates with 5 V logic, while the RYUW122_Lite uses 3.3 V logic. A logic-level shifter is required on the UART connections to protect the module from incompatible signal levels.

UWB Anchor to Arduino UNO

  • Arduino 3.3V → UWB module VDD

  • Arduino GND → UWB module GND

  • UWB TXD → level shifter LV1; corresponding HV1 → Arduino digital pin 9

  • Arduino digital pin 10 → level shifter HV2; corresponding LV2 → UWB RXD

The Arduino uses SoftwareSerial with digital pin 9 as RX and digital pin 10 as TX.

Before powering the module, verify that the Arduino's 3.3 V supply can support the module's current requirements. If it cannot, use an appropriate regulated 3.3 V supply with a common ground.

LCD Interface

The I2C LCD connects to the Arduino as follows:

  • LCD VCC → Arduino 5V

  • LCD GND → Arduino GND

  • LCD SDA → Arduino A4

  • LCD SCL → Arduino A5

With the A0, A1, and A2 address-selection jumpers open, the original circuit uses I2C address 0x27.

Buzzer Interface

The active-low buzzer is connected with its positive/supply pin to Arduino 5V and its negative/control pin to digital pin 2. Driving pin 2 LOW activates the buzzer.

Check the buzzer's current requirements. If its load exceeds the safe output capability of the Arduino pin, use a suitable transistor driver.

Tag Power Supply

Tag Power Supply

The Tag operates independently of the Arduino. In the original setup, a 12 V source feeds the input of a breadboard power-supply module configured for a 3.3 V output. Connect the regulated output to the Tag's VDD and GND.

Never apply 12 V directly to the RYUW122_Lite. Its specified operating voltage is 2.4–3.6 V.

Distance Monitoring and Alert Logic

Once both modules are configured and the hardware is connected, the Arduino communicates with the Anchor using SoftwareSerial on pins 9 and 10 at 9600 bps.

The software sends the ranging request, receives the Anchor's response, extracts the distance, and updates the LCD. The measured value is then compared with the configured threshold of 200 cm. If the distance exceeds the threshold, the Arduino activates the active-low buzzer.

The threshold can be changed in the application to suit a different monitoring distance. The implementation should also account for incomplete or malformed serial responses so that invalid data is not interpreted as a valid distance measurement.

Testing and Troubleshooting

Begin testing in an open area with a clear path between the Anchor and Tag. Confirm that the modules respond to AT commands and that the Anchor receives valid ranging responses before testing the LCD and buzzer behavior.

If the modules do not communicate, verify their operating modes, Network ID, addresses, UART wiring, and baud rate. If the LCD remains blank, check its power, I2C connections, and address. If the buzzer does not activate, confirm its polarity and the active-low control behavior.

Walls, people, nearby objects, and antenna orientation may affect the ranging result. Test the system at several distances rather than relying on a single measurement.

Applications and Further Development

This project provides a starting point for UWB-based proximity alerts, object-distance monitoring, robotics experiments, and presence-detection systems. Possible extensions include adding an LED status indicator, implementing multiple distance thresholds, recording measurements, or integrating the ranging data into a larger embedded application.

For safety-related or industrial applications, the complete system would require additional validation under the expected operating conditions, including evaluation of measurement reliability and alert response.

Conclusion

Combining an Arduino UNO with two REYAX RYUW122_Lite modules demonstrates how UWB ranging can be integrated into a simple embedded application. The project brings together wireless distance measurement, UART communication, an LCD interface, and a threshold-based buzzer alert.

It is also a useful platform for exploring the practical details that often matter in embedded development: module configuration, voltage compatibility, power-supply requirements, serial-response handling, and real-world ranging behavior.

Mfr Part # RYUW122_Lite
RF TXRX MODULE ANTENNA INCLUDED
REYAX
Mfr Part # A000066
ARDUINO UNO R3 ATMEGA328P BOARD
Arduino
Add all DigiKey Parts to Cart
Have questions or comments? Continue the conversation on TechForum, DigiKey's online community and technical resource.