The Basic Concepts of Bluetooth Low Energy (BLE) for Beginner
Bluetooth Low Energy (BLE) is a very exciting wireless technology for the Internet of Things (IoT). There are many online resources about Bluetooth Low Energy. However, these resources are scatter and most of them only focus on a certain topic. Hence, I started this series on BLE, to go from the basic concepts about BLE, and slowly diving into the BLE application development with mobile and embedded systems. This series aims to create a comprehensive understanding of BLE such that one can easily work with high-level APIs on modern smartphone and embedded devices.
This article mainly focuses on the basics of BLE and how BLE difference from the well-known Bluetooth technology. For the rest of the series, it will be updated slowly until its completion. The list below will keep track of all the updated topic from time to time.
- Bluetooth Protocol Stack — Controller
- Bluetooth Protocol Stack — Host Controller Interface (HCI)
- Bluetooth Protocol Stack — Host-GAP
- Bluetooth Protocol Stack — Host-GATT
- Others — Received Signal Strength (RSS)
The Development of Bluetooth
Bluetooth is a short-range wireless technology for device-to-device communication over radio links. Originally, Bluetooth is designed as a cable replacement for data exchange, multimedia streaming and device control. The use cases ranging from exchanging files between Bluetooth-compatible devices, listening to music or answering calls with Bluetooth headsets, to controlling the computer with Bluetooth mouse. Bluetooth is ubiquitous and can be found almost 100% in today’s mobile devices (e.g., smartphones, tablets, laptops, etc.).
On the other hand, BLE is a new and existing technology that is designed to operate with the lowest possible power consumption, low cost, low bandwidth and complexity. Such a radio standard was originally initiated by Nokia as Wibree. These design goals eventually lead to Bluetooth 4.0 (i.e., BLE)— a genuine low-power standard that can run for an extended period on a small coin cell battery. While BLE reused some protocol designs from classic Bluetooth, it is considered as a completely different technology with different design goals and use cases. In other words, BLE is not backward compatible with Bluetooth. Bluetooth devices with any specification version prior to 4.0 cannot communicate in any way with a BLE device. The on-air protocol, the upper protocol layers, and the applications are incompatible between these two technologies. Table below compares the features between BLE and classic Bluetooth (BR/EDR).
Since the introduction of Bluetooth 4.0 in 2010, we have seen a rapid adoption of BLE in many commercial products. Such a growth is intimately tied to the pervasive used of Bluetooth in modern mobile devices, such as smartphones, tablets, and laptops. Furthermore, the active adoption of BLE by the giant tech company, such as Apple, Google and Microsoft, path the way for the explosive implementation of BLE in different IoT use cases.
Bluetooth 4.1, which released in December 2013, is the first major update of BLE. Since then, Bluetooth 4.1 has become the reference for application development based on BLE. While the basic building blocks remained intact, there are multiple changes with Bluetooth 4.1 to improve the user’s experience. Note that Bluetooth 4.1 is backwards compatible with Bluetooth 4.0, hence, we can ensure a correct interoperability among devices implementing specification versions of 4.0 and 4.1.
To provide support to the classic Bluetooth, Bluetooth SIG later introduced Bluetooth Smart Ready. Bluetooth Smart Ready, is a dual-mode wireless standard, enables device to incorporating both classic Bluetooth and BLE into application development. Figure below shows the protocol stacks comparing classic Bluetooth, BLE and Bluetooth Smart Ready.
Nowadays, most of the end user’s device support Bluetooth Smart Ready, whereas the sensor infrastructure mostly use single-mode Bluetooth standard (typically BLE) to conserve the energy. Those Blueooth Smart Ready devices can forward the data collected from pure BLE-based sensors to the Internet via the WiFi radios or cellular access.
The Main Features of BLE
Comparing the data rate of BLE and WiFi, one can see that each technology aims to increase their data rate from one version to another version. It is same as Bluetooth until Bluetooth 4.0, which takes a completely different path aiming to reduce the power consumption rather than increasing the data rate. Device developed with BLE consumes very low power and is expected to operate reliably for months to years on a coin cell battery. Such a low power feature is favorable for many IoT applications. Besides low power, BLE also features the following characteristics:
- small form factor
- low cost
- fast link setup time
- data is always transmitted in a short burst
- secure
Perhaps one of the less visible key factors contributing to the success of BLE is its service for data exchange. There is a fundamental difference with classic Bluetooth, BLE, in general, can facilitate a bunch of data without having to know anything about the underlying technology. Recognize this feature, smartphone operating system always provide flexible but low-level APIs that allow developers a greater freedom to work with the BLE framework in any way they see fit.
The ability for the BLE devices to communicate with pervasive smartphone give them an unusual low barrier to adoption. Since public users are accustomed to the smartphone in their pocket, it is easy for users to interact with the BLE devices directly with their own smartphone. With an easy-to-use data model, no intrusive licensing costs, no fees to access the core specs, and a lean overall protocol stack, it should be clear why platform designers and mobile vendors see a winner in BLE.
Network Topology
BLE can communicate with other devices in the following two ways: 1) broadcasting or 2) connections. Each mechanism has its own advantages and limitations, and they are both subject to the guidelines established by the Generic Access Profile (GAP), which we will look at it in more details later.
Broadcasting is typically connectionless: a BLE device works as broadcaster will send packet to any scanning device within its communication range. Such a communication mechanism is one way and insecure, i.e., any Bluetooth-compatible device can easily pick up the data broadcast by the BLE device. According to GAP, the device that broadcast the packet is called the broadcaster, whereas the device that listen for the packet is called the observer. The communication is unidirectional, many-to-one, in which the network topology is a star topology as follows:
Broadcasting takes advantage of the advertising features of BLE to send a small packet (typically 47 bytes with 31 bytes customizable payload) to multiple devices at any time. The advertising feature has been used by the famous iBeacon and Eddystone. We will talk more about the concepts related to beacon’s advertising, including its advertising packet, channels, etc. in later topic of this series.
Connections, on the other hands, establish a secure link for two devices to exchange data over the data channels. There are certain steps in establishing a secure connection between two devices. The diagram below illustrates the steps involved in connection establishment.
To initiate a connection, a central device picks up the advertising packets broadcast by a peripheral device, and then sends a connection request to the peripheral. Upon accepting the connection request, the central and peripheral devices become the master and slave, respectively. More precisely, the device initials the connection request would be the master, and the device accepts the request would be the slave. When the devices are in a connection state, both devices can exchange data in either direction.
Upon connection establishment, the master will coordinate the timing to facilitate periodical data exchanges, whereas the slave follows the timing set by the master. Note that with Bluetooth 4.1, the device can acts as a central and peripheral at the same time. The central can be connected to multiple peripherals and a peripheral can be connected to multiple centrals, this lead to the establishment of a scatternet, as shown belows:
Generic Attribute Profile (GATT) is used to organize the data into services and characteristics. With GATT, we can have multiple services and characteristics organized in a more systematic structure. In general, services contain multiple characteristics, each with their own access rights and descriptive metadata. GATT ensures a higher throughput and a secure encrypted link by negotiating connection parameters that fit the data model.
Limitations of BLE
Good design is all about making the right tradeoffs. Similarly, BLE might not be a solution that meets the requirement of different wireless application. Classic Bluetooth, WiFi, NFC, and other wireless technologies still have their place, with their own unique set of design tradeoffs and decisions. The two keys limitaions of BLE are its data throughput and communication range:
- Data throughput: the modulation rate of BLE is set by the specification at a constant 1 Mbps. This sets the theoretical upper limit for the throughput that BLE can provide. In practical scenario, this limit is typically lowered significantly owing to protocol overhead, radio performance and software restriction.
- Communication range: BLE is generally focused on short-range communication. It’s maximum communication range is determined by the configurable transmit power. Note that the higher the transmit power, the shorter the lifetime of the battery. While it is possible to configure a BLE device to transmit data up to 30 meters, a typical communication range is probably closer to 2 to 5 meters.
Other Wireless Technologies
There are many competing technologies to BLE. Here, we provide a quick review about some of them:
- ANT: this ultra-low power wireless technology is responsible in sending information between devices in a robust and flexible manner. With millions of deployed nodes, ANT is perfectly suited for any kind of low data rate sensor network topologies, such as star and mesh. ANT is specifically designed for wireless sensor networks (WSN) that requires highly resource optimized and network flexibility.
- ZigBee: this 2.4GHz wireless technology is designed to address the unique needs of low-cost, low-power wireless sensor and control networks. ZigBee is easy to implement and requires very little power for operation. The opportunity for growth into new markets, as well as innovation in existing markets, is limitless.
- Near Field Communication (NFC): NFC technology has been widely used for on-spot transaction, digital content exchange and allowing devices to connect with a touch. NFC harmonizes today’s diverse contactless technologies, enabling current and future solutions in areas like access control, consumer electronics, health care, information collection, etc.
Thank you for your support. I hope you like this series. Please let me know if you spot any mistake so that I can correct them.