Getting Started with ESP32 DW1000 UWB (Ultra Wideband) Module
Using ESP32 UWB Ultra Wideband Module based on DW1000 Module BU01 to measure distance with Arduino DW1000 library & Antenna Delay Calibration
- Suitable forB.Tech/Diploma ESP32/IoT students
- Build time1-2 weeks
- LevelBeginner
- Available atAjvika Labs, Kakinada
About this project
Overview
In this getting started tutorial, we will learn about the
Ultra Wideband Technology
using
ESP32 DW1000 UWB Module
. The UWB technology is a
wireless carrier communication technology
that uses a frequency bandwidth above 1 GHz. It does not use a sinusoidal carrier, but uses nanosecond-level non-sinusoidal narrow pulses to transmit data.
The
BU01
is developed by
Ai-Thinker
based on
DecaWave’s DW1000 chip
, which integrates an antenna, all RF circuits, power management, and clock modules.
ESP32 UWB module
based on DW1000 and ESP32 is like a continuously scanning radar that can precisely lock onto another device, discover its
location
, and communicate with it.
In this tutorial, we will go through the board design, specifications, and applications. Then we will learn how to use the
ESP32 DW1000
embedded board for
object detection
and
ranging
. During range detection, there might be antenna delay issues leading to measuring incorrect distance. Therefore we will learn the method to fix the distance issue with the
Antenna delay calibrating
method.
What is Ultra Wideband?
UWB is a short-range, wireless communication protocol similar to Bluetooth or Wi-Fi. It also uses radio waves for communication & operates at a very high frequency. As its name denotes, it also uses a wide spectrum of several GHz. One way to think of it is as a radar that can continuously scan an entire room and precisely lock onto an object like a laser beam to discover its location and communicate data.
The primary purpose of Ultra Wideband is location discovery and device ranging. While both Wi-Fi and Bluetooth have been modified to allow greater accuracy in locating other devices and connecting to them, UWB is natively more precise & uses less power.
How does UWB work?
A UWB transmitter works by sending billions of pulses across the wide spectrum frequency. A corresponding receiver receives the signal, which translates the pulses into data by listening for a familiar pulse sequence sent by the transmitter. Pulses are sent about one every two nanoseconds, which helps UWB achieve its real-time accuracy.
UWB is extremely low power. Its high bandwidth (500MHz) is ideal for relaying a lot of data from a host device to other devices up to about 30 feet away. Unlike Wi-Fi, it is not particularly good at transmitting through walls.
When a smartphone with a UWB chip comes close to another UWB device, the two starts ranging or measuring, their exact distance. The ranging is accomplished through “Time of Flight” (ToF) measurements between the devices. These are used to calculate the roundtrip time of challenge/response packets.
The concepts “anchor” and “tag” are important to understand distance and location measurement with UWB. An anchor is generally a fixed UWB device with a known location. A tag generally refers to a mobile UWB device. An anchor and tag exchange information to establish the distance between them. The exact location of a tag can be determined by communicating with multiple anchors. Some devices can act as either an anchor or tag.
DW1000 Based UWB Module BU01
The
BU01
module is developed by Ai-Thinker which is based on
DecaWave’s DW1000
chip. It integrates an antenna, all RF circuits, power management, and clock modules. The module can use two-way ranging or TDOA positioning system with a positioning accuracy of 10cm. The data transmission rate of up to 6.8Mbps.
Features
Simple integration, no RF design required
Using RTLS infrastructure to expand the communication range
Support high label density
Comply with IEEE 802.15.4-2011 UWB standard
Support 4 channels from 3.5
GHz
to 6.5
GHz
Programmable transmit power
Power supply 2.8 V to 3.6 V
Power consumption in sleep mode<1mA
Support two-way ranging and TDOA
Support SPI interface
Data rate 110 kbps, 850 kbps, 6.8 Mbps
ESP32 UWB(Ultra Wideband) Board
The ESP32 UWB Ultra Wideband module is based on DW1000 and ESP32. This board is manufactured by
Makerfabs
. The BU01 Module based on DW1000 Chip is interfaced with ESP32 WiFi Module with I/O expansion. The board acts like a continuously scanning radar, that precisely locks onto another device (called Anchor) and communicates with it, thus calculating its own location.
The top side of the board has ESP32 WROOM/Wrover Module embedded with BU01 Module with other passive electronic components. There are two push buttons, one for flash and the other for rest. The board has a micro-USB port for uploading the firmware and Serial Communication.
On the backside of the board, there is CP2102 Chip for UART communication. The name of the input/output ports is also assigned on the board. The male or female headers can be soldered on both sides of the board. The board is breadboard friendly. Hence you can place it on a breadboard with other components during practical applications.
Features
Decawave DWM1000 for precision tracking
ESP32 for fast & powerful applications
Support Wifi, Bluetooth
Arduino compatible
Micro-USB connector
Board USB supply voltage range: 4.8~5.5V, 5.0V Typical
Getting Started with ESP32 DW1000 UWB (Ultra Wideband) Module
Let’s learn how we can use the ESP32 DW1000 UWB (Ultra Wideband) Board with Arduino IDE and measure the distance between the boards. For this project, you will need pair of boards. Then we need to go through a series of steps to use this Module.
Installing DW1000 Library
First we need to install
Arduino-DW1000 Library
from thotro. This library offers functionality to use Decawave’s DW1000 chips/modules with Arduino.
You can also install this library through the library manager. Just search for DW1000 and click on install to install the library.
Modifying the Library
The
DW1000 UWB library
doesn’t compile for ESP32 Boards directly. Therefore we need to make some modifications in the library part.
Go to the Arduino Library folder and look for
DW1000
. Then open the Library folder and look for the
source folder
(src).
Open the src folder and look for
DW1000.cpp
file. Open the file with some text editor like
Notepad++
Now look for the following lines (
Line No. 172
) and comment on all these 3 lines.
1
2
3
//#ifndef ESP8266
// SPI.usingInterrupt(digitalPinToInterrupt(irq)); // not every board support this, e.g. ESP8266
//#endif
Once these lines are commented, the library code will successfully
compile
Board Selection
Connect the pair of
ESP32 Wrover Board
to the two different USB port of your computer with the help of micro-USB Cable.
On your
Arduino IDE
, select the development board “
ESP32 Dev Module
” if you are using the ESP32 UWB Board with ESP32 WROOM Chip. Else select the “
ESP32 WROVER Module
“, if you are using ESP32 UWB Board with ESP32 WROVER Chip.
Also select the
COM Port
. You can find the COM port from the device manager. Now the ESP32 Ultra Wideband Board is ready for Serial Communication.
How to use ESP32 UWB Module to measure the distance?
To measure the
distance
between the boards, we need to upload an “
Anchor
” code to one ESP32 Board and the “
Tag
” code to other ESP32 Board.
One of the board will act as an
Anchor (Sender)
and the other board will act as a
Tag (Receiver)
. According to UWB Standards, the Anchor should be
stationary
and the tag should be
movable
. For the test purpose, we are keeping the boards at a distance of
1 meter
from each other.
Anchor Code
Copy the following code and upload it to the first UWB(Ultra Wideband) Board.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
#include `SPI.h`
#include \"DW1000Ranging.h\" //https://github.com/thotro/arduino-dw1000
#define ANCHOR_ADD \"83:17:5B:D5:A9:9A:E2:9C\"
#define SPI_SCK 18
#define SPI_MISO 19
#define SPI_MOSI 23
#define DW_CS 4
// connection pins
const
uint8_t
PIN_RST
=
27
;
// reset pin
const
uint8_t
PIN_IRQ
=
34
;
// irq pin
const
uint8_t
P
In this getting started tutorial, we will learn about the
Ultra Wideband Technology
using
ESP32 DW1000 UWB Module
. The UWB technology is a
wireless carrier communication technology
that uses a frequency bandwidth above 1 GHz. It does not use a sinusoidal carrier, but uses nanosecond-level non-sinusoidal narrow pulses to transmit data.
The
BU01
is developed by
Ai-Thinker
based on
DecaWave’s DW1000 chip
, which integrates an antenna, all RF circuits, power management, and clock modules.
ESP32 UWB module
based on DW1000 and ESP32 is like a continuously scanning radar that can precisely lock onto another device, discover its
location
, and communicate with it.
In this tutorial, we will go through the board design, specifications, and applications. Then we will learn how to use the
ESP32 DW1000
embedded board for
object detection
and
ranging
. During range detection, there might be antenna delay issues leading to measuring incorrect distance. Therefore we will learn the method to fix the distance issue with the
Antenna delay calibrating
method.
What is Ultra Wideband?
UWB is a short-range, wireless communication protocol similar to Bluetooth or Wi-Fi. It also uses radio waves for communication & operates at a very high frequency. As its name denotes, it also uses a wide spectrum of several GHz. One way to think of it is as a radar that can continuously scan an entire room and precisely lock onto an object like a laser beam to discover its location and communicate data.
The primary purpose of Ultra Wideband is location discovery and device ranging. While both Wi-Fi and Bluetooth have been modified to allow greater accuracy in locating other devices and connecting to them, UWB is natively more precise & uses less power.
How does UWB work?
A UWB transmitter works by sending billions of pulses across the wide spectrum frequency. A corresponding receiver receives the signal, which translates the pulses into data by listening for a familiar pulse sequence sent by the transmitter. Pulses are sent about one every two nanoseconds, which helps UWB achieve its real-time accuracy.
UWB is extremely low power. Its high bandwidth (500MHz) is ideal for relaying a lot of data from a host device to other devices up to about 30 feet away. Unlike Wi-Fi, it is not particularly good at transmitting through walls.
When a smartphone with a UWB chip comes close to another UWB device, the two starts ranging or measuring, their exact distance. The ranging is accomplished through “Time of Flight” (ToF) measurements between the devices. These are used to calculate the roundtrip time of challenge/response packets.
The concepts “anchor” and “tag” are important to understand distance and location measurement with UWB. An anchor is generally a fixed UWB device with a known location. A tag generally refers to a mobile UWB device. An anchor and tag exchange information to establish the distance between them. The exact location of a tag can be determined by communicating with multiple anchors. Some devices can act as either an anchor or tag.
DW1000 Based UWB Module BU01
The
BU01
module is developed by Ai-Thinker which is based on
DecaWave’s DW1000
chip. It integrates an antenna, all RF circuits, power management, and clock modules. The module can use two-way ranging or TDOA positioning system with a positioning accuracy of 10cm. The data transmission rate of up to 6.8Mbps.
Features
Simple integration, no RF design required
Using RTLS infrastructure to expand the communication range
Support high label density
Comply with IEEE 802.15.4-2011 UWB standard
Support 4 channels from 3.5
GHz
to 6.5
GHz
Programmable transmit power
Power supply 2.8 V to 3.6 V
Power consumption in sleep mode<1mA
Support two-way ranging and TDOA
Support SPI interface
Data rate 110 kbps, 850 kbps, 6.8 Mbps
ESP32 UWB(Ultra Wideband) Board
The ESP32 UWB Ultra Wideband module is based on DW1000 and ESP32. This board is manufactured by
Makerfabs
. The BU01 Module based on DW1000 Chip is interfaced with ESP32 WiFi Module with I/O expansion. The board acts like a continuously scanning radar, that precisely locks onto another device (called Anchor) and communicates with it, thus calculating its own location.
The top side of the board has ESP32 WROOM/Wrover Module embedded with BU01 Module with other passive electronic components. There are two push buttons, one for flash and the other for rest. The board has a micro-USB port for uploading the firmware and Serial Communication.
On the backside of the board, there is CP2102 Chip for UART communication. The name of the input/output ports is also assigned on the board. The male or female headers can be soldered on both sides of the board. The board is breadboard friendly. Hence you can place it on a breadboard with other components during practical applications.
Features
Decawave DWM1000 for precision tracking
ESP32 for fast & powerful applications
Support Wifi, Bluetooth
Arduino compatible
Micro-USB connector
Board USB supply voltage range: 4.8~5.5V, 5.0V Typical
Getting Started with ESP32 DW1000 UWB (Ultra Wideband) Module
Let’s learn how we can use the ESP32 DW1000 UWB (Ultra Wideband) Board with Arduino IDE and measure the distance between the boards. For this project, you will need pair of boards. Then we need to go through a series of steps to use this Module.
Installing DW1000 Library
First we need to install
Arduino-DW1000 Library
from thotro. This library offers functionality to use Decawave’s DW1000 chips/modules with Arduino.
You can also install this library through the library manager. Just search for DW1000 and click on install to install the library.
Modifying the Library
The
DW1000 UWB library
doesn’t compile for ESP32 Boards directly. Therefore we need to make some modifications in the library part.
Go to the Arduino Library folder and look for
DW1000
. Then open the Library folder and look for the
source folder
(src).
Open the src folder and look for
DW1000.cpp
file. Open the file with some text editor like
Notepad++
Now look for the following lines (
Line No. 172
) and comment on all these 3 lines.
1
2
3
//#ifndef ESP8266
// SPI.usingInterrupt(digitalPinToInterrupt(irq)); // not every board support this, e.g. ESP8266
//#endif
Once these lines are commented, the library code will successfully
compile
Board Selection
Connect the pair of
ESP32 Wrover Board
to the two different USB port of your computer with the help of micro-USB Cable.
On your
Arduino IDE
, select the development board “
ESP32 Dev Module
” if you are using the ESP32 UWB Board with ESP32 WROOM Chip. Else select the “
ESP32 WROVER Module
“, if you are using ESP32 UWB Board with ESP32 WROVER Chip.
Also select the
COM Port
. You can find the COM port from the device manager. Now the ESP32 Ultra Wideband Board is ready for Serial Communication.
How to use ESP32 UWB Module to measure the distance?
To measure the
distance
between the boards, we need to upload an “
Anchor
” code to one ESP32 Board and the “
Tag
” code to other ESP32 Board.
One of the board will act as an
Anchor (Sender)
and the other board will act as a
Tag (Receiver)
. According to UWB Standards, the Anchor should be
stationary
and the tag should be
movable
. For the test purpose, we are keeping the boards at a distance of
1 meter
from each other.
Anchor Code
Copy the following code and upload it to the first UWB(Ultra Wideband) Board.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
#include `SPI.h`
#include \"DW1000Ranging.h\" //https://github.com/thotro/arduino-dw1000
#define ANCHOR_ADD \"83:17:5B:D5:A9:9A:E2:9C\"
#define SPI_SCK 18
#define SPI_MISO 19
#define SPI_MOSI 23
#define DW_CS 4
// connection pins
const
uint8_t
PIN_RST
=
27
;
// reset pin
const
uint8_t
PIN_IRQ
=
34
;
// irq pin
const
uint8_t
P
Technologies used
Hardware components
- ESP32
- ESP8266
- Arduino
- Relay
Software & tools
- Arduino IDE
What you get
- Working project / hardware kit, tested before delivery
- Complete source code with explanation
- Project demo and guidance for your viva
- Project report, PPT and IEEE paper support (on request)
Delivery & Payment
Delivery takes a minimum of two weeks from the date your inquiry is confirmed.
Payment is in two parts:
• 50% advance to start the project
• Remaining 50% before delivery
Note:
• Documentation and PPT are not included by default
• If you need documentation/PPT, it can be arranged for extra time and cost
We'll confirm the exact timeline and cost with you after reviewing your requirements.