Design and Simulation of a Meteorological Data Monitoring System Based on a Wireless Sensor

—A system for observing meteorological data based on a wireless sensor network (WSN) is designed to fulfill the business requirements for meteorological data observation in unattended areas. The WSN is based on the ZigBee communication protocol, which can implement a system with low power consumption, self-organizing capability


INTRODUCTION
A wireless sensor network (WSN) integrates sensor technology, embedded computing technology, modern network and wireless communication technology, and other advanced technologies. Its subjects are integrated microsensors. These miniature sensors exhibit wireless communication, data acquisition and processing, and collaborative functions. WSN is made up of thousands of sensor nodes through network self-organization. These sensors collaborate in real-time monitoring, sensing, and information gathering of monitored objects. Embedded systems process the information and the situation via random self-organizing wireless communication networks in a multi-hop relay. The information is transmitted to the user terminal, thereby allowing users to monitor and respond to the corresponding region. WSNs are part of the second generation of the computer and Internet world information industry. The third wave focuses on global economic and technological development. WSNs are being gradually integrated into the daily lives of people, particularly in their social activities. WSNs comprise a large number of sensor nodes, which exhibit network awareness. Data are collected via self-organizing multihop transmission. Such data are processed and then embedded into a platform by uploading to the server. The meteorological data observations of the system expand the geographic scope of data collection. Data are accurately and wirelessly uploaded in remote mountainous areas and islands. For these existing systems, two problems should be solved, namely, data sharing and publishing. Meteorological data do not belong to secret data. All meteorological monitoring systems can disclose data. Providing a user query will bring considerable convenience to the lives of people or in the aspects of production. The traditional meteorological monitoring system belongs to the internal local area network, in which data cannot be shared. Data can only be viewed through the web or through a network. This approach lacks a monitoring system with a unified data format. We need to set up a web server, an identitycharacterizing network, and Internet connection. The monitoring system also has no uniform standard. The efficiency and cost of monitoring networks are also considered problems. Maintaining a wired connection is not convenient. General Packet Radio Service, Wi-Fi, and other wireless connections have high cost and considerable power consumption. Some deficiencies on network size are also present. Therefore, new, suitable communication protocols for monitoring network nodes are necessary.
Bill Gates, the founder of Microsoft Corporation, wrote "The Road Ahead" in 1995. This book presents interconnected ideas. Chavan C H used WSN to monitor the environmental factors, namely, soil moisture, temperature, and humidity, of a tomato greenhouse in 2014 [1]. Hong A I based on ZigBee to achieve a controlled greenhouse environment within the parameters of temperature and humidity; the information collected was stored in a PC data service system [2]. Bonomo R et al. studied the effect of soil conductivity on WSN usage in agriculture in 2014 [3]. Win K T adopted WSN for water-saving irrigation systems and regular sampling in 2015; data collected by WSN were sent to the host computer and to the base station control system [4]. In 2015, Lin F T used WSN in an eco-park in Murcia and in semi-arid areas to achieve wireless real-time monitoring of soil temperature, soil moisture, salinity, temperature, humidity, and other environmental information in the experimental area [5]. Khan R used WSN to collect the environmental information of a red pepper greenhouse and automatically controlled the internal environment variables, thereby significantly improving production efficiency [6]. Tournebize J used specific farmland-designed basic meteorological elements collected by WSN within a region to reduce the amount of pesticide [7]. Akshay based on WSN to achieve precise management of the greenhouse environment and increase greenhouse production in India in 2012 [8]. In 2013, Mainoe deployed WSN nodes within an apple orchard to collect information on soil moisture and temperature, and the information collected was analyzed; the quality of apple production was considerably increased [9]. Robert W also achieved automatic irrigation of vineyards and save water via WSN [10]. The remainder of this paper is organized as follows. Section 2 presents the problem. Section 3 provides the materials and methods used in the meteorological data-monitoring system. Section 4 describes a real experiment to evaluate the system. Section 5 concludes this study.

A. WSN Node Structure
The structure of sensor nodes varies in different applications, but they are generally composed of four parts, namely, the sensor, processor, wireless communication, and power supply modules. The sensor module is responsible for monitoring regional collection, and data conversion information is determined by the type of sensor being monitored in the form of a physical signal, such as for monitoring the temperature of a platinum resistance sensor and for sensing a capacitive pressure sensor. The processor module is responsible for controlling the entire sensor node operation, data storage, and the processing itself, along with other nodes. The wireless communication module is responsible for wireless communication with other sensor nodes, exchanging control information, and receiving acquisition data. The power supply module provides the energy required to run a network; it is typically a miniature battery. However, some companies have explored energy from the environment and converted it using the microwatt method.

