# Design and Implementation of Node of Wireless Network Environment Monitoring System Based on Artificial Intelligence

Authors: Pinghui Zou; Gaoqing Ji
Journal: Wireless Communications and Mobile Computing
 (2022)

---

## Abstract

In order to effectively solve the problem of traditional environmental monitoring system due to high sensor cost, difficult deployment, and high maintenance cost, the node design and implementation of a wireless sensor network-based environmental monitoring system are proposed. Simulation experiments show that the time-consuming running time is 14.210361 s. After adding the action force of the grid point on the node, the running time is 11.257740 s, and the operation efficiency of the algorithm is significantly improved. The improved virtual force algorithm optimization improved node coverage by 5.2%.The system is easy to deploy, reduces the development and maintenance cost, and can obtain data or monitor through wireless communication. It is convenient to use and maintain.


---

## Body

## 1. Introduction

To create a content instrumentation and network monitoring system and to provide users with remote indoor environment monitoring information services, modern science and technology involves various fields, and the interdisciplinary intersection between various fields constructs new technologies. WSN is a perfect combination of sensor technology, embedded system, wireless communication technology, and other fields, which can maximize human vision and help people monitor the changes of external things [1]. WSN has the ability of self-organization and long-distance communication and is widely used in all walks of life [2–5]. The traditional environment detection system has certain limitations. It needs to initialize the sensor network and can only understand the environmental changes through local accuracy. In addition, the monitoring range of wired sensor network is small, there is a monitoring blind area, and the fault-tolerant performance of the network system is also poor [6, 7].The main categories include RF technology, infrared technology, and Bluetooth technology, which have been common in mobile phones and other devices in the past decade. These technologies have different characteristics and different costs. The acquisition node in wireless sensor network is one of the most basic elements of the network. It is used to collect, preprocess, store, and transmit the data in the covered area in a multihop manner. Various types of sensors can be installed on the acquisition node, and the soil temperature, soil humidity, noise, light intensity pressure, air humidity, air temperature, and many other material phenomena of interest to us [8, 9]. At the same time, it must have the characteristics of simple, easy to use, reliable work, and low price, and Zigbee advantage lies in the interconnection between equipment in a certain environment and low power consumption; obvious advantages is shown in Figure 1. Wireless sensor network has several remarkable features: first is the high node density, a wide range of distribution. Due to the large number of sensor nodes, the maintenance of the wireless sensor network is more difficult than the traditional wireless network, and the software and hardware of the sensor network must be high robustness and fault tolerance: second is the strong network dynamic. Since the nodes in the network are randomly distributed, the three elements of sensor, perception object, and observer may be mobile, and often new nodes join or existing nodes fail, resulting in the sensor network is very dynamic: third is that the node energy is limited. Sensor nodes are mostly distributed in sparsely populated areas and harsh environment, making the energy problem, so sensor nodes are mostly microembedded devices, whose processing capacity, storage capacity, communication bandwidth, and carrying energy are very limited: fourth is low cost. Sensor nodes should be cheap, because a large sensor network often consists of hundreds of sensor nodes, so each node should be low cost, low price: fifth is wireless transmission. Sensor nodes transmit data wirelessly: sixth is node self-organization. Wireless sensor network system is mostly distributed in areas where people cannot or cannot reach, and the deployment of nodes is implemented in a random manner. This requires the communication protocol of the wireless sensor network system to complete the automatic network: the seventh, multijump. A sensor node may not have direct access to the base station, so the data should be transmitted to the base station in a multihop manner. In WSN, the deployment of nodes is usually random. WSN with random layout has some problems, such as low node utilization and small network coverage. Due to the consistency between the virtual force algorithm (VFA) and the network coverage problem, the algorithm is widely used in WSN [10, 11].Figure 1
Wireless sensor network system architecture.Sensor nodes are often a miniature-embedded system that have weak processing, storage, and communication power due to volume, price, and power supply, usually exchanging data only with neighbor nodes within the white body communication range, powered by carrying batteries with limited energy. To access nodes outside the communication range, you must use multihop routes. In order to ensure that the collected data information can be multiple jumped to the converged nodes, the distribution of the nodes should be quite dense. In terms of network function, each sensor node has the dual function of information collection and routing. In addition to local information collection and data processing, they should also store, manage, and integrate the data forwarded by other nodes, while cooperating with other nodes to complete some specific tasks. Convergent nodes usually have strong processing capacity, storage capacity, and communication capabilities. They can be either a sensor node with enhanced function, sufficient energy supply and memory and computing resources, or a special gateway device without a monitoring function and only a wireless communication interface. The convergence nodes connect the sensor network with the external networks such as the Internet to realize the communication protocol transformation of the two networks, send the detection tasks of the management nodes, and forward the collected data to the external network. Compared to traditional single-sensor devices, the sensor network can change the control objectives and monitoring content to suit the researcher’s interests. Users can send instructions to the sinking node via the Internet, and the sinking node is very flexible as it can change the function of the node in the network by providing these instructions to the sensor network. The receiving node is responsible for collecting all the collected data, sending it to the Internet, and storing the collected data in the sensor database. The database provides remote data services and allows users to connect to the Internet and view data.


