Channel Sounding

Browse source code on GitHub

Overview

These samples demonstrates how to use the Bluetooth Channel Sounding feature.

The CS Test sample shows how to us the CS test command to override randomization of certain channel sounding parameters, experiment with different configurations, or evaluate the RF medium. It can be found under samples/bluetooth/channel_sounding/cs_test.

The connected CS sample shows how to set up regular channel sounding procedures on a connection between two devices. It can be found under samples/bluetooth/channel_sounding/connected_cs

A basic distance estimation algorithm is included in both. The Channel Sounding feature does not mandate a specific algorithm for computing distance estimates, but the mathematical representation described in [1] and [2] is used as a starting point for these samples.

Distance estimation using channel sounding requires data from two devices, and for that reason the channel sounding results in the sample are exchanged in a simple way using a GATT characteristic. This limits the amount of data that can be processed at once to about 512 bytes from each device, which is enough to estimate distance using a handful of RTT timings and PBR phase samples across about 35-40 channels, assuming a single antenna path.

Both samples will perform channel sounding procedures repeatedly and print regular distance estimates to the console. They are designed assuming a single subevent per procedure.

Diagrams illustrating the steps involved in setting up channel sounding procedures between two connected devices are available in [3] and [4].

Requirements

  • Two boards with Bluetooth LE and Channel Sounding support (such as an nRF54L15)

  • A controller that supports the Channel Sounding feature

Building and Running

These samples can be found under samples/bluetooth/channel_sounding in the Zephyr tree.

See Bluetooth samples for details.

These sample use two applications, so two devices need to be setup. Flash one device with the initiator application, and another device with the reflector application.

The devices should perform distance estimations repeatedly every few seconds if they are close enough.

Here is an example output from the connected CS sample:

Reflector:

*** Using Zephyr OS v3.7.99-585fbd2e318c ***
Starting Channel Sounding Demo
Connected to EC:E7:DB:66:14:86 (random) (err 0x00)
MTU exchange success (247)
Discovery: attr 0x20006a2c
UUID 87654321-4567-2389-1254-f67f9fedcba8
Found expected UUID
CS capability exchange completed.
CS config creation complete. ID: 0
CS security enabled.
CS procedures enabled.

Initiator:

*** Using Zephyr OS v3.7.99-585fbd2e318c ***
Starting Channel Sounding Demo
Found device with name CS Sample, connecting...
Connected to C7:78:79:CD:16:B9 (random) (err 0x00)
MTU exchange success (247)
CS capability exchange completed.
CS config creation complete. ID: 0
CS security enabled.
CS procedures enabled.
Estimated distance to reflector:
- Round-Trip Timing method: 2.633891 meters (derived from 7 samples)
- Phase-Based Ranging method: 0.511853 meters (derived from 38 samples)

Here is an example output from the CS Test sample:

Reflector:

*** Using Zephyr OS v3.7.99-585fbd2e318c ***
Starting Channel Sounding Demo
Connected to C7:78:79:CD:16:B9 (random) (err 0x00)
MTU exchange success (247)
Discovery: attr 0x20006544
UUID 87654321-4567-2389-1254-f67f9fedcba8
Found expected UUID
Disconnected (reason 0x13)
Re-running CS test...

Initiator:

*** Using Zephyr OS v3.7.99-585fbd2e318c ***
Starting Channel Sounding Demo
Found device with name CS Test Sample, connecting...
Connected to EC:E7:DB:66:14:86 (random) (err 0x00)
MTU exchange success (247)
Estimated distance to reflector:
- Round-Trip Timing method: 0.374741 meters (derived from 4 samples)
- Phase-Based Ranging method: 0.588290 meters (derived from 35 samples)
Disconnected (reason 0x16)
Re-running CS test...

References

See also

Generic Access Profile (GAP)
Bluetooth APIs