IoT Bluetooth
IoT Bluetooth
IoT Bluetooth
Standards
BLUETOOTH
2ECDE65 Internet of Things
Non-IP Based WPAN IP-Based WPAN and WLAN
Protocols Protocols
▪ Bluetooth ▪ TCP/IP
▪ Zigbee ▪ WPAN with IP – 6LoWPAN
▪ Z-wave ▪ WPAN with IP – thread™
▪ IEEE 802.11 protocols and
WLAN (Wi-Fi)
Non-IP Based WPAN
Non-IP based WPAN protocols are wireless communication protocols that do not
use the Internet Protocol (IP). IP is a standard set of rules for routing data packets
across networks. Non-IP based WPAN protocols use their own proprietary protocols
to communicate.
Non-IP (Internet Protocol) based WPAN (Wireless Personal Area Network) protocols
refer to communication standards and technologies used for short-range wireless
connectivity among devices.
WPANs are typically designed for connecting devices within a small, localized area, such
as within a room or between nearby devices. These networks are often used for
purposes like data exchange, control, and automation in scenarios like home
automation, healthcare, industrial automation and more.
Non IP Based WPAN Advantages
• Lower power consumption: Non-IP based protocols are designed to consume less
power than IP based protocols, which is important for battery-powered devices.
• Simpler: Non-IP based protocols are simpler to implement than IP based
protocols, which can make them easier to develop and deploy.
• More efficient: Non-IP based protocols can be more efficient in terms of bandwidth
and latency than IP based protocols.
Limitations:
• Less flexibility: Non-IP based protocols are less flexible than IP based protocols,
which can limit their applications.
• Less compatibility: Non-IP based protocols are not as widely compatible as IP
based protocols, which can make it difficult to connect devices from different
vendors.
802.15 standards
Bluetooth device has a unique 48-bit address, presented in the form of a 12-digit hexadecimal value.
Piconet and Scatternet
Two or more Bluetooth devices can be In a scatternet, devices may participate in multiple
connected point to point or point to piconets simultaneously, allowing them to communicate
multipoint. with devices in different piconets.
In a piconet, one device acts as the Devices that participate in multiple piconets often take on
master, and the other devices are slaves. the role of both master and slave in different piconets.
The master device initiates and controls Scatternets enable more complex Bluetooth network
the communication within the piconet. topologies where devices can relay information between
different piconets.
For example, if you have a smartphone
(master) connected to a Bluetooth For example, imagine a scenario where your smartphone
headset (slave), you have a simple is connected to a Bluetooth headset (piconet 1) while also
piconet. connected to a Bluetooth keyboard and a Bluetooth
speaker (piconet 2).
Bluetooth Connection Procedure
• Inquiry -- One device sends out the inquiry request, and any device listening for such a
request will respond with its address, and possibly its name and other information.
• Paging (Connecting) -- Paging is the process of forming a connection between two
Bluetooth devices. Before this connection can be initiated, each device needs to know
the address of the other.
• Connection -- After a device has completed the paging process, it enters the
connection state. While connected, a device can either be actively participating or it can
be put into a low power sleep mode.
• Active Mode -- This is the regular connected mode, where the device is actively transmitting or
receiving data.
• Sniff Mode -- This is a power-saving mode, where the device is less active. It'll sleep and only listen for
transmissions at a set interval (e.g. every 100ms).
• Hold Mode -- Hold mode is a temporary, power-saving mode where a device sleeps for a defined
period and then returns back to active mode when that interval has passed.
• Park Mode -- Park is the deepest of sleep modes. A master can command a slave to "park", and that
slave will become inactive until the master tells it to wake back up.
Ref:- https://lynxbee.com/understanding-bluetooth-basics-pairing-and-handshaking-process/
Inquiry Procedure
Inquiry procedure in Bluetooth is a process by 3. Response from slaves: The inquiry response
which a master device (such as a smartphone packet includes information about the slave
or computer) searches for and discovers device, such as its BD_ADDR and class of
nearby slave devices (such as Bluetooth device (CoD), which describes the type of
headsets, keyboards, or other peripherals) device it is (e.g., headset, keyboard, phone).
that are available for connection.
4. Device Discovery: Master maintains a list of
1. Initiation of Inquiry: The master device discovered devices along with their
enters an "inquiry mode" and starts sending information.
out inquiry packets to discover other devices.
5. Pairing: Pairing involves exchanging
2. Inquiry Packets: These packets contain encryption keys to ensure secure
information about the master device, such as communication between the devices.
its Bluetooth address (BD_ADDR) and its
inquiry access code.
Paging Procedure
The paging procedure is a fundamental 3. Slave’s Response: The page response
process in Bluetooth communication that acknowledges the page request and confirms
allows a master device to establish a that the slave is available for connection.
connection with a specific slave device. It's
used when devices are already paired, and the 4. Link Establishment: During this phase, they
master needs to reconnect with the slave. negotiate parameters such as the Bluetooth
version, data rate, and other settings.
1. Initialization: Master initiates paging Synchronization with FHSS.
procedure when it wants to reconnect with
paired slave which is not connected with any 5. Data Exchange: Data is sent in packets, and
other device. error-checking mechanisms ensure data
integrity.
2. Page Request: Master sends page request
to specific BD_ADDR of slave. Page request
include timing information for synchronisation
Connection
1. Data Exchange: After the link is established, the devices can begin exchanging data.
2. Connection Maintenance: Both devices continuously monitor the quality of the
Bluetooth connection. They adjust parameters and may retransmit data to maintain a
stable and reliable connection, especially in the presence of interference or signal
degradation.
3. Connection Termination: Either the master or the slave device can initiate the
termination of the connection when it's no longer needed.
4. Idle Mode or Power Saving Mode: When there's no active data exchange, Bluetooth
devices can enter idle mode to conserve power. They remain connected but reduce
their power consumption. Devices can quickly wake up from idle mode when data needs
to be exchanged again.
Bluetooth
Connection
Procedure
Think – Pair - Share
1. If you have Bluetooth in Mobile Phone. An Image is to be printed
with Printer and at the same time music is also available in Headset.
It an example of ______________.
2. What is encryption key? Where it can be used?
3. Which parameters are important during link establishment?
4. Explain different connection modes in Bluetooth.
Bluetooth Versions
Bluetooth Low Energy (BLE)
Bluetooth Low Energy (BLE), often referred to as Bluetooth Smart, is
a wireless communication technology that was introduced as part of
the Bluetooth 4.0 specification.
It is designed to provide low-power, energy-efficient communication
between devices over short distances.
BLE is ideal for applications that require extended battery life, such
as fitness trackers, smartwatches, medical devices, and various
Internet of Things (IoT) devices.
Features of BLE
1. Low Power Consumption: Shorter data packets and minimize the active radio time. Battery life
can be extended with very high energy efficiency.
2. Short Range Communication: Upto 30 meters. Suitable for many IoT devices and wearable
devices.
3. Reduced data rate: Small bursts of data are transmitted intermittently. (200 kbps)
4. Advertising and Scanning: Advertising is often used for device discovery and initial connection
setup.
5. Security: BLE includes security features such as encryption and pairing to protect data
transmissions.
6. Interoperability: BLE is designed to be compatible with classic Bluetooth (BR/EDR), allowing
devices to support both BLE and classic Bluetooth communication for greater versatility.
Bluetooth Low Energy (BLE) or Bluetooth smart
Protocol Stack for Bluetooth
Application Layer: Interaction with specific users. Hands free Profile (HFP) or
Advanced audio distribution profile (A2DP)
Bluetooth Stack Layer: It handles device discovery, pairing, and connection
management.
Logical Link Control and Adaptation Protocol (L2CAP): L2CAP is responsible for
establishing logical channels for data communication between devices.
Service Discovery Protocol (SDP): SDP allows Bluetooth devices to discover
and advertise the services they offer (e.g. Printing, audio streaming, file
transfer etc.)
RFCOMM (Radio Frequency Communication): RFCOMM is a protocol that emulates the
serial port over Bluetooth.
Telephony Control Protocol (TCS-BIN): TCS-BIN provides call control and signalling for
telephony-related Bluetooth profiles, such as the Hands-Free Profile (HFP) used for
hands-free calling in cars.
Audio/Video Control Transport Protocol (AVCTP): AVCTP is used for controlling audio and
video playback between devices. It provides commands for functions like play, pause,
stop, and volume control in A2DP and other audio/video profiles.
Baseband Layer: The Baseband layer is responsible for the physical radio
communication. It handles tasks like modulation, error correction, and frequency
hopping. It also manages the connection establishment and maintenance, including
the handling of packet transmission and reception
Link Manager Protocol (LMP): LMP is responsible for link setup and management. It
handles functions such as device authentication, encryption key exchange, and
power control.
Host Controller Interface (HCI): HCI is a standard interface between the Host stack
(software) and the Controller stack (hardware). It allows the Host to send
commands to the Bluetooth hardware, control the radio, and retrieve status and
event information.
Physical Layer: The Physical Layer encompasses the actual hardware components,
including the Bluetooth radio and antenna. It deals with the transmission and
reception of radio signals, modulation, and other aspects of wireless communication.
Protocol Stack of Bluetooth LE
• Host Layer: The Host Layer is responsible for managing higher-level protocol
functions and application interactions. It includes the Generic Attribute
Profile (GATT) and the Generic Access Profile (GAP). GATT defines how data is
organized and exchanged between devices, while GAP defines how devices
discover, connect, and authenticate with each other. Application-specific
profiles and services reside in this layer. For example, the Heart Rate Profile or
the Battery Service can be defined here for specific applications.
• Logical Link Control and Adaptation Protocol (L2CAP): L2CAP operates just
below the Host Layer and is responsible for segmenting, reassembling, and
managing the flow of data between devices. It supports multiple protocol
multiplexing and segmentation and reassembly (SAR) for larger data packets.
• Attribute Protocol (ATT): ATT is responsible for defining the structure of data and
how it is stored and exchanged between Bluetooth LE devices. It uses a client-
server model, where the client reads, writes, and requests data from the server.
• Link Layer: The Link Layer is responsible for establishing and maintaining the
physical connection between Bluetooth LE devices. It manages the radio and
handles error correction, data encryption, and security. This layer includes
functions like advertising, scanning, and connection establishment.
• Physical Layer (PHY): The Physical Layer is the lowest layer of the stack and deals
with the actual radio communication. It defines how data is transmitted over the
airwaves and specifies the modulation, frequencies, and transmission rates used
by Bluetooth LE.
HCI layer provides communication between the host and controller through a
standardized interface
L2CAP layer provides data encapsulation services to the upper layers, allowing for logical
end-to-end communication of data
Security Manager layer defines the methods for pairing and key distribution, and
provides functions for the other layers of the protocol stack to securely connect and
exchange data with another device
Generic Access Profile (GAP) layer handles device discovery and connection-related
services for the device
Generic Attribute Profile (GATT) layer is a service framework that defines the sub-
procedures for using ATT.
ATT layer allows a device to expose certain pieces of data or attributes, to another
device.
https://www.youtube.com/watch?v=8OfOwD8f2VI https://www.youtube.com/watch?v=eHqtiCMe4NA
Generic Access Profile GAP
❑Broadcasting: No connection
• Broadcaster: A device that broadcasts public advertising data packets,
such as how long a button has been pressed.
• Observer: A devices that listens to the data in the advertising packets
sent by the broadcaster. No connection happens between the
broadcaster and observer.
❑Connecting: Explicitly connect and handshake to transfer data.
• Peripheral: A device that advertises its presence so central devices can
establish a connection. After connecting, peripherals no longer
broadcast data to other central devices and stay connected to the
device that accepted connection request.
• Central: A device that initiates a connection with a peripheral device by
first listening to the advertising packets. A central device can connect
to many other peripheral devices.
Generic Attribute Profile
https://www.bluetooth.com/specifications/gatt
Bluetooth 5
Bluetooth 5 brings several improvements that enhance data transfer
speeds, range, power efficiency, and overall performance, making it
a compelling choice for various wireless communication applications.
Its ability to support a wide range of use cases, from consumer
electronics to industrial IoT, has solidified its position as a versatile
and widely adopted wireless technology.
Three PHY modes of Bluetooth 5
Three PHY modes in Bluetooth 5 give developers the flexibility to choose the best trade-off
between data rate, power consumption, and range for their specific application needs. The
availability of multiple PHY options allows Bluetooth devices to adapt to a wide range of use
cases, from low-power sensors with modest data requirements to high-data-rate audio streaming
and more robust connections in challenging environments.
Bluetooth 5's PHY modes are backward compatible with earlier versions of Bluetooth, which
ensures that Bluetooth 5 devices can communicate with devices using older Bluetooth standards,
such as Bluetooth 4.2 or 4.0. This backward compatibility allows for a smooth transition to the
new PHY modes while maintaining interoperability with existing Bluetooth devices.
3 PHY Modes
LE 1M PHY (Low Energy 1 Mbps LE 2M PHY (Low Energy 2 Mbps LE Coded PHY
PHY) PHY)
Data Rate: 1 Mbps Data Rate: 2 Mbps Variable data rate
This PHY mode is suitable for low- The LE 2M PHY mode offers higher The LE Coded PHY modes are
power, short-range data transfer speeds compared to designed for scenarios where
communication, such as the 1M PHY while still being power- extended range or robustness
connecting sensors, wearables, efficient. against interference is essential.
and other battery-operated It is useful for applications that These modes provide slower data
devices. require faster data transmission, rates but increased signal range and
It offers a balance between data such as audio streaming or firmware improved resistance to interference.
rate and power consumption, updates for IoT devices. They are particularly valuable in
making it ideal for applications applications like Bluetooth-based
that prioritize energy efficiency. asset tracking or outdoor IoT
deployments.
Extended Range in Bluetooth 5
Bluetooth 5 offers significantly improved range compared to previous versions.
The LE Coded PHY mode, in particular, can achieve up to four times the range of
Bluetooth 4.2, making it ideal for applications that require communication over
longer distances, such as IoT devices in large spaces or outdoor environments.
The range can be increased by Higher transmitting power, improved receiver
sensitivity and reduced interference with other signals of same frequency
Improved Coexistence: Bluetooth 5 includes features and mechanisms to reduce
interference and improve coexistence with other wireless technologies operating in the
same frequency band, such as Wi-Fi. This results in more reliable and robust Bluetooth
connections, even in congested wireless environments.
Enhanced Indoor Positioning and Navigation: The increased range and improved accuracy
of Bluetooth 5, combined with its ability to provide direction-finding capabilities, make it
suitable for indoor positioning and navigation applications. This can be used for asset
tracking, wayfinding in indoor spaces, and location-based services.
Lower Power Consumption: Bluetooth Low Energy (LE), introduced in previous versions,
continues to be a core feature of Bluetooth 5. It remains highly power-efficient, making it
suitable for battery-operated devices. This low power consumption extends battery life,
which is crucial for wearables, IoT sensors, and other mobile devices.
Multi-device Connectivity: Bluetooth 5 enables more efficient multi-device
connectivity, allowing a single device to connect and communicate with
multiple Bluetooth peripherals simultaneously. This is beneficial for scenarios
like audio streaming to multiple headphones or managing connections to
multiple IoT sensors.
Beacon Technology
https://www.youtube.com/w
atch?v=2YorsgulwdU
Beacons for
social distancing
https://www.bluepyc.com/application/blueye-ble-social-distancing-solution-covid/
Beacon for Indoor position & Tracking
Calculating Battery life _ A case study
Assume an iBeacon is advertised every 500 ms and the packet length is 31 bytes. The device
uses a CR2032 coin cell battery rated at 220mAh at 3.7V. The beacon electronics consume
49uA at 3V. Use 0.7 factor or battery power decay. Find life of the battery.
https://www.novelbits.io/bluetooth-mesh-tutorial-part-2/
Bluetooth Mesh
•Bluetooth Mesh is a networking technology that extends the
capabilities of traditional Bluetooth wireless communication to
create large-scale, reliable, and scalable wireless networks.
•It is designed for applications where multiple devices need to
communicate and cooperate over a mesh topology, such as smart
homes, industrial automation, building automation, and outdoor
lighting systems.
•Bluetooth Mesh was introduced as part of the Bluetooth 5.0
specification and has been further developed in subsequent
versions.
Features
Low Power Nodes Battery Powered devices with limited processing
Friend Nodes Assist LPN for message relaying, extension of coverage and conserving
power
Proxy Nodes Acting as a bridge. Establish connection between Bluetooth mesh
nodes and internet
Publish-Subscribe Some nodes publish the data and the other nodes subscribe to receive
model the data. This will efficiently distribute the information to specific
group of devices
Scalability Small scale to large scale deployment of network
Configuration and Managed by softwares and administrators to set up the network, assign
Management the roles to nodes andupdate the firmware overt the air (OTA)
Bluetooth Mesh – Role of Nodes
Relay: A node that supports relay is termed a relay node and can retransmit messages received.
Proxy: Allows for Bluetooth LE devices that do not support Bluetooth mesh natively to interact with nodes on the mesh.
Low power: Some nodes on the mesh need to obtain extremely low levels of power consumption. That type of device cannot be
placed in a listening mode. The node enters a role termed the low power node (LPN), which pairs it with a friend node. The
LPN enters a deep sleep state and polls the associated friend for any messages that may have arrived while it was sleeping.
Friend: The friend node is associated with the LPN but is not necessarily power constrained like an LPN. A friend may use a
dedicated circuit or wall power. The friend's duty is to store and buffer messages destined for the LPN until the LPN.
Bluetooth Mesh – Publish-Subscribe
Group or
virtual address
Ease of adding or
removing nodes
without
reconfiguring
entire mesh
Bluetooth Mesh – Type of Nodes
Provisioning is a secure procedure which results in an unprovisioned device
possessing a series of encryption keys and being known to the Provisioner device.
Two types of PDUs are supported: advertising bearer and GATT bearer.
The advertising bearer handles the transmission and reception of mesh PDUs, while the
GATT bearer provides a proxy for devices that don't support the advertising bearer.
BLE: The complete Bluetooth LE specification.
Bluetooth Mesh Topology