## 2. Literature Review

Microsensor technology and the wireless communication capability of node inquiry give broad application prospects for the wireless sensor network. Not having the application fields of wire sensor network include military investigation, environmental monitoring, medical treatment, and building monitoring. With the continuous development and improvement of sensor technology, wireless communication technology, and computer technology, various sensor networks will be spread at all levels of life, especially in areas such as environmental monitoring. Modern environmental control systems usually adopt a line control system. There are two defects in such systems: on the one hand, the wiring control system is highly dependent on the line, and the layout of the system will affect the wiring. On the other hand, in the wired way, the node distribution is fixed; the distribution density is not high; and when some nodes fail, it will lose the local control function. This article collects ambient temperature and humidity information using a wireless sensor network and transmits this information to the monitoring center in a timely manner. The use of wireless sensor networks compared to traditional monitoring methods has three important advantages: (1) The number of sensor network nodes is high, the distribution density is high, and each node can monitor the details of the local environment. To the information center, therefore, the sensor networks are characterized by high data collection and high accuracy. (2) Because the size of the sensor node is small and the entire network needs to be deployed only once, the deployment of the sensor network has little human impact on the controlled environment. (3) Wireless sensors have the ability to monitor, self-calculate, and store in more complex ways. The sensor may not be desired to connect to physical changes, monitoring, or control. The order is being executed. This topic aims to help protect forests and disrupt traditional methods of environmental monitoring. Environmental monitoring aims to take advantage of a stationary sensor network to provide environmental monitoring information [12]. Mohapatra, H. and others used different filtering methods for different scenes. The data processing of temperature, humidity, and light intensity sensors adopts the amplitude limiting average filtering method, and the data processing of particle concentration sensors with large sampling variation adopts the first-order lag average filtering method [13]. Li, P. and others proposed correlation based data coding mode, distributed algorithm for determining node location in wireless sensor networks and method for reconstructing sensor node location, and developed an operating system based on wireless sensor networks [14]. Li, J. and others developed a wireless sensor network simulation system to study the problems in wireless sensor networks [15]. Y Jia. and others studied methods and technologies for ultralow power wireless sensor networks. According to the particularity of wireless sensor network communication protocols, new routing protocols based on negotiation protocols, directional release protocols, energy sensitive protocols, multipath protocols, and propagation routing protocols are proposed [16]. Watt, A. J. and others believe that wireless sensor network system can also play a great role in traffic. Through various sensors on the node, vehicle speed and traffic flow can be monitored, providing strong support for traffic management departments to better manage urban traffic [17]. Rahman, G. and others conducted data fusion processing on the collected data, and the reliability has been enhanced, but the fusion algorithm is complex, and the real-time performance is not strong [18]. Sharma, H. and others improved wireless sensor network routing protocol algorithm and reduced node power consumption [19]. Li, K. and others established a wireless sensor network test group, specializing in the research on the hardware implementation of wireless sensor networks [20]. Ranjan, A. and others believe that the wireless sensor network system can also be used for forest environmental monitoring and fire alarm. The nodes are randomly densely distributed in the forest and regularly report environmental data under normal conditions. In case of fire, the nodes will transmit the specific address of the fire source, fire size, and other information to relevant departments in a very short time through cooperation [21, 22].Based on this research, we propose a node design and implementation of an environmental monitoring system for a wireless sensor network based on artificial intelligence. The WSN environmental monitoring system based on ZigBee can be well applied in various environmental monitoring fields such as clean plant and is an effective solution. The traditional environment detection system has certain limitations. It needs to initialize the sensor network and can only understand the environmental changes through local accuracy.


## 3. Research Methods

### 3.1. Sensor Node Design

First, wireless sensor node is the way and means to realize the connection of things. Internet of Things is the extension of wireless sensor node to the connection of things in the real world, which is an important basis and component of the realization of this technology. Second, data exchange and transmission are carried out between any objects with the function of signal exchange. The range of network and goods involved is extensive. The Internet of Things is not only a network but also a product of the in-depth development of wireless sensor nodes. It is a brand new innovation in the application of wireless sensor nodes. All kinds of terminals create brand new forms of use and bring more industrial revolution with better operation experience to users.


#### 3.1.1. Design Principles of Sensor Nodes

