Bluetooth
Bluetooth is a short-range wireless technology standard used for exchanging data between fixed and mobile devices over short distances using ultra-high frequency (UHF) radio waves, from 2.402 GHz to 2.48 GHz. Bluetooth uses low-power transmission which gives it a very short range of up to 10 metres but with the benefit of low battery power consumption.
Bluetooth and Wi-Fi are similar in that both are used to exchange data between devices. The difference is that Wi-Fi is access point-centered, with all traffic routed through the access point, while Bluetooth is symmetrical, with data exchanged directly between two Bluetooth devices. Bluetooth serves well in simple applications where two devices need to connect without a dependency on additional devices such as those required for a WiFi access point.
While Ethernet, WiFi, and cellular connections are networking protocols and can be used for data transfer across large networks, Bluetooth is a device-to-device communication protocol, not a networking protocol.
Bluetooth is widely used to exchange files between two devices and connect smartphones to audio playback systems such as headphones, eliminating the need for wires. Bluetooth is also used to connect smartphones to Arduino circuits and IoT appliances to send control signals over a very short distance.
There are two variants of Bluetooth:
Classic Bluetooth
This is the original version of Bluetooth with a limitation that it can only have two devices connected and communicating with each other at one time.
To overcome these limitations and to improve its capability a newer version of Bluetooth (BLE) was introduced which is soon likely to become the de-facto standard.
Bluetooth Low Energy (BLE)
Bluetooth Low Energy is a low-energy variant of Bluetooth (as the name suggests). One of the ways it conserves energy is that unlike Bluetooth that is always on, BLE remains in sleep mode constantly except for when a connection is initiated.
BLE is not simply an upgrade to Bluetooth Classic, it is a different protocol altogether. It is meant for scenarios where you need to exchange small packets of data infrequently, as against exchanging large amounts of data over a coninuous connection, which is better achieved by Bluetooth Classic.
In addition to having a lower energy consumption BLE supports broadcast communication in addition to point-to-point communication.
Every device in BLE communication plays one of two roles: Central and Peripheral.
The Central device initiates a connection with a Peripheral device and receives data transmitted by the peripheral. A common example of a central device is a smartphone, which can connect to several peripherals simultaneously, receiving from each peripheral.
Peripheral devices include sensors, smart wearables, medical devices, and other such devices that read some data and transmit to to a central device for processing.
Every peripheral has what are referred to as Services and Characteristics. Data can be read from or written to characteristics. The peripheral advertises itself and its services so that the Central device can find it and connect with it. There are some standard services and characteristics that many commonly used devices use so that any central device can connect to it and know what data it can expect. You can also specify custom services and characteristics.
Services and characteristics have what are known as Universally Unique Identifiers (UUIDs). A UUID is a universally unique 128-bit number which has a specific format as shown below:
55072829-bc9e-4c53-938a-74a6d4c78776
If your solution is expected to work in the public domain, you will have to ensure the UUIDs you use are indeed unique. If your solution is expected to work in a private domain you can generate UUIDs using an online generator.
We will be using BLE in our Smart Home project. Classic Bluetooth will be demonstrated in other projects.