Book Image

IoT Projects with Bluetooth Low Energy

By : Madhur Bhargava
Book Image

IoT Projects with Bluetooth Low Energy

By: Madhur Bhargava

Overview of this book

Bluetooth Low Energy, or Bluetooth Smart, is Wireless Personal Area networking aimed at smart devices and IoT applications. BLE has been increasingly adopted by application developers and IoT enthusiasts to establish connections between smart devices. This book initially covers all the required aspects of BLE, before you start working on IoT projects. In the initial stages of the book, you will learn about the basic aspects of Bluetooth Low Energy—such as discovering devices, services, and characteristics—that will be helpful for advanced-level projects. This book will guide you through building hands-on projects using BLE and IoT. These projects include tracking health data, using a mobile App, and making this data available for health practitioners; Indoor navigation; creating beacons using the Raspberry Pi; and warehouse weather Monitoring. This book also covers aspects of Bluetooth 5 (the latest release) and its effect on each of these projects. By the end of this book, you will have hands-on experience of using Bluetooth Low Energy to integrate with smart devices and IoT projects.
Table of Contents (15 chapters)
Title Page
Credits
Foreword
About the Author
About the Reviewer
www.PacktPub.com
Customer Feedback
Preface

Profiles


Profile, in a generic sense as a verb, means to describe, and that is what actually Bluetooth Low Energy Profiles are. In a nutshell, A Bluetooth Low Energy Profile is a description of the behavior of a Bluetooth Low Energy device, and it is also an answer to questions like "What is the purpose of this device?" or "What can this device do?"

Perhaps, a conversation between a company executive and the software development team lead revolving around a Bluetooth Low Energy device will give you an idea of the importance of profiles for Bluetooth Low Energy devices:

Healthcare Company Executive: "We want to roll out a new series of health devices for recording and monitoring a user's blood pressure"

Software Development Lead: "Ok, sure. Do you have some specifics in mind about this device?"

Healthcare Company Executive: "Yes, this will be a small handheld device which can diagnose, record user's blood pressure and send the readings to an app installed on the user's smartphone. The app will then upload the data to our servers to be made available to the doctor for diagnosis."

Software Development Lead: "Since this is an on-demand connectivity device; that is, the user only has to connect to the smartphone to transfer the data; hence this can be built into a low power consumption device which uses Bluetooth Low Energy as a mode of communication with the smartphone. Also, the device will support Blood Pressure Profile to be recognized as a healthcare device, which can process blood pressure data."

After the decision committee has reached a conclusion:

Software Development Lead to Developers: "Our company is rolling out a Bluetooth Low Energy based medical device supporting Blood Pressure Profile and we need to write an app for that. More details in tomorrow's meeting. Please come prepared for the meeting."

Our seasoned developer, developing a newer profile, will now head over to the Bluetooth SIG website to read the specification about the Blood Pressure Profile in preparation for the upcoming meeting.

Note

For more information regarding profiles at Bluetooth SIG visit: https://www.bluetooth.com/specifications/adopted-specifications#gattspec and for Blood Pressure Profile visit: https://goo.gl/jVcB0n.

This is a very real example of an ideal IoT+BLE use case and devices like these already exist fulfilling similar use cases.

Note

To know more about a popular blood pressure meter visit: http://www.welltec-usa.com/welltec-idt-products-blood-pressure-BLE.html. Also, a popular blood glucose meter can be found at: https://www.accu-chek.com/meters/aviva-connect-meter.

The preceding discussion might already have given you some vague idea regarding what a profile actually is and how it matters for a Bluetooth Low Energy device. To solidify it to some extent, here is a popular visualization of a profile:

Figure 12: Bluetooth Low Energy Profile

As the diagram shows, the profile dictates what services each profile hosts and, before delving deeper into that, we would request you please go over the Blood Pressure Profile description document available at the link provided previously, since, not only will it give you a better understanding of what we just discussed, but it will also be very helpful in what we are about to discuss. Don't worry if you don't understand everything there (and in the preceding diagram) at once, as we will be delving much deeper into services and other acronyms, which might be puzzling you at this stage.

Going over the Blood Pressure Profile description document, a few things would have jumped out at you right off the bat:

  • Blood Pressure Profile requires a GATT profile
  • It defines two roles GATT Server (Sensor) and GATT Client (collector)

If you recall, this is exactly what we discussed when we went over the Host layer and briefly touched upon the role of the GATT profile. We are now seeing glucose profile building upon GATT and defining individual device roles for a connection to be established between two devices.

The Profile document also dictates what kind of services the sensor will contain by mentioning the following:

  • The blood pressure sensor will instantiate one, and only one, blood pressure service
  • The blood pressure sensor will instantiate the device information service

That exactly maps up if you look closely at the Profile diagram. The Blood Pressure Profile is already dictating the kind of services it will contain. And this brings us to the question, "What exactly are Services?", which will be our next topic of discussion.