Wi-Fi and Bluetooth in IoT Smart Lock Systems - and why do we need both
Wireless IoT options
When designing an IoT device you are faced with a difficult choice: what wireless networking technology to choose? After all there are so many, how do you decide which one is best for your project? In what follows we will explore some of the factors involved in deciding the best wireless tech for an IoT smart lock device.
As the Internet of Things (IoT) is rapidly gaining momentum, more and more everyday objects have an IP address and ability to communicate with each other, either locally or across the Internet. An IoT system could consist of a range of devices: smart TVs, smart speakers, wearables, or smart locks like Keymitt, and concentrator or Internet gateway devices providing access to a back-end cloud server. These devices may support one or several different wireless network standards such as Wi-Fi, Bluetooth, Zigbee, Z-Wave, Thread, LoRa etc. Building a new IoT device / application you’ll need to decide which interface is best suited for your use case. There is no silver bullet or one-fits-all here - these solutions offer different power consumption, coverage/range, throughput, security, price, compatibility etc. In case of Keymitt’s smart lock we decided the device should be able to communicate directly with a user’s smartphone, allowing for autonomous operation. This narrowed the choices down to Bluetooth and Wi-Fi - the two most universally available interfaces, discussed here in more detail.
Bluetooth and Wi-Fi networking systems come from two different worlds, namely the PAN and LAN. Bluetooth was initially designed for interconnecting small, battery operated devices that surround us, forming a low power, short range wireless Personal Area Network (WPAN). On the other hand, a LAN (Local Area Network) normally covers a significantly larger area, such as an office floor, a building, or even several buildings. A Wireless LAN is its radio-based extension, designed with the same purpose in mind: interconnecting computers, printers, routers and other devices within a fast local network. Over the years both of these technologies went through several evolution cycles, adding features that at times overlap. Nevertheless, at their core they stay true to their legacy applications.
Differences between Wi-Fi and Bluetooth from the IoT perspective
When it comes to coverage Wi-Fi easily outperforms Bluetooth. Wi-Fi devices usually have higher available transmission power, with more (and higher gain) antennas. A typical Wi-Fi transmitter may radiate up to 100 mW (20dBm) or 200 mW (23 dBm) of power, in some cases even 1 W (30 dBm) for outdoor installations in the 5 GHz spectrum. Bluetooth devices are more constrained: smaller device size limits the achievable antenna gain, and the choice of the Bluetooth chipset determines the output power limit (called Bluetooth device class). The reception range is power-class-dependent: when two devices with different power classes communicate, the actual range is determined by the weaker (lower class) device power, the higher class device’s receiver sensitivity, and both device’s antenna gains.
In both Wi-Fi and cases these power ratings refer to the maximum (nominal) power determining the maximum range. It does not mean a transmitting device will always output this amount of power - in fact it is not only unnecessary but potentially counterproductive as it would drain energy and cause interference to other systems. Hence we use power control mechanisms to determine the minimum power required to successfully transmit data in given conditions (distance / path loss between devices, noise level, amount of data to transmit etc). In general Wi-Fi can serve larger distance communication, especially given that most Bluetooth devices use low power Class 2 chip-sets.
Bluetooth range by Device Class, Wikipedia
The throughput of a wireless link depends mainly on the amount of spectrum (channel width, in MHz), SNR (signal to noise ratio expressed in dB) and the antenna configuration (possibility of parallel transmission, so called Spatial Streams realized through MIMO). Wi-Fi and Bluetooth differ rather dramatically here:
- MIMO and multi-stream transmission are not available in Bluetooth and a single antenna is normally used. Wi-Fi can employ a more advanced, multi-antenna systems allowing for transmission over up to 4 Spatial Streams. This is a computationally intensive operation that increases transmission speed at the expense of battery power.
- Spectrum: Wi-Fi can operate in frequency bands 2.4 GHz and 5 GHz and use channel size 20 MHz and its multiples through channel bonding: 40, 80 and 160 MHz (the latter two only in the 5 GHz band). Bluetooth on the other hand uses much narrower, 1 MHz transmission channels overlapping with Wi-Fi in the same license-free ISM 2.4 GHz band.
- SNR: the better the signal-to-noise rate, a more efficient modulation and coding scheme (MCS) can be used that will achieve a better spectrum efficiency — in other words more bits per second can be sent per each Hz of spectrum. The SNR can be improved by using higher gain antennas — just pay attention to the correct antenna orientation. E.g. to ensure optimal coverage of an omnidirectional dipole antenna (like the one you can find on the Keymitt Hub) the antenna should always be aligned vertically.
In short, if your IoT application requires sending larger amounts of data (multimedia or continuous streaming) Bluetooth will not be enough. On the other hand, transactional communication such as authentication or reading / changing device state require much less data to be sent and here Bluetooth will do just fine.
Here’s where the true potential of Bluetooth is most visible, notably for BLE - Bluetooth Low Energy, and Bluetooth Smart devices. Smaller bandwidth, simpler receiver and antenna configuration results in significant energy savings and much longer battery life compared to a Wi-Fi-equipped device. For a battery operated smart lock such as Keymitt the device autonomy is one of the main design priorities. Our chipset supports Bluetooth Smart, which adds flexibility i.e. the application can manage the connection and sleep more intervals, thus optimizing the receiver's duty cycle. This kind of energy performance simply wouldn’t be possible with a Wi-Fi chipset on-board.
Of course the challenge for a Bluetooth-only device is the Internet / cloud connectivity - after all it needs to communicate with the backend when executing various transactions. The Bluetooth Technology Alliance provides three ways to access the Internet based on Bluetooth Smart technology: RESTFul API, HTTP Proxy Service (HPS) and Internet Protocol Support Profile (IPSP). In all three cases Bluetooth devices rely on a gateway to access the Internet. Gateways could be routers, set-top boxes, or even an old / idle smartphone at home (upcycling your own device benefits the planet and extends its usable lifetime - this solution is also supported by Keymitt). Extending Bluetooth Smart with the Internet capability opens up a whole range of services and experiences, which is why Keymitt offers the Wi-Fi Hub - a small gateway device accessing home Wi-Fi network, powered by a standard USB cable (an old phone charger or a free USB port on any other device can provide power supply). You can use a Wi-Fi Hub or upcycle an old phone to access and control your lock remotely: monitor battery status, log events, receive warnings and unauthorized access alarms etc.
Wi-Fi and BLE - stronger together
It's probably clear by now that both Wi-Fi and Bluetooth communication standards are crucial for IoT operation, serving different but complementary purposes. We need Bluetooth to achieve the desired battery autonomy, and we need Wi-Fi for a reliable Internet connection to access the MiB cloud and control the device remotely. By utilizing both we are able to turn your smartphone into your key and make your door lock smarter.