B. WSN Protocol Stack
A WSN protocol stack includes the physical, data link, network, transport, and application layers. The protocol stack also comprises energy, mobile, and task management platforms. These management platforms enable sensor nodes to work together in an energy-efficient manner to transfer data node movement and support multitasking and resource sharing.
The Internet protocol layers and functions are as follows. The physical layer provides simple but robust signal modulation and radio technology. The data link layer is responsible for data framing, frame detection, medium access, and error control. The routing network layer is responsible for generating and routing. The transport layer is responsible for data transmission flow control, and quality of service is an important part of communication. The application layer includes application layer software based on a series of monitoring tasks. The energy management platform determines how to utilize the energy in each protocol layer to save energy. The mobility management platform detects and registers mobile sensor nodes and aggregation nodes to maintain routes; thus, the sensor nodes dynamically track the location of their neighbors. The task management platform balances and schedules inspection tasks in a given region.

C. Topology WSNs
New requirements for sensor network topology design are introduced based on a specific application environment and the inherent characteristics of WSNs. In WSNs, nodes should complete a self-organizing network that constitutes autonomous, harsh, and unattended environments. WSNs mainly comprise two topologies, namely, planar and hierarchical topologies.
Flat topology refers to the equal status of all nodes in the same role, i.e., collecting data and performing data transfer communication do not exist in a centralized control center. The distance among nodes in a multi-hop communication system should be determined to save energy. Figure 1 shows the flat network structure, which is relatively simple, without any structural maintenance procedures. According to a predetermined routing protocol, nodes self-organize into a wireless network. The planar structure of all the sensor nodes is theoretically equal. No bottleneck and single point of failure exist. This topology is robust, but the network has a limited size, dynamic scalability, poor performance, and is difficult to maintain. In a planar structure, the source node typically needs to transfer huge amounts of query messages to obtain destination information. However, the maintenance of the dynamic routing information requires sending a large number of control messages because of the dynamic nature of the network, such as node failures. Network size indicates the route maintenance overhead. When network size increases to a certain extent, all the network bandwidth may be consumed out of the routing protocol, which leads to poor network scalability planar structure.
In the hierarchical topology, the network is divided into clusters according to specific application requirements, such as geographic area, energy, and application types. Each cluster consists of a cluster head node and a plurality of cluster membership. The number of cluster head node is abstracted into a high-class network to cluster, which eventually forms a sensor network with a multi-level organizational structure, as shown in Figure 2. Different levels of local concepts interact in a hierarchal topology to achieve the desired global task. In a hierarchical organizational structure, the members of the cluster nodes are responsible for the perception task and for sending a multi-hop fashion to the information collected to the cluster head node. The cluster head node, as the central node cluster category, is responsible for communicating with the remote terminal, publishing class cluster management information, and performing high-level data PAPER DESIGN AND SIMULATION OF A METEOROLOGICAL DATA MONITORING SYSTEM BASED ON A WIRELESS SENSOR integration and analysis. The energy cluster head node performs a probability distribution by the network node to use energy efficiently and prolong network life cycle. Accordingly, the high-energy cluster head node on the network node will have an average consumption, while avoiding the vulnerability and instability caused by the cluster head fixed network and increasing the number of clusters to form a high-level network to enhance the capacity of the entire network. Nevertheless, the drawback is that maintaining a hierarchical structure requires a careful design of the cluster head selection algorithm.

A. Overall Design
The system is mainly used for the real-time detection of agricultural meteorological environmental elements using solar energy for electricity to build networks based on ZigBee WSN technology CC2530 and design PC realtime display of information. The basic parameters of farmland acquisition, emerging farming, and agricultural development facilities are necessary to guide agricultural production activities, and their decision-making basis has an important guiding significance. The overall system is shown in Figure 3.

B. Working Principle
The working principle of the system can be understood via a hierarchical model. Layers communicate with one another and coordinate work. The system can be divided into four layers according to the nature of work, namely, field data collection sensor layer, information acquisition and control processing layer, wireless data communication layer, and data service center layer. The layers work together to complete information acquisition and transmission tasks. The specific work process is as follows. First, the underlying information and data collection terminals remain connected to the WSN monitoring center layer. After holding link data in the monitoring center, if the client is not sending a command by the underlying information collection terminal, then the default setting of measuring every half hour once and uploading the data collection terminal can also receive commands sent to the upper layer to control the underlying various actions. Finally, the underlying data monitoring center receives data information and uploads it back to save and facilitate data analysis and management. The trends of various data can be observed to provide technical support. Figure 4 shows the work flow of the system.
The received weather data are specified in a frame format to send them to the host computer. The baud rate is set. The serial port for sending data frame format is shown in Table 1. When far from the coordinator, the coordinator will need to connect with the data communicator by sending meteorological data to the host computer.

