Building a UWB Indoor Positioning System using ESP32
Technology

Building a UWB Indoor Positioning System using ESP32

Building a UWB Indoor Positioning System using ESP32 and Qorvo DWM3000If you have ever tried to track a robot, a moving tool, or a small drone indoors

Circuit Digest
Circuit Digest
8 min read

Building a UWB Indoor Positioning System using ESP32 and Qorvo DWM3000

If you have ever tried to track a robot, a moving tool, or a small drone indoors, you already know how unreliable GPS becomes once you step inside. This is where Ultra-Wideband (UWB) technology shines. It provides highly accurate distance measurements using short radio pulses instead of relying on weak satellite signals.

In this post, we will take a look at how you can build a UWB Indoor Positioning System using ESP32 and the Qorvo DWM3000 module. This setup can deliver centimeter-level accuracy for asset tracking, navigation, and robotics projects.


Why UWB for Indoor Tracking?

Most indoor tracking systems use Wi-Fi or Bluetooth, but both struggle with reflected signals and interference from walls and metal surfaces. UWB solves this by transmitting very short pulses across a wide frequency range, usually between 6 and 8 GHz. Because each pulse is so short, the system can measure the time of flight with incredible precision.

In simple terms, it measures how long it takes for a radio pulse to travel from one device to another and back. That time difference translates into distance. With proper calibration, UWB can achieve positioning accuracy within a few centimeters, which is far better than what Bluetooth or Wi-Fi can manage indoors.


The Hardware: ESP32 and Qorvo DWM3000

The hardware setup is built around the Qorvo DWM3000 UWB transceiver and the ESP32 microcontroller. The DWM3000 module is based on the DW3110 chip and follows the IEEE 802.15.4z standard. It is designed for real-time location and secure ranging applications.

Main features of the DWM3000:

  • Operates at 6.5 GHz and 8 GHz frequency bands
  • Supports up to 6.8 Mbps data rate
  • Built-in ceramic antenna and onboard oscillator
  • Works directly with 3.3V logic (perfect for ESP32)

The system uses four ESP32 boards in total. Three of them act as anchors, which are fixed in known positions, and one acts as a tag, which is the moving node being tracked. The tag calculates its distance from each anchor using UWB ranging and then determines its position through trilateration.


How the UWB Indoor Positioning System Works

This project uses Double-Sided Two-Way Ranging (DS-TWR). It works like this:

  1. The tag sends a poll message to an anchor.
  2. The anchor responds with a reply.
  3. The tag measures the time difference between sending and receiving.
  4. Using that time, the firmware calculates the distance between the two.

Since the system does not rely on synchronized clocks, DS-TWR is accurate and simple to implement. Once the tag knows its distance from at least three anchors, it can compute its position using basic geometry.

The ESP32 tag then sends this data over Wi-Fi to a computer that runs a Python visualization script, which plots the real-time location of the tag on a 2D map.


Setting Up the Hardware

Building a UWB Indoor Positioning System using ESP32Each DWM3000 connects to an ESP32 through the SPI interface. The connection looks like this:

  • MOSI → GPIO 23
  • MISO → GPIO 19
  • SCK → GPIO 18
  • CS → GPIO 4
  • RST → GPIO 27
  • 3V3 and GND for power

All three anchors use the same firmware but have unique IDs to identify them. The tag firmware is slightly different because it initiates the ranging process and sends position data over Wi-Fi.

Antenna delay calibration is essential to achieve high accuracy. The DWM3000 modules usually perform well with a calibration value around 16350, but you may fine-tune it depending on your test environment.


ESP32 Firmware Overview

The ESP32 firmware handles three major tasks:

  1. Ranging – Uses the DWM3000’s built-in ranging API to exchange packets and calculate time of flight.
  2. Wi-Fi Communication – Connects the tag to a local network and sends measurement data to the PC.
  3. Data Formatting – Packages all distances, signal strength values, and timestamps into JSON format for easy parsing.

A sample output looks like this:

{
  "tag_id": 10,
  "anchors": {
    "A1": {"distance":112.5, "rssi":-63.1},
    "A2": {"distance":118.2, "rssi":-68.3},
    "A3": {"distance":123.8, "rssi":-69.8}
  }
}

This structured data is easy to use for visualization or for feeding into more complex tracking software.


Visualizing Position in Python

The Python visualization script brings the system to life. It listens for the incoming JSON packets from the tag, computes coordinates, and plots the live position using Matplotlib.

The script defines fixed positions for the anchors, for example:

ANCHOR_POSITIONS = np.array([[15,5], [290,5], [165,625]])

Using SciPy’s least-squares solver, it calculates the tag’s (x, y) coordinates even if the measured distances are slightly noisy. The visualization shows a moving dot representing the tag, with a trail of previous positions for better visualization of motion.

If you are building a robot or mobile IoT device, this view makes debugging and path tracking much easier.


Testing and Accuracy

During testing, the UWB Indoor Positioning System using ESP32 achieved consistent and repeatable results. The DWM3000 modules provided a range of 50 to 100 meters indoors and up to 200 meters in open line-of-sight. After calibration, the positioning error was within 10 centimeters.

A few things that helped improve accuracy:

  • Proper antenna orientation (modules facing upward)
  • Avoiding reflective metallic surfaces near anchors
  • Applying a median filter to smooth distance readings
  • Keeping the update rate around 5 Hz to balance performance and stability

When plotted on a floor map, the tag’s movement tracked closely with real motion, proving that low-cost UWB systems can deliver near-industrial performance.


Why ESP32 Makes Everything Easier

ESP32 was a great choice for this project because it provides both high-speed SPI for the UWB module and Wi-Fi connectivity for data transmission. This removes the need for an external gateway or controller.

You can even expand the project to multiple tags, each sending their coordinates to the same server. With minor tweaks, this setup can become a full-fledged indoor navigation system for small robots or AGVs.


Final Thoughts

The combination of ESP32 and Qorvo DWM3000 brings UWB positioning technology into the hands of hobbyists and engineers who want to explore real-time indoor tracking without expensive infrastructure.

By doing this ESP32 Project, you can learn the fundamentals of ranging, trilateration, and wireless time-based distance measurement while creating a system that actually performs well in the real world.

This project bridges the gap between DIY experimentation and industrial-grade technology, making UWB accessible to anyone with a soldering iron, a few modules, and a curious mind.

Discussion (0 comments)

0 comments

No comments yet. Be the first!