- Open Board Manager and install esp32 by Expressif
- Open Library Manager and Install Adafruit Screen Library - SSD1306 (with dependencies)
- Download the code example files along with their associated folders for:
- ANCHOR A0 (ANCHOR_A0)
- ANCHORs A1, A2 and A3 (ANCHOR_default)
- TAGs (TAG_xyPosition)
Use a label maker to name and mark your board (A0, A1, A2, T0, T1, T2, and so on...)
In Arduino IDE, under:
// User configmake sure it says:
#define UWB_INDEX 1(or the appropriate integer for the ANCHOR or TAG you need as labelled in the previous step above)
To flash firmware, plug the cable into the USB C port marked USB NATIVE (the one next to the two tiny black buttons, NOT the one close to the white JST battery port)
On MacOS, when you connect the board let it connect to the accessory in the pop-up by choosing "Allow"
- Under the board drop-down menu, choose ESP32 Family Device
- THEN, do the thing below (Tools > Board: "ESP32 Family Device" > esp32 > ESP32S3 Dev Module):
- Make sure your USB CDC on Boot is Enabled:
Then, verify and upload the code to the device
When uploaded correctly, the screen on your board will say A3 (or the appropriate ID number) and you will get police lights at the back (1 flashing blue and 2 orange lights) like below:
Mount the ANCHOR boards in four corners of the space, making sure to keep them in the following orientation:
- Board VERTICAL
- Screen OUT (AWAY from the other boards)
- USB ports pointed UP
- Boards at the SAME relative HEIGHT
Connect the ANCHOR A0 using the USB port to your computer and open the ANCHOR_A0 file in Arduino IDE to read measurement values.
Calibration should ideally be done each time the ANCHOR-TAG arrangement is set up in a new space to achieve best results.
The idea is to calibrate all ANCHORs with one TAG so that the real-world distance between the two device types matches the reading in the code.
Flash the first ANCHOR (A0) with the ANCHOR A0 code. This is the home ANCHOR and will be used to read values off of when connected to a computer.
Flash the other ANCHORs (A1, A2, and A3) with the ANCHOR_default code.
Flash all the TAGs with the TAG code, ensuring to modify the code with the appropriate TAG number (T0, T1, T2 and so on...) at the top of the code (see step 5 in Basic Setup for ANCHORs and TAGs).
Place one TAG a fixed distance away from the ANCHOR making sure that the two are at the same height and completely stationary to ensure accurate readings. A distance of 700-800 cm away is good to shoot for according to jremington's Calibration Guide.
Connect the ANCHOR to your computer using a USB cable.
Using the p5.js Calibration sketch shown below:
Update the antenna delay. Increasing the antenna delay value will increase the measured distance and decreasing it will decrease the measured distance.
Adjust this value in steps of ±10 until it shows a reading close to the actual distance of the TAG from the ANCHOR. You can fine tune the value when you get closer to the real-world value. An error of < 5% is acceptable.
Download the entire p5_calibration folder and open the HTML file inside in Chrome or any other browser that supports the Web Serial API.
Click the "Connect Anchor" button, you will be prompted to select the serial port.
Set the distance between the anchor and tag in centimeters.
Select the corresponding index for the ANCHOR you're calibrating (0-3).
Monitor the reading and adjust the Antenna Delay value in the text field or with the Quick Adjustment buttons. These show up as below:
range: [830,424,679,999,0,0,0,0]
These values are in the order of the TAG IDs (T0, T1, T2, and so on).
Commit this setting by using the "Set Antenna Delay", "Save Config" and "Restart Module" buttons.
The UI will notify you when the average error is within 5% of the real-world distance. (Wait for a moment for the values to stabilize).
Repeat steps 5-14 above for ANCHORs A1, A2, and A3 using the same TAG and distance for consistency:








