This blog is to demonstrate how to show difference physical codec such as 1Mbps and Coded PHY125Kbps with difference TX power. I would show the RSSI and Packet Success Rate on the LCD display (Adafruit 1947). It can use to estimate the range with difference configurations.
Bluetooth Range Estimator
Recently, Bluetooth SIG launches the online range estimator.
( https://www.bluetooth.com/bluetooth-technology/range/#estimator )
By selecting difference configuration, it can roughly estimate the range.

In order to prove such estimated range, I created the example on nRF52840 DK x 2 and lets the users select difference Bluetooth PHY and TX Power (0, 4, 8dBm).
HW Requirement
I am using two nRF52840 DK board with 2 Adafruit display
( https://www.adafruit.com/product/1947).

Get on the RSSI value
uint32_t sd_ble_gap_rssi_start | ( | uint16_t | conn_handle, |
uint8_t | threshold_dbm, | ||
uint8_t | skip_count | ||
) |
Start reporting the received signal strength to the application.
A new event is reported whenever the RSSI value changes, until @ref sd_ble_gap_rssi_stop is called.
Events generated
BLE_GAP_EVT_RSSI_CHANGED | New RSSI data available. How often the event is generated is dependent on the settings of the threshold_dbm and skip_count input parameters. |

How to get the RSSI value
// On the connection event
uint32_t err_code;
m_conn_handle = p_ble_evt->evt.gap_evt.conn_handle;
err_code = sd_ble_gap_rssi_start(m_conn_handle, 10, 0);
APP_ERROR_CHECK(err_code);
static void ble_evt_handler(ble_evt_t const * p_ble_evt, void * p_context)
{
ret_code_t err_code;
ble_gap_evt_t const * p_gap_evt = &p_ble_evt->evt.gap_evt;
switch (p_ble_evt->header.evt_id)
{
case BLE_GAP_EVT_RSSI_CHANGED:
rssi = p_ble_evt->evt.gap_evt.params.rssi_changed.rssi;
break;
All the source code can be found at https://github.com/jimmywong2003/nrf52-ble-range-estimator .
Thanks for your marvelous posting! I quite enjoyed reading it, you are a great author.I will always bookmark your blog and will come back later in life. I want to encourage you to ultimately continue your great writing, have a nice day!
LikeLike
Nice project! When the link is in long range mode (Coded) is this using 500kbps or 125kbps throughput? I notice there is a throughput button, but this looks like it’s not coded to do anything? Is there anyway to change this?
LikeLike
The range estimator is purpose to show the distance with RSSI and PSR only.
It is not target to show the throughput with S8 codec.
Note: the S140 doesn’t support the S2 (500kbps) option.
LikeLike
Many thanks for the reply. Ok makes sense to why the button is not coded to do anything
LikeLike
Hello Jimmy,
Thanks for your wonderful post. Have you tried the same on an FANTEL BT840XE module by any chance? Your response is greatly appreciated.
LikeLike
I haven’t tried to use other modules such as Fantel for range performance test. But it should be similar performance to the nRF52 DK board if the antenna is well tuned.
LikeLike