The Internet of Things (IoT) has been a buzzword for decades, but today this market is far from theoretical. There are over 10 billion active IoT devices globally, and one of the key technologies enabling this market growth is Bluetooth Low Energy (BLE).
Introduced in 2012, this flexible protocol provides wireless connection for many of IoT’s most critical applications. Its focus on operating with ultra-low power allows it to be used across industries such as consumer electronics, healthcare, and logistics.
In this article, we’ll equip you with all of the basics of BLE, so you can jumpstart your next BLE development project and get a piece of the massive $384 billion-dollar IoT market.
The Origins of Bluetooth
The Bluetooth Specification has been around since the 90s. The original intent was to design a protocol that would take the place of cables for transmitting data between devices over short distances. Today, this is still its primary use case.
Bluetooth is a short-range wireless technology that operates in the unlicensed 2.4 GHz ISM to transmit data and build personal area networks (PANs).
Most of us probably have a handful of Bluetooth devices within grabbing distance right now: cell phones, laptops, headphones, and speakers. In fact, in 2021, there were over 4.7 billion Bluetooth devices shipped globally. Bluetooth is one of the most widely used technologies in the world.
Most people on the street would know what Bluetooth is – at least at a high level. But behind the scenes, it’s a relatively complex technology standard managed by a group known as the Bluetooth Special Interest Group (SIG). Over the years, the Bluetooth SIG has released different versions of the Bluetooth Specification. The most popular protocols in the spec are Bluetooth Classic and Bluetooth Low Energy.
Up until 2010, the focus was on enhancing Bluetooth Classic. But in 2010, the Bluetooth SIG released v4.0. This version took a different direction than the previous versions by adding a new protocol: Bluetooth Low Energy (BLE).
What is Bluetooth Low Energy (BLE)?
Despite taking many cues from its predecessor, Bluetooth Classic, Bluetooth Low Energy is regarded as a different technology that specifically targets markets where the demand is for ultra-low power rather than high throughput.
Data communication with an LE radio happens in short bursts that do not need to be very frequent. A typical LE use case would include periodically turning on the radio, transferring or receiving a few bytes or kilobytes of data, and then turning off and going back to sleep.
This contrasts with Bluetooth Classic use cases where the radio is not turned off, like maintaining a connection for a lengthy period of time to guarantee the least latency when a call comes in, or use cases like the exchange of a large file.
Bluetooth Classic vs. Bluetooth Low Energy (LE)
While Bluetooth Classic and Bluetooth Low Energy protocols share many similarities, such as both being protocols covered by the Bluetooth Specification and both operating within the 2.4 GHz ISM band, they are two distinct, incompatible protocols.
Bluetooth Classic is designed to handle a lot of data, but it also consumes power quickly. Think about transmitting music from your phone to Bluetooth headphones. That is a traditional use case for Bluetooth Classic.
BLE, on the other hand, is designed for applications that don’t require handling a lot of data but do require really good battery life. Think about a sensor in a temperature-controlled warehouse that you want to set and forget for months or even years. BLE would be a better fit for that kind of application.
While there is more technical nuance to the two protocols, at a high level, the difference between Bluetooth Classic and Bluetooth Low Energy comes down to differences in power consumption and data throughput.
Advantages of BLE
By now, you understand that BLE was developed with a particular market in mind: that of devices that require low power and small data transmission. To help meet this market’s demand, Bluetooth Low Energy provides an array of advantages for both developers and end consumers of BLE devices. Let’s look at a few of the most valuable advantages of BLE:
Low power consumption
Even when compared to other low-power technologies. BLE achieves optimized and low power consumption by keeping the radio off as much as possible and sending small amounts of data at low transfer speeds.
Low cost of entry into development
BLE modules and chipsets are low cost when compared to other similar technologies. This is a result of the increased adoption rate and competition in the marketplace.
Open access to documentation
With most other wireless protocols and technologies, you would have to become a member of the official group or consortium for that standard to access the specification. Becoming a member of those groups can cost a significant amount (up to thousands of dollars annually). With BLE, the major version (4.0, 4.1, 4.2, 5.0, 5.1, 5.2, 5.3, etc.) specification documents are available to download from the Bluetooth.com website for free.
Prevalence in smartphones
This is probably the biggest advantage BLE has over its competitors, such as ZigBee, Z-Wave, and Thread. The vast majority of people in the world own a smartphone, and almost all of those smartphones have BLE hardware inside. This gives developers a much larger potential user base for their applications.
Limitations of BLE
As a developer, understanding the limitations of a particular technology is just as important as understanding its advantages. In this way, you can determine if a particular technology is a good fit for your application or not. Let’s look at a few of the most important limitations of BLE.
The data throughput of BLE is limited by the physical radio data rate, which is the rate at which the radio transmits data. This rate depends on the Bluetooth version used.
For Bluetooth versions earlier than 5.0, the rate is fixed at 1 Mbps. For Bluetooth 5.0 and later, however, the rate varies depending on the mode, and PHY (discussed later in the Physical Layer section) used. The rate can be at 1 Mbps like earlier versions or 2 Mbps when utilizing the high-speed feature.
When utilizing the long-range feature, the rate drops to either 500 or 125 Kbps. At the application layer and for the end-user, the data rate is much lower than the radio data rate.
BLE was designed for short-range applications; hence, its range of operation is limited. There are a few factors that limit the range of BLE, including:
- It operates in the 2.4 GHz ISM spectrum, which is greatly affected by obstacles that exist all around us, such as metal objects, walls, and water (especially human bodies).
- Performance and design of the antenna of the BLE device.
- The physical enclosure of the Bluetooth Low Energy device affects the antenna performance, especially if it is an internal antenna.
- Device orientation – effectively relates to the positioning of the antenna (e.g., in smartphones).
Gateway Requirement for Internet Connectivity
To transfer data from a BLE-only device to the Internet, another BLE device that has an IP connection is needed to receive this data and then, in turn, relay it to another IP device (or to the internet).
When it was released in 2010, the BLE protocol primarily focused on the Internet of Things (IoT) applications where small amounts of data are transferred at lower speeds. Over the last decade, BLE has been used in various applications, from consumer devices to industrial manufacturing. Let’s take a look at a few of the most common applications we see today:
- Home automation: Much of the home automation market is, in part, enabled by the use of Bluetooth LE. BLE technology enables devices like smart lights, smart thermostats, smart locks, and sensors that detect smoke or an ajar window.
- Fitness tracking: Many of us have smartwatches or Fitbits that track our heart rate, steps, and more. These health and activity tracking devices communicate with apps on our phones using BLE. These short bursts of data at close range are a perfect candidate for BLE technology.
- Audio devices: We’re all familiar with Bluetooth headphones, but typically these devices utilize Bluetooth Classic. One of the latest developments in Bluetooth Low Energy is LE Audio. This new standard offers several advantages over traditional Bluetooth, including improved audio quality, lower power consumption, and support for hearing aids.
- Contact tracing: Smart contact tracing systems are starting to emerge to help prevent the spread of infectious diseases. Instead of manually reporting data that can be used to identify those who have been in close contact with an infected person, BLE-enabled contact tracing allows for continuous scanning of BLE “tags” or smartphones to anonymously track human touchpoints.
- Item finding tags: An increase in travel chaos has had some people adding AirTags or Tiles to their luggage in case it gets lost. These BLE-enabled precision tracking devices can be used for more than just luggage, though. You can pop one on anything you think you might lose, like a bicycle or your car keys, and track its location via a smartphone app.
- Targeted ads: Imagine being at the clothing store and getting a push notification for a coupon delivered to your phone for the very store you’re in. These types of personalized, location-based ads are exactly what advertisers and store owners can deliver. This is thanks to enhancements found in Bluetooth 5.0 along with Bluetooth Beacons’ broadcasting technology.
- Inventory management: Warehouse managers are starting to use BLE solutions to track temperature and humidity on sensitive shipments, detect drops for fragile items, and even map out the most optimal storage locations for assets within a warehouse. There is significant potential in this area to combine artificial intelligence and BLE to provide a truly smart logistics chain.
BLE and the Internet of Things (IoT)
While IoT technology has been around for some time, in recent years, it’s been gaining some serious traction. This traction means there’s also been an uptick in confusing explanations of what IoT is exactly. So, let’s break it down.
The Internet of Things is the network of billions of devices – “things” – that are connected wirelessly to exchange data over the internet. IoT technology helps to connect things like thermostats, smart lights, people with embedded medical devices, animals with implanted trackers, and cars with driver-assist sensors. Any person, animal, or man-made object can become a “thing” in IoT. This means IoT is essentially connecting people, processes, and systems.
To make all of these connections possible, IoT relies on wireless technologies. ZigBee, Bluetooth Classic, and WiFi can all be used to connect devices wirelessly. However, BLE is often viewed as the most optimal technology for IoT applications because of two main reasons:
- Low power consumption. Many IoT devices are battery-powered and need to last in the field for a very long time. For example, it would simply be impractical to regularly replace the batteries in hundreds of sensors in a warehouse environment.
- The type of data being exchanged. BLE is optimized to transmit a small amount of data. This works great for IoT devices like sensors that just need to transfer state data.
Bluetooth beacons are small and wireless battery-powered transmitters that use BLE protocol for transmission. The special thing about beacons is that they usually work in one direction. They broadcast to nearby Bluetooth Low Energy devices, but they do not receive data. BLE beacons do not require an internet connection to do this broadcasting. Typically this would look like a single beacon broadcasting data to smart devices (cell phones, smart watches, etc.) nearby.
Currently, smartphone support for Bluetooth beacons is lacking, so real-world implementations are minimal. In the future, we will likely see beacons being used for things like proximity marketing, indoor navigation, and asset tracking in the logistics industry.
BLE Development Basics
The Bluetooth Low Energy protocol is not straightforward to learn, even if you’re a seasoned developer. To get you started on your BLE development journey, we’re going to break down the Bluetooth LE protocol architecture at a high level and each of the BLE protocol layers.
Bluetooth LE Protocol Architecture
Bluetooth Low Energy is a protocol. And just like any other protocol, it acts as a rulebook that devices must adhere to in order to communicate or exchange information.
It’s important to understand that a protocol’s general functionality is broken down into smaller protocols, each of which is responsible for a very specialized role. These smaller protocols are packaged into a layered architecture called a protocol stack or protocol suite.
The Bluetooth protocol stack is broadly broken down into three primary components or subsystems: application, host, and controller. Inside each of these blocks are distinct layers.
BLE Protocol Layers
If you are a developer looking to develop BLE applications, you won’t have to worry much about the layers below the Security Manager and Attribute Protocol layers. But it might still be helpful to have some context about these layers. Let’s take a look.
The Physical Layer
The physical layer (PHY) refers to the physical radio used for communication and for modulating/demodulating the data. It operates in the ISM band (2.4 GHz spectrum).
The Link Layer
The Link Layer is the layer that interfaces with the Physical Layer (Radio) and provides the higher levels an abstraction and a way to interact with the radio (through an intermediary level called the HCI layer which we’ll discuss shortly). It is responsible for managing the state of the radio as well as the timing requirements for adhering to the Bluetooth Low Energy specification.
The Host Controller Interface (HCI)
The (HCI) layer is a standard protocol defined by the Bluetooth specification that allows the Host layer to communicate with the Controller layer. These layers could exist on separate chips, or they could exist on the same chip.
The Logical Link Control and Adaptation Protocol (L2CAP)
The L2CAP layer acts as a protocol multiplexing layer. It takes multiple protocols from the upper layers and places them in standard BLE packets. These packets are then passed down to the lower layers beneath it.
Attribute Protocol (ATT)
The Attribute Protocol (ATT) defines how a server exposes its data to a client and how this data is structured.
Generic Attribute Profile (GATT)
The Generic Attribute Profile (GATT) defines the format of the data exposed by a BLE device. It also defines the procedures needed to access the data exposed by a device.
There are two Roles within GATT: Server and Client. The Server is the device that exposes the data it controls or contains and possibly some other aspects of its behavior that other devices may be able to control.
A Client, on the other hand, is the device that interfaces with the Server with the purpose of reading the Server’s exposed data and/or controlling the Server’s behavior. Keep in mind that a Bluetooth LE device can act as the Server and a Client at the same time.
To understand the GATT, you need to understand Services and Characteristics. Services are a grouping of one or more Attributes (a generic term for any type of data exposed by the server). It’s meant to group together related Attributes that satisfy a specific functionality on the Server. For example, the SIG-adopted Battery Service contains one Characteristic called the Battery Level.
A Characteristic is always part of a Service, representing a piece of information/data that a Server wants to expose to a client. For example, the Battery Level Characteristic represents the remaining power level of a battery in a device that can be read by a Client.
In BLE, there are six types of operations on Characteristics:
Generic Access Profile (GAP)
The GAP provides a framework that defines how BLE devices interact with each other. This includes:
- Roles of BLE devices
- Advertisements (Broadcasting, Discovery, Advertisement parameters, Advertisement data)
- Connection establishment (initiating connections, accepting connections, Connection parameters)
The different roles of a Bluetooth LE device are:
- Broadcaster: a device that sends out Advertisements and does not receive packets or allow Connections from others.
- Observer: a device that listens to others sending out Advertising Packets but does not initiate a Connection with an Advertising device.
- Central: a device that discovers and listens to other devices that are Advertising. A Central also has the capability of connecting to an Advertising device.
- Peripheral: a device that Advertises and accepts Connections from Central devices.
Keep in mind that a single device may operate in multiple Roles at the same time. For example, your smartphone can operate in the Central role when communicating with your smartwatch and also act in the Peripheral role while communicating with a PC.
How to Learn More About BLE?
We’ve only scratched the surface of the BLE technology. If you’re looking to dive a little deeper or just stay up-to-date on the latest in Bluetooth, there are numerous free and low-cost resources available. Some of our top tips are:
- Read a book on BLE. Intro to Bluetooth Low Energy is a great resource for Bluetooth developers. You can pick up a physical copy on Amazon or a free digital version on my website.
- Get your hands on a development kit. This is one of the best ways to put knowledge into practice. Some of the best are:
- Use a Bluetooth sniffer.
- Subscribe to industry newsletters:
- Read official spec docs. While not the easiest to digest, every Bluetooth developer should have a copy of the latest official Bluetooth spec (Bluetooth v5.3 specification).
- Join the Developer Academy. If you’re looking to get expert help to accelerate your Bluetooth LE product development, the Bluetooth Developer Academy.
Summary – Bluetooth Low Energy (BLE)
Let’s take a look at the highlights of what we covered in this BLE Guide:
- Bluetooth Low Energy was released in 2010 as part of version 4.0 of the Bluetooth Spec.
- BLE is a separate protocol from Bluetooth (also known as Bluetooth Classic). The two protocols are not compatible.
- BLE is designed for applications that demand ultra-low power but do not require the transmission of large amounts of data.
- The Bluetooth protocol stack is broken into three primary subsystems: application, host, and controller.
- As a developer, you must understand how the GATT and GAP protocol layers of BLE function.
- If you’re a developer looking to dive deeper into the BLE protocol, we recommend you pick up a BLE book, get your hands on a development kit, and start getting plugged into industry resources.