Bluetooth Low Energy (BLE)

ble-graphic2

WARNING THIS BLOG IS VERY INFORMATIC IN ITS NATURE, YOU HAVE BEEN WARNED.

In this blog post, I will be covering what I’ve researched and learned about the new Bluetooth protocol called “Bluetooth Low Energy” “(BLE)” also known as “Bluetooth Smart”.

In 2009 Bluetooth SIG announced a new version of Bluetooth noted as V4.0 that included a new protocol called BLE. Originally BLE was made by Nokia in 2006 under the name Wibree, however, Wibree was merged into the main Bluetooth standard in 2010 with the release of Bluetooth V4.0.

So what makes Bluetooth V4.0 so special? Well Bluetooth V4.0 operates two different protocols. Number 1 being Bluetooth classic, and number 2 being Bluetooth Low Energy, both protocols operate under the 2.4 GHz ISM band, however, both protocols are not compatible. BLE uses a 40 2MHz-wide channels while Classic uses the 89 1MHz-whide Channels, but one thing both protocols have in common is the ability to use frequency hopping to spread their RF energy.

Bluetooth Low energy, however, is unique in comparison to Bluetooth Classic, not only in the sense of the 40 2MHz-wide Channels but also in how it operates and how its operation allows for low power consumption. With BLE communications two types of communication’s come into play “GAP” and “GATT”, both operate differently, however, comes with its beneficial applications.

 

Generic Acess Profile (GAP)

GAP defines how BLE devices can make them selfs available to each other and how two devices can communicate with each other. GAP plays four different roles that allow for communication to take place:

  1. Broadcaster
  2. Observer
  3. Peripheral
  4. Central

 

Broadcaster – Broadcasts public advertising data packets, an example of this would be as if a button was pressed every 20 – 40ms to show that a signal is taking place within a system however in terms of Bluetooth Low Energy application, these advertising data packets may come as a local thermometer presenting its latest temperature update, or for a business to advertise its latest sales.

Observer – An observer device listens to the data in the advertising packets that is being sent by the broadcaster, an observer can be a range of different devices that is programmed to take in this information, such as a smartphone that is take in that temperate update or present the sales deals.

Note: Overserver and Broadcaster roles do not need to connect in order to transfer data. These two roles are typically used in Bluetooth beacon technology.

Peripheral – Peripheral devices make its presence known through advertising a data packet to allow for a central device to establish a connection. After a connection has been made by a central device the peripheral device stops broadcasting to other central devices and stays connected with the device that has accepted the connection request.

Central – Central devices initiate the connection between its self and a peripheral by the first listening to the advertised data made by a peripheral device. When a central device wants to connect it sends a request connection data packet to a peripheral device. If the peripheral device accepts the request from the central device, a connection is therefore made. Another note about central devices is its ability to connect to many other peripheral devices. Central device can also update the connection parameters between the two devices, the peripheral device cannot, however, the peripheral device can ask permission to the central device to update the connection parameters.

Note: Central or Peripheral devices can terminate the connection made, both devices can terminate connections intentionally, other reasons why the connection may break is due to power issues (such as the device’s batteries dying out) or out of signal range.

Do take a quick few minutes to process that information before moving onto GATT

Generic Attribute Profile (GATT)

GATT defines the roles how two BLE devices send back and forth data using concepts called “services” and “characteristics”. However similar to GAP, GATT is very different as the connection is exclusive to the two connected devices. A GATT connection is only made after a central and peripheral device has gone through the GAP process and updated its communication parameters.

A GATT connection requires two devices whose roles are followed:

 Client – Sends a request to the GATT server, the client can either read and/or write attributes found in the server

Server – the role of the server is to store the attributes, once the client makes the request, the server must make the attributes available.

Client-Server Relationships

An example of a client-server relationship would be. If my accelerometer test device were fully operational and is experiencing movement, and I want to know what type of movement is being experienced by my test device in the form of updated graphs or data through my phone. The test device acts as the server and provides the information, while the phone acts as the client reading the information.

But one interesting point about Client and Server relationships is the fact the roles can be swapped depending on how information is flowing, for example, if the phone needed to send an update for the test device, now the phone would act as the server while the test device acts as the client. Another interesting point would be the fact that central and peripheral devices can act as either a client or server as silently hinted from the previous sentence, but in terms of GAP and GATT communications, both are independently different from one another.

 

Conclusion

In the world of IoT (Internet of things) many new ideas for devices have been under development, mediums such as BLE or NFC have already quickly changed how many of us on earth operate for example contactless payments via card was a NFC “thing” that came out 3 to 5 years ago, now many countries are slowly moving to using their phones via NFC for contactless payments. In nursing homes, Fitbit-like BLE enabled devices are now potentially becoming both a tracker and heart monitor for residents or even patients in a hospital.

Many of these “things” are still the research and development stage however with active devices using BLE, more devices can be interconnected to one another, especially with Bluetooth 5 and their upcoming feature called “Bluetooth Mesh” what will create a whole network of different BLE devices together.

Bluetooth V4.0 – V4.2, and Bluetooth 5 are setting the scene for future and new IoT applications in almost every and any sector.

Resources:

EDN-Europe: http://www.edn-europe.com/blog/bluetooth-low-energy-ble-short-history-ble-standard-and-gatt

Bluetooth SIG: https://www.bluetooth.com/what-is-bluetooth-technology/how-it-works

Adafruit: https://learn.adafruit.com/introduction-to-bluetooth-low-energy/introduction

Punch Through Designs: https://punchthrough.com/bean/docs/guides/everything-else/how-gap-and-gatt-work/

 

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s