The device driver is the interface between the operating system kernel and the machine hardware. It protects the software hardware details. In general, Linux device drivers must perform the following functions: start and remove the device, and transfer data from the kernel. Read data from hardware and hardware; read the data sent by the application to the device file; and return the requested data to the application; check. Measure and resolve errors during equipment operation. Networking is a necessary module for many embedded systems, and Ethernet is a high-speed, open, wide-ranging communication interface that plays an important role in the development, debugging, and use of installed systems. An important role is that in order to enable the designed wireless sensor node to form a wireless sensor network with long service life, stability, reliability and superior performance, the node design must consider the following aspects:(1)
Miniaturization. Miniaturization is the ultimate goal of sensor networks. Only when the size of the node itself is small enough can it ensure that it will not affect the target system environment or the impact can be ignored. In addition, in some special occasions, it is even required that the target system can be small enough to be imperceptible(2)
Low-power consumption. Due to the particularity of wireless sensor network application environment, it is difficult to replace the power supply, and the requirements for node power consumption are very strict. During normal operation, the power consumption of wireless transceiver is the main part of node power consumption, so advanced algorithms and protocols must be adopted as far as possible to shorten the duration of wireless transceiver working state(3)
High stability. In order to meet the requirements of service life in applications, each node must have high stability. The method of modular system design can reduce the mutual interference of circuits and improve the stability of nodes. To coexist with other wireless systems, wireless sensor network nodes must also be able to adapt to external interference. The method to improve the anti-interference performance of nodes is to use multichannel wireless transceiver. This wireless transceiver can make the system work in multiple frequency bands to avoid mutual interference of multiple wireless systems due to sharing a certain frequency [23, 24].(4)
Rapid development of market economy and the development strategy of “Internet +” also for the new period of production start-up provide a good platform and make the informatization, digitalization, and intelligence, and the network is gradually applied to all walks of life of entrepreneurship development; for all kinds of production environment to implement intelligent real-time monitoring, low cost, and easy operation, business can effectively improve production quality and efficiency. With open market space, this is the subject to adapt to market demand, according to the development of the starting point


#### 3.1.2. Design Concept of Wireless Sensor Node

The chip integrates a radio frequency transmitter and controller to provide high-performance, complex functions.This kind of communication control is only applicable to power systems, as long as there are wires, data can be transmitted, so this kind of transmission technology is already widely used. The pin description is shown in Table1.Table 1
Pin description.
PinNameNotes1GNDLand2DATASerial data, bidirectional3SKCSerial clock, input4VDDPower supply 2.2~5.5 V5~8NCThe remaining pins are not connected


#### 3.1.3. Calculation of Humidity

The sensor developed from the energy gap material PTAT (proportional to absolute temperature) has excellent linearity, which can be used as follows:Convert the digital output to the temperature value, as shown in(1)T=d1+d2×SOT,where d1 and d2 are specific coefficients, the value of d1 is related to the working voltage of SHT10, and the value of d2 is related to the resolution adopted by the internal A/D converter of SHT10.Since the digital output characteristic of relative humidity is nonlinear, in order to compensate the nonlinearity of humidity sensor, the humidity value can be corrected according to the following formula, as shown in(2)AWlinear=T1+T2×COAW+T3×COAW2,where AWlinear is the humidity value after linear compensation, sorh is the measured value of humidity, and T1,T2,T3 are the linear compensation coefficients.The compensation formula is as follows:(3)AWtrue=D−25×d1+d2×CORH+AWlinear,where AWtrue is the humidity value after linear compensation and temperature compensation, D is temperature, and d1 and d2 are the compensation coefficients.


### 3.2. Overall System Scheme Design

In the indoor environment combined with simple equipment to achieve the required environmental quality data collection function. Figure2 shows the overall block diagram of the system.Figure 2
Overall system block diagram.The improved VFA is used to optimize the node layout and obtain high network coverage, which provides a reference for the placement position of practical engineering application nodes. The gateway module transmits the data to the external network and gives an early warning of the equipment operation.


### 3.3. System Hardware Design

#### 3.3.1. Sensor Module

According to the design specifications of the clean workshop, the selected sensor model and its parameters are shown in Table2, taking volume and cost into consideration.Table 2
Model and parameters of sensor.
SensorModelMeasuring rangeTemperature and humidityDHT100~40°C; 10%~85%~PressureBMP160300~1000 hPaPM2.5DSL-020~999.9μg/g3Figure3 shows a design flow chart of the hardware structure of the sensor module.Figure 3
Hardware structure design of sensor module.The sensor of digital output is directly connected with STM32 microprocessor, and the sensor of analog output is connected with STM32 microprocessor.


#### 3.3.2. Zigbee Networking Module

Figure4 shows the design diagram of the hardware structure of the ZigBee network module.Figure 4
Hardware structure design diagram of ZigBee networking module.ZigBee networking module consists of CC2530 processor, antenna unit, and power module. Coordinator nodes are connected to gateway modules through serial ports.


#### 3.3.3. Hardware Design of Gateway Module

