Bluetooth
Bluetooth is a collection of short range wireless communication protocols. The Bluetooth Special Interests Group (SIG) was founded in 1998 and oversees the development of Bluetooth standards1. The original Bluetooth is known as Bluetooth Classic and was designed as a short-range wireless point-to-point communications protocol.
Piconet And Scatternets
A Piconet is the term used for a small Bluetooth network with 1 master device connected to up to 7 active slave devices. Up to 255 more slave devices may be connected to the master but in a inactive or “parked” state. Active slaves can be parked to bring parked devices into the active state3.
Both active and parked slaves in a Piconet are time-synchronized to the master so that RF contention does not occur (they implement a Time Division Multiple Access (TDMA) network).
A Scatternet is two or more independent Piconets which are connected together by one node in one Piconet (either the master or a slave) also acting as a slave in the second Piconet4.
Advanced Audio Distribution Profile (A2DP)
This is a bluetooth standard which supports the streaming of audio between bluetooth-enabled devices.
Bluetooth 4.0
In 2010, the Bluetooth Core Specification version 4.0 was released. This included Bluetooth Low Energy (BLE), which is now more commonly known as Bluetooth Smart. Bluetooth Smart specifies a hub-and-spoke connection model (with broadcast support), but no mesh topology.
An attribute is a piece of labelled and addressable data. A characteristic is a group of attributes, and a service is a group of attributes.
attribute < characteristic < service
Bluetooth 4.0 uses the server/client paradigm.
Bluetooth Low Energy (BLE)
Bluetooth Low Energy (BLE) is a Bluetooth protocol specifically designed for communication on low power devices that need to run for months or years of small batteries. Active BLE connections can be maintained by a MCU with approx. 4-20uA of average current (depends on a lot of things, including connections settings and transmission power).
Channels
BLE has 40 channels, compared to Bluetooth Classic which has 795.
Advertising
Advertising is when a BLE peripheral broadcasts packets to any device that wants to listen. Advertising allows a low energy device to sleep most of the time, only waking up periodically for a short amount of time to send a new advertisement packet. Advertising is unidirectional, the peripheral sends out unsolicited data and expects no response. To achieve 2-way communication you have to connect with the BLE peripheral.
Advertisement packets give you 31 bytes of data for application specific use.
When a phone or other connecting device sees advertisement packets from a BLE peripheral, it can request more information with a scan request. The phone send the device a scan request packet, the the device responds with a scan response packet. Both Android and iPhone devices automatically emit a scan request packet when they discover a new device as part of the Bluetooth scanning process5.
Connections
Connection settings:
- Connection interval (min): 7.5ms to 4s6. Typically specified in units of 1.25ms.
- Connection interval (max): 7.5ms to 4s. Typically specified in units of 1.25ms.
- Latency: This is the latency of the peripheral. It allows the peripheral to skip N connection intervals if it doesn’t have any data to send(i.e. not respond)6. The Central device must still poll the peripheral on every connection interval. This has a similar power saving effect as reducing the connection interval, except with the added benefit that fast connection intervals can be used when the Peripheral has data to send.
- Timeout: If no packets have been received in this time, the connection is considered lost.
These connection settings are controlled by the Central device. However, the Peripheral can suggest connection parameters to the Central device. The Central device can choose to accept or reject them (or use different parameters). This is the reason a min. and a max. are given for the connection interval, it allows the peripheral to suggest a range and gives the Central device some flexibility in choosing the connection parameters.
See the Bluetooth section on the Zephyr page for information on how to set these connection parameters on MCUs running the Zephyr RTOS.
Beacons
Beacons are BLE peripherals that use advertisement exclusively, and do not allow for connections. This is so that the device can always be found and used, if a connection occurs then the peripheral is meant to stop advertising5.
Apple’s iBeacon is the most popular beacon standard.
Bluetooth Smart Mesh Working Group
In 2017, a set of three specifications were released by the Bluetooth SIG:
- Mesh Profile
- Mesh Model
- Mesh Device Properties
These specifications allowed Bluetooth devices to form a mesh network. Mesh Profiles use Bluetooth LE for it’s underlying radio communications, and as such Mesh Profiles work with Bluetooth 4.2 and Bluetooth 5 devices.
Bluetooth Mesh data packets can be up to 384 bytes.
Packet Delivery
Packets are not routed in a Bluetooth mesh, but instead use flooding. Packets are not sent through a particular sequence of nodes to reach the destination, nor are routing tables kept by any of the nodes. Instead, nodes can be designated as relays receive the message and re-broadcast it to everyone in range. Any relays receiving this will then re-broadcast it again, and so on. Nodes keep track of the packet ID so that they do not re-transmit a message they have already received and transmitted before. This method of flooding is intended to keep the network simple and resilient to node failure. If nodes acted as routers, their failure might have a significant impact on the network7.
Latencies
Bluetooth mesh latency depends on the payload size, number of nodes (incl. number of relays) and the connection topology. You can expect round-trip latencies of around 50ms for packets with an 8 byte payload that go through 3 hops8. Silicon Labs has a great application note, AN1137: Bluetooth Mesh Network Performance which goes into mesh latencies in more detail.
Encryption
Two types of encryption keys:
- Network keys: Specific to a physical network.
- Application keys: Specific to the function of the data, e.g. reading sensor values vs. configuring the sensor.
Bridge ICs
CH9141/CH9143
The CH9141 is a serial-to-Bluetooth BLE bridge IC made by Nanjing Qinheng Microelectronics Co., Ltd. that allows for “transparent” serial communication over Bluetooth. It supports broadcast, host and slave mode.9 It looks like there is not many suppliers for this IC, and much of the information is not in English.
Footnotes
-
Wikipedia (2023, Apr 27). Bluetooth Special Interest Group. Retrieved 2023-05-24, from https://en.wikipedia.org/wiki/Bluetooth_Special_Interest_Group. ↩
-
Bluetooth SIG. About Us - Origin of the Bluetooth Name. Retrieved 2023-05-24, from https://www.bluetooth.com/about-us/bluetooth-origin/. ↩
-
Wikipedia (2021, May 16). Piconet. Retrieved 2023-05-24, from https://en.wikipedia.org/wiki/Piconet. ↩
-
Vijay K. Garg (2007). Wireless Personal Area Network — Bluetooth. Wireless Communications & Networking. Retrieved 2023-05-24, from https://www.sciencedirect.com/book/9780123735805/wireless-communications-and-networking. ↩
-
Argenox. BLE Advertising Primer. Retrieved 2024-02-27, from https://www.argenox.com/library/bluetooth-low-energy/ble-advertising-primer/. ↩ ↩2 ↩3
-
Silicon Labs. Optimizing Current Consumption in Bluetooth Low Energy Devices. Retrieved 2024-04-30, from https://docs.silabs.com/bluetooth/3.2/general/system-and-performance/optimizing-current-consumption-in-bluetooth-low-energy-devices. ↩ ↩2
-
Martin Woolley (2017, Aug 1). BlueTooth Blog - An Intro to Bluetooth Mesh Part 2. BlueTooth SIG. Retrieved 2023-05-24, from https://www.bluetooth.com/blog/an-intro-to-bluetooth-mesh-part2/. ↩
-
Silicon Labs. AN1137: Bluetooth Mesh Network Performance. Retrieved 2023-05-24, from https://www.silabs.com/documents/public/application-notes/an1137-bluetooth-mesh-network-performance.pdf. ↩
-
Nanjing Qinheng Microelectronics Co., Ltd. Bluetooth serial port transparent chip: CH9141. Retrieved 2024-11-20, from https://www.wch-ic.com/products/CH9141.html. ↩ ↩2