Bluetooth is one of the most popular wireless protocols, and it has been available in smartphones, computers, and other devices for over a decade. Most of us are familiar with Bluetooth and how Bluetooth can allow us to connect a headset and make calls using our cellphones. The explosive growth in Bluetooth devices led the Bluetooth SIG and other companies to the realization that Bluetooth consumed too much power and took too long to connect in some applications. So that they have implemented Bluetooth Low Energy, mostly called as BLE. So Now we will see the Bluetooth Low Energy (BLE) Introduction. I’ve divided this tutorial into two parts. In this Part 1 we will see the very basic things about BLE.
- 1 Bluetooth Low Energy (BLE) Introduction
- 2 Building Blocks of Bluetooth Device
- 3 Data Throughput
- 4 Operating Range
- 5 Network Topology
- 6 BLE Protocol Stack
Bluetooth Low Energy (BLE) Introduction
Bluetooth Low Energy is also called as BLE and Bluetooth Smart. When Bluetooth released the the Bluetooth 4.0 core specification, they introduced BLE . The BLE was actually started by Nokia, as a project once called “Wibree”, and was introduced in 2006 under that certain name. In 2010, the Bluetooth Special Interest Group merged Wibree into the Bluetooth standard as a part of the 4.0 core specification. Although it is a part of the same specification, BLE alone is not backwards compatible with Bluetooth, and so we can not treat it as the same protocol as Bluetooth.
Now a days everyone having mobile phone. So BLE can communicate with a large number of mobile devices find today, phones which run Android,OS X, Windows Phone, iOS and BlackBerry, as well as Linux, and Windows 8 all support BLE. Which means that you can integrate your project easily to make a multi-platformed communication. The main big adavantage of the BLE is it consumes very very less power. BLE, unlike the classic Bluetooth standard, is designed to reduce power consumption, allowing your BLE device to run for months or years on a coin-cell battery. Now lets learn the working of BLE.
Building Blocks of Bluetooth Device
There are three main building blocks in every Bluetooth device.
The user application interfacing with the Bluetooth protocol stack to cover a particular use case.
The upper layers of the Bluetooth protocol stack.
The lower layers of the Bluetooth protocol stack, including the radio.
Additionally, the specification provides a standard communications protocol between the host and the controller. That is Host Controller Interface (HCI). It is used to allow interoperability between hosts and controllers produced by different companies.
These layers can be implemented in a single integrated circuit (IC) or chip, or they can be split in several ICs connected through a communication layer (UART, USB, SPI, or other).
The modulation rate of the Bluetooth Low Energy radio is set by the specification at a constant 1Mbps. This, of course, is the theoretical upper limit . In practice, you can expect between 5-10 KB per second, depending on the limitations of the devices used.
The actual range of any wireless device depends on a wide variety of factors (operating environment, antenna design, enclosure, device orientation, etc.) but Bluetooth Low Energy is unsurprisingly focused on very short-range communication. It’s possible to create and configure a BLE device that can reliably transmit data 30 meters or more line-of-sight, but a typical operating range is probably closer to 2 to 5 meters. Of course, the higher the range the more battery consumption, so take care when trying to tweak your device for higher range.
A Bluetooth Low Energy device can communicate with the outside world in two ways:
Well. Have you heard about the term Broadcasting? What is it? Exactly. Broadcasting means sending data to more that one members. Same here also. Broadcasting is the act of sending data out to all the listening devices. Using connection less broadcasting, you can send data out to any scanning device or receiver in listening range. See the below picture.
In this mechanism essentially allows you to send data out one-way to anyone or anything that is capable of picking up the transmitted data.
Broadcasting defines two parts.
Sends non connectable advertising packets periodically to anyone willing to receive them.
Repeatedly scans the preset frequencies to receive any nonconnectable advertising packets currently being broadcasted.
Each advertising packet can carry up to 31 bytes of advertising data payload, along with the basic header information (including Bluetooth device address). Such packets are simply broadcast blindly over the air by the advertiser without the previous knowledge of the presence of any scanning device.
Broadcasting is fast and easy to use, and it’s a good choice if you want to push only a small amount of data on a fixed schedule or to multiple devices.
Note: A major limitation of broadcasting, when compared to a regular connection, is that there are no security or privacy provisions at all with it (any observer device is able to receive the data being broadcasted), so it might not be suited for sensitive data.
If you need to transmit data in both directions, or if you have more data than the two advertising payloads can accommodate, you will need to use a connection. A connection is a permanent, periodical data exchange of packets between two devices.
Connections involve two separate roles:
Central devices are usually mobile phones or PC’s which have a higher CPU processing power. This Central devices repeatedly scans the particular frequencies for advertising packets. If it finds any suitable packets, it will initiate the connection. Once the connection is established, the central manages the timing and initiates the periodical data exchanges.
Peripheral devices are usually some sensors or low power devices, which connect to the central device. So this peripheral device sends the advertising packets periodically. And also it accepts the incoming connection. Once in an active connection, the peripheral follows the central’s timing and exchanges data regularly with it.
I explained the connection procedure below.
Peripheral devices periodically sends the advertising packets.
Central devices scanning the advertising packets from nearby peripheral devices.
If central device find a suitable advertising packet, It send the connection requests to the peripheral device.
Perpheral devices accepts the incoming connection.
After establishing the connection, Peripheral device stops the advertising and follow the central device.
Now two devices can exchange the data in two direction.
Beginning with version 4.1 of the specification, any restrictions on role combinations have been removed, and the following are all possible:
A device can act as a central and a peripheral at the same time.
A central can be connected to multiple peripherals.
A peripheral can be connected to multiple centrals.
In the below diagram, I have explained the both advertising and connection modes.
These all the very basics of the Bluetooth Low Energy (BLE). Now we will go into some depth. Let’s start the Bluetooth Low Energy (BLE) Protocol Stack.
BLE Protocol Stack
BLE, like many other wireless technologies, is organized in a number of layers. Each layer has its purpose and plays a significant role in making a BLE device function properly. As we discussed before there are three building blocks present in the BLE.
Each of these basic building blocks of the protocol stack is split into several layers that provide the functionality required to operate:
The application, like in all other types of systems, is the highest layer and the one responsible for containing the logic, user interface, and data handling of everything related to the actual use-case that the application implements. The architecture of an application is highly dependent on each particular implementation.
Host contains following layers.
Generic Access Profile (GAP)
Generic Attribute Profile (GATT)
Logical Link Control and Adaptation Protocol (L2CAP)
Attribute Protocol (ATT)
Security Manager (SM)
Host Controller Interface (HCI), Host side
Controller contains following layers.
Host Controller Interface (HCI), Controller side
Link Layer (LL)
Physical Layer (PHY)
Now that we know a bit about BLE. In our next part (Part 2) we will see the whole protocol stacks layers of BLE. I hope you would enjoyed in this tutorial. Let’s breath freely 😆