Figure5 shows the hardware design structure of the gateway module.Figure 5
Hardware structure design of gateway module.The gateway module includes STM32 microprocessor, serial port, and esp8266 serial port to WiFi module. The module is connected to the coordinator node through serial port.


### 3.4. Wireless Sensor Network Environmental Monitoring

The ARM processor as the core of coordinated processing and the measured data are recorded and the managed by database technology. Figure6 shows the flow chart of the environmental monitoring.Figure 6
Environmental monitoring flow chart.


#### 3.4.1. Sensor Module

Figure7 shows the flow chart of the design of the sensor module software.Figure 7
Data acquisition software design.Firstly, the temperature, humidity, dust concentration, and air pressure in the environment are collected and cached in a queue. To effectively remove the interference of various factors on the collected data, the data were processed by a combination of median filtering and sliding mean filtering algorithm. The filtering algorithm flow is shown in Figure8.Figure 8
Software design of digital filtering algorithm.


### 3.5. ZigBee Networking Module

Its application in life is very common; there are a lot of assemblies in display equipment, light sensing equipment, and food image acquisition equipment.


### 3.6. Sensor Network Node Layout Optimization Algorithm

#### 3.6.1. Traditional VFA

Due to the consistency between VFA and node coverage technology, VFA is used to optimize the node layout. The specific virtual force modeling is as follows: set any two nodessi and sj, and the force of node si by node sj meets the following force relationship, as shown in
(4)Fij=k1/dijα1,0<dij<rs;0,dij=rsordij>dth;k2/dijα2,otherwise,where k1 and k2 are gain coefficients; dij is the distance between nodes si and sj; dth is the distance threshold between nodes; and rs is the best distance between nodes.Each sensor node will update the node position according to the total resultant force. The update formula is shown in(5)xnew=xold,Fxy=0;xold+FxFxy×dm×e−1Fxy,Fxy≠0,(6)ynew=yold,Fxy=0;yold+FxFxy×dm×e−1Fxy,Fxy≠0,where dm is the maximum moving distance of the sensor node; Fxy is the resultant force of the virtual force acting on the node; and Fx and Fy are the x-axis and y-axis components of Fxy.


#### 3.6.2. Improvement of VFA

Traditional VFA only considers the force between nodes. In order to reduce the time loss of nodes in the process of location update, the force of grid points on nodes is added, and its definition is shown in(7)Fgrid=ωdig,r<dig<R0,other,where ω is the gain coefficient; r is the perceived radius; R is the communication radius; and dig is the distance between the node and the grid point.In the actual environmental monitoring process, nodes will gather on the boundary, as shown in Figure9.Figure 9
Case of a large number of boundary nodes.In this case, if the nodes move according to the above rules, some nodes will be excluded from the boundary, resulting in the weakening of node coverage of wireless sensor networks.Let the boundary of the region of interest also have a constraintFb on the node, so that the node will not be “excluded” outside the region. The expression of the force is shown in
(8)Fb=ϕdidi3,di≥dbth+∞,di<dbth,where di is the distance from the sensor node i to the boundary; ϕ is the gain coefficient; and dbth is the boundary distance threshold.


### 3.7. Gateway Module Software Design

The WiFi module loads the smart cloud firmware, establishes corresponding data points on the smart cloud platform, and realizes the data interaction between the gateway module, smart cloud server, and applications. Firstly, the gateway module receives the data from the coordinator node through the serial port, then gives an early warning on the operation of the clean equipment, and finally sends the data to the WiFi module through the serial port to the external network.


## 3.1. Sensor Node Design

First, wireless sensor node is the way and means to realize the connection of things. Internet of Things is the extension of wireless sensor node to the connection of things in the real world, which is an important basis and component of the realization of this technology. Second, data exchange and transmission are carried out between any objects with the function of signal exchange. The range of network and goods involved is extensive. The Internet of Things is not only a network but also a product of the in-depth development of wireless sensor nodes. It is a brand new innovation in the application of wireless sensor nodes. All kinds of terminals create brand new forms of use and bring more industrial revolution with better operation experience to users.


### 3.1.1. Design Principles of Sensor Nodes

