ZigBee based data collection in wireless sensor networks

Wireless sensor networks (WSN), referring to groups of technologies wirelessly controlled, are widely used in many different fields, agriculture, medical, military, etc. These technologies are mainly used for monitoring physical or environmental conditions, such as temperatures, sound, pressure, and so on. In WSN fields, there are technologies as Wi-Fi, radio frequency (RF), Bluetooth, ZigBee, Z-Wave, and so on. Furthermore, there is one of this technology that offers more outstanding futures to provide more energy-saving and long distances of transmissions compared to other technologies, and that is Zigbee technology, and this had become for many applications, the first high-quality to use and consequently the most used in WSNs. In Zigbee aided WSNs, are included three main devices used to communicate data, that is a ZigBee coordinator (network coordinator), ZigBee router, and ZigBee end-devices. The data sensed is transmitted from sensor nodes through coordinators to a base-station (BS), this device (coordinator), collects the data, stores it in a memory, processes, and finally forward to the next suitable nodes or the BS. This research presents the concepts and discussions of Zigbee technologies used in WSNs. Utmost ZigBee communication technologies are revised and analyzed, as well as simulation results with different scenarios are addressed comprehensively. Proposals for advance applications in WSNs are presented. Suggestions for future developments are provided.

INTRODUCTION Wireless sensor networks (WSN) are one of the most searched and developed topics in technology fields because its promise and advantages in economic, efficiency and velocity in data sending, this for the best of this modern world. There are many investigators who have been spending their time to create devices to be used in both military and civil applications. This technology, WSNs, allows sensors to wirelessly communicate without thinking of any possibility of using wires [1], [2]. There are a lot of WSN technologies, studied and designed by the designers to be used in daily human life, example of this technologies are sensors that are used in many different fields [3], [4]. Many different WSN technologies have been develop and designed to be used day-by-day, for instance, sensors are designed to be used with different WSNs technologies in different

WSN APPLICATIONS UTILIZING ZIGBEE TECHNOLOGY
Likewise the other technolgies (Bluetooth, Z-Wave, Wi-Fi), ZigBee technology is designed according to the standards of the institute of electricians and electronics (IEEE 802.15.4). In order to develop devices that would be industrial or home use. Therefore, the IEEE 802.15.4 ZigBee technologies or applications [46]:

Applications in smart homes and control
Home automated management, at this application, Zigbee technology is used to remotely control all devices outside and inside building, security cameras, alarms, lights, security alarms, switches, doors, air conditioning, and many other devices that are for home use [47].

Applications in smart energy
Big companies that supplies electricity, water, gas, or else, uses smart energy to make sure they have information and bills to their clients without approaching them every single month. This wirelessly communication between the companies and automate homes, will increase the efficiency and the celerity of their local services [48].

Applications in health care
The relationship between hospital and patients is improved too much. By using Zigbee technology, many things go in a simple direction, doctors can have provided information from their patients in a real time, though, avoiding the constant contact with patients, and patients avoiding the journeys to the hospital and stay in lines to be attended by the doctors. Through this, the hospital may have data such as blood pressure, health rate, glucose level, body temperature, among other applications that can be read by the ZigBee [49]. In the paper [50], the author points to studies related to monitoring physiological parameters such as body temperature, heart rate and body effects. The algorithms have been tested and found to be quite accurate and consistent.

Applications in industry
Wireless Sensor Networks using ZigBee technology has also improved the manufacturing industry significantly. Nowadays, machines can work 100% with sensors, avoiding then, the human contact even to the places that human being found difficulty to reach inside the industry, and this has also reduce the presence of wires when it was about electrification of machines [51].

