Background
With the social development, human beings are increasingly concerned about the environmental quality, but because of improper treatment in the industrial production process, the environmental pollution is increased continuously, the human health is threatened, and all countries also recognize the urgency of environmental governance and actively carry out environmental protection research. At present, various environment monitoring products are developed, some of which are already used or are about to be used, and some environment detection sites are also established, but factors influencing the environment are many and change rapidly, and regional continuous detection is required to quickly find out pollution factors and change trends. Only by manual detection, the workload is huge and the accuracy is difficult to guarantee, so that finding an intelligent, continuous and instant regional environment detection system becomes a technical problem which needs to be solved urgently.
The invention with publication number CN 106051937A discloses an intelligent haze detection and removal device, which adopts Arduino UNO as a controller, and determines whether to open a window by analyzing the detection data of a laser dust sensor and comparing the detection data with local other meteorological information obtained by a mobile phone user through the Internet. Simple operation is done to Arduino UNO steerable device, can guarantee that indoor haze does not exceed standard.
The invention with publication number CN 105241015A discloses an air purifier based on a raspberry pi, which adopts the raspberry pi as a controller, analyzes PM2.5 and other related data acquired by an acquisition device by combining with the activity condition of a human body, makes a decision and adjusts the operation condition of purification equipment. The device utilizes raspberry group programming to realize intelligent operation and purify indoor air.
The utility model discloses a publication number is CN 206470155U's utility model discloses a haze detects and data transmission device based on GPRS network, adopts the STM32F103 chip to do microprocessor control haze sensor and detect and through GPRS in real time with haze data transmission to high in the clouds server on, user's accessible visit high in the clouds server obtains real-time haze information. The device can be used for collecting data in a large range, expanding the data collection range and simply analyzing the regional haze dynamics.
The haze detection device can realize automatic and continuous monitoring by adopting the controller, but the two devices can only be used for indoor haze detection and cannot realize regional haze detection and monitoring; although regional haze monitoring can be achieved by the third person, the STM32F103 chip is small in storage space and low in hardware compatibility, data are easily lost when the chip and the sensor perform mass data transmission, and monitoring data are transmitted in real time to consume a large number of network resources.
In conclusion, the memory capacity of the Arduino UNO and STM32F103 chips is small, and the software development difficulty is high; the raspberry group development function is stronger, but data transmission is delayed when the raspberry group development function is directly connected with a sensor; the detection data is transmitted in real time, and when the data acquisition is dense and the data volume is large, the network resource consumption is large in the transmission process and the data is easy to lose.
Disclosure of Invention
Aiming at the defects in the prior art, the invention provides a haze monitoring system. The portable detector is manufactured by connecting the sensor and the raspberry pie by the aid of Arduino, and accordingly the problem of data transfer lag between the sensor and the controller is solved; an Android Things system is programmed on the raspberry, so that the development difficulty of the functions of the detector and the development difficulty of APP are reduced; the raspberry group is connected with the cache module, so that the storage space of the detector is expanded, data cache is realized and the data are transmitted outwards periodically, the data transmission safety is enhanced, and network resources are saved.
The invention discloses a haze monitoring system which comprises a portable detector, a cloud end and a user end.
Wherein the portable detector comprises a sensor and a raspberry pi connected by Arduino; the sensor is carried on the Arduino, and the Arduino is connected with the raspberry pie through a DuPont line; an Android Things operating system is also burnt on the raspberry; in addition, the raspberry pie is also connected with the cache module, the positioning module, the communication module and the power module respectively.
The cloud end is connected with the user side through a network, and the cloud end is connected with the portable detector through the communication module.
The raspberry pi is a relatively complete microcomputer, has a strong development function and a large storage space, but has data transmission lag when being directly connected with a sensor; this problem does not exist when the sensor is connected to Arduino. The prior part of detectors adopts Arduino as a controller, but the Arduino has small storage space and poor developability, and the controller which is used as the detector alone is not beneficial to the operation and function development of the detector. Research finds that when the Arduino is connected with the raspberry pie, data can be quickly transmitted to the raspberry pie from the Arduino, and the raspberry pie has large storage space and strong expandability. Therefore, the sensor and the raspberry pie are connected through the Arduino, and smooth operation of the detector and rapid transmission of internal data can be achieved.
The raspberry pi and the Arduino can be connected wirelessly or by wire, and preferably, the raspberry pi and the Arduino are connected by a DuPont wire in the invention. The connection mode is simple to install and does not consume network resources, and the data transmission between the two is smoother after the connection.
In conclusion, the Arduino is used as a medium to connect the sensor and the raspberry pie, so that the problems of unsmooth operation and untimely data transmission when the sensor and the raspberry pie are directly connected are solved; in addition, the raspberry pie has a large storage space, detection data of the sensor can be stored and then transmitted outwards periodically, and network flow is saved.
In addition, the Android Things operating system is mainly applied to the Internet of Things and embedded equipment, supports multiple data transmission modes, can process data by means of a cloud, and shortens a product development cycle. Therefore, the Android Things system is burnt on the raspberry, the system development speed can be increased, and the system and the APP can be optimized on the cloud. Meanwhile, the monitoring system disclosed by the invention can be automatically upgraded along with the upgrading of the Android Things operating system. The system operation is ensured to be always in the optimal state, and meanwhile, the APP can also keep the optimal matching degree with the user side.
Meanwhile, most programs of the system are developed on the raspberry, the Arduino only reserves a part of instructions related to sensor behaviors, the operating load of the Arduino is reduced, the sensor is operated more smoothly, space is provided for subsequent optimization of the detector and the system, a new sensor can be directly added on an existing Arduino board to increase the dimensionality of detection data, and the monitoring accuracy of the system is improved.
The improved and optimized portable detector not only runs smoothly and has instant internal data transmission, but also is convenient for device improvement and system optimization.
Preferably, the portable detector of the present invention is fixedly mounted on the monitoring site or carried around.
Still preferably, the sensor in the portable detector comprises an infrared dust sensor and at least one of a temperature sensor and a humidity sensor. The infrared dust sensor can detect the content of particulate matters with different particle sizes in the atmosphere, and can further calculate the concentration of the particulate matters with different particle size ranges, such as PM2.5, PM10, and the like.
Preferably, the user side comprises one or more smartphones or computers loaded with APP. Preferably, the user mainly refers to a scientific research unit or a government department. The detection system disclosed by the invention is mainly used for monitoring regional haze, acquiring a large amount of continuous data and having higher value for scientific research units and government departments.
In order to better utilize the haze monitoring system provided by the invention, the invention provides a haze monitoring method, which is implemented according to the following steps:
step one, after receiving a monitoring signal, a raspberry pie sends a monitoring instruction to Arduino, the Arduino starts a sensor, the sensor starts detection after power-on self-detection, and detection data are transmitted to the raspberry pie in real time through the Arduino;
wherein, the sensor detects once every 0.5-60s, and the sensor is rested for 0.5-2h after continuously detecting for 0.5-8 h;
secondly, the raspberry group converts the format of the received detection data, adds position information through a positioning module, caches the detection data on a cache module, packs and compresses the cached data at intervals of 0.1-10h, and transmits the packed and compressed data to the cloud through a communication module;
thirdly, when the cloud receives the data transmitted by the portable detector, capturing related data in the network, comparing various data, automatically generating a haze monitoring report, and storing the haze monitoring report in the cloud;
step four, when the cloud receives a request of the user side, the cloud transmits a haze monitoring report to the user side for the user to use;
the related data in the third step comprises one or more of meteorological data, traffic flow data, industrial and mining enterprise data, nitrogen oxide concentration and sulfur dioxide concentration, and the meteorological data comprises wind direction and wind speed.
Preferably, in the third step, the raspberry group duplicates the data which is converted in format and added with the position information, one part of the data is cached and then is transmitted to the cloud end at regular time, and the other part of the data is transmitted to the cloud end in real time. Namely, real-time transmission and timing transmission are carried out simultaneously, so that the safety of data can be ensured to a greater extent. When the network is unstable or interrupted in the surrounding environment, the data transmitted in real time is easy to lose, and the data transmitted at regular time can make up for the loss, thereby playing a backup effect; or when the portable detector fails in the processes of caching and data compression and the like, the data transmitted in real time also has a backup effect; both can guarantee the security of system data.
Preferably, when the cloud receives data transmitted by the portable detector at regular time, the data is compared with the received real-time data, and when the two data are completely consistent, any one of the two data is released, and the other data is reserved; when the two data are inconsistent, one missing data is released and the other complete data is reserved.
Preferably, after the cloud compares the data transmitted by the portable detector with the related data in the network, the automatically generated haze monitoring report includes haze cause judgment and haze change trend prediction.
Preferably, the sensor detects once every 0.5-30s, and the sensor continuously detects for 1-4h and then takes a rest for 0.5-1 h; the portable detector transmits data to the cloud end every 0.1-5 h. When the detection frequency of the sensor is too high, the equipment is greatly damaged and the energy consumption is high; however, when the detection frequency is too low, the power consumption of the sensor during standby is high, and the instantaneous loss of the standby mode to the detection mode is large, so that the detection frequency of the sensor is not easily too high or too low. When the continuous monitoring time is too long, the heat generated by the sensor is large, and operation faults are easily caused, so that the continuous monitoring time is not easy to overlong, a user needs to rest for a period of time after detecting for a period of time, and the main sensors can preferably operate in a plurality of modes alternatively, so that the service life of the sensor can be prolonged, and the detection data is stable and reliable.
In summary, the haze monitoring system of the present invention preferably includes at least 2 infrared particle sensors and 1 temperature sensor or humidity sensor, and the infrared particle sensors operate alternately; when the detection value of the infrared particle sensor is continuously increased or decreased for more than 2 times and the increase or decrease exceeds 25%, the raspberry sends a command, starts one or more other sensors and increases the detection frequency by 1 time; when the detection value of the infrared particle sensor continuously fluctuates for more than 2 times and the change amplitude is less than 10%, the raspberry sends out an instruction, and the sensor returns to the initial detection state. The calculation method of the amplification, the reduction and the change amplitude comprises the following steps: dividing the difference value between the latter detection value and the former detection value by the former detection value to obtain a numerical value according to the percentage, and taking the absolute value of the percentage as the amplification, the reduction and the variation amplitude; the calculation formulas of the amplification, the reduction and the change amplitude are as follows: i (((latter detection value-former detection value)/former detection value) × 100% |.
Further preferably, when the haze monitoring system comprises more than 2 infrared particle sensors, one infrared particle sensor continuously detects for 1-4h and then switches to another infrared particle sensor.
Preferably, in the fourth step, the haze monitoring data is attached to the haze monitoring report sent to the user. The user can carry out the reutilization to haze monitoring data according to own specific demand for relevant scientific research or other uses.
The haze monitoring system of the present invention is not limited to the above-described structure and use, and one skilled in the art can replace or add other detectors or sensors as taught by the present invention, such as: the monitoring system provided by the invention can be applied to other monitoring fields by replacing the sensor with a heavy metal detector, a microbial sensor or adding a carbon dioxide sensor and the like, and can be used for more researches, such as the research on the synergistic effect or physicochemical reaction among various pollution factors.
Compared with the prior art, the invention has the following beneficial effects:
(1) the sensor is connected with the raspberry pie through the Arduino, and the Arduino is connected with the raspberry pie through a DuPont line, so that the transmission lag of detection data is avoided, and the detection data is quickly and instantly transmitted in the detector;
(2) an Android Things operating system is operated on the raspberry, so that the portable detector not only has a larger storage space, but also can be conveniently accessed with various controls, and the development difficulty of the system and the APP is reduced;
(3) the portable detector is small in size, convenient to carry on common portable equipment such as a bracelet and a mobile phone, more convenient to use and capable of being used for large-scale and large-batch data acquisition.
(4) The raspberry group is connected with the cache module, monitoring data in a period of time can be stored, and the monitoring data are transmitted after being packaged and compressed regularly, so that the problem of network resource waste and data loss risk caused by real-time transmission are avoided.
Example 1
As shown in fig. 1, a haze monitoring system includes a portable detector 1-n, a cloud, and a user 1-m, where the user 1-m is connected to a cloud server via a network, and the cloud is connected to the portable detector 1-n via a communication module. Wherein, the n portable detectors have the same structure and respectively comprise a sensor and a raspberry pi which are connected by Arduino; the sensor is carried on the Arduino, and the Arduino is connected with the raspberry pie through a DuPont line; an Android Things operating system is burned on the raspberry; the raspberry pie is also connected with the cache module, the positioning module, the communication module and the power supply module; the user side is a smart phone and/or a computer loaded with APP.
Wherein the sensors in each portable detector include 1 infrared particle sensor and 1 temperature sensor.
The haze monitoring system carries out haze monitoring according to the following steps:
step one, after receiving a monitoring signal sent by a cloud, a raspberry group sends a monitoring instruction to Arduino, the Arduino starts a sensor, the sensor starts detection after power-on self-checking, and detection data are transmitted to the raspberry group in real time through the Arduino;
wherein, the sensor detects once every 0.5s, and the sensor continuously detects for 1h and then takes a rest for 0.5 h;
secondly, the raspberry group converts the format of the received detection data, adds position information through a positioning module, caches the detection data on a cache module, packs and compresses the cached data at intervals of 0.1h, and transmits the packed and compressed data to the cloud end through a communication module;
thirdly, when the cloud receives the data transmitted by the portable detector, capturing related data in the network, comparing various data, automatically generating a haze monitoring report, and storing the haze monitoring report in the cloud;
after receiving a request of the user side, the cloud side sends a haze monitoring report to the user side for the user to use;
the related data comprises meteorological data, traffic flow data and industrial and mining enterprise data, and the meteorological data comprises wind direction and wind speed.
Example 4
In the haze detection system of embodiment 1, one infrared particle sensor and one humidity sensor are added, that is, the sensors in each portable detector comprise 2 infrared particle sensors and 1 temperature sensor and 1 humidity sensor. And the n portable detectors in the haze detection system are fixedly arranged on the appointed detection sites, and the raspberry pie is connected with the power supply module.
The haze monitoring system carries out haze monitoring according to the following steps:
step one, after receiving a monitoring signal sent by a cloud server, a raspberry pie sends a monitoring instruction to Arduino, the Arduino starts 1 infrared particle sensor, the sensor starts to perform self-checking and then starts to detect, and detection data are transmitted to the raspberry pie through the Arduino in real time;
the sensor detects every 2s, and another infrared particle sensor is replaced to detect after continuous detection for 3 h;
when the PM2.5 value detected by the infrared particle sensor is continuously increased for 3 times and the amplification exceeds 25%, the raspberry group automatically sends an instruction, a temperature sensor and a humidity sensor are started, and the detection frequency of the sensors is changed to be once every 1 s; when the infrared particle sensor detects that the PM2.5 value changes less than 10% for 5 times continuously, the raspberry dispatching unit automatically sends out an instruction, the temperature sensor and the humidity sensor are closed, and the detection frequency of the infrared particle sensor is recovered to be detected once every 2 s;
step two, converting the format of the detection data received by the raspberry group and adding positioning information into the detection data, copying the detection data into duplicates, caching the duplicates by entering a cache module, packing and compressing the cached data at intervals of 0.5h, and transmitting the packed and compressed data to the cloud end through a communication module; transmitting the other part to the cloud end in real time;
comparing the data with the received real-time data when the cloud receives the data transmitted by the portable detector at regular time, reserving a complete part of data, and releasing the other part of data; meanwhile, related data in the network are captured, various data are compared, a haze monitoring report is automatically generated, and the haze monitoring report is stored in the cloud;
the related data comprises meteorological data, traffic flow data, industrial and mining enterprise data, nitrogen oxide concentration and sulfur dioxide concentration, and the meteorological data comprises wind direction and wind speed;
after receiving a request of the user side, the cloud side sends a haze monitoring report to the user side for the user to use;
wherein the haze monitoring report is accompanied by haze detection data.
While embodiments of the invention have been disclosed above, it is not intended to be limited to the uses set forth in the specification and examples. It can be applied to all kinds of fields suitable for the present invention. Additional modifications will readily occur to those skilled in the art. It is therefore intended that the invention not be limited to the exact details and illustrations described and illustrated herein, but fall within the scope of the appended claims and equivalents thereof.