The device driver is the interface between the operating system kernel and the machine hardware. It protects the software hardware details. In general, Linux device drivers must perform the following functions: start and remove the device, and transfer data from the kernel. Read data from hardware and hardware; read the data sent by the application to the device file; and return the requested data to the application; check. Measure and resolve errors during equipment operation. Networking is a necessary module for many embedded systems, and Ethernet is a high-speed, open, wide-ranging communication interface that plays an important role in the development, debugging, and use of installed systems. An important role is that in order to enable the designed wireless sensor node to form a wireless sensor network with long service life, stability, reliability and superior performance, the node design must consider the following aspects:(1)
Miniaturization. Miniaturization is the ultimate goal of sensor networks. Only when the size of the node itself is small enough can it ensure that it will not affect the target system environment or the impact can be ignored. In addition, in some special occasions, it is even required that the target system can be small enough to be imperceptible(2)
Low-power consumption. Due to the particularity of wireless sensor network application environment, it is difficult to replace the power supply, and the requirements for node power consumption are very strict. During normal operation, the power consumption of wireless transceiver is the main part of node power consumption, so advanced algorithms and protocols must be adopted as far as possible to shorten the duration of wireless transceiver working state(3)
High stability. In order to meet the requirements of service life in applications, each node must have high stability. The method of modular system design can reduce the mutual interference of circuits and improve the stability of nodes. To coexist with other wireless systems, wireless sensor network nodes must also be able to adapt to external interference. The method to improve the anti-interference performance of nodes is to use multichannel wireless transceiver. This wireless transceiver can make the system work in multiple frequency bands to avoid mutual interference of multiple wireless systems due to sharing a certain frequency [23, 24].(4)
Rapid development of market economy and the development strategy of “Internet +” also for the new period of production start-up provide a good platform and make the informatization, digitalization, and intelligence, and the network is gradually applied to all walks of life of entrepreneurship development; for all kinds of production environment to implement intelligent real-time monitoring, low cost, and easy operation, business can effectively improve production quality and efficiency. With open market space, this is the subject to adapt to market demand, according to the development of the starting point


### 3.1.2. Design Concept of Wireless Sensor Node

The chip integrates a radio frequency transmitter and controller to provide high-performance, complex functions.This kind of communication control is only applicable to power systems, as long as there are wires, data can be transmitted, so this kind of transmission technology is already widely used. The pin description is shown in Table1.Table 1
Pin description.
PinNameNotes1GNDLand2DATASerial data, bidirectional3SKCSerial clock, input4VDDPower supply 2.2~5.5 V5~8NCThe remaining pins are not connected


### 3.1.3. Calculation of Humidity

The sensor developed from the energy gap material PTAT (proportional to absolute temperature) has excellent linearity, which can be used as follows:Convert the digital output to the temperature value, as shown in(1)T=d1+d2×SOT,where d1 and d2 are specific coefficients, the value of d1 is related to the working voltage of SHT10, and the value of d2 is related to the resolution adopted by the internal A/D converter of SHT10.Since the digital output characteristic of relative humidity is nonlinear, in order to compensate the nonlinearity of humidity sensor, the humidity value can be corrected according to the following formula, as shown in(2)AWlinear=T1+T2×COAW+T3×COAW2,where AWlinear is the humidity value after linear compensation, sorh is the measured value of humidity, and T1,T2,T3 are the linear compensation coefficients.The compensation formula is as follows:(3)AWtrue=D−25×d1+d2×CORH+AWlinear,where AWtrue is the humidity value after linear compensation and temperature compensation, D is temperature, and d1 and d2 are the compensation coefficients.


## 3.1.1. Design Principles of Sensor Nodes

The device driver is the interface between the operating system kernel and the machine hardware. It protects the software hardware details. In general, Linux device drivers must perform the following functions: start and remove the device, and transfer data from the kernel. Read data from hardware and hardware; read the data sent by the application to the device file; and return the requested data to the application; check. Measure and resolve errors during equipment operation. Networking is a necessary module for many embedded systems, and Ethernet is a high-speed, open, wide-ranging communication interface that plays an important role in the development, debugging, and use of installed systems. An important role is that in order to enable the designed wireless sensor node to form a wireless sensor network with long service life, stability, reliability and superior performance, the node design must consider the following aspects:(1)
Miniaturization. Miniaturization is the ultimate goal of sensor networks. Only when the size of the node itself is small enough can it ensure that it will not affect the target system environment or the impact can be ignored. In addition, in some special occasions, it is even required that the target system can be small enough to be imperceptible(2)
Low-power consumption. Due to the particularity of wireless sensor network application environment, it is difficult to replace the power supply, and the requirements for node power consumption are very strict. During normal operation, the power consumption of wireless transceiver is the main part of node power consumption, so advanced algorithms and protocols must be adopted as far as possible to shorten the duration of wireless transceiver working state(3)
High stability. In order to meet the requirements of service life in applications, each node must have high stability. The method of modular system design can reduce the mutual interference of circuits and improve the stability of nodes. To coexist with other wireless systems, wireless sensor network nodes must also be able to adapt to external interference. The method to improve the anti-interference performance of nodes is to use multichannel wireless transceiver. This wireless transceiver can make the system work in multiple frequency bands to avoid mutual interference of multiple wireless systems due to sharing a certain frequency [23, 24].(4)
Rapid development of market economy and the development strategy of “Internet +” also for the new period of production start-up provide a good platform and make the informatization, digitalization, and intelligence, and the network is gradually applied to all walks of life of entrepreneurship development; for all kinds of production environment to implement intelligent real-time monitoring, low cost, and easy operation, business can effectively improve production quality and efficiency. With open market space, this is the subject to adapt to market demand, according to the development of the starting point