Applications in telecommunications
Telephones and computers networks are connected from distances. They may not use wires for communications. When they send data from points to points, using Zigbee has a great advantages because of the distance that this technology is able to work [52]. This provides a global open standard for wireless radio networks. ZigBee is mainly used in low-powered devices that do not require very high bandwidth. Technol   ISSN: 2252-8776  ❒  215 2.6. Applications of ZigBee in agriculture Zigbee is everywhere, and it is even explored in agriculture. Sensors can be deployed in a farm that help for measuring various parameters of agriculture land like humidity, climatic condition, intrusion detection, soil moisture, water level which facilitate that can support to better productions [53]. There are large machines in agriculture, for small and large scale of production, so having sensors to monitor or control this equipment, would increase the quality of production, as well as using sensors to control pressure, predict the weather or temperature of certain period of time, and so make sure of production of any king of plants. It is possible to calculate and see when it needs the irrigation, when to collect, and after collecting, sensors will give information in real time about the conditions of collected products in a stored place [54].

Applications in military fields
As mentioned before, Zigbee is also used for the surveillance, this means, detecting the presence of anybody or anything that sensors are programmed to detect. Different from commercial WSNs, a tactical military sensor networks have different priority requirements for military usage. In many countries, there are too many registered cases of unknown groups that attacks government's buildings, kills enemies and none is able to identify their faces. So, using WSN, especially Zigbee, will be possible to reconnaissance these strange people, their positions or origins. Using Zigbee, may also help the army to get information of their enemies, like the number of the enemy troop, their ability in the artillery, their movements, the facial recognition of the home troop, to greatly improve the effectiveness of weapons or warlike [55].

Applications in maintenance of the electric grid
Past few years, technicians were the one who took care of every single problem with electric grid, they use to go and concert them, sometimes spending too much hours only to identify where is the problem coming from and other time to solve the problem. They needed to climb the electric tower to check issues, and to do that, they needed to shut off all the long line and work on that, what made this tough task. This was tough task. Today, with WSNs using Zigbee technology, this re much better and quickly, because the problem identification is more effective and no need to shut off electricity for long periods, everything is done quickly. Installed power towers will send information to the base station [56].

Applications in vehicle entertainment
There are a lot of people who likes to travel for touring or parties. Young wants to spend their lives enjoying, so by using Zigbee technology, companies have been developing vehicles equipped with sensors and all the sound system to fulfill their needs in music, water, places to sleep, etc. inside the car. Zigbee is made to consume less power [57].

3.
ARCHITECTURES OF ZIGBEE PROTOCOL Zigbee protocol architecture consists of a stack of various layers where IEEE 802.15. 4 is defined by physical and MAC layers. The protocol is completed by accumulating Zigbee's own network and application layers. The architectures are shown in Figure 2.

Application layer-APL
ZigBee device objects (ZDOs), is included in application lyer, and this is responsible for including and keeping track of device roles, managing requests to join a network, as well as device discovery and security. Also, the application layer includes manufacturer-defined application objects that are not part of the communication standard.

Network layer-NWK
WSNs using ZigBee technology supports multiple networks topologies, such as star network, tree network, and mesh network. Network or also known as transport layer is where the routing, security, and transport between the different nodes in ZigBee network are defined. Network encryption model is also included in this. However, network layer is where the difference between the controller (coordinator), routers, and end-nodes is defined in ZigBee network. Transport layer is also responsible for data encryption and data authentication via advanced encryption standard (AES); all encryption keys are secured by 128 bit.

