Abstract: This paper analyzes the characteristics of ZigBee wireless communication technology and home networks, introducing a smart home system that utilizes ZigBee technology for wireless networking. It focuses on the networking methods of ZigBee, the implementation of automatic control between nodes, and data collection and transmission.
1 Overview and Characteristics of ZigBee Technology
1.1 Overview of ZigBee Technology
ZigBee is a low-power personal area network protocol based on the IEEE 802.15.4 standard. ZigBee technology is a short-range, low-power wireless communication technology based on this protocol. The ZigBee protocol is divided into two parts: IEEE 802.15.4 defines the technical specifications for the PHY (Physical Layer) and MAC (Medium Access Control) layers; the ZigBee Alliance defines the technical specifications for the NWK (Network Layer), APS (Application Support Sublayer), and APL (Application Layer). The ZigBee protocol integrates the definitions of each layer into a functional form, providing API calls for users.
1.2 Characteristics of ZigBee Technology
ZigBee operates wirelessly in three frequency bands: 2.4 GHz, 868 MHz, and 915 MHz, with a maximum transmission rate of up to 250 kb/s. Its transmission distance can reach 110 m, but this distance can be extended through networking. Each ZigBee node can connect with up to 65,000 wireless modules, which is sufficient for the range of smart home control nodes. As a wireless communication technology, ZigBee is characterized by low power consumption, high reliability, powerful networking capabilities, and high security.
ZigBee is primarily suitable for applications in automatic control and remote control fields. It can be embedded in various devices, enabling wireless networking of control nodes in smart homes, avoiding the issues associated with traditional wiring, thus making the practical application and standardization of smart homes possible.
2 Design Scheme of ZigBee-Based Smart Home
2.1 Traditional Smart Home Systems
Research on smart homes began abroad in the 1970s, with the first implementation being a renovation of an old building in the United States, where computer control was used for lighting systems and elevators. In China, research on smart homes started relatively late, only about 8-9 years ago. Traditional smart homes use wired systems, which not only require professional installation and maintenance by specialized companies but also have long construction periods, high costs, difficult maintenance, low system flexibility, and limited scalability. Once established, users cannot upgrade or update the smart home system.
2.2 Design Scheme of ZigBee-Based Smart Home System
The structure of the ZigBee-based smart home system is shown in Figure 1. The central control system (Cortex A8) controls multiple functional modules such as smart lighting modules, smart temperature modules, smart smoke modules, smart RFID modules, and smart alarm modules (buzzer, not shown in the block diagram) via a wireless network (ZigBee). The central control unit can display the real-time status of each module in the smart home, such as temperature, LED light on/off status, smoke status, etc., through a Qt interface. An embedded database SQLite stores status information for LED lights, temperature, smoke, and RFID access records. Remote clients can query the internal information of the smart home (LED lights, temperature, smoke, etc.) in real-time via a web/CGI application through a browser, and can also periodically report internal information to a mobile client.
2.2.1 Home Network
The home network connects through one ZigBee coordinator and four ZigBee nodes via wireless networking. The four nodes forward the collected information to the ZigBee coordinator, and the nodes do not communicate with each other. Each ZigBee corresponds to a 16-bit short address, allowing ZigBee to determine which node transmitted the information based on the address. The coordinator can transmit the received information to the central control system via a serial port; conversely, the central control system can also send data to the coordinator via the serial port, which will be transmitted to the designated node to control the corresponding electrical appliances (such as LED lights).
2.2.2 Home Gateway
Communication between the home network and external networks is achieved through a home gateway, enabling remote observation and control, primarily considering access via the Internet and mobile networks. In fact, this system mainly uses an ARM chip and peripheral modules to act as the gateway. The basic development environment is built by porting uboot → porting the Linux kernel → porting the Linux root filesystem.
The web server can be set up based on this by porting BOA and configuring it simply. By writing HTML files and CGI programs, remote access to the server can be achieved. Users can trigger requests by adding access in the browser’s address bar and pressing enter; the web server receives this request, reads the corresponding HTML file, and returns it to the browser, which displays the control interface. Submitting forms calls CGI programs to query the database and control the corresponding nodes.
3 ZigBee Wireless Network Design Scheme for Smart Homes
As an important component of smart homes, ZigBee transmits information from each node to the home gateway via the coordinator, allowing users to view information remotely through a browser; on the other hand, the ZigBee coordinator must receive information transmitted from the gateway and send it to specific nodes, allowing users to remotely control corresponding electrical appliances.
3.1 Hardware Design Scheme for ZigBee Network Nodes
Network nodes are divided into collection nodes and master control nodes (also known as coordinators). The collection nodes send the collected data to the master control node in real-time. The master control node receives the data from the collection nodes and sends commands to control indoor devices.
The nodes use the CC2530 module launched by TI, with the system block diagram shown in Figure 2, communicating with the master control node via a serial port, and all nodes are controlled by the master control node.
The master control node circuit consists of the CC2530 module, reset button, power switch, a standard serial port, network status indicator, switch indicator, and six device indicators, with a double-layer fiberglass board as the base, powered by two AA batteries. The hardware block diagram of the master control node is shown in Figure 3.
3.2 Software Design Scheme for ZigBee Wireless Network
There are three networking methods for ZigBee: tree, star, and mesh. Each networking method requires at least one ZigBee coordinator. This paper adopts a star networking method. Modifications are needed at the application layer of the ZigBee protocol stack, using the ZStack-CC2530-2.3.0-1.4.0 protocol stack, and then selecting to download to the collection node or master control node based on the type of node. The software design for the collection node is shown in Figure 4, and for the control node in Figure 5.
The collection node first reads information from the terminal, and the data is analyzed and transmitted to the coordinator control node in a fixed format. The control node determines the receiving or sending node based on the short address, transmits the information to the designated node, thus observing or controlling the corresponding device. At the same time, limits can be set for automatic control of the corresponding device. Information from each node can be viewed through the browser, as shown in Figure 6.
Using ZigBee modules to establish a home wireless network allows for the perception, collection, and transmission of information through a wireless network, solving the issues of non-upgradability and updates associated with traditional wiring. The powerful networking capabilities of ZigBee enable high coverage density in home networks, especially suitable for living environments with a large number of collection nodes. Additionally, by setting limit values, spontaneous control between nodes can be achieved.