## 3.1.2. Design Concept of Wireless Sensor Node

The chip integrates a radio frequency transmitter and controller to provide high-performance, complex functions.This kind of communication control is only applicable to power systems, as long as there are wires, data can be transmitted, so this kind of transmission technology is already widely used. The pin description is shown in Table1.Table 1
Pin description.
PinNameNotes1GNDLand2DATASerial data, bidirectional3SKCSerial clock, input4VDDPower supply 2.2~5.5 V5~8NCThe remaining pins are not connected


## 3.1.3. Calculation of Humidity

The sensor developed from the energy gap material PTAT (proportional to absolute temperature) has excellent linearity, which can be used as follows:Convert the digital output to the temperature value, as shown in(1)T=d1+d2×SOT,where d1 and d2 are specific coefficients, the value of d1 is related to the working voltage of SHT10, and the value of d2 is related to the resolution adopted by the internal A/D converter of SHT10.Since the digital output characteristic of relative humidity is nonlinear, in order to compensate the nonlinearity of humidity sensor, the humidity value can be corrected according to the following formula, as shown in(2)AWlinear=T1+T2×COAW+T3×COAW2,where AWlinear is the humidity value after linear compensation, sorh is the measured value of humidity, and T1,T2,T3 are the linear compensation coefficients.The compensation formula is as follows:(3)AWtrue=D−25×d1+d2×CORH+AWlinear,where AWtrue is the humidity value after linear compensation and temperature compensation, D is temperature, and d1 and d2 are the compensation coefficients.


## 3.2. Overall System Scheme Design

In the indoor environment combined with simple equipment to achieve the required environmental quality data collection function. Figure2 shows the overall block diagram of the system.Figure 2
Overall system block diagram.The improved VFA is used to optimize the node layout and obtain high network coverage, which provides a reference for the placement position of practical engineering application nodes. The gateway module transmits the data to the external network and gives an early warning of the equipment operation.


## 3.3. System Hardware Design

### 3.3.1. Sensor Module

According to the design specifications of the clean workshop, the selected sensor model and its parameters are shown in Table2, taking volume and cost into consideration.Table 2
Model and parameters of sensor.
SensorModelMeasuring rangeTemperature and humidityDHT100~40°C; 10%~85%~PressureBMP160300~1000 hPaPM2.5DSL-020~999.9μg/g3Figure3 shows a design flow chart of the hardware structure of the sensor module.Figure 3
Hardware structure design of sensor module.The sensor of digital output is directly connected with STM32 microprocessor, and the sensor of analog output is connected with STM32 microprocessor.


### 3.3.2. Zigbee Networking Module

Figure4 shows the design diagram of the hardware structure of the ZigBee network module.Figure 4
Hardware structure design diagram of ZigBee networking module.ZigBee networking module consists of CC2530 processor, antenna unit, and power module. Coordinator nodes are connected to gateway modules through serial ports.


### 3.3.3. Hardware Design of Gateway Module

Figure5 shows the hardware design structure of the gateway module.Figure 5
Hardware structure design of gateway module.The gateway module includes STM32 microprocessor, serial port, and esp8266 serial port to WiFi module. The module is connected to the coordinator node through serial port.


## 3.3.1. Sensor Module

According to the design specifications of the clean workshop, the selected sensor model and its parameters are shown in Table2, taking volume and cost into consideration.Table 2
Model and parameters of sensor.
SensorModelMeasuring rangeTemperature and humidityDHT100~40°C; 10%~85%~PressureBMP160300~1000 hPaPM2.5DSL-020~999.9μg/g3Figure3 shows a design flow chart of the hardware structure of the sensor module.Figure 3
Hardware structure design of sensor module.The sensor of digital output is directly connected with STM32 microprocessor, and the sensor of analog output is connected with STM32 microprocessor.


## 3.3.2. Zigbee Networking Module

Figure4 shows the design diagram of the hardware structure of the ZigBee network module.Figure 4
Hardware structure design diagram of ZigBee networking module.ZigBee networking module consists of CC2530 processor, antenna unit, and power module. Coordinator nodes are connected to gateway modules through serial ports.


## 3.3.3. Hardware Design of Gateway Module

Figure5 shows the hardware design structure of the gateway module.Figure 5
Hardware structure design of gateway module.The gateway module includes STM32 microprocessor, serial port, and esp8266 serial port to WiFi module. The module is connected to the coordinator node through serial port.


## 3.4. Wireless Sensor Network Environmental Monitoring