Medium access control-MAC
The MAC layer of the 802.15.4 standard is responsible for the process of condensing the data coming from the upper layers, making it ready to be transmitted. The method of accessing the medium characterizes the network in two modes of operation, beacon and non-beacon enable modes [58]. It is in MAC layer that are defined all the operations modes of the main characters in the network with ZigBee low power consumption, assisted by the low transmission rate, the ability to reduce the duty cycle while remaining inactive means that the device can be powered with very long-lasting batteries. However, this feature of reduced function device (RFD), devices can only be extended to full function device (FFD) router nodes using the beaconing mode.
Beaconing mode, this model consists of making the routers occasionally transmit beacon frames, signals to confirm their existence in a network, as shown in Figure 3. Using good sync, the network nodes (except the coordinator) can stay inactive between the beacon frames and save energy [59], [60]. The super-frame structure is used to operate in this way. This structure aims to provide free bandwidth in some situations and to provide low latency in transmissions. The super-frame will be limited by beacon frames at each predetermined period of time, which may be between 15 ms and 252 s. The total time for a super-frame will be equally divided into 16-time slots. Access to the channel inside each slot will be free of contention.
Non-beaconing mode, it depends to the type of application, sometimes can be expensive to get the beacon frames synchronized in order to eliminate them keeping all devices active 100% of the time as shown in Figure 4. This consumes too much power and also requires battery changes every time [61]. It should be noted that in topologies with star configuration, a ZigBee network requires at least one FFD device acting as the network coordinator and the other devices can be of the RFD type to reduce the cost of the system. For peer-to-peer and tree topologies, all devices must be FFD.   that includes a laying-off pattern in each bit of data and spreads them across the bandwidth used. This laying-off allows not only the data to be identified as belonging to a given node, but of course, it simplifies the detection of errors. By data diffusion across all frequencies in the band, the resulting signal progressively resembles noise, making it more robust to interference. After the direct sequenced spread spectrum (DSSS) is done, the signal is modulated on a carrier for transmission. Report free channels clear channel assessment(CCA), the physical layer determines whether the channels are occupied according to the carrier sense of the DSSS signals and/or if the energy detection (ED) parameter is above the channel limit. WSNs by ZigBee standard was designed for all around the world because it sends data to IoT, teherefore, making possible to share data with any sensor with different applications technologies. In Table 1 compares ZigBee and other technologies for wireless communication in WSNs. Unlike to Bluetooth technology, that was designed for many modes and states, ZigBee is simply designed to serve two modes of operation placed by WSNs, which are the active and non-active modes. The world today is really concerned about the environment, and there are many applications releasing too much carbon to the atmosphere and so, polluting air and ozone. Then, ZigBee has a great ability to be ecological, with ecological products promoting an ecological life that helps to save power and also avoids the pollution of air, water, and noise. They prove to be beneficial for the environment and also the decline of human health [62]. The low cost of acquiring products and the easy setting up means that there is greater access by consumers, it offers high security in the transmission and reception of data due to the design that was made by the media access control, which in turn, works with AES, being that it works with encrypted algorithms. This means that there is greater protection for discretion, veracity, and the genuineness of MAC frames. The easy and inexpensive implementation of the ZigBee project, as well as its circuit, is easy to be integrated, media access control or simply MAC, which is a term used in the computer network to designate a part of the link layer and serves as an access route to a communication channel between networks. The ZigBee technology was designed to enable multiple technologies to be connected without much complexity. The operation of energy has been designed in a way that does not require many complex ways for operation, the media access control was designed to allow a large number of devices to be connected to a large number of devices, without therefore requiring that they be fixed in one place.

ZIGBEE ROLES IN DIFFERENT TOPOLOGIES IN A WSN
In WSNs using ZigBee technology, there are three different devices classified according to their functions in each part of the network topology, the topology of a ZigBee system can be explained by analyzing the Mesh or Mesh topology. It includes all types of networks. The mesh network system provides automatic device initialization as soon as they connect to the network. In this way, it uses other devices attached to the network to transmit the information to end-devices, allowing an increase in the coverage area [63].

ZigBee coordinator
There is only one coordinator in each network. This has the largest number of functions. The coordinator is able to create a network; become the root of the network and be the only device with the autonomy to switch data between networks. Other than that, it stores network information, channel selection, responsible to assign an ID to the whole network, allocates a unique address to each device, initiates, and transfers messages in the network [63].

