Bluetooth 5 : Long Range + Advertising Extension on NRF52840
This blog is to describe how to use the nRF52840 for the Bluetooth 5.0 for advertising extension / long range.
The Softdevice S140v6.1.1 has started to support the extended advertising and work with Coded PHY.
Such as Extended Advertising support
- Advertising and scanning up to 255 bytes of advertising data in an advertising event
- Advertising, scanning, and connecting on all supported PHYs
- Anonymous advertising
Inside the Bluetooth 5.0 specification, it has supported the coded PHY with long range.
https://www.bluetooth.com/blog/exploring-bluetooth-5-going-the-distance/
FEC in Bluetooth 5 bit stream processing
Comparing the three PHYs
Bluetooth 5 adds two new PHY variants to the PHY specification used in Bluetooth 4. Each PHY variant has its own particular characteristics and was designed with specific aims in mind. The three PHYs have been named to allow them to be referenced in specifications. Their names are LE 1M, LE 2M and LE Coded.
LE 1M is the PHY used in Bluetooth 4. It uses Gaussian Frequency Shift Keying and has a symbol rate of 1 mega symbol per second (Ms/s). Higher up the stack, this correlates to a bit rate of 1 Mb/s since one symbol corresponds to one data bit. LE 1M continues to be available for use in Bluetooth 5 and in fact its support is mandatory.
LE 2M – DOUBLE THE SPEED
The new LE 2M PHY allows the physical layer to operate at 2 Ms/s and thus enables higher data rates than LE 1M and Bluetooth 4. Its support in a stack implementation is optional. We’ll be publishing another article all about Bluetooth 5’s higher speed PHY in this blog later on.
LE Coded – 4 X RANGE
The LE Coded PHY allows range to be quadrupled (approximately), compared to Bluetooth 4 and this has been accomplished without increasing the transmission power required. This latter point is of course important.
What is Advertising Extension??
In Bluetooth 4.0, all advertising was done on just three channels. Bluetooth 5 improves this mechanism by allowing a small header packet sent on the three primary advertising channels to point to a larger payload sent at a later time on one of the 37 data channels.
This removes the need to duplicate the data payload on all three advertising channels, while allowing considerably more advertising data in the area before running into coexistence issues.
The specification for extended advertisements in Bluetooth 5 is almost as large as the entire original Bluetooth 4.0 specification. There are some key differences to understand before delving into development, including:
- A single advertising packet can hold up to 255 bytes of data, up from 37 in Bluetooth 4.0.
- Advertising packets can now be chained together, allowing for even larger beacon payloads than with a single packet (a chain can hold a maximum of 1650 bytes).
- Advertising packets can be sent periodically, allowing observers to lock on to a stream of advertised packets.
- Periodic advertisements can be combined with chained packets, allowing even higher overall data throughput.
Long Range with connection handling
For the device is advertising for the long range, it needs to use the advertising extension as below.
Allow sending more than 31 bytes of advertising data.
Keep the time on used on the three primary advertising channels short.
Be able to connect on LE Coded PHY (LE Long Range).
Peripheral Role with Advertiser
Configure to use the advertising extension (primary/secondary) with PHY Coded 125kbps.
Central Role on Scanner
Configure to use the Coded PHY with extended advertising.
Result
By using the above advertising and scanner, it would get the advertising payload as below.
ADV_EXT_IND Packet
AUX_ADV_IND Packet
Example code is placed at https://github.com/jimmywong2003/nrf52-ble5-long-range-demo.