The ARM processor as the core of coordinated processing and the measured data are recorded and the managed by database technology. Figure6 shows the flow chart of the environmental monitoring.Figure 6
Environmental monitoring flow chart.


### 3.4.1. Sensor Module

Figure7 shows the flow chart of the design of the sensor module software.Figure 7
Data acquisition software design.Firstly, the temperature, humidity, dust concentration, and air pressure in the environment are collected and cached in a queue. To effectively remove the interference of various factors on the collected data, the data were processed by a combination of median filtering and sliding mean filtering algorithm. The filtering algorithm flow is shown in Figure8.Figure 8
Software design of digital filtering algorithm.


## 3.4.1. Sensor Module

Figure7 shows the flow chart of the design of the sensor module software.Figure 7
Data acquisition software design.Firstly, the temperature, humidity, dust concentration, and air pressure in the environment are collected and cached in a queue. To effectively remove the interference of various factors on the collected data, the data were processed by a combination of median filtering and sliding mean filtering algorithm. The filtering algorithm flow is shown in Figure8.Figure 8
Software design of digital filtering algorithm.


## 3.5. ZigBee Networking Module

Its application in life is very common; there are a lot of assemblies in display equipment, light sensing equipment, and food image acquisition equipment.


## 3.6. Sensor Network Node Layout Optimization Algorithm

### 3.6.1. Traditional VFA

Due to the consistency between VFA and node coverage technology, VFA is used to optimize the node layout. The specific virtual force modeling is as follows: set any two nodessi and sj, and the force of node si by node sj meets the following force relationship, as shown in
(4)Fij=k1/dijα1,0<dij<rs;0,dij=rsordij>dth;k2/dijα2,otherwise,where k1 and k2 are gain coefficients; dij is the distance between nodes si and sj; dth is the distance threshold between nodes; and rs is the best distance between nodes.Each sensor node will update the node position according to the total resultant force. The update formula is shown in(5)xnew=xold,Fxy=0;xold+FxFxy×dm×e−1Fxy,Fxy≠0,(6)ynew=yold,Fxy=0;yold+FxFxy×dm×e−1Fxy,Fxy≠0,where dm is the maximum moving distance of the sensor node; Fxy is the resultant force of the virtual force acting on the node; and Fx and Fy are the x-axis and y-axis components of Fxy.


### 3.6.2. Improvement of VFA

Traditional VFA only considers the force between nodes. In order to reduce the time loss of nodes in the process of location update, the force of grid points on nodes is added, and its definition is shown in(7)Fgrid=ωdig,r<dig<R0,other,where ω is the gain coefficient; r is the perceived radius; R is the communication radius; and dig is the distance between the node and the grid point.In the actual environmental monitoring process, nodes will gather on the boundary, as shown in Figure9.Figure 9
Case of a large number of boundary nodes.In this case, if the nodes move according to the above rules, some nodes will be excluded from the boundary, resulting in the weakening of node coverage of wireless sensor networks.Let the boundary of the region of interest also have a constraintFb on the node, so that the node will not be “excluded” outside the region. The expression of the force is shown in
(8)Fb=ϕdidi3,di≥dbth+∞,di<dbth,where di is the distance from the sensor node i to the boundary; ϕ is the gain coefficient; and dbth is the boundary distance threshold.


## 3.6.1. Traditional VFA

Due to the consistency between VFA and node coverage technology, VFA is used to optimize the node layout. The specific virtual force modeling is as follows: set any two nodessi and sj, and the force of node si by node sj meets the following force relationship, as shown in
(4)Fij=k1/dijα1,0<dij<rs;0,dij=rsordij>dth;k2/dijα2,otherwise,where k1 and k2 are gain coefficients; dij is the distance between nodes si and sj; dth is the distance threshold between nodes; and rs is the best distance between nodes.Each sensor node will update the node position according to the total resultant force. The update formula is shown in(5)xnew=xold,Fxy=0;xold+FxFxy×dm×e−1Fxy,Fxy≠0,(6)ynew=yold,Fxy=0;yold+FxFxy×dm×e−1Fxy,Fxy≠0,where dm is the maximum moving distance of the sensor node; Fxy is the resultant force of the virtual force acting on the node; and Fx and Fy are the x-axis and y-axis components of Fxy.


## 3.6.2. Improvement of VFA

Traditional VFA only considers the force between nodes. In order to reduce the time loss of nodes in the process of location update, the force of grid points on nodes is added, and its definition is shown in(7)Fgrid=ωdig,r<dig<R0,other,where ω is the gain coefficient; r is the perceived radius; R is the communication radius; and dig is the distance between the node and the grid point.In the actual environmental monitoring process, nodes will gather on the boundary, as shown in Figure9.Figure 9
Case of a large number of boundary nodes.In this case, if the nodes move according to the above rules, some nodes will be excluded from the boundary, resulting in the weakening of node coverage of wireless sensor networks.Let the boundary of the region of interest also have a constraintFb on the node, so that the node will not be “excluded” outside the region. The expression of the force is shown in
(8)Fb=ϕdidi3,di≥dbth+∞,di<dbth,where di is the distance from the sensor node i to the boundary; ϕ is the gain coefficient; and dbth is the boundary distance threshold.


