Paper—Design and Implementation of the ZigBee Wireless Sensor Network Based on ARM Design and Implementation of the ZigBee Wireless Sensor Network Based on ARM

This paper is intended to design a ZigBee wireless network node based on the advanced RISC machines (ARM), so as to facilitate the network usage process. The performance of the new sensor is subject to antenna test and simulation experiment. The HFSS simulation method is adopted, and the antenna size and scanning frequency are optimized through analyzing the research status of ZigBee technology and the working principle of ZigBee protocol stack based on parameters, such as, the return loss and direction of the antenna, which not only increases the accuracy of analysis and but also reduces the reflection coefficient. The experimental results show that when L2 is 14. 9mm, the effect is the best, and Sll is -26.6 dB. Based on the above findings, it is concluded that the integrated antennas on the printed circuit board (PCB) board can reduce the production cost of the antennas; thus, IFA antennas can meet the requirements of ZigBee based wireless sensor network in term of antenna performance. Keywords—ZigBee wireless network, ARM and PCB board


Introductions
The wireless sensor network has been developing rapidly with the development of computer technology, sensor technology and modern communication technology. In terms of development, Internet technology provides a unified communication basis, and greatly improves the efficiency of communication among people. However, with the development of Internet of Things technology, the traditional Internet technology can no longer meet the people's need to access information. While, the development of wireless sensor network has greatly promoted the people's ability of information acquirement and perception, which can effectively acquire various information in the physical world, and make such information be widely used in national defense, industrial control, intelligent medical treatment, modern agriculture, etc. The ZigBee technology is a communication protocol standard that is developed based on small wireless networks [1], and has great application prospect in smart home and commercial building automation, as the ZigBee protocol matures gradually, especially in recent years [2].
The ZigBee technology is a communication protocol standard that is developed based on small wireless networks [3]; the emergence of which makes up for the mar-ket of low cost, low power consumption and low rate wireless communication. In general, the ZigBee technology can be applied in many fields [4]. For example, for industrial control, the ZigBee technology can be used to establish a wireless network, then the data transfer will be achieved with sensor data collected at each node. With regards to agriculture, traditional agriculture mainly employs isolated machinery with no communication capability; and uses manual methods to test the soil conditions and crop growth status of farmland. However, if the ZigBee technology is adopted, the monitoring of each stage of the crop can be easily realized [5], sensor data can be transmitted over the ZigBee network wirelessly, and users only need to monitor the growth of crops in front of the computers in real time, which will greatly promote the pace of modern agriculture. In medical field, the ZigBee technology can be adopted to accurately and effectively detect the patient's blood pressure, body temperature and other information, which will greatly reduce the burden of ward rounds. Doctors will only need to monitor the patient's conditions of several wards with corresponding PC software in front of the computers.

Literature review
The Wireless sensor network (WSN) is a network system that is developed based on the system on chip (SoC), micro electro mechanical system (MEMS) and wireless communication technology. Its typical characteristics include low cost, low power consumption, distributed processing and self-organization [6]. Usually, the functions of sensing, processing, transmitting and receiving the detected quantities from the physical world are realized with a large number of nodes deployed.
In the 1990's, the United States pioneered the study of wireless sensor network, mainly for military use. Among them, the University of California at Berkeley, Cornell University and other famous universities have obtained important research results [7]. The new technology has been successfully applied in military operations, and achieved important functions, such as, tracking the wartime environment, identifying the enemy, and predicting the enemy's route. The In-Suit team deployed the nodes of wireless sensor network in the big duck island in the summer of 2002. Through monitoring the temperature and humidity sensors, photosensitive sensors and pressure sensors that are installed on the network nodes, the swallow nest was monitored. Meanwhile, the remote monitoring function of the petrel nest was realized as well using the software working on the remote servers.
The research of wireless sensor network in China is a little late than that in other countries [8][9][10]. In 1999, the Chinese Academy of Sciences issued the Research Report on Information and Automation, taking the wireless sensor network as one of the key projects. Since then, many colleges and universities, as well as research institutes have started to carry out relevant researches on the wireless sensor network. In 2001, the Shanghai R&D center was set up by the Chinese Academy of Sciences, focusing on the research of wireless sensor network. In 2006, China promulgated the National Program on Medium & Long Term Scientific and Technological Development, specifying the development plan related to wireless sensor network. At present, the R&D of both the physical layer and network layer of the wireless sensor network is relatively weak. In particular, the gap in distributed address assignment algorithm is even larger, and still at its stage of theoretical analysis.