ZigBee router
These are the devices that provide information to other devices on the network, that is, it routes information like a common Wi-Fi router, Act as intermediate nodes between the coordinator and the enddevices, route traffic between different nodes, receive and store messages intended for their children, it can allow other routers and end-devices to join the network [63].

ZigBee end-device
It only has the function of exchanging information with a coordinator or router. An advantage is its smaller memory, as it does not need to route information, therefore the cost is lower. It contains just enough information to the parent node; they may sleep (a standby) which makes end-devices a suitable choice for battery-operated devices; all traffic to an end-devices are first routed to their parents; the end-device is responsible for requesting any pending messages from its parents [63].
In a ZigBee network, devices can remain for long periods without communicating with another device, their connected access time is 30 ms. Because of these characteristics, the ZigBee technology is very economical when it comes to energy consumption and can last much longer than other wireless communication devices [64].

Zigbee topologies
In Figure 5 (a) Star topoloy, this is the simplest and less expensive implementation. There are no routers in this architecture. The end-device cannot communicate directly with another end-device [58]. E. Tree topology, In Figure 5 (b) it is not much different from mesh topology configuration, and routers are not interconnected. Cluster tree network expands the network range [58].

COMMON ROUTING PROTOCOLS IN THE NETWORKS UTILIZING ZIGBEE
In wireless sensor communication, routing protocols are required for sending data between sensor nodes and the base stations for communication, and different routing protocols are proposed for wireless sensor networks, these protocols are divided into lots of categories. Based on the mode of operation and types of target applications, according to the participation style of the nodes, depending on the network structure, data dissemination protocols, and finally, the data gathering protocols [33]. In the type of the network structure, there is data-centric routing, where the node desiring certain types of information sends queries to certain regions and waits for data from the nodes located in the selected regions [65]. For the mode of operation and types of target applications, there are reactive and proactive, reactive protocols find a route on-demand by flooding the network with route request packets. The advantage of this type of protocols is that it does not have to keep routing information to all nodes [66], and in a proactive protocol, the nodes switch on their sensors and transmitters, sense the environment and transmit the data to a base station through the predefined route [33]. Hybrid routing protocols: combines both proactive and reactive technologies, it uses clustering technique which makes the network stable and sealable. The network cloud is divided into many clusters and these clusters are maintained dynamically if a node is added or leave a particular cluster [67]. Therefore, among all of these protocols the tree routing is considered to be the ideal for the ZigBee network, this is according to the paper [65]. According to this article, tree routing is also known as hierarchical routing. The formation of nodes in this protocol is done as the construction of a graph for the network to be connected, and thus showing clearly which node is connected to which node. Each node will calculate the best path from source to destination. In the paper [68], we can see in the analysis of the results in the second case. The routers and the end-devices easily and quickly choose the way to connect with the coordinator [68]. The opposite is showed in the first case, the eight end-devices send data to two routers and then this data is sent to the coordinator. The best collection of paths will create a routing table for each node. This contrasts with distance vector routing protocols, which work by having each node share its routing table with its neighbors in a tree routing protocol. The only information passed between nodes is connectivity-related. In order to determine the neighbors of each node, nodes need to determine what other ports it is connected to. It does over fully working links by using a reach-ability protocol which it runs periodically and separately with each of its directly connected neighbors.