## 3.7. Gateway Module Software Design

The WiFi module loads the smart cloud firmware, establishes corresponding data points on the smart cloud platform, and realizes the data interaction between the gateway module, smart cloud server, and applications. Firstly, the gateway module receives the data from the coordinator node through the serial port, then gives an early warning on the operation of the clean equipment, and finally sends the data to the WiFi module through the serial port to the external network.


## 4. Result Discussion

### 4.1. System Practicability Test

Conduct a complete test on the data sending and receiving in the environmental monitoring system, and the data receiving information is shown in Table3. The system can normally display the monitored environmental parameter information, and can make a judgment on the operation status of various components in the fresh air and air conditioning system, which greatly saves the consumption time of manual investigation, troubleshooting in a very short time, and making the normal operation of the equipment.Table 3
Android APP data receiving information.
Ambient temperature25Ambient humidity47PM2.540Pressure988Air conditioning boxNormal operationFilter screenNormal operationFan coil unitFault


### 4.2. Effectiveness Test of Filtering Algorithm

The data detection module is related to the final embodiment of the data collected by each sensor, storing the core data of the environmental quality monitoring system as shown in Figure10.Figure 10
Filtering effect.
(a)
Original signal(b)
Median filtering(c)
Mean filtering(d)
This filteringThe simulation test is carried out on matlabr2013b, and the relevant parameters are set as follows: the monitoring area of wireless sensor network is 800 m ×700 m; the grid size is set to 2 m ×2 m; the number of sensor nodes isn=36; under the action of grid points, the sensing radius is r=90m; the maximum step is dth=2.5 m; and under the action of sensor nodes, the maximum step is dm=3.5 m. When there is no grid point force, the operation takes 14.210361 s. After adding the force of grid points on nodes, the running time is 11.257740 s, and the operation efficiency of the algorithm is significantly improved. The improved virtual force algorithm improves the node coverage by 5.2%. As can be seen from Figure 10, compared with the initial random distribution of nodes, the nodes are evenly distributed by using this filtering algorithm, and the task of overall regional monitoring is well completed.


## 4.1. System Practicability Test

Conduct a complete test on the data sending and receiving in the environmental monitoring system, and the data receiving information is shown in Table3. The system can normally display the monitored environmental parameter information, and can make a judgment on the operation status of various components in the fresh air and air conditioning system, which greatly saves the consumption time of manual investigation, troubleshooting in a very short time, and making the normal operation of the equipment.Table 3
Android APP data receiving information.
Ambient temperature25Ambient humidity47PM2.540Pressure988Air conditioning boxNormal operationFilter screenNormal operationFan coil unitFault


## 4.2. Effectiveness Test of Filtering Algorithm

The data detection module is related to the final embodiment of the data collected by each sensor, storing the core data of the environmental quality monitoring system as shown in Figure10.Figure 10
Filtering effect.
(a)
Original signal(b)
Median filtering(c)
Mean filtering(d)
This filteringThe simulation test is carried out on matlabr2013b, and the relevant parameters are set as follows: the monitoring area of wireless sensor network is 800 m ×700 m; the grid size is set to 2 m ×2 m; the number of sensor nodes isn=36; under the action of grid points, the sensing radius is r=90m; the maximum step is dth=2.5 m; and under the action of sensor nodes, the maximum step is dm=3.5 m. When there is no grid point force, the operation takes 14.210361 s. After adding the force of grid points on nodes, the running time is 11.257740 s, and the operation efficiency of the algorithm is significantly improved. The improved virtual force algorithm improves the node coverage by 5.2%. As can be seen from Figure 10, compared with the initial random distribution of nodes, the nodes are evenly distributed by using this filtering algorithm, and the task of overall regional monitoring is well completed.


## 5. Conclusion

Through the research and the analysis of wireless sensor network, the system designed the sensor module, ZigBee networking module, gateway module, and Android APP monitoring interface and studied the accuracy of the system data collection and the coverage rate of the wireless sensor network. The environmental data collected by the sensor module was filtered, the improved virtual force algorithm was used to optimize the network module layout, and finally the system was tested. The experimental results show that the system has good communication and the signal is stable and can be widely used in various environmental monitoring fields. Wireless sensor network technology has a very broad application prospect, which will profoundly change people’s lives. With the further research of wireless sensor network technology, it can be predicted that the products based on wireless sensor network technology will enter more and more into people’s lives in the near future.



---

*Source: 5911476-2022-04-26.xml*