Zigbee is a wireless ad hoc network based on IEEE 802.15.4 standards for projects whose requirement is a wireless network which is energy efficient with low data transfer, low latency, and proximity. In IoT, many use cases require data collection from devices spread across a small area (Personal Area Network) for a long time in regular intervals. Some of such IoT use cases are:
- Home automation
- Healthcare – body vitals data collection and transmission to hospitals regularly
- Industrial automation
Some things typical in all these use cases are:
- Data collection happens over a small area
- Real-time data gathering is not needed; periodic data collection works fine
- The data collected by sensors are status relay oriented, which means that the volume of data is minimal
- A large number of devices may be connected
- Devices would be battery-operated. Hence low power consumption is ideal.
Zigbee is a perfect solution for embedded IoT applications that fulfill some or all of the above conditions. Moreover, the simplicity of hardware and open-sourcing of the software makes it rapid and cost-effective to implement.
Zigbee vs. Wifi vs. Bluetooth
|Typical communication range||10 to 100 meters(line of sight)||30 to 100 meters||10 to 100 meters|
|Data Rate||250 Kbps||11 Mbps||1 Mbps|
|Network join time||30 ms||3 sec||10 sec|
|Max number of devices||240||32||7|
This section covers the network architecture of Zigbee devices. The physical and MAC layer is based on IEEE 802.15.4 standard, the same one used by the OSI model, through which computers can connect to different networks. On top of this, Zigbee consists of a custom Network and Application layer:
- Network layer – It deals with network functions such as connecting, disconnecting, and setting up networks. It can establish a network, allocate addresses, and add and remove devices. This layer makes use of star, mesh, and tree topologies.
- Application layer – It binds tables, sends messages between bound devices, manages group addresses, reassembles packets and also transports data. It is responsible for providing service to Zigbee device profiles.
Zigbee Device Types and Topologies
Every device in the Zigbee network has the hardware as defined in the above architecture. However, the hardware configuration and cost define the topology of the network and the type of Zigbee device, respectively.
There are three types of Zigbee devices: Coordinator, Router and End Device
|functionality||Central repository of network information||Relays signals from coordinator(or parent routers) to reach the end device, and vice versa||Usually a sensor device, just captures information and sends to coordinator on predefined intervals|
|cost||Expensive than ZEDs||Expensive than ZEDs||Relatively cheap|
Apart from the devices, there are different ways in which the devices can be configured in a network, i.e., different topologies in the Zigbee networks, mainly:
1. Star Topology
In star topology, each sensor is ZED and directly connected to the coordinator. Routers are not needed as all the end devices are located at a very close range.
2. Mesh Topology
In the mesh topology, routers are needed as devices are spread in a larger area. They are interconnected to each other and to the coordinator. If any of the routers fails, there is still an alternative path for the signal to reach the coordinator. This approach increases fault tolerance and makes the network self-healing.
Wifi and Zigbee: a Home Automation Use Case
This section covers frequency bands and channels, Zigbee and Wifi frequency bands and possibilities when Wifi and Zigbee networks are nearby.
All wireless communications use radio waves, whose frequency bandwidth is from 30Khz to 300Ghz. This bandwidth is divided into spectrums or frequency bands. Each frequency band is further divided into channels.
The range of frequency bands for Zigbee networks is as follows:
|Frequency Band (MHz)||Frequency Range||Bit Rate(kbps)||Country||Number of Channels|
|915||902-928||40||USA and Australia||1-10, 13(North America)|
This means that Zigbee networks worldwide can work with 2400 MHz bands and additionally have some more frequency bands if they are located in Europe or North America.
However, each zigbee network, once configured can use only one channel for communication.
Consider an example of a home automation system configured using Zigbee. In a home, both Zigbee and Wifi networks are working together in close proximity.
The frequency band of Wifi can be 2.4GHz or 5GHz. If the Wifi operates at 5GHz, both systems work concurrently without any conflict. But if the Wifi operates at 2.4GHz, there is a good chance of Wifi interference in the Zigbee network due to overlap between few channels. Hence, to avoid interference, it is recommended to:
- Use 5GHz frequency Wifi
- Configure Zigbee/Wifi to avoid signal transmission across the same channels.
Channel Access in Zigbee networks
This section covers different approaches by which the end devices communicate with the coordinator. For a Zigbee network, irrespective of the topology, all the devices have a single channel to share data. There are two ways to relay information from ZED to the coordinator:
1. Contention Based(beacon enabled)
In the contention-based approach, the coordinator assigns specific time slots to each device(GTS – Guaranteed Time Slot) using a beacon.
- The coordinator sends a beacon(signal) to each device.
- Each device synchronizes its clock with the coordinator and gets their GTS.
- Each device sends its data whenever as per its slot. Note that a device doesn’t necessarily need to send data in each time slot.
2. Contention Free(non-beacon enabled)
This approach uses CSMA/CA mechanism to send information to the coordinator; synchronization between coordinator and devices is unnecessary. If a device wants to submit any information:
- The device goes into receive mode
- Detect if there is any signal in the channel
- If the channel is clear, send the signal
- If the channel is busy, the device tries again after a random time
Zigbee is a low-cost energy-efficient solution for many IoT use cases like home automation, medical data detection, smoke alarms etc., which require low latency and low data transfer rates. However, it is not suitable for networks with high activity among different devices, for example radio networks used in battles.
Hrushikesh Vazurkar is an alumni of VNIT Nagpur, CSE Department. He is passionate about competitive programming, web development and AI.