UWB Distance Monitoring and Alert System Using Arduino UNO

by Rachana Jain in Circuits > Arduino

54 Views, 0 Favorites, 0 Comments

UWB Distance Monitoring and Alert System Using Arduino UNO

20261011_140533.jpg

I wanted to build a simple system that could measure the distance between two devices and alert me when they moved too far apart. For this project, I used an Arduino UNO and two REYAX RYUW122_Lite Ultra-Wideband (UWB) modules.

The system displays the measured distance on a 16×2 I2C LCD. When the distance exceeds 200 cm, a buzzer sounds. One UWB module acts as the Anchor and connects to the Arduino, while the second acts as the Tag and only needs a suitable power supply.

This project is a useful starting point for learning about UWB ranging, UART communication, and distance-based alerts without adding another microcontroller to the Tag.

Supplies

  1. Arduino UNO R3
  2. 2 × REYAX RYUW122_Lite UWB modules
  3. 16×2 I2C LCD
  4. Active-low buzzer
  5. Logic-level shifter for UART signals
  6. Breadboards and jumper wires
  7. Breadboard power-supply module for the Tag
  8. USB-to-TTL converter with 3.3 V-compatible logic for module configuration
  9. USB cable for programming the Arduino
  10. Computer with Arduino IDE installed

Understand the Working Principle

The two UWB modules perform the distance measurement. The module configured as the Anchor communicates with the Tag and returns a ranging result to the Arduino over UART.

The Arduino sends the measurement request to the Anchor, receives the response, extracts the distance, and displays it on the LCD. It also compares the measured distance with the preset 200 cm limit. If the distance exceeds this value, the active-low buzzer is activated.

The Anchor is connected to the Arduino, LCD, and buzzer. The Tag operates independently and does not require a second Arduino.

Get Familiar With the UWB Modules

Reyax RYUW122_Lite UWB Module Pinout.png

The REYAX RYUW122_Lite supports IEEE 802.15.4-2015 UWB and IEEE 802.15.4z BPRF mode. It operates on Channel 5 at 6489.6 MHz and Channel 9 at 7987.2 MHz.

The module includes an integrated antenna, supports AES-128 encryption, and provides UART communication through AT commands. Its stated ranging accuracy is approximately 10 cm under open-field conditions, with a range of up to 100 m in open-field conditions. Actual performance depends on the environment and module placement.

Important electrical specifications:

  1. Supply voltage: 2.4–3.6 V
  2. Default UART baud rate: 115200 bps
  3. Supported baud rates: 9600, 57600, and 115200 bps
  4. Operating temperature: −40°C to +85°C

Important: The RYUW122_Lite is a 3.3 V-logic device. Do not connect its UART pins directly to the Arduino UNO's 5 V logic without appropriate level shifting.

Configure the Anchor and Tag

Before assembling the complete circuit, configure each UWB module using a USB-to-TTL converter. Connect the converter's TX to the module's RXD, its RX to TXD, and provide a suitable 3.3 V supply with a common ground. Use a converter with logic levels compatible with the module.

Open the Arduino IDE Serial Monitor and select the correct port. Start at 115200 bps and select Both NL and CR for the line ending. Send:

AT

A working module should respond with:

+OK

Configure both modules to use the same network ID:

AT+NETWORKID=1

For the Anchor, send:

AT+MODE=1

AT+ADDRESS=ANC

AT+IPR=9600

For the Tag, send:

AT+MODE=0

AT+ADDRESS=TAG

The Anchor and Tag must have different addresses but share the same Network ID. The Anchor is set to 9600 bps because the Arduino sketch communicates with it using SoftwareSerial at that rate.

To check ranging, send this command to the Anchor:

AT+ANCHOR_SEND=TAG,2,Hi

A successful command should return +OK. A ranging response may look like this:

+ANCHOR_RCV=TAG,2,Hi,50 cm

Here, 50 cm is only an example. Your reading will depend on the distance between the modules.

Connect the Anchor to Arduino UNO

Anchor Side Wiring.jpg
uwb anchor.png

Use the following connections for the UWB Anchor. Keep these pin assignments unchanged when building the circuit.

UWB Anchor and Arduino UNO

  1. Arduino 3.3V → UWB VDD
  2. Arduino GND → UWB GND
  3. UWB TXD → level shifter LV1; corresponding HV1 → Arduino D9
  4. Arduino D10 → level shifter HV2; corresponding LV2 → UWB RXD

The Arduino uses D9 as the SoftwareSerial receive pin and D10 as the transmit pin.

The logic-level shifter is necessary because the Arduino UNO operates with 5 V logic, whereas the UWB module uses 3.3 V logic.

Connect the 16×2 I2C LCD to the Arduino UNO as follows:

  1. LCD VCC → Arduino 5V
  2. LCD GND → Arduino GND
  3. LCD SDA → Arduino A4
  4. LCD SCL → Arduino A5

For the original circuit, the LCD I2C address is 0x27 when the A0, A1, and A2 address-selection jumpers are open.

The display will show the distance reported by the UWB Anchor.

The project uses an active-low buzzer controlled by Arduino digital pin D2.

  1. Buzzer positive/supply pin → Arduino 5V
  2. Buzzer negative/control pin → Arduino D2

Because this is an active-low arrangement, the Arduino activates the buzzer by driving D2 LOW. Check the buzzer's current requirements before connecting it directly. Use a transistor driver if the buzzer draws more current than the Arduino pin can safely supply.

Power the Tag

uwb2.png
Tag Side Wiring.jpg

The Tag does not need to connect to the Arduino. It only requires a regulated power supply.

In the original setup, a 12 V source feeds the input of a breadboard power-supply module. Set the module's output to 3.3 V and connect its regulated output to the Tag's VDD and GND.

Never apply 12 V directly to the UWB module. Its permitted supply range is 2.4–3.6 V.

Upload the Arduino Sketch

Install the required libraries in the Arduino IDE, including the LiquidCrystal_I2C library by Frank de Brabander.

Upload the tested Arduino sketch associated with this project.

Test the Distance Monitoring System

Power up the Arduino and both UWB modules. Keep the Anchor and Tag in a clear area for the first test.

The LCD should initialize and display the distance in centimeters. Move the Tag closer to and farther away from the Anchor and watch the displayed reading change.

When the measured distance goes beyond 200 cm, the buzzer should sound. Move the Tag back within the threshold to check that the system responds correctly.

Walls, people, nearby objects, and antenna orientation can affect the measurement, so do not expect every reading to be identical.

Video Demonstration