A machine learning-based electronic nose method for detecting volatile ammonia in farmland
The ammonia collection device, which combines machine learning algorithms with farmland robots, solves the problems of high cost, slow speed, and low limit in ammonia volatilization detection in farmland, and realizes low-cost, high-precision real-time ammonia monitoring.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- HENAN AGRICULTURAL UNIVERSITY
- Filing Date
- 2023-10-17
- Publication Date
- 2026-06-30
AI Technical Summary
Existing ammonia volatilization detection devices for farmland are costly, unsuitable for long-term detection in exposed farmland environments, slow in detection speed, and have low detection limits.
A machine learning-based electronic nose method for detecting volatile ammonia in farmland was developed. The method uses a gas sensor in an ammonia collection chamber and an Arduino-Mega microprocessor board to record the detection results. A machine learning algorithm is built using Matlab software and combined with a farmland robot to perform on-site gas sampling and concentration calculation.
It reduces detection costs, improves detection stability and accuracy, and enables real-time monitoring of ammonia concentration in farmland environments, saving manpower and resources.
Smart Images

Figure CN117347563B_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the technical field of volatile ammonia detection in farmland, specifically a machine learning-based electronic nose detection method for volatile ammonia in farmland. Background Technology
[0002] Ammonia (NH3) reacts with water to produce ionic ammonium nitrogen (NH4). + Ammonium nitrogen (NH4+) is an important plant nutrient element that promotes plant growth and development. In agricultural production, ammonium nitrogen is added to farmland soil through basal fertilizer or top dressing. However, with weather changes and soil microbial activity, ammonium nitrogen (NH4+) can degrade. + -N) will be converted into ammonia (NH3), which will volatilize from the soil into the atmosphere. Ammonia volatilization not only causes air pollution, but also reduces soil fertility, thereby affecting agricultural production efficiency.
[0003] Therefore, the detection of volatile ammonia in farmland is an important aspect of atmospheric pollutant gas detection. Currently, ammonia (NH3) detection methods mainly include optical absorption detection and passive gas collection detection. However, accurate optical detection requires expensive and bulky equipment; passive gas collection detection methods require bringing the gas to a laboratory for testing, and cannot immediately determine the current ammonia concentration, let alone obtain the dynamic changes in volatile ammonia in farmland. Furthermore, long-term passive gas collection detection methods consume significant manpower and resources. Therefore, different volatile ammonia detection devices for farmland have emerged in the existing technology, mainly as follows:
[0004] Prior art 1: A laser-based low-pressure detection device for ammonia volatilization in farmland, disclosed in Chinese utility model patent application CN215297136U (authorization announcement date: December 14, 2021), includes a laser, a gas cell, a detector, a low-pressure gas path, and a pre-treatment gas path for ammonia sampling in farmland. The pre-treatment gas path collects ammonia volatilized from farmland crops. The pre-treatment gas path, the low-pressure gas path, and the gas cell are sequentially connected. The laser emits a laser signal into the gas cell, and the detector receives the laser signal passing through the gas cell.
[0005] Prior Art 2: A laser-based low-pressure detection device for ammonia volatilization in farmland, disclosed in Chinese invention patent application CN11364007A (publication date: November 12, 2021), includes a cylindrical sealed chamber with an opening at the bottom; temperature control elements are distributed and installed on the inner wall of the sealed chamber, and the temperature control elements are connected to a temperature controller; temperature sensors are installed in the soil outside the sealed chamber and in the surface soil, and the temperature sensors are connected to the temperature controller; holes are distributed on the top and sides of the sealed chamber, and each hole is connected to an exhaust device through a rubber tube; wind speed and direction sensors are installed inside the sealed chamber and on the surface soil around the sealed chamber, and the wind speed and direction sensors are connected to the exhaust control device; each exhaust device is connected to a multi-channel exhaust control device; the gas extracted by the multi-channel exhaust control device is then connected to a boric acid solution container.
[0006] The aforementioned prior art can detect ammonia volatilization in farmland relatively accurately, but the optical equipment is expensive and easily damaged, making it unsuitable for long-term detection in farmland environments. Furthermore, the detection speed is slow and the detection limit is low, making it difficult to apply on a large scale in farmland.
[0007] In the aforementioned prior art 2, boric acid is used to absorb ammonia gas, and the original ammonia concentration in the farmland is reduced by detecting the ammonia gas absorbed by the boric acid. However, this method cannot directly detect the concentration of ammonia gas and requires subsequent testing.
[0008] Therefore, it is urgent to solve the technical problems of high detection cost, unsuitability for long-term detection in farmland exposure environment, slow detection speed and low detection limit for ammonia volatilization in farmland. Summary of the Invention
[0009] To address the shortcomings of the aforementioned background technology, this invention proposes an electronic nose detection method for volatile ammonia in farmland using machine learning, which solves the problems of high cost, unsuitability for long-term detection in farmland exposure environments, slow detection speed, and low detection limit for volatile ammonia detection.
[0010] The technical solution of this application is as follows:
[0011] A machine learning-based electronic nose method for detecting volatile ammonia in farmland, with the following steps:
[0012] S1: Using ammonia water to simulate ammonia gas of different concentrations;
[0013] S2: Ammonia gas of different concentrations is drawn into the ammonia gas collection chamber and detected by the gas sensor inside the ammonia gas collection chamber. The detection results are recorded by the Arduino-Mega microprocessor board on the ammonia gas collection chamber.
[0014] S3: The Arduino-Mega microprocessor board uploads the detection results to the experimental computer;
[0015] S4: The experimental computer uses Matlab software to build machine learning algorithms based on the collected ammonia data;
[0016] S5: Write the constructed machine learning algorithm into the onboard computer of the farm robot;
[0017] S6: Connect the ammonia collection chamber to the farm robot;
[0018] S7: Move the farm robot to the farmland. When the farm robot drives the ammonia collection chamber to the path planning point, conduct on-site gas sampling.
[0019] S8: The onboard computer receives a signal from the gas sensor inside the ammonia collection chamber and uses the onboard machine learning algorithm to calculate the current concentration of volatile ammonia.
[0020] S9: After the test is completed, the DC fan starts working to discharge the ammonia gas from the ammonia gas collection chamber;
[0021] S10: The farm robot detects ammonia concentration at each path planning point through the settings of the onboard computer.
[0022] Furthermore, the specific steps of S2 are as follows:
[0023] S2.1: The air pump pumps ammonia gas from the sampling inlet into the ammonia collection chamber;
[0024] S2.2: Ammonia gas passes through a gas sensor installed on a ring-shaped PCB circuit board and an ambient temperature and humidity sensor installed on the inner wall of the ammonia gas collection chamber. The gas sensor transmits an electrical signal to the Arduino-Mega microprocessor board.
[0025] S2.3: The Arduino-Mega microprocessor board installed on the outer wall of the ammonia collection chamber records the detection results and uploads them to the vehicle computer;
[0026] S2.4: Turn on the DC fan to expel the ammonia gas from the ammonia collection chamber;
[0027] S2.5: Repeat steps S2.1-S2.4 to test ammonia gas of different concentrations multiple times and record the data.
[0028] Furthermore, the gas sensors include MQ135, MQ137, TGS2600, TGS2602, TGS2620, SHT11, and Grove multichannel sensor.
[0029] Furthermore, the machine learning algorithm includes a gas data input layer, a CNN layer, an LSTM layer, and a data output layer that outputs the final gas concentration information. The CNN layer is used to extract deep-level gas feature information, and the LSTM layer is used to acquire gas feature information.
[0030] Furthermore, the specific steps of S4 are as follows:
[0031] S4.1: Import the detection results data into Matlab on the experimental computer to construct machine learning algorithms;
[0032] S4.2: Convert the data input from the gas sensor into an image input;
[0033] S4.3: The image is input to the first CNN layer, which includes convolutional layers, batch normalization layers, ReLU activation function layers, and max pooling layers;
[0034] S4.4: Then input the image into a second CNN layer with different parameters than the first CNN layer;
[0035] S4.5: Convert image data into two-dimensional structural data through flattening layers;
[0036] S4.6: Input the two-dimensional structure data sequentially into the LSTM layer, the fully connected layer, the Softmax layer, and the classification output layer;
[0037] S4.7: Data classification output, the machine learning algorithm construction is complete.
[0038] Furthermore, the ammonia collection chamber is connected to the farm robot via a connector. The farm robot includes an intelligent module, a 5G communication module, a GPS positioning module, and a replaceable module. The intelligent module is connected to the Arduino-Mega microprocessor board in the ammonia collection chamber.
[0039] Furthermore, the intelligent module includes an onboard computer connected to the experimental computer, which directs the farm robot to move point-to-point through path planning points provided by the experimental computer.
[0040] Furthermore, the replaceable module includes a carbon dioxide detection module, a particulate matter pollution detection module, and a volatile organic compound detection module.
[0041] Furthermore, a mechanical guide rail is provided below the ammonia collection chamber, and the ground-level volatile ammonia sampling hood is slidably connected to the mechanical guide rail. A gas guiding hose connected to the gas pump is provided on the ground-level volatile ammonia sampling hood.
[0042] Furthermore, an electric heating wire is installed inside the ammonia collection chamber, and the electric heating wire covers the bottom of the chamber and the cylinder wall of the ammonia collection chamber.
[0043] The specific beneficial effects of this invention include:
[0044] 1. It can effectively reduce costs to a minimum without sacrificing detection accuracy and minimum detection limits;
[0045] 2. Compared with optical detection devices and boric acid solution adsorption, this electronic nose device is more stable and less susceptible to interference from extreme or rapidly changing environments;
[0046] 3. The present invention has multiple gas sensors. Compared with the detection of a single sensor, the algorithm generated by the machine learning algorithm can detect a lower ammonia limit and can detect ammonia from a variety of interfering gases.
[0047] 4. Machine learning algorithms can read data transiently from sensors, saving a significant amount of time;
[0048] 5. Farmland walking robots can move and collect samples more easily in the fields, saving manpower and resources. Attached Figure Description
[0049] To more clearly illustrate the embodiments of the present invention, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0050] Figure 1 A schematic diagram of an electronic nose device for detecting volatile ammonia in farmland;
[0051] Figure 2 This is a schematic diagram of the ammonia collection chamber.
[0052] Figure 3 This is the circuit connection topology diagram for the ammonia collection chamber;
[0053] Figure 4 This is a schematic diagram of the structure of a walking robot in farmland;
[0054] Figure 5 This is a schematic diagram of a machine learning algorithm;
[0055] Figure 6 A schematic diagram of the design structure for an ammonia collection chamber with a mechanical lifting mechanism;
[0056] Figure 7 This is a schematic diagram of the modular structure of a farmland robot;
[0057] Figure 8 A schematic diagram of an ammonia collection chamber equipped with an electric heating wire;
[0058] Figure 9 A schematic diagram illustrating the construction of a machine learning algorithm.
[0059] Explanation of icon numbers:
[0060] 1. Ammonia collection chamber; 2. Farm robot; 3. Connectors; 4. Arduino-Mega microprocessor board;
[0061] 11. Sampling air inlet; 12. Air pump; 13. DC fan; 14. Gas sensor;
[0062] 15. Circular PCB circuit board; 16. Temperature and humidity sensor; 17. Sampling outlet;
[0063] 21. Drive motor; 22. Battery; 23. LiDAR; 24. Onboard computer;
[0064] 25. Replaceable module; 26. Tire;
[0065] 31. Mechanical guide rail; 32. Ground-mounted volatile ammonia sampling hood; 33. Guide rail motor; 34. Gas delivery hose;
[0066] 40. Electric heating wire. Detailed Implementation
[0067] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0068] An electronic nose method for detecting volatile ammonia in farmland using machine learning includes the following steps:
[0069] S1: Ammonia gas of different concentrations can be simulated using ammonia water; ammonia gas with a concentration range of 1-100ppm can be prepared by using 3ml of 0.5% ammonia water and different volumes of distilled water (8ml / 16ml / 32ml).
[0070] S2: Ammonia gas of different concentrations is drawn into ammonia collection chamber 1 and detected by gas sensor 14 inside ammonia collection chamber 1. The detection results are recorded by Arduino-Mega microprocessor board 4 on ammonia collection chamber 1. During this period, ammonia gas with concentrations of 1ppm, 2ppm, 3ppm, 5ppm, 10ppm, 20ppm, 30ppm, 50ppm and 100ppm is introduced into ammonia collection chamber 1 respectively. Each concentration is repeated 20 times. Between every two experiments, a DC fan is turned on to completely expel the ammonia gas remaining in ammonia collection chamber 1 from the previous experiment.
[0071] S3: The Arduino-Mega microprocessor board 4 uploads the detection results to the experimental computer;
[0072] S4: The experimental computer uses Matlab software to build machine learning algorithms based on the collected ammonia data;
[0073] S5: Write the constructed machine learning algorithm into the onboard computer 24 of the farm robot 2;
[0074] S6: Connect the ammonia collection chamber 1 to the farm robot 2;
[0075] S7: Move the farm robot 2 to the farmland. When the farm robot 2 drives the ammonia collection chamber 1 to the path planning point, perform on-site gas sampling.
[0076] S8: The onboard computer 24 receives a signal from the gas sensor 14 inside the ammonia collection chamber 1 and uses the onboard machine learning algorithm to calculate the current concentration of volatile ammonia.
[0077] S9: After the test is completed, DC fan 13 starts to work and discharges the ammonia gas in ammonia collection chamber 1;
[0078] S10: The farm robot 2 completes the detection of ammonia concentration at each path planning point through the settings of the on-board computer 24.
[0079] Based on the above implementation method, the specific steps of S2 are as follows:
[0080] S2.1: The air pump 12 pumps ammonia gas from the sampling inlet 11 into the ammonia collection chamber 1;
[0081] S2.2: Ammonia gas passes through gas sensor 14 set on the ring PCB circuit board 15 and ambient temperature and humidity sensor 16 set on the inner wall of gas collection chamber 1. Gas sensor 14 transmits electrical signals to Arduino-Mega microprocessor board 4.
[0082] S2.3: The Arduino-Mega microprocessor board 4, located on the outer wall of the ammonia collection chamber 1, records the detection results and uploads them to the vehicle computer 24;
[0083] S2.4: Turn on DC fan 13 to discharge the ammonia gas in ammonia collection chamber 1;
[0084] S2.5: Repeat steps S2.1-S2.4 to test and record data for ammonia gas at different concentrations multiple times. Ammonia gas at concentrations of 1ppm, 2ppm, 3ppm, 5ppm, 10ppm, 20ppm, 30ppm, 50ppm, and 100ppm is introduced into the gas collection chamber. Each concentration is tested 20 times. Between every two tests, the DC fan is turned on to completely expel the ammonia gas remaining in the gas collection chamber from the previous test.
[0085] Based on the above embodiments, the gas sensor includes MQ135, MQ137, TGS2600, TGS2602, TGS2620, SHT11, and Grove multichannel sensor.
[0086] Specifically, the MQ135 is an air quality sensor, the MQ137 is an ammonia sensor, the TGS2600 is an air quality sensor, the TGS2602 is an air pollutant detection sensor, the TGS2620 is an organic solvent gas detection sensor, the SHT11 is a temperature and humidity sensor, and the Grove multichannel sensor is a volatile organic compound sensor. These sensors do not only respond to a single gas; they also respond when ammonia is present in the environment, exhibiting cross-sensitivity. However, different sensor models respond differently to the same concentration of ammonia. Machine learning algorithms learn these different response characteristics under the same ammonia environment, thus enabling the detection of low concentrations of ammonia. The gas pumped into the collection chamber is sensed by the sensor, and the electrical signal is transmitted to the Arduino-Mega microprocessor board 4. Because different sensor models produce different characteristic information under the same gas environment, that is, the output voltage and current of the sensors are different under the same concentration of ammonia.
[0087] Specifically, the ambient temperature and humidity sensor 16 in the sampling chamber provides a basis for calibrating the concentration signal of the sensor.
[0088] Based on the above implementation, the machine learning algorithm includes a gas data input layer, an LSTM long short-term memory network structure, a CNN convolutional neural network structure, and a data output layer that outputs the final gas concentration information. The LSTM long short-term memory network structure is used to acquire gas feature information, and the CNN convolutional neural network structure is used to extract deep-level gas feature information.
[0089] Based on the above implementation methods, such as Figure 9 As shown, the specific steps of S4 are as follows:
[0090] S4.1: Import the detection results data into Matlab on the experimental computer to construct machine learning algorithms;
[0091] S4.2: Convert the data input of gas sensor 14 into image input; each sensor corresponds to each column of the sensor, each observation value is each row of the image, and the number of channels of the image is 1;
[0092] S4.3: The image is input to the first CNN layer, which includes convolutional layers, batch normalization layers, ReLU activation function layers, and max pooling layers;
[0093] S4.4: The image is then input into a second CNN layer with different parameters than the first CNN layer. The first and second CNN layers are used to capture features and reduce dimensionality. The convolutional part consists of two layers with filter sizes of 5,5 and 3,3, corresponding to 32 and 16 filters respectively. The max pooling layer has pooling sizes of 5,5 and 3,3.
[0094] S4.5: Convert image data into two-dimensional structural data through flattening layers;
[0095] S4.6: The two-dimensional structure data is sequentially input into the LSTM layer, the fully connected layer, the Softmax layer, and the classification output layer; the LSTM layer contains 258 hidden units, the state activation function is tanh, and the activation function is sigmoid; the output size of the fully connected layer is 3, which is used for training long-term series data; the Softmax layer and the classification output layer are responsible for outputting the results of the neural network operation as the classification result, i.e., concentration;
[0096] S4.7: Data classification output, the machine learning algorithm construction is complete.
[0097] Based on the above implementation, the ammonia collection chamber 1 is connected to the farm robot 2 via the connector 3. The farm robot 2 includes an intelligent module, a 5G communication module, a GPS positioning module, and a replaceable module. The intelligent module is connected to the Arduino-Mega microprocessor board 4 in the ammonia collection chamber 1.
[0098] Specifically, such as Figure 2As shown, an air pump 12 for extracting gas is fixed to the outer wall of the ammonia collection chamber 1. The ammonia collection chamber 1 is connected to a gas inlet and outlet duct, and a gas sensor 14 is installed inside the ammonia collection chamber 1 to sense gas concentration signals. An ambient temperature and humidity sensor 16 is installed on the inner wall of the ammonia collection chamber 1 to sense the temperature and humidity of the ammonia collection chamber 1. A DC fan 13 is installed inside the ammonia collection chamber 1 to accelerate air circulation. A fixing device for connecting a sampling cart is located at the bottom of the ammonia collection chamber 1. An Arduino-Mega microprocessor board 4 for controlling the sensor 14 is fixed to the outer wall of the ammonia collection chamber 1.
[0099] Specifically, agricultural walking robots, such as Figure 4 As shown, this is a motion device located under the ammonia collection chamber 1, tasked with walking in the farmland. The self-propelled farmland robot 2 includes an intelligent module, a drive module, a functional module, and a replaceable module 25. The intelligent module includes a computer 24. The drive module includes a drive motor 21 and a battery 22. The drive motor 21 is the power unit of the self-propelled robot, driving the tires 26 to rotate. The battery 22 provides energy for the entire ammonia collection chamber 1. The functional modules include a lidar 23, a GPS positioning module, and a 5G communication module. The lidar 23 is responsible for sensing the environment in which the farmland robot 2 is located, helping the farmland robot 2 to plan its path and avoid obstacles. The GPS positioning module can perform satellite positioning.
[0100] Based on the above implementation method, the intelligent module includes an on-board computer 24 connected to the experimental computer. The on-board computer 24 directs the farm robot 2 to move point-to-point through the path planning points provided by the experimental computer.
[0101] Based on the above implementation methods, such as Figure 7 As shown, the replaceable module includes a carbon dioxide detection module, a particulate matter pollution detection module, and a volatile organic compound detection module.
[0102] Specifically, the replaceable modules of the farm robot 2 are actually reserved interfaces that can be updated and replaced according to different needs. They can be replaced with a carbon dioxide detection module for greenhouse gas detection, or a particulate matter pollution detection module to complete the detection of air pollutants, or a volatile organic compound detection module.
[0103] Based on the above embodiment, a mechanical guide rail 31 is provided below the ammonia collection chamber 1, and a ground-level volatile ammonia sampling hood 32 is slidably connected to the mechanical guide rail 31. A guide rail motor 33 providing power is provided on the mechanical guide rail 31, and a gas guiding hose connected to the air pump 12 is provided on the ground-level volatile ammonia sampling hood 32. The ground-level volatile ammonia sampling hood 32 sends the collected ammonia into the air pump 12 through the gas guiding hose 34.
[0104] Specifically, such as Figure 6 As shown, a gas collection chamber design with a mechanical lifting structure is presented. Considering that the concentration of volatile ammonia in farmland after the application of manure and synthetic fertilizer is as low as 1 ppm, directly extracting ambient gas from the environment may make the detection of ammonia difficult. The design of a lifting mechanical gas collection device will help collect ammonia. In the original ammonia collection chamber 1 design, a guide rail motor 33 is added to drive the ground-level volatile ammonia sampling cover 32 to move on the mechanical guide rail 31. The volatile ammonia gas will be pumped into the ammonia collection chamber 1 through the gas guide hose 34 and the air pump 12.
[0105] Based on the above embodiments, an electric heating wire 41 is provided inside the ammonia collection chamber 1, and the electric heating wire 41 covers the bottom of the chamber and the cylinder wall of the ammonia collection chamber 1.
[0106] Specifically, such as Figure 8 As shown, volatile ammonia gas easily combines with water to form ammonia water. If ammonia water is present in the ammonia collection chamber 1, it will affect the detection of ammonia gas, leading to a significant difference between the actual and displayed concentrations. To solve this problem, an electric heating wire was designed to heat the ammonia collection chamber 1. The electric heating wire covers the bottom and the wall of the ammonia collection chamber 1.
[0107] This invention can effectively reduce costs to a minimum without sacrificing detection accuracy and minimum detection limits. Compared with optical detection devices and boric acid solution adsorption, this electronic nose device is more stable and less susceptible to interference from extreme or rapidly changing environments. Compared with detection by a single sensor, the algorithm generated using machine learning can detect a lower ammonia limit and can detect ammonia from a variety of interfering gases. The machine learning algorithm can read data transiently from the sensor, saving a significant amount of time. The self-propelled robot in the farmland can move and sample more conveniently in the field, saving manpower and resources.
[0108] All aspects not detailed in this invention are conventional technical means known to those skilled in the art.
[0109] The above content shows and describes the basic principles, main features, and beneficial effects of the present invention. The above description is merely a preferred embodiment of the present invention and is not intended to limit the invention. Any modifications, equivalent substitutions, or improvements made within the spirit and principles of the present invention should be included within the scope of protection of the present invention.
Claims
1. A method for detecting ammonia volatilization in a farmland using an electronic nose with machine learning, characterized in that: The usage steps are as follows: S1: Ammonia gas of different concentrations is simulated using ammonia water, with the concentration range being 1-100 ppm; S2: Ammonia gas concentrations of 1ppm, 2ppm, 3ppm, 5ppm, 10ppm, 20ppm, 30ppm, 50ppm, and 100ppm are introduced into the ammonia collection chamber (1). The gas sensor (14) in the ammonia collection chamber (1) is used to perform multiple sampling tests under different ammonia concentration conditions. The gas sensor (14) includes MQ135, MQ137, TGS2600, TGS2602, TGS2620, SHT11, and Grove multichannel sensor. The test results are recorded by the Arduino-Mega microprocessor board (4) on the ammonia collection chamber (1). Between each two experiments, the DC fan (13) is turned on to completely exhaust the ammonia gas remaining in the ammonia collection chamber (1) from the previous test. S3: The Arduino-Mega microprocessor board (4) uploads the detection results to the experimental computer; S4: The experimental computer uses Matlab software to build machine learning algorithms based on the collected ammonia data; S5: Write the volatile ammonia concentration prediction model into the onboard computer (24) of the farm robot (2); S6: Connect the ammonia collection chamber (1) to the farm robot (2) via the connector (3). A mechanical guide rail (31) is provided below the ammonia collection chamber (1). The ground-level volatile ammonia sampling cover (32) is slidably connected to the mechanical guide rail (31). A gas guiding hose (34) connected to the air pump (12) is provided on the ground-level volatile ammonia sampling cover (32). An electric heating wire (41) is provided inside the ammonia collection chamber (1). The electric heating wire (41) covers the bottom of the chamber and the cylinder wall of the ammonia collection chamber (1). S7: Move the farm robot (2) to the farmland. When the farm robot (2) drives the ammonia collection chamber (1) to the path planning point, perform on-site gas sampling. S8: The onboard computer (24) receives the signal from the gas sensor (14) inside the ammonia collection chamber (1) and uses the onboard machine learning algorithm to calculate the current concentration of volatile ammonia. S9: After the test is completed, the DC fan (13) starts to work and discharges the ammonia in the ammonia collection chamber (1); S10: The farm robot (2) completes the detection of ammonia concentration at each path planning point through the settings of the on-board computer (24).
2. The method for detecting volatile ammonia in farmland using an electronic nose based on machine learning according to claim 1, characterized in that: The specific steps of S2 are as follows: S2.1: The air pump (12) pumps ammonia gas from the sampling inlet (11) into the ammonia collection chamber (1); S2.2: Ammonia passes through a gas sensor (14) set on a ring PCB circuit board (15) and an ambient temperature and humidity sensor (16) set on the inner wall of the ammonia collection chamber (1). The gas sensor (14) transmits an electrical signal to the Arduino-Mega microprocessor board (4). S2.3: The Arduino-Mega microprocessor board (4) set on the outer wall of the ammonia collection chamber (1) records the detection results and uploads them to the vehicle computer (24). S2.4: Turn on the DC fan (13) to discharge the ammonia gas in the ammonia gas collection chamber (1); S2.5: Repeat steps S2.1-S2.4 to test ammonia gas of different concentrations multiple times and record the data.
3. The method for detecting volatile ammonia in farmland using an electronic nose based on machine learning according to claim 2, characterized in that: The machine learning algorithm includes a gas data input layer, a CNN layer, an LSTM layer, and a data output layer that outputs the final gas concentration information. The CNN layer is used to extract deep-level gas feature information, and the LSTM layer is used to acquire gas feature information.
4. The method for detecting volatile ammonia in farmland using an electronic nose based on machine learning according to claim 3, characterized in that: The specific steps for S4 are as follows: S4.1: Import the detection results data into Matlab on the experimental computer to construct machine learning algorithms; S4.2: Convert the data input from the gas sensor (14) into an image input; S4.3: The image is input to the first CNN layer, which includes convolutional layers, batch normalization layers, ReLU activation function layers, and max pooling layers; S4.4: Then input the image into a second CNN layer with different parameters than the first CNN layer; S4.5: Convert image data into two-dimensional structural data through flattening layers; S4.6: Input the two-dimensional structure data sequentially into the LSTM layer, the fully connected layer, the Softmax layer, and the classification output layer; S4.7: Data classification output, the construction of the machine learning algorithm is complete.
5. The method for detecting volatile ammonia in farmland using an electronic nose based on machine learning according to claim 1, characterized in that: The farm robot (2) includes an intelligent module, a 5G communication module, a GPS positioning module, and a replaceable module. The intelligent module is connected to the Arduino-Mega microprocessor board (4) on the ammonia collection chamber (1).
6. The method for detecting volatile ammonia in farmland using an electronic nose based on machine learning according to claim 5, characterized in that: The intelligent module includes an onboard computer (24) connected to the experimental computer, which directs the farm robot (2) to move point-to-point through path planning points provided by the experimental computer.
7. The method for detecting volatile ammonia in farmland using an electronic nose based on machine learning according to claim 5, characterized in that: The replaceable modules include a carbon dioxide detection module, a particulate matter pollution detection module, and a volatile organic compound detection module.