SIMULATION SETUP AND RESULTS
Before understanding the simulations and results, it is really important to understand the three Zigbee, we refer to the coordinator, router, and the end-device. Coordinator is the first device in Zigbee, its crucial mission is to create a network, is known as the root of network. Which consequently, would result in a reception of data coming from all components within this network. Next is router whose main mission is to act as an intermediary agent between the coordinator and the end-device. Finally, is end-device that has a mission to keep in contact with the router or the coordinator. The simulation is done following one of the topology, that is tree topology, as mentioned in section 4. In tree routing protocols, the network is done graphically and in the shape of a tree, as well as the quick calculation of which path the data can lead to that there is not much loss of resources such as the battery, power consumption, and others. As well as being responsible, when something is wrong in the system, it automatically searches for easy ways to continue the data transmission. However, to understand better, we divided these simulations into two different ways as is shown above in the Figure 6. The first being a network containing eight end-devices and two routers, in the second case, eight end-devices and one of the two routers failed.
(a) (b) Figure 6. Simulation scenarios of (a) normal router and (b) one router failed Scenario 1: We are going to describe the two aspects that we were able to observe during the analysis of the experience. The first situation has to do with eight end-devices that send data to two routers and then forward the data to the coordinator, as shown in Figure 6 (a). It is also important to mention that when the communication models are configured (beaconing and non-beaconing). The coordinator device will be automatically configured when to receive and not the data, this means that if the coordinator is in beaconing mode, then it will decide when or will give authorization to the router or end-device to share the information/data. Very contrary to the case of the device being configured in non-beaconing mode, the coordinator will be able to ❒ ISSN: 2252-8776 receive data anytime the router has already ready the data from the end-device. Figure 6 shows data transferred from source to destination has the same format as 802.15.4 standard when passing through router device. In this case, both routers are working properly. Based on the characteristics of the ZigBee communication network, both routers have end-devices information on the network. Therefore, it causes data redundancy and network resource consumption. In addition, both routers transmit this data to the coordinator, so it will cause a greater transmission delay when a router is connected to the coordinator as shown in Figure 8. Specifically in this case the latency will be higher than 0.018 s. devices is only transmitted by a router to the coordinator, now we consider there is only one transmission channel, so the throughput also changes significantly. However, there is only one router transmitted to the coordinator so the number of packets is halved so the packets reach the coordinator faster, reducing the latency from 0.034 to 0.016 s as shown in the Figure 8. But the biggest difference lies in the routers, this is because the end-devices can be connected to any router that is nearby, so much so that the same end-device can be connected to two or more routers. However, the two routers that are receiving the same information on an end-device, cannot send and receive the same data in a single coordinator. If so, the ZigBee technology allows only one router to reach the coordinator, unlike the first case. The great advantage of having an end-device connected to two routers is that, when there is a situation where one router fails, the other automatically turns on and the sharing process continues normally. According to Figure 7 data from end-devices is also transmitted to the coordinator when either router device loses connection and in this case, we're simulating a tree topology. All routers on the network have information as well as data transmitted from end-devices. Therefore, the data is still transmitted to the coordinator even with one router is disconnected. This can also be considered the advantage point of the ZigBee communication networks.

CONCLUSIONS AND FUTURE DEVELOPMENTS
The present paper, were reviewed and presented some of the recent power monitoring, control, and management systems. The review presents the significance of such applications and overviews the growth in this field of study. This review aimed to study such monitoring systems and specify the challenges and issues as indicated by many researchers where these challenges need to be avoided during the design and deployment of WSNs. Communication protocols represent the most important component in any WSN where many types of research are carried out to either investigate the performance of these wireless protocols or to improve their performance in terms of different aspects such as power consumption, error correction capability, QoS, etc.
Through the literature, it can be concluded that noise and co-channel interference represents the most important challenge, especially for ZigBee-based WSNs. Although that some researches were carried out to overcome noise, most of these solutions increase the power consumption of the transceiver itself, which represents a critical issue and one of the most important challenges affecting the sensor lifetime, especially in those applications where power resources are limited. Also, most of these solutions are simulation-based and have not been validated practically. Therefore, we intend a near future, to develop the communication of the end-device, router and also the sending of data to the coordinator, which in turn will send these data to the internet. This will be a test to see how far these three layers of the ZigBee network, can actually exchange data and in what ways this can happen in the most perfect way possible. On the other hand, there is also a needs to study ways of improving estimated coverage accuracy for both indoor and outdoor WSN taking into consideration wireless channel characteristics in such an environment for better planning of sensing nodes deployment, especially for long-range communication protocols as ZigBee networks.