Construction and research of water quality monitoring system based on ZigBee technology

. The water quality monitoring system proposed in this paper is to establish a monitoring system by using the ZigBee technology .The sensor nodes are placed in the monitoring area to form a tree-type network topology, and the data of the water quality parameters (including PH value, turbidity, water temperature, electric conductivity, etc.) are collected and analyzed. This paper mainly expounds the construction of the hardware system of the monitoring system, establishes the test model of the hardware system, simulates the placement of the sensor node to obtain the experimental data, and provides the hardware test result for the overall system design.

wireless sensor network (WSN) use Zigbee technology in water quality monitoring system.
ZigBee is a new wireless network technology, which has the advantages of low transmission rate and low power consumption. ZigBee provides a platform for sensor networks to interconnect and communicate with each other, which can communicate with each other among up to 65000 tiny sensors, which is very similar to the existing mobile communication CDMA network or GSM network.

Features of ZigBee Technology
ZigBee is a wireless communication technology based on IEEE802.15.4 standard, which is a standard of IEEE Wireless Domain Network Personal Area Network (PAN) working Group. However, ZigBee is not just the name of 802.15.4, because IEEE802.15.4 only standardizes the low-level media access control layer (MAC) and the physical layer (PHY) protocol, and the ZigBee alliance standardizes its network layer (NWK) protocol and application programming interface (API) ZigBee technology is praised as a new short-distance wireless communication technology which is most likely to realize wireless sensor networks because ZigBee has the following advantages.
(1) low data transmission rate: in line with the principle of adequacy, the rate is controlled at 10 kb / s to 250 kb / s, focusing on low rate transmission applications. (2) Low power consumption: The device can run for months or even years with battery power, low power means high reliability and maintainability, and non-battery powered devices need to take into account the energy problem, as power consumption is also related to a range of problems, such as cost. (3) Low cost: ZigBee data transmission rate is very low, ZigBee protocol is widely used in the world and free of patent fees, so the development cost has been greatly reduced; in addition, the development of technology makes ZigBee develop in the direction of integration, and the cost of bringing CPU (4) The time delay is short: the time-delay sensitive application is optimized. A typical search device has a latency of only 30 ms, ZigBee sleeps activation delay, and an active device channel accesses delay of only 15 ms. (5) The network capacity is large: the number of network nodes included in the network implemented by the ZigBee technology can theoretically realize the networking of 65535 nodes, and can support more than 300 nodes in the practical application from the BeeBee2006, and the BeePro is more than 1000 nodes. (6) The effective range is large: ZigBee coverages the effective that is 10 ≤ 75 meters, ZigBee distances communication of more than 1000 meters.ZigBee can be realized by power amplifier under the condition of low power consumption. ZigBee can help the node forward the data so as to extend the wireless network with a larger coverage area. (7) High reliability: The physical layer of IEEE802.15.4 adopts direct sequence spread spectrum (DSSS, Direct Sequence Spread Spectrum) technology to transform a signal into a plurality of signals, and then transmit the signal via the coding mode to avoid interference. In the MAC layer, the CSMA/ CA mode of the 802.11 series standard in the WLAN is mainly used to improve the system compatibility, so that the so-called CSMA/ CA is used to check whether the channel has data transmission before transmission, it will be re-circulated at a later time (8) Good security: Not only ZigBee provides data integrity check and authentication function, but also uses AES-128 encryption algorithm. AES-128 can flexibly determine the security attributes of each application. AES-128 encryption algorithm is a new encryption algorithm in the United States, is one of the best text encryption algorithms at present. (9) The frequency band is quite flexible: the license-free band is used the 2.4 GHz. band is used in China. (10) ZigBee technology is still in the primary stage of application, but it has shown extraordinary application value. With the continuous development and promotion of related technologies, ZigBee will certainly get greater applications in many fields and occasions, such as wireless sensor networks, industrial control, wireless monitoring, home wireless monitoring and so on. These occasions do not need too high communication rate, but in cost, power consumption, volume. Reliability and other aspects have more stringent requirements.

Network topological structure design of water quality monitoring system
In order to construct a wireless sensor network, we must first choose a reasonable network topology, because the structure of the network topology can determine the cost, speed, characteristics and functions of the network. In order to select the appropriate network topology, you can consider the location of the access point or gateway, as well as the maximum distance from the network facility to the end node or device.
There are three kinds of network topology of ZigBee: star network and tree network (Tree), network (Mesh), as shown in figure 1.  If the distance between the access point and the device is less than 100 meters, then the topology can be said to be an ideal topology for ZigBee networks. If a larger transmission distance is required, the transmission distance can be extended by building a tree topology through the ZigBee router. If higher network reliability is required, the network network can provide redundant paths, so that there are multiple routes between the end nodes and the gateway. The network topology of this structure can provide higher reliability to cope with router failure.
Considering comprehensively, the tree network is finally selected as the network topology of sewage data acquisition and analysis system. This is because the RTU of the water quality data acquisition and analysis system may be in the situation of complex environment and more obstacles, so it needs a large network coverage, but the complex terrain makes it difficult to deploy the nodes in some places, so it is necessary to increase the routing function. However, the research of mesh network is more complex, especially the improper deployment of nodes can easily lead to network connection quality problems.

