Ultra-precise indoor positioning using ESP32 & Qorvo DWM3000 UWB modules with centimeter-level accuracy
Article Link: How to Build a Real-Time Indoor Position Tracking System using ESP32 & Qorvo DWM3000 UWB Modules
This project implements a Real-Time Location System (RTLS) using Ultra-Wideband (UWB) technology to achieve sub-10cm positioning accuracy indoors. Unlike GPS, Wi-Fi, or Bluetooth-based solutions that struggle with indoor precision, this UWB system provides reliable, fast, and highly accurate position tracking even in challenging indoor environments.
Perfect for applications like:
- ๐ญ Warehouse automation and robot navigation
- ๐ช Asset tracking in industrial facilities
โ๏ธ Indoor navigation systems (airports, malls)- ๐ฅฝ AR/VR applications requiring precise spatial tracking
- ๐ฅ Healthcare equipment and personnel tracking
- ๐ฏ High Precision: 10cm accuracy using Double-Sided Two-Way Ranging (DS-TWR)
- โก Real-Time: Live position updates with minimal latency
- ๐ก๏ธ Multipath Resistant: UWB technology filters out wall reflections
- ๐ Live Visualization: Real-time Python plotting with signal strength monitoring
- ๐ง Easy Setup: Plug-and-play hardware with detailed documentation
- ๐ก Wireless: Tag communicates via Wi-Fi to central processing unit
- ๐ Secure: IEEE 802.15.4z compliance with anti-spoofing features
Component | Quantity | Purpose |
---|---|---|
Qorvo DWM3000 UWB Module | 4 | 1 Tag + 3 Anchors for trilateration |
ESP32-WROOM Development Board | 4 | SPI communication and processing |
Micro-USB Cables | 4 | Programming and power |
Breadboards/PCBs | 4 | Module mounting and connections |
5V USB Power Sources | 4 | Powering ESP32 modules |
- Operating Bands: Channel 5 (6.5 GHz) and Channel 9 (8 GHz)
- Data Rates: 850 kbps and 6.8 Mbps
- Standards: IEEE 802.15.4z / FiRa Consortium compliant
- Security: Scrambled Timestamp Sequences (STS) for anti-spoofing
- Interface: High-speed SPI (up to 38 MHz)
- Form Factor: Compact 24 ร 16 mm with integrated antenna
- Position Accuracy: ยฑ10 cm or better
- Update Rate: Real-time (depends on ranging cycle configuration)
- Range: Optimized for indoor environments
- Multi-tag Support: Expandable architecture
Each ESP32-DWM3000 pair uses the following SPI connections:
DWM3000 Pin | ESP32 Pin | Function |
---|---|---|
VCC | 3.3V | |
GND | GND | Ground |
SCK | GPIO18 | SPI Clock |
MOSI | GPIO23 | SPI Data (ESP32 โ DWM3000) |
MISO | GPIO19 | SPI Data (DWM3000 โ ESP32) |
CS | GPIO4 | SPI Chip Select |
RST | GPIO27 | Hardware Reset |
IRQ | GPIO34 | Interrupt (optional) |
โ ๏ธ Warning: The DWM3000 operates at 3.3V only. Higher voltages will damage the module!
Position three anchors at known coordinates for optimal trilateration:
Anchor Layout Example:
A3 (165, 625) โโโโโโโโโโโโโโโโโโโ Room boundary
โ โ
โ โ
โ TAG โ
โ โ โ
โ โ
A1 (15, 5) โโโโผโโโโโโโโโโโโโโโโโผโโโ A2 (290, 5)
Update the ANCHOR_POSITIONS
array in your Python script to match your room layout.
- Connect each DWM3000 module to an ESP32 using the pin mapping above
- Ensure all connections are secure and power is 3.3V
- Position anchors at known coordinates in your tracking area
# Clone the repository
https://github.com/Circuit-Digest/ESP32-DWM3000-UWB-Indoor-RTLS-Tracker.git
cd ESP32-DWM3000-UWB-Indoor-RTLS-Tracker
# Flash anchor firmware to 3 ESP32s (set unique ANCHOR_ID for each)
# Upload tag firmware to 1 ESP32
# Configure Wi-Fi credentials in both firmwares
# Install required packages
pip install numpy scipy matplotlib json socket
# Run the visualization script
python floor_view.py
- Power on all anchor nodes first
- Power on the tag node
- The tag will automatically begin ranging with anchors
- Position data appears in real-time on your Python visualization
The system transmits position data via JSON over Wi-Fi:
{
"tag_id": 10,
"A1": {
"distance": 144.51,
"raw": 146.38,
"rssi": -79.63,
"fp_rssi": -85.71,
"round_time": 64870950,
"reply_time": 78282714,
"clock_offset": -0.000004
},
"A2": {
"distance": 137.00,
"raw": 137.47,
"rssi": -71.19,
"fp_rssi": -75.68,
"round_time": 69129089,
"reply_time": 72260735,
"clock_offset": -0.000001
},
"A3": {
"distance": 134.89,
"raw": 138.88,
"rssi": -74.64,
"fp_rssi": -82.12,
"round_time": 71333162,
"reply_time": 76495574,
"clock_offset": -0.000001
}
UWB measures the time-of-flight of radio pulses between devices with nanosecond precision. The DWM3000 uses Double-Sided Two-Way Ranging (DS-TWR) to eliminate clock synchronization errors:
- Poll: Tag sends poll message to anchor
- Response: Anchor replies after known delay
- Final: Tag sends final message with timing data
- Calculation: Both devices compute precise distance
With distances to three anchors, the system solves:
(x - xโ)ยฒ + (y - yโ)ยฒ = dโยฒ
(x - xโ)ยฒ + (y - yโ)ยฒ = dโยฒ
(x - xโ)ยฒ + (y - yโ)ยฒ = dโยฒ
Using least-squares optimization to handle measurement noise and find the best-fit position.
UWB's short pulse duration and wide frequency spectrum make it highly resistant to multipath interference from walls and obstacles, maintaining accuracy in complex indoor environments.
- Channel: UWB Channel 5 (6.5 GHz) - globally available
- Data Rate: 6.8 Mbps for faster ranging cycles
- Antenna Delay: Calibrated for each module (see calibration guide)
- Wi-Fi: Configure SSID/password for your network
- Room Dimensions: Update in
floor_view.py
- Anchor Positions: Match your physical setup
- Update Rate: Adjustable refresh rate
- RSSI Monitoring: Live signal strength display
- Antenna Calibration: Perform antenna delay calibration for best accuracy
- Line-of-Sight: Maintain clear paths between tag and anchors when possible
- Anchor Placement: Position anchors to avoid geometric dilution of precision
- Environment: UWB performs best in spaces without excessive metal reflections
- Power Supply: Use clean, stable power sources to minimize noise
- No ranging data: Check SPI connections and power supply
- Poor accuracy: Verify antenna delay calibration
- Intermittent connection: Ensure stable Wi-Fi and power
- High noise: Check for electrical interference sources
- Multi-tag Support: Track multiple objects simultaneously
- 3D Positioning: Add vertical dimension with 4+ anchors
- Mobile App: Smartphone interface for configuration
- Cloud Integration: Remote monitoring and data storage
- Machine Learning: Predictive tracking and anomaly detection
- Mesh Networking: Extended coverage with anchor relaying
Contributions are welcome! Please read our contributing guidelines:
โญ Star this project if you find it useful!
Built with โค๏ธ for the maker and robotics community