C. CC2530 Chip Serial Design
Upon receipt of the meteorological data, we need to send the data to the host computer. The diagram of the serial interface circuit is shown in Figure 5.
A multiplexed input/output (I/O) port is sometimes necessary for special purposes. A dozen I/O ports are free to use, and more sensors can be added as needed. Each sensor is connected to the appropriate I/O port. The sys-    tem adds a temperature sensor to the most important meteorological elements of temperature monitoring. The CC2530 chip has a built-in temperature sensor, but it produces unstable, and sometimes, inaccurate data; therefore, the sensor is not used. After comparing commonly used temperature sensors in the market, this study selects a DS18B20 temperature sensor because it is easy to use and has a low cost.

PAPER DESIGN AND SIMULATION OF A METEOROLOGICAL DATA MONITORING SYSTEM BASED ON A WIRELESS SENSOR
A DS18B20 temperature sensor is a small digital sensor with a wide operating voltage range (3 V to 5 V). Its measurement range is "55 °C to +125 °C, with an accuracy of ±0.5 °C. This sensor uses a unique single-wire interface mode, and only one data pin microcontroller unit is connected (this system port is connected to P0_6 I/O). The other two pins are grounded with an external power supply. The circuit diagram is shown in Figure 7.

D. ZStack Protocol Stack Development of CC2530
Only the programming serial should be developed based on the gateway and end nodes for Z-Stack protocol stack development. Serial communications are converted into wireless communications. The protocol stack is developed based on CC2530-2.3.1-1.4.0 using the provided development on Sample APP. The main achievement of this routine is simple point-to-point communication. A few network configurations are involved, which are the most important event handlers, and the initialization of two basic functions to fulfill our requirements. The gateway PC host computer is connected to the node equipment and data acquisition terminal equipment routing node according to the aforementioned routine. This study develops node serial communications.

A. CC2530 Wireless Test
CC2530 communication between the upper computer and the PC is tested. Cor denotes the coordinator gateway node, and Node denotes the wireless terminal node. In the environment of MDK Keil, the test program is prepared based on STM32 to complete the supplementary test. Table 2 presents the data transmission performance test of CC2530.
The test conditions are as follows: laboratory normal temperature conditions, 10 partition transmissions, high signal quality, the continuous transceiver receives 80 kB zero packet loss, continuous test is 8 times, a serial port baud rate selection of 38400 bps (module optimal baud rate), and serial debugging assistant SSCOM3.2.

B. Simulation Sensor Node Localization
OMNET++ software is developed using a simulation code. The distance vector-hop (DV-Hop).exe is run. DV-Hop and DV-Hop-MinMax are generated, which are both targeting algorithms. The relative positioning error with the relative ranging error curve is shown in Figure 9. The relative positioning error with the radio range curve is shown in Figure 10. The relative position error ratio curves with anchor node are shown in Figure 11. As shown in Figure 9, the standard DV-Hop algorithm has a relatively lower positioning error than the DV-Hop-MinMax algorithm. Figure 10 indicates that when the network connectivity is too low, the conventional DV-Hop presents a significantly decreased performance, whereas the performance of the improved DV-Hop-MinMax algorithm decreases insignificantly. Figure 11 indicates that when the anchor node ratio value is too large, the error results obtained by the two algorithms are inconsiderable. Therefore, in case of a large node, a high proportion of network connection, and anchor node, the DV-Hop-MinMax algorithm is more effective than the original DV-hop algorithm.

V. CONCLUSIONS
The CC2530 WSN technology is completed based on the Zigbee formation. This technology is used to upload the basic elements of a farmland. The meteorological data observation system based on WSNs improves the level of real-time data collection. Using the embedded web technology enables concerned personnel to monitor areas remotely via the Internet and third-generation networks, which substantially reduces the complexities of data collection and transmission. The real-time performance of the system is improved and its development costs are reduced because of the high reliability of the embedded real-time operating systems and the simple preparation of the embedded operating systems and software. The wireless sensor node localization algorithm is also improved, and the new algorithm presents accurate positioning accuracy. The application of these technologies provides the system with high-speed data acquisition and processing capabilities as well as good positioning performance.