Overall design of the system
The Water quality monitoring system mainly includes data acquisition layer, data management layer and data sharing layer. The wireless sensor network based on Zigbee technology is used to collect and analyze a variety of water quality parameter data (including PH value, turbidity, water temperature, conductivity, etc.) in the natural environment. It is mainly composed of data acquisition layer and data management layer. Sensor nodes self-organize the network in the monitoring area to collect data to obtain water quality parameters. The network coordinator in the middle layer is the data convergence center, which is responsible for receiving the data sent by all sensor nodes and merging the data. In addition, the router is responsible for the transfer of data and realizes the first-level routing of water quality parameters. The top layer is a computer, which is used to receive all the data of the network coordinator, realize the display of the data, and carry on the automatic archiving and the data processing to the data, analyze the data by compiling the corresponding software system, master the situation of the enterprise and the city sewage discharge, realize the intelligent and network management of the sewage monitoring, provide the basic data for the early warning of the sudden discharge and the prevention of pollution diffusion. In order to construct a system which can meet the needs of water quality monitoring, and make it have strong application value. For automatic integrated monitoring of water quality parameters in remote and unattended large areas, the top layer of data sharing can be added, and the monitoring data can be transmitted back to provincial, municipal, district environmental protection bureau or data management center through the convergence node deployed in the monitoring area, and the monitoring department or researcher can view the water quality information of the target area at any time through the Internet. Researchers view water quality information to achieve the purpose of early warning . Researchers judge the occurrence of major water quality events and alarm to start the corresponding plan to deal with the plan

Completion of ZigBee Module
Because the CC2530 wireless transceiver module works in the ISM band of 2.4GHz, the RF module has high requirements for the device,that is why resistance, capacitance and inductance used in practice all use 0402 packaged patch devices, which increases the difficulty of manual welding. In the process of welding the patch, we should not only ensure good electrical contact, but also pay attention to the control of welding time. Not only long time welding challenges the quality of the micro device itself. but also it is easy to cause false welding.
We must attention to weld plate grounding when we are welding. Figure 2 shows the physical diagram of ZigBee module and debugging tool.

2 Completion of Sensor Node Module
In order to save the hardware cost, the PCB, physical diagram of the sensor node module is made by thermal transfer method, as shown in figure 3. The PCB of the PH measuring circuit and the PCB of the conductivity measurement circuit are both single panels. Because the operational amplifier LMC6041 uses patch elements, some of the devices in figure 3 are placed on the back. In order to enhance the degree of anti-interference, the ground was covered in the wiring layer.

Overall construction of the system
The whole physical diagram of the water quality monitoring system is shown in figure 4. One end of the C51RF-3-ZDS simulator is connected to the IDC10 download socket, the other is connected to the USB interface of the PC, and the DB9 socket is connected to the serial port of the PC through the serial port line. In practical use, it is necessary to number each node in order to facilitate the study of the protocol. Before the system is powered on, the multimeter and other tools are used to carefully check the correctness of the circuit, the correctness of the component package and whether the installation of the components meets the requirements according to the hardware wiring diagram. Pay special attention to the inspection of the power supply system to prevent the power supply from breaking and polarity errors.

conclusion
At present, the water quality data collection of industrial pollution sources in all parts of the country is still in the stage of manual collection, so it is difficult to reflect the continuous change of sewage discharge in enterprises. However, because of the weak awareness of environmental protection and the drive of interests, the pollution of water resources is often caused by stealing sewage and non-standard sewage. Therefore, it is imperative to provide an effective, practical and advanced monitoring system and solution in monitoring and supervision.
Compared with the traditional data acquisition and analysis method, the system realizes the automatic extraction and random extraction of water discharge and physical and chemical parameter data, the automatic extraction and monitoring of the operation of sewage treatment equipment and the alarm under abnormal circumstances, the automatic alarm of the main physical and chemical indexes of sewage discharge exceeding the standard, and the automatic generation of data statistical reports. At the same time, the operation cost of the system is low, the system is easy to expand, by configuring or changing different sensors, the system is also suitable for atmospheric and noise monitoring, and the market prospect is very broad.