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

Bluetooth 5, Meshes, and Beacons


The retail market for connected things is projected to have a worth of 53.75 billion by 2022 and Bluetooth Low Energy is forecast to witness a substantial growth with a CAGR of over 25% during the forecast period.

Note

For more extensive reading on the study conducted on the growth of the retail market of connected things, visit https://iotbusinessnews.com/2016/03/16/57411-connected-retail-market-worth-53-75-billion-usd-by-2022/.

In other words, this makes Bluetooth Low Energy a significant driver for this forecast growth and technology to be taken seriously. Bluetooth SIG is leaving no stone unturned to make the existing Bluetooth Low Energy technology a better fit for IoT Applications. The SIG recently finalized and released the specification for Bluetooth 5, which takes the existing technology to the next level by enabling quadrupled range, twice the speed and increasing the data broadcasting capacity by 800%. These new features are specifically focused on Internet of Things technology.

Note

You can find the press release by SIG (Bluetooth Special Interest Group) for Bluetooth 5 at https://www.bluetooth.com/news/pressreleases/2016/06/16/-bluetooth5-quadruples-rangedoubles-speedincreases-data-broadcasting-capacity-by-800.

However, MCUs supporting Bluetooth Low Energy 5 like the one shown here are already available:

Figure 16: CC2640R2F MCU supporting Bluetooth Low Energy 5

Bluetooth 5 is a new standard, which has been rolled out very recently (from the end of 2016 to the beginning of 2017). For the consumers, it may take some time to feel the difference between the older Bluetooth Low Energy 4.2 versus the Bluetooth Low Energy 5 as various device manufacturers will adopt this standard and manufacture Bluetooth Low Energy 5 compatible devices, which will then hit the market and eventually end up in the hands of the consumers. As of the writing of this book, Samsung has already taken the lead and has released Galaxy S8 worldwide during the period towards the end of April and beginning of May 2017, which is the first smartphone to support and an early adopter of Bluetooth Low Energy 5. However, another key update, which is not immediately included in the Bluetooth Low Energy 5 standard is the specification for Mesh Networking. It is still said to be in works and probably will arrive early next year. This update for Bluetooth Low Energy is crucial for the IoT paradigm as it can enable data to be transferred across even greater distances just via Bluetooth Low Energy nodes/hubs. We shall briefly touch upon Mesh Networking to see how this is possible.

Traditional Bluetooth Low Energy network topology looks something similar to the star topology such as shown in the following diagram:

Figure 17: A traditional Bluetooth Low Energy network star topology; source: www.wikipedia.com

Here, one device acts as the server and others access information (characteristics) from the server, if and when required. It goes without saying that this is the traditional way of communication, and it limits the networking capabilities in terms of the following:

  • Limited range/distance of data transfer
  • Nodes are not directly connected, all data goes through a central device (server)
  • Single point of failure, if the server fails everything else fails too

The preceding factors mentioned can severely limit an IoT-based solution.

The solution to this is the eagerly awaited mesh networking update, intended to transforming each individual Bluetooth Low Energy node to a hub, where the node/hub can also transfer data to the nearby devices. This will change the network topology from a traditional star network to a Mesh as shown as follows:

Figure 18: A mesh topology; source: www.wikipedia.com

This means each node of the network can accept and forward data to a neighboring node, allowing a network to scale more easily by just adding new nodes. A mesh network exhibits the following characteristics:

  • Self Forming/Organising: As soon as a new node joins the network, all its adjacent nodes are notified so that an optimized path can be configured dynamically for the data packets.
  • Self Healing: If one node fails in the network then surrounding nodes immediately become aware of this and an optimized path is configured dynamically for the remaining data packets. A single node cannot cause the failure of the complete network. The network continues to function without any downtime as long as the density of the devices is sufficient to keep the communication ongoing.
  • Self Optimization: The network can self-optimize itself to have as large a coverage as possible.

Another pre-existing piece of hardware technology, which is greatly going to benefit with Bluetooth Low Energy 5 is Beacons. Beacons are small sized, Bluetooth Low Energy devices which broadcast information:

Figure 19: Beacons from various vendors; source: www.wikipedia.com

Bluetooth Low Energy Beacons are primarily used for proximity broadcasting or advertising. A very popular use case of beacons is to broadcast/advertise contextual information to nearby smartphones and handheld devices, which support Bluetooth Low Energy, in close proximity. The context of the information can be bus updates on a bus stop, new products in a store, or special delicacies available at a restaurant.

The other uses of Beacons include:

  • Indoor Navigation: Since GPS does not work indoors, Bluetooth Low Energy can be used for indoor navigation by placing beacons at strategic places in a closed space (houses/offices)
  • Tracking Things: Bluetooth Low Energy based Beacons/tags can be attached as trackers to things that are more prone to getting lost, such as keys. These items can then be monitored via a smartphone app
  • Personal Monitoring: Monitoring patients, the elderly, and toddlers inside a home

There are already various preprogrammed beacons and respective development kits available in the market.

Note

For an insight about Estimote Beacons, please visit https://estimote.com/.

However, later in the course of this book, we will take the road less traveled and create a beacon of our own using a Raspberry Pi. Also, we shall discuss the two primary Beacon protocols namely, Eddystone and iBeacon.