Methods
The antennas play a key role in the process of receiving and transmitting information in wireless sensor networks, whose performance will directly affect the communication distance, node power consumption, network stability and other indicators. The 2.4 GHz monopole whip antenna has been put on the market already. Generally speaking, its cost is higher (compared with PCB antenna) and its resonance frequency sometimes varies greatly due to the influence of package characteristics. While the manufacturing process of PCB plates allows the integration of antennas on the circuit boards; therefore, the antennas can be welded to the PCB boards. With regard to the latter option the production cost of the antennas can be lowered on one hand; it is also convenient to adjust the resonant frequency and impedance of the antennas with vector network analyzers on the other hand, because the parameters of the PCB plates affect the radiation performance of the antennas.

Introduction to antennas and analysis of antenna type mechanism
The antennas are important radio devices for transmitting and receiving electromagnetic waves in wireless communication systems. The cost, performance and size of the antennas are main considerations for the selection of antennas. At present, the three types of common short distance communication antennas are PCB printed board antenna, chip integrated antenna and rod antenna. Their advantages and disadvantages are shown in Table 1.
It can be seen from the theory of electromagnetism that when the conductor flows through alternating current, electromagnetic radiation occurs. As shown in Figure 1, radiation and radiation efficiency are closely related to the length and shape of the wire.
When two wires are relatively close, the current is confined between the two wires, and radiation is very weak. As the opening angles of the two wires are different, the radiation capacity increases gradually. Furthermore, when the wire length is much  smaller than the wavelength, the radiation capacity is very weak too; but when the length of the wire is comparable to the wavelength, the radiation capacity is greatly enhanced.
The common printed board antennas include microstrip antennas and printed board inverted F antennas, that is, IFA antennas. In general, the microstrip antennas have strong directionality, and can be used under special circumstances, including building automation, coal mine tunnels, etc. Whereas, the IFA antennas belong to omnidirectional antennas, and are widely used in wireless sensor networks.

Antenna parameter calculation
The structure of common FA antennas is shown in Figure 2  According to the theory about the antennas, the total length of L and H is 1/4 of the working wavelength. It can be inferred that the length between L and H is generally between 1/4 of the free space wavelength and 1/4 of the medium wavelength according to the basic structure of printed circuit board FA type antennas, since the radiation substrate of the antennas is attached to the PCB board. The initial values of L and H in the design which are in common use are shown in Formula 1.
In the formula, ! ! is the free space wavelength, and ! ! is the relative dielectric constant of dielectric plate. The antennas have cross polarization characteristics, and the radiation direction is omnidirectional in the horizontal plane. When the antenna is resonant, the current is mainly distributed in the horizontal part of the antennas and the short-circuited part to the ground; and there is no current in the feeding part at this point. The relative magnetic field strength produced by the current distribution of the horizontal part is shown in Formula 2 with the coordinate system in Figure 2.

Network management function test
For the ZigBee wireless network, a wide variety of network management functions are designed, including local MAC address query, local network address query, remote known network address, node MAC address query, and remote known MAC address node network address query; as well as network topology display and energy allocation and measurement. Among them, the local MAC address query and local network address query are relatively simpler. This paper mainly involves the remote known network address, node MAC address query, and remote known MAC address node network address query function. The ZigBee network nodes are identified mainly through its 16-bit network address and 48 bit IEEE address. The network management function is mainly realized through querying the address information of other unknown nodes in the network, which includes the IEEE addresses of nodes about the known 16-bit network addresses and the network addresses of the known 48 bit IEEE addresses. Given that the coordinator's network address is 0 x 0000, it is possible to send an address request from a node for the convenience of testing, so as to obtain the coordinator's IEEE address.
Firstly, the interface function provided in the protocol stack can be adopted: ZDP_IEEEAddrReq (uint16 shortAddr, byte ReqType, byte StartIndex and byte Se-curityEnable). Secondly, this function will further call some of the functions in the protocol stack, and eventually send the request packet through the physical layer. In the network, a node with a network address of 0 x 0000 responds to the request, and sends its IEEE address and other parameters encapsulated in a packet to the node. After the node successfully receives the packet, and the layers are checked and finally sent to the application layer, a message ZDO CB MSG appears, which contains the coordinator's IEEE address information. In the application layer, the ZDO_ParseAddrRsp () function can be adjusted to parse the packet, and finally get the coordinator's IEEE address.

4
Results and discussion

Analysis of simulation results
Upon completion of the HFSS simulation, the size and scanning frequency of antennas can be optimized through combining relevant parameters, including the return loss and the direction diagram of the antennas; so as to improve the accuracy of analysis, reduce the reflection coefficient, and enhance the radiation efficiency. The SLL curve as shown in Figure 3 is obtained after completing frequency scanning analysis; when L2=14. 9 mm, the effect is best with Sll being-26.6 dB. Meanwhile, it can be concluded that the horizontal part of the antennas can affect the resonant frequency, and when, the resonant length increases, the resonant frequency decreases gradually; while when resonant length decreases, the resonant frequency of the antennas increases gradually. Moreover, attention should be paid to the influence of parameter W1 on the antennas during design. Based on the simulation results shown in Figure 4, when W1=l mm, better matching results can be achieved.

Fabrication and debugging of antennas
The antenna L2 parameter can be designed a little longer during the fabrication of PCB for convenient cutting and debugging of the antennas. The 50 ! coaxial line should be properly welded to the antenna feed point, so as to minimize the measurement results. The shielding length of the center conductor should be as short as possible to avoid increasing the sensibility of the antennas; meanwhile, the outer ground need to be as close as possible with the axis of the coaxial line terminal, and the coaxial line also needs to be placed away from the antenna as far as possible.
During the design of antennas, the L2 parameter can be simulated by means of HFSS to obtain the optimal size. However, during processing of PCB, the actual resonance frequency of the antennas will be slightly offset by the influence of processing technology and medium parameters. In this design, the maximum frequency offset can reach 200 NHz.
As a result, the L2 is usually designed slightly longer, so that the antennas can be properly cut and adjusted in order to work at right frequencies. In addition, in order to minimize the measurement error, the 50 ! coaxial line needs to be welded to the antenna feed point in a proper manner; and the inner conductors of the shielding wires should be as short as possible, so as not to increase the inductance effect of the antenna feed. In the meantime, the outer part of the outer end of the coaxial lines should be as close as possible to the end of the coaxial lines.

Result analysis
I type antennas feature low cost, easy system integration, cross polarization and omnidirection; therefore, this type of antennas are widely used in the ZigBee wireless network. This section analyzes the radiation characteristic of IFA antennas based on theoretical analysis with the help of HFSS simulation software; and also simulates and analyzes the parameters that affect the resonant frequency of the antennas. The experimental and measured results show that the characteristics of the antennas are in line with the requirements of the ZigBee wireless network in term of the antenna performance.

Conclusions
Under the current application background, this paper studies the technologies related to the ZigBee wireless network, proposes corresponding hardware and software design methods; and analyzes the design principles and ideas. The ZigBee wireless network node based on CC2530 and the ZigBee-TCP/ P gateway is designed with ARM technology, combining the current development status and application background of the ZigBee wireless network. The specific software design flow chart is developed through analyzing the hardware composition principles and the software design methods; and the research work is carried out based on the ZigBee wireless network node. First of all, the author designs the hardware system of ZigBee wireless network node based on CC2530, then introduces its composition principles, realization ways and the notice of PCB layout by analyzing the basic principles of the ZigBee network. Meanwhile, the author also completes the design of ZigBee-TCP/ P gateway system hardware. Furthermore, according to the requirements of the design of antennas for the ZigBee network, the center frequency of the printed circuit board antenna is 2.45 GHz, which can meet the requirements of the ZigBee wireless network through software simulation and actual test as shown in the test results.
In a sense, this design basically involves all aspects covered by the ZigBee based wireless network. However, due to the complexity of the ZigBee technology and the diversity of application scenarios, there are still some areas for improvement in the design.
1. The power supply part of the wireless sensor network designed needs to be improved properly, and the energy supply of the network nodes can be realized with micro energy technology or microwave energy transmission technology. 2. The system design process only covers network data transmission; and the specific data transmission format needs to be defined based on the different application scenarios. At the same time, the appropriate host computer control software needs to be graded as well.
3. When the capacity of the ZigBee network is enlarged, the data throughput of the ZigBee-TCP/ P gateway will be promoted; where new low-power high speed network interface chips may be adopted for the gateway hardware, so as to achieve higher data throughput and meet network requirements. Moreover, it is easy for the embedded file system storage medium of FLASH to lose data due to bad blocks; thus, new memories may be considered for data storage.