Intelligent acquisition system for agricultural soil information

By designing a smart collection system for agricultural soil information, using sensor modules and cloud platforms to achieve accurate collection and real-time monitoring of soil information, the problems of large equipment size, low mobility and small information application range in the existing technology are solved, and the agriculture is improved Production benefits and sustainability.

CN119182804APending Publication Date: 2024-12-24GUANGDONG OCEAN UNIVERSITY
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411225418.2
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-09-03
Publication Date
2024-12-24

AI Technical Summary

Technical Problem

The existing technology has problems such as large equipment size, low mobility, high cost and small information application range in soil information collection, which cannot meet the needs of modern agriculture for efficient and intelligent production management.

Method used

A smart collection system for agricultural soil information is designed, including equipment terminal, cloud platform and mobile terminal, and the main control module, sensor module and WiFi module are used for soil information collection and data transmission, and the RS485 soil four-parameter sensor and DHT11 temperature are used. Humidity sensor, real-time synchronization and remote monitoring of data through cloud platform and MQTT protocol.

Benefits of technology

It realizes accurate collection and real-time monitoring of information such as soil temperature, humidity and pH, providing comprehensive collection and management of soil conditions, and improving the efficiency and sustainability of agricultural production.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119182804A_ABST
    Figure CN119182804A_ABST
Patent Text Reader

Abstract

The invention discloses an intelligent acquisition system for agricultural soil information. The intelligent acquisition system comprises an equipment end, a cloud platform and a mobile terminal, the equipment end comprises a main control module, a sensor module and a WiFi module; the sensor module is used for collecting soil information and environment temperature and humidity information based on a soil sensor and an environment temperature and humidity sensor. The main control module is used for receiving the soil information and the environment temperature and humidity information; the WiFi module is used for realizing data interaction between the equipment end and the cloud platform; and the mobile terminal is connected with the cloud platform and is used for synchronously receiving the soil information and the environment temperature and humidity information acquired by the equipment end and autonomously controlling the soil sensor and the environment temperature and humidity sensor to acquire data. The soil information and the environment temperature and humidity information are collected based on the equipment end and then transmitted to the mobile terminal based on the cloud platform, the soil information and the environment temperature and humidity information obtained by the equipment end can be synchronously received, and comprehensive collection and receiving of soil data are achieved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the technical field of soil information collection, and in particular relates to an intelligent collection system for agricultural soil information. Background Art

[0002] With the development of agricultural production technology, the demand for efficient and intelligent agricultural production is getting higher and higher, and modern agriculture is facing increasing pressure. In addition, with the continuous growth of the global population, in order to meet the growing demand for food, agricultural production must achieve efficient, environmentally friendly and sustainable development.

[0003] Soil is the foundation of agricultural production and social development. At present, soil pollution has become one of the serious environmental problems and one of the major challenges facing current agricultural production. This pollution not only affects the yield and quality of crops, but may also cause long-term harm to the ecosystem and human health. The main causes of soil pollution include excessive use of fertilizers and pesticides, heavy metal pollution, and the accumulation of organic pollutants. Therefore, in modern agriculture, soil monitoring is a very important component. Traditional soil information collection methods usually rely on manual on-site measurement and recording. This method is not only inefficient and has poor real-time performance, but may also be affected by human factors and cannot meet the needs of modern agriculture for efficient and intelligent production management.

[0004] As for existing technologies, domestic researchers use vehicle-mounted hydraulic sampling tools, remote sensing and geographic information systems, sensors and databases to improve soil information collection efficiency and detection accuracy through automation and intelligent means. However, there are some problems in practical applications, such as the large size of the collection equipment, low mobility and high cost, which need to be further improved in technology and application scenarios to solve.

[0005] Foreign researchers have used GPS-enabled smartphone applications, IoT sensors, etc. to collect and detect soil information in real time. At the same time, some soil management systems have been developed, such as geographic information system layouts based on cloud databases, to manage and query soil. However, these studies still have some problems, such as the lack of comprehensive information collection for the application and management of soil information, and a small scope of application.

[0006] In order to achieve comprehensive and accurate collection of soil information, it is urgent to propose an intelligent collection system for agricultural soil information. Summary of the invention

[0007] In order to solve the above technical problems, the present invention proposes an intelligent collection system for agricultural soil information, which can realize the accurate collection of soil temperature, humidity, pH value and other information, and can synchronously monitor and manage on mobile devices, helping agricultural producers to understand soil conditions in real time, and provide strong support for agricultural production, thereby improving agricultural production efficiency and sustainability, so as to solve the problems existing in the above-mentioned prior art.

[0008] To achieve the above-mentioned purpose, the present invention provides an intelligent collection system for agricultural soil information, including: a device end, a cloud platform and a mobile terminal;

[0009] The device end includes a main control module, a sensor module and a WiFi module;

[0010] The sensor module is used to collect soil information and environmental temperature and humidity information based on a soil sensor and an environmental temperature and humidity sensor;

[0011] The main control module is used to receive the soil information and the environmental temperature and humidity information;

[0012] The WiFi module is used to realize data interaction between the device and the cloud platform;

[0013] The cloud platform is responsible for data transmission between the device end and the mobile terminal based on the MQTT protocol;

[0014] The mobile terminal is connected to the cloud platform, and is used for synchronously receiving the soil information and the environmental temperature and humidity information acquired by the device end, and autonomously controlling the acquisition of data by the soil sensor and the environmental temperature and humidity sensor.

[0015] Optionally, the soil sensor adopts an RS485 soil four-parameter sensor, and measures the temperature, humidity, pH value and conductivity of the soil based on the RS485 soil four-parameter sensor.

[0016] Optionally, the main control module adopts an STM32F103C8T6 main control chip.

[0017] Optionally, the main control module includes a power supply circuit, a crystal oscillator circuit, a reset circuit, a startup configuration circuit and a modulation circuit;

[0018] The power supply circuit is used to power the system based on the main power input pin, the analog power input pin and the backup battery input pin;

[0019] The crystal oscillator circuit is used to provide a clock signal for the system;

[0020] The reset circuit is used to restore the system to the initial state when the single chip microcomputer is powered on, abnormal or needs to be manually reset;

[0021] The startup configuration circuit is used to configure the startup mode of the system when the single-chip microcomputer is powered on or reset;

[0022] The modulation circuit is used to transmit debugging-related data and control signals between the single-chip microcomputer and the debugger based on a bidirectional data line, and is used to synchronize the timing of data transmission and control signals between the single-chip microcomputer and the debugger based on a unidirectional clock line.

[0023] Optionally, the device end also includes a power module, the power module includes three lithium batteries connected in series, and the lithium battery is a 18650 lithium battery.

[0024] Optionally, the power module is connected to a step-down module, which is used to connect the input voltage of the power module to the inductor through a MOS tube, and then periodically open and close the MOS tube, and through the synergistic effect of the inductor and the filter capacitor, convert the input voltage into an output voltage that meets the working conditions of each module.

[0025] Optionally, the device also includes a display module, which is used to display the soil information and environmental temperature and humidity information based on an OLED display screen.

[0026] Optionally, the mobile terminal includes an information synchronization module, a weather query module and a remote control module;

[0027] The information synchronization module is used to synchronously receive the soil information and the environmental temperature and humidity information, and update the soil information and the environmental temperature and humidity information in real time;

[0028] The weather query module is used to query the weather conditions of the current day and the next two days;

[0029] The remote control module is used to autonomously control the opening and closing of the soil sensor and the ambient temperature and humidity sensor based on the weather conditions of the current day and the next two days.

[0030] Optionally, the mobile terminal further includes an information display module, which includes a homepage display unit, a weather display unit and a user display unit;

[0031] The homepage display unit is divided into a weather bar, a function area and an information area, and is used to display the weather conditions obtained by the weather query module based on the weather bar, display the autonomous control buttons of the remote control module based on the function area, and display the soil information and environmental temperature and humidity information obtained by the information synchronization module based on the information area;

[0032] The weather display unit is used to further display the weather conditions of the day and the next two days, and the weather conditions at least include daytime and nighttime weather phenomena, maximum and minimum temperatures, humidity, rainfall probability, rainfall, wind direction and wind force level;

[0033] The user display unit is divided into a user information display area and a function control area, and is used to display the user's avatar and nickname based on the user information display area, and to display the switch of the weather query module based on the function control area.

[0034] Compared with the prior art, the present invention has the following advantages and technical effects:

[0035] The present invention collects soil information and environmental temperature and humidity information based on the device end, and can realize the accurate collection of information such as soil temperature, humidity and pH value; then the soil data collected by the device end is transmitted to the mobile terminal based on the cloud platform, and the soil information and environmental temperature and humidity information obtained by the device end can be synchronously received, thereby realizing the comprehensive collection and reception of soil data.

[0036] The present invention can obtain accurate weather conditions at the location of soil information, and adjust agricultural management strategies based on actual conditions and weather forecast information for the next two days, autonomously control the acquisition of data by soil sensors and environmental temperature and humidity sensors, and provide convenience for agricultural management. BRIEF DESCRIPTION OF THE DRAWINGS

[0037] The drawings constituting a part of the present application are used to provide a further understanding of the present application. The illustrative embodiments and descriptions of the present application are used to explain the present application and do not constitute an improper limitation on the present application. In the drawings:

[0038] Figure 1 A schematic diagram of a framework of an intelligent collection system for agricultural soil information according to an embodiment of the present invention;

[0039] Figure 2 This is a diagram of the overall design structure of the system hardware of an embodiment of the present invention. DETAILED DESCRIPTION

[0040] It should be noted that, in the absence of conflict, the embodiments and features in the embodiments of the present application can be combined with each other. The present application will be described in detail below with reference to the accompanying drawings and in combination with the embodiments.

[0041] It should be noted that the steps shown in the flowcharts of the accompanying drawings can be executed in a computer system such as a set of computer executable instructions, and that, although a logical order is shown in the flowcharts, in some cases, the steps shown or described can be executed in an order different from that shown here.

[0042] This embodiment is a smart collection system for agricultural soil information, which is studied in response to the information needs of modern agriculture for plant growth environment. The system can accurately collect information such as soil temperature, humidity, pH value, etc. in agricultural planting sites, and further realize remote synchronous monitoring on mobile phones.

[0043] like Figure 1 As shown, a smart collection system for agricultural soil information provided in this embodiment includes: a device end, a cloud platform and a mobile terminal; the device end includes a main control module, a sensor module and a WiFi module; the sensor module is used to collect soil information and environmental temperature and humidity information based on a soil sensor and an environmental temperature and humidity sensor; the main control module is used to receive the soil information and environmental temperature and humidity information; the WiFi module is used to realize data interaction between the device end and the cloud platform. The cloud platform is responsible for data transmission between the device end and the mobile terminal based on the MQTT protocol; the mobile terminal is connected to the cloud platform to synchronously receive the soil information and environmental temperature and humidity information obtained by the device end, and autonomously control the soil sensor and environmental temperature and humidity sensor to obtain data.

[0044] Furthermore, the device end also includes a power module, which includes three lithium batteries connected in series, and the lithium battery is a 18650 type lithium battery. The power module is connected to the step-down module, and the step-down module is used to connect the input voltage of the power module to the inductor through the MOS tube, and then periodically open and close the MOS tube, and through the synergistic effect of the inductor and the filter capacitor, the input voltage is converted into an output voltage that meets the operation of each module.

[0045] Furthermore, the device also includes a display module, which is used to display the soil information and environmental temperature and humidity information based on an OLED display screen.

[0046] As a specific example, the agricultural soil information collection system mainly consists of three parts: device end, cloud platform and mobile end. The overall design framework of the system is as follows: Figure 1 As shown in the figure. The overall design idea is that the main control chip analyzes and processes the soil information data collected by the sensor, and then sends it to the cloud through the WiFi module. The cloud platform forwards the data to the mobile phone in real time. Each part is responsible for completing specific tasks, and at the same time works with other parts to jointly complete the intelligent collection and real-time monitoring and management of agricultural soil information.

[0047] Furthermore, the device side is the hardware part of the system, which is mainly responsible for collecting and processing data. It contains multiple sensors that can monitor soil temperature, humidity, pH value and other information. After being processed by the main control chip, these data are uploaded to the cloud platform through the WiFi module. At the same time, the device side can also display data. Using an OLED display, you can intuitively view the current soil information parameters.

[0048] In order to collect various parameters such as soil temperature, humidity and pH value, and transmit data to the mobile phone through WiFi transmission to realize remote monitoring, the device hardware mainly includes the main control module STM32 minimum system board, soil sensor, ambient temperature and humidity sensor, WiFi module, OLED display, lithium battery and buck module, etc. The overall framework of the system hardware design is as follows: Figure 2 shown.

[0049] Through the collaborative work of the above modules, the device can collect various parameters and upload data to the cloud platform. During the design process, factors such as interface compatibility between modules, signal transmission stability, and system power consumption need to be fully considered to ensure the stable and reliable operation of the entire system.

[0050] System hardware selection:

[0051] Power module:

[0052] When designing the acquisition system, considering that the device end of the system generally works outdoors, a stable and energy-sufficient independent power supply solution is required. In terms of power selection, this system uses 18650 lithium batteries as the power supply. 18650 lithium batteries are a commonly used rechargeable lithium-ion battery. Each cell can provide a voltage of about 3.7V. They are cylindrical in shape and have the advantages of high energy density, stable discharge performance and long life. They are very suitable for outdoor equipment. In addition, 18650 batteries also have high safety, which can effectively prevent problems such as overcharging and over-discharging, and ensure the stable operation of the system.

[0053] In order to increase the capacity of the power supply, this design uses three lithium batteries connected in series. However, due to the different voltage requirements of each hardware module, directly using the batteries connected in series to power the hardware may cause damage. Therefore, it is necessary to add a DCDC step-down module to the power module to reduce the output voltage of the battery to a voltage level suitable for the operation of each hardware module, such as 3.3V or 5V.

[0054] In general, the combination of 18650 lithium battery and DCDC step-down module can provide the system with long-lasting and stable power supply, ensuring its stable operation in outdoor environments.

[0055] Main control module:

[0056] The device uses the smallest system board designed based on the STM32F103C8T6 main control chip as the main control module. This chip is an MCU based on the ARM Cortex-M3 core launched by ST. It has 32-bit processing power, 64KB flash memory and 20KB RAM, and the operating frequency can reach up to 72MHz. This chip also has rich peripheral resources, such as GPIO, USART, ADC, SPI, I2C and other commonly used peripherals, and also has multiple timers. Compared with other single-chip microcomputers, it has the characteristics of high performance and low power consumption, and can meet the design requirements of control and data communication of various sensors.

[0057] Soil Sensor:

[0058] In the smart agricultural soil information collection system, Vemsee's five-pin soil four-parameter sensor is selected as the core sensor for soil monitoring. The sensor has an overall size of 45*15*123mm, which is easy to carry. In addition, the fully sealed and acid- and alkali-resistant design can be buried in the soil for long-term dynamic detection. The sensor defaults to DC 4.5-30V DC power supply, has the characteristics of stable performance, high sensitivity, fast response, stable output, etc., and is suitable for various soil types; it can measure the temperature, humidity, pH value and EC value of the soil. Table 1 is a description of the measurement parameters of the sensor; it uses an RS485 communication interface and follows the Modbus-RTU protocol, making the data exchange between the sensor and the main control module more stable and reliable.

[0059] Table 1

[0060]

[0061] Ambient temperature and humidity sensor:

[0062] In the soil information collection system, a DHT11 temperature and humidity sensor is also added to monitor the temperature and humidity of environmental conditions. DHT11 is a low-cost, high-precision temperature and humidity sensor that can accurately measure the temperature and humidity of the current environment. It uses digital signal output, has a fast response speed and good stability. Through the DHT11 sensor, this embodiment can monitor the temperature and humidity changes around the soil in real time, providing an important reference for the growth and management of crops.

[0063] WiFi Module:

[0064] In order to realize intelligent remote monitoring, it is necessary to introduce a WiFi module into the system. The WiFi module provides the function of wireless network connection, allowing the device to communicate and exchange data with the Internet. This system uses the ESP8266 WiFi module to implement this function. It has the characteristics of small size, low power consumption, and high stability. It can achieve fast connection and stable data transmission, meeting the remote monitoring needs of this system.

[0065] Furthermore, in order to realize the real-time display of the collected data, this embodiment selects a 0.96-inch OLED display screen as the display module of the system. This display screen has the characteristics of high definition and self-luminescence, and can display data and graphics in a clear and bright manner. It has the advantages of low power consumption and fast response, and can provide good visibility and real-time performance. Through this display screen, the collected data can be viewed intuitively.

[0066] In summary, this system has fully considered factors such as performance, stability, and power consumption in hardware selection, ensuring the reliable operation of the intelligent collection system for agricultural soil information.

[0067] System hardware circuit:

[0068] DCDC step-down module:

[0069] A DC-DC step-down module is a power converter that can reduce the DC voltage to a specific voltage output to meet the power requirements of different hardware devices. The DC-DC module has many advantages such as high efficiency, good stability, small size, and light weight. It is widely used in various electronic devices, such as mobile devices, wireless communication devices, etc., to provide suitable voltage input for these devices. The DC-DC step-down module is designed based on the principle of switching power supply.

[0070] The basic principle of a switching power supply is to periodically switch the input voltage on and off through the switching operation of the switching element, and to reduce the output voltage by controlling the switching time ratio. The key electronic component is the switching element, which generally uses a MOS tube.

[0071] During operation, the input voltage is first connected to the inductor through the MOS tube, and then the MOS tube is periodically turned on and off to make the current flow between the inductor and the filter capacitor. In this way, through the synergistic effect of the inductor and the filter capacitor, the input voltage is converted into a stable, lower output voltage for the output load. By adjusting the switching frequency and duty cycle of the switching element, the stability and accuracy of the output voltage can be controlled.

[0072] The buck module used in this system is based on the MP1584 chip design. This chip integrates a high-frequency step-down switching regulator with a power MOSFET, supports a wide voltage range input of 4.5V to 28V, and can achieve the reduction function of 12V to 3.3V and 5V, meeting the system's requirements for power supply stability and efficiency.

[0073] STM32 minimum system board:

[0074] This system uses the STM32F103C8T6 minimum system board as the main control module. The minimum system board contains the basic circuits and debugging interfaces required for the normal operation of the microcontroller, which is easy to use and debug, providing great convenience for system development.

[0075] Generally speaking, the microcontroller itself cannot work properly, so it is necessary to connect some necessary circuits. These basic circuits constitute the minimum system circuit of the microcontroller. The minimum system circuit of the STM32 main control chip includes:

[0076] Power supply circuit: The STM32F103C8T6 main control chip has three different power supply pins, namely VDD, VDDA, and VBAT. VDD is the main power input pin, which has three groups, namely VDD_1, VDD_2, and VDD_3; VDDA is the analog power input pin, which is responsible for powering the internal analog circuits, such as ADC, DAC, etc.; VBAT is the backup battery input pin, which is responsible for powering the RTC real-time clock and backup registers. If these two functions are not needed, the VBAT pin can be directly connected to VDD or left floating. The normal working power supply voltage range of this chip is 2.0 to 3.6V. If it is not within this range, the chip will not work properly, and it may even burn out in serious cases. In actual applications, the power supply voltage is usually 3.3V, because 3.3V is also the standard operating voltage of many other electronic components, which helps to simplify the power supply design and improve the compatibility of the system. In addition, a filter capacitor is generally connected between the power supply and the ground pin, and the capacitor is used for filtering to ensure the stability of the power supply.

[0077] Crystal oscillator circuit: Since the accuracy and stability of the clock signal provided by the RC oscillator inside the STM32F103C8T6 main control chip are usually poor, in order to provide the system with an accurate clock signal, an external 8MHz crystal oscillator is generally connected. The crystal oscillator is connected to the high-speed external clock HSE pins OSC_IN and OSC_OUT of the main control chip, and the corresponding capacitors are connected in series at both ends of the crystal oscillator to ensure the stable oscillation of the crystal oscillator. In addition, the main frequency of the chip can reach up to 72MHz after the frequency multiplication operation of the internal frequency multiplication circuit.

[0078] Reset circuit: The main function of the reset circuit is to restore the system to its initial state when the microcontroller is powered on, abnormal or requires manual reset. After reset, the program will start running from the beginning. Its circuit structure is to connect a pull-up resistor, a reset button and a capacitor to the reset pin NRST of the STM32F103C8T6 main control chip. This chip is a low-level reset. When the system is powered on, the power supply starts to charge the capacitor. At this time, the capacitor is short-circuited and the NRST pin is low. When the capacitor is fully charged, the capacitor is equivalent to an open circuit, and the NRST pin is high, causing the level of the reset pin to gradually rise from a low level to a high level, realizing a power-on reset. In addition, when the reset button is pressed, the NRST pin is pulled low, realizing a manual reset operation.

[0079] Startup configuration: used to configure the startup mode of the microcontroller. The STM32F103C8T6 main control chip has three startup modes. By controlling the high and low level combination of the BOOT0 and BOOT1 pins, the startup mode of the system is determined when powered on or reset.

[0080] Debug circuit: STM32F103C8T6 integrates a debugging module that supports SWD (Serial Wire Debug) interface. SWD is a serial two-wire debugging interface. SWDIO (Serial Wire Data I / O) and SWCLK (Serial Wire Clock) are two key signal lines of the SWD interface. Among them, SWDIO is a bidirectional data line used to transmit debugging-related data and control signals between the microcontroller and the debugger; SWCLK is a unidirectional clock line used to synchronize the timing of data transmission and control signals between the microcontroller and the debugger. The debugging tool (such as ST-Link) establishes a connection with the microcontroller through these two signal lines, which can download the program to the microcontroller, and can also debug and monitor the microcontroller.

[0081] Through the design of the above hardware circuit, the STM32F103C8T6 main control chip can be ensured to work stably and reliably, and effective control of each module can be achieved.

[0082] RS485 soil four-parameter sensor:

[0083] The RS485 soil four-parameter sensor used in this embodiment can measure the four key parameters of soil temperature, humidity, pH value and conductivity. This sensor adopts RS485 communication interface design. RS485 defines a physical layer communication standard and stipulates a differential signal transmission method. Compared with traditional serial port communication, it has the characteristics of strong anti-interference ability and long transmission distance, and is suitable for long-distance data transmission in complex environments. To carry out data communication between the single-chip microcomputer and the soil sensor, it is necessary to connect an RS485 to TTL level conversion module between the two, which can convert the RS485 differential signal into a TTL level signal compatible with the single-chip microcomputer serial port. In this way, the single-chip microcomputer can reliably communicate with the RS485 soil four-parameter sensor, and obtain the soil parameter data measured by the sensor for subsequent processing and application.

[0084] DHT11 Temperature and Humidity Sensor:

[0085] The DHT11 temperature and humidity sensor uses a single bus bidirectional serial communication interface, connecting the power supply pin and ground pin to the corresponding pins of the microcontroller, and connecting the data pin to the GPIO pin of the microcontroller, thus realizing the physical connection between the sensor and the microcontroller. During the communication process, the microcontroller sends a specific signal to start data transmission, and the DHT11 responds and transmits the temperature and humidity data. After receiving the data, the microcontroller parses and processes it. In this way, the microcontroller can read the temperature and humidity data measured by the DHT11 sensor and perform further application and control.

[0086] ESP8266 WiFi Module:

[0087] The ESP8266 WiFi module has powerful WiFi communication functions. Its serial communication interface is designed to communicate with the microcontroller via serial ports, thus realizing wireless connection between the microcontroller and the Internet. Connecting the TX (transmit) and RX (receive) pins of the ESP8266 module to the serial port of the microcontroller can realize two-way data transmission. In addition, the ESP8266 module needs to be powered, and the input voltage is usually 3.3V.

[0088] OLED Display:

[0089] This embodiment uses a four-pin I2C communication OLED display screen, connecting the SCL and SDA pins to the two GPIO pins of the single-chip microcomputer, and also connecting the VCC pin of the OLED display screen to the positive power supply, and the GND pin to the power ground. Although there are related I2C communication pins on the STM32 single-chip microcomputer, GPIO is generally used to simulate the I2C communication timing. Compared with using specific I2C pins, simulating I2C communication can more flexibly select communication pins without being restricted by specific pins.

[0090] As a specific embodiment, a complete hardware object of the agricultural soil information intelligent collection system is built. The object is built on the basis of a breadboard, which completely combines the power module, the main control module STM32 minimum system board, the soil sensor, the ambient temperature and humidity sensor, the WiFi module, and the OLED display module. This hardware object is easy to debug and modify through the flexible plug-in of the breadboard, and also provides a physical basis for understanding the overall hardware layout and the synergy of the functions of each part.

[0091] The goal of the overall design is to achieve the coordinated work of various modules, so that the agricultural soil information intelligent collection system can collect various parameters such as soil temperature, humidity, pH value, etc., and transmit data to the mobile phone via WiFi for remote monitoring.

[0092] The power module provides a stable power supply for the entire system. The main control module STM32 minimum system board is the core part, responsible for the coordination and control of the entire system. The soil sensor and the ambient temperature and humidity sensor are responsible for collecting various information of farmland soil, including soil temperature, humidity, pH value, etc. The WiFi module is responsible for wirelessly transmitting the collected data to achieve remote transmission and monitoring of data. Finally, the OLED display module can intuitively display the real-time status of various parameters.

[0093] This hardware design demonstrates the hardware layout of the entire system and the synergy of the functions of each part, which can provide a deep understanding of the hardware implementation process of the entire agricultural soil information intelligent collection system.

[0094] As a specific embodiment, the cloud platform serves as the intermediate hub of the entire system, establishing a data communication bridge between the device end and the mobile end, and is mainly responsible for receiving and forwarding data. This embodiment uses the Alibaba Cloud IoT platform as the cloud platform of the system, and uses the MQTT protocol for data transmission.

[0095] As a specific embodiment, the mobile terminal includes an information synchronization module, a weather query module and a remote control module; the information synchronization module is used to synchronously receive the soil information and the ambient temperature and humidity information, and update the soil information and the ambient temperature and humidity information in real time; the weather query module is used to query the weather conditions of the day and the next two days; the remote control module is used to autonomously control the opening and closing of the soil sensor and the ambient temperature and humidity sensor based on the weather conditions of the day and the next two days.

[0096] Furthermore, the mobile terminal also includes an information display module, which includes a homepage display unit, a weather display unit and a user display unit; the homepage display unit is divided into a weather bar, a function area and an information area, which is used to display the weather conditions obtained by the weather query module based on the weather bar, display the autonomous control buttons of the remote control module based on the function area, and display the soil information and environmental temperature and humidity information obtained by the information synchronization module based on the information area; the weather display unit is used to further display the weather conditions of the day and the next two days, and the weather conditions at least include weather phenomena during the day and night, the highest and lowest temperatures, humidity, rainfall probability, rainfall, wind direction and wind force level; the user display unit is divided into a user information display area and a function control area, which is used to display the user's avatar and nickname based on the user information display area, and display the switch of the weather query module based on the function control area.

[0097] This embodiment uses a mobile phone as a mobile terminal. The mobile phone is the software part of the system, which is mainly responsible for receiving cloud data and correctly displaying soil information data. This part is implemented by designing a WeChat applet. In this way, the device can be monitored in real time through the mobile phone, and the status of the device can be understood at any time.

[0098] As a lightweight mobile application, WeChat Mini Program is suitable for realizing the function of remote monitoring of soil information. The Mini Program can synchronize agricultural soil information in real time and provide users with convenient remote management tools.

[0099] First, the WeChat applet has realized the function of connecting to the Alibaba Cloud IoT platform. By establishing a connection with the cloud platform, it has realized the function of receiving agricultural soil information in real time and synchronously, and can remotely monitor soil temperature, humidity, pH value and other parameters. In addition, the WeChat applet also has the function of controlling equipment. Users can choose to turn on or off the data reading function to obtain agricultural soil information in real time as needed. The existence of this function allows users to freely control data acquisition in different situations, improving the flexibility and practicality of the system.

[0100] In addition to real-time synchronization of soil information and data visualization, the mini program also has a carefully designed weather query function. Weather information is divided into real-time weather and weather forecast. This function allows users to select the agricultural site they care about and obtain today's real-time weather information for the site and the weather conditions for the next two days. According to the upcoming weather conditions, timely measures can be taken to adjust the facilities and management of the agricultural site. The weather query function is enabled by default, and users can also choose whether to enable this function according to their needs.

[0101] Through the above functional design, WeChat Mini Program provides users with convenient remote management tools and comprehensive technical support for agricultural management and decision-making. Such functional design not only meets the needs of users, but also improves the efficiency and accuracy of agricultural management.

[0102] The WeChat applet uses a simple and easy-to-use interface design, realizes data reception, processing and display, can display various soil parameters in real time, and has remote control and other functions. In addition, the applet integrates a weather query function, which can obtain today's real-time weather and weather forecast information for the next two days at the selected location, and adjust agricultural management strategies according to weather changes, providing convenience for agricultural management. Specifically:

[0103] WeChat applet interface design:

[0104] Home page interface:

[0105] The design of the main page is mainly divided into three parts: weather bar, function area, and information area.

[0106] A weather bar is designed at the top of the main page to display today's real-time weather information at the location of the soil information collection sensor. Click the location icon to modify the selected location. At the same time, the weather update time is displayed above the weather bar, so that users can understand the real-time nature of the data. In the weather information display section, through the display of weather icons, users can intuitively understand the weather conditions, including the current temperature and weather phenomena, and also display detailed information such as today's maximum and minimum temperatures, wind direction, wind force, humidity, and precipitation probability, to make up for the fact that soil collection information cannot predict future weather changes, so as to make timely adjustments to crop management. This information is of great significance for agricultural managers to make corresponding decisions.

[0107] In the function area of ​​the home page interface, users can control the system. Each startup control item includes an icon, status information, prompt information and a switch button. Users can choose to turn on or off the corresponding function as needed.

[0108] Finally, in the information display part, the WeChat applet provides data visualization. Through the design of small cards, users can view the information of various parameters in the form of cards. Each card contains an icon and the corresponding parameter and value, as well as unit information. This design allows users to quickly obtain the required information and facilitate the management and adjustment of crops.

[0109] Weather Page:

[0110] In order to allow users to have a more comprehensive understanding of the weather conditions, a weather page is specially designed in the mini program. On this page, you can not only view the real-time weather information on the homepage, but also check the weather conditions for the next two days, and provide more detailed weather information, including daytime and nighttime weather phenomena, maximum and minimum temperatures, humidity, rainfall probability, rainfall, wind direction and wind force level and other parameters.

[0111] User Page:

[0112] The user page mainly consists of two parts: user information display area and function control area.

[0113] In the user information display area, the user's avatar and nickname are displayed. If the user has not set a nickname, the system will prompt the user to set personal information. The user can click on the avatar to enter the personal information setting page and change his or her personal information.

[0114] In the function control area, a switch for the weather function is set. Through this switch, users can easily turn on or off the weather query function. When the weather function is turned on, users can query weather information in the mini program; when the weather function is turned off, the weather query function will not be available. This design increases the flexibility of the mini program, and users can decide whether to use the weather query function based on the network conditions and their own needs.

[0115] In WeChat mini programs, data processing is an important part of realizing the main functions. In the mini program of the agricultural soil information collection system, the MQTT protocol is mainly used to connect to the Alibaba Cloud IoT platform to obtain and process agricultural soil information in real time. MQTT is a lightweight publish / subscribe messaging protocol that is very suitable for IoT applications.

[0116] When data is transmitted from the Alibaba Cloud IoT platform to the mini program, the mini program needs to parse and process the data. First, the mini program receives the pushed MQTT message by subscribing to the corresponding topic. Then, the received message is parsed to extract various parameter information, such as soil moisture, temperature, pH value, etc.

[0117] When the WeChat applet receives a topic-related message through the MQTT client, it triggers a listener, which processes the message and displays it in a certain way on the user interface.

[0118] In general, the main task of the data processing part is to parse the messages received from the MQTT client and update the user interface according to the content of these messages. These operations enable the WeChat applet to dynamically display soil and environmental information, as well as the switch status of the equipment based on the real-time data received. In order to display this data on the user interface, the applet needs to map these parameter values ​​to each card. This process involves the design of data structures and the application of algorithms. In actual operation, it is necessary to pay attention to the update frequency and update time of the data to ensure that the data displayed on the user interface is always up to date.

[0119] This embodiment can help farmers understand the situation of the land through the collection and monitoring of soil information, and provide a reference for precise fertilization, farming and crop selection, thereby improving agricultural production efficiency and quality, and further realizing sustainable agricultural development; collecting and analyzing agricultural soil information can also better understand the soil conditions, and pollution problems can be discovered in time, avoiding soil pollution and environmental damage, and protecting and improving the ecological environment; the intelligent collection system of agricultural soil information can provide scientific support and technical guarantees for modern agriculture, accelerate the transformation and upgrading of the agricultural industry, and promote the development of modern agriculture. Therefore, the intelligent collection system of agricultural soil information proposed in this embodiment can provide more scientific, accurate and sustainable support and guarantees for agricultural production, and is an indispensable part of the development of modern agriculture.

[0120] Systematic program development and design:

[0121] In order to ensure the efficient development and stable operation of the single-chip program of the acquisition system, this embodiment uses the Keil MDK v5 integrated development environment based on the ARM Cortex-M3 core for program development for the STM32F103C8T6 main control chip. Keil MDK v5 provides rich library functions and powerful debugging functions, which helps to improve development efficiency and reduce development difficulty.

[0122] During the development process, the Standard Peripheral Library (StdPeriph) officially provided by ST is used for program writing. StdPeriph is a firmware function library provided for the STM32 series microcontrollers, covering all peripheral functions of the STM32 microcontrollers. Using the StdPeriph library, developers can quickly and efficiently write stable and reliable code, avoiding direct operations on the underlying registers and reducing the difficulty of development.

[0123] This embodiment uses a suitable single-chip microcomputer development platform and tools to help improve the development efficiency and quality of the agricultural soil information intelligent collection system.

[0124] RS485 soil four-parameter sensor design:

[0125] This embodiment uses the Modbus-RTU protocol to write a program to read the data of the RS485 soil four-parameter sensor. Modbus-RTU is a communication protocol based on a serial port. It defines the communication data frame structure of the host query and the slave response. This is a binary format message. Different function codes can be used to realize the reading and writing operations of data between devices.

[0126] Environmental sensor programming:

[0127] The DHT11 sensor is an integrated temperature and humidity sensor that uses a single bus data format for communication. The time it takes to transmit data is about 4ms. The data contains the integer and decimal parts of the temperature and humidity. A complete data transmission is 40 bits, with the high bit first out. The data format is 8bit humidity integer data + 8bit humidity decimal data + 8bit temperature integer data + 8bit temperature decimal data + 8bit checksum.

[0128] First, initialize the DHT11 sensor. The GPIO port connected to the DATA pin on the STM32 microcontroller needs to be configured in output mode to send a start signal, and then configured in input mode to receive data from the DHT11. Reading DHT11 data needs to be done according to the data transmission protocol of the DHT11. The host sends a start signal, pulls the data line low for at least 18 milliseconds, then pulls it high and waits for 20-40 microseconds. This process will trigger the DHT11 sensor to send a response signal. The host needs to read the response signal of the DHT11. If the response signal is high, it means that the DHT11 has not responded and the line connection may need to be checked. If the DHT11 responds correctly, the GPIO pin needs to be configured in input mode so that the incoming data can be read. The response signal of the DHT11 is a low signal for 80 microseconds, followed by a high signal for 80 microseconds. The DHT11 will then send 40 bits of data, which includes the integer and decimal parts of the humidity and temperature, as well as the checksum. Each bit of data starts with a low level of 50 microseconds, followed by a high level. The duration of the high level determines whether the bit is 0 or 1. A long level signal represents 1 and a short level signal represents 0.

[0129] On the STM32 microcontroller, this process can be implemented through timer interrupts to ensure accurate timing. When the data is read, it is necessary to calculate the checksum according to the DHT11 protocol to verify the correctness of the data. If the data is correct, it can be converted to the actual value of temperature and humidity according to the data format and then used in the system. According to the above analysis, the soil sensor data is successfully read.

[0130] WiFi module programming:

[0131] ESP8266 is a powerful and easy-to-use WiFi module that integrates 2.4GHz Wi-Fi wireless communication functions and has three working modes: Station, SoftAP, and Station+SoftAP. The Station mode can connect to a specified wireless network to achieve wireless data communication. The programming of the WiFi module is mainly divided into three parts: WiFi connection, cloud platform connection, and data publishing.

[0132] WiFi connection: The first step in programming is to ensure that the ESP8266 module can connect to an available WiFi network. To achieve this, a series of AT commands need to be sent to the ESP8266 through the STM32. These AT commands include resetting the module, setting the module working mode (Station mode), and connecting to a specified WiFi network. In this process, it is necessary to ensure that there is enough delay when each command is executed so that the module can respond correctly.

[0133] Cloud platform connection: Once the WiFi connection is established, the next step is to connect to the cloud service. At this stage, you need to configure the MQTT user, set the client ID, and connect to the specified cloud service. Similarly, you need to send a series of AT commands to ESP8266 through STM32 and ensure that there is enough delay for each command to be executed.

[0134] Data publishing: After the WiFi and cloud platform connections are established, the last step is to publish the data to the cloud. You need to send AT commands to ESP8266 to specify the topic and data to be published. In this process, you can publish various types of data, such as soil temperature, soil moisture, pH value, EC value, etc.

[0135] Throughout the programming process, the key idea is to use AT commands to control the ESP8266 module. These AT commands are sent through the USART interface of the STM32, enabling the STM32 to send data wirelessly to the cloud through the WiFi module. This design approach not only reduces hardware complexity, but also provides a flexible and powerful method to achieve wireless data communication.

[0136] OLED display programming:

[0137] The design of the acquisition system uses a 0.96-inch OLED display screen to display soil parameters in real time. In its program design, the system first performs initialization settings of the OLED screen, including color, display direction, and screen clearing.

[0138] After initialization, the OLED screen is ready to start displaying the required data. In this system, the following four types of soil data are mainly displayed: temperature, humidity, PH, and conductivity. After receiving the data at the serial port, it is necessary to convert these data into real soil parameter values ​​and display them on the OLED screen. The program to implement this function is to use the sprintf function to convert the received temperature data into a string, and then call the OLED_ShowString function to display it. In order to ensure the real-time display of the data, the OLED_Refresh() function must be called to refresh the screen after each data update.

[0139] Through the above design, the system equipment can collect various soil parameters in real time and display these parameters on the OLED screen in real time, providing users with a convenient way to view data.

[0140] System network communication:

[0141] Cloud platform parameter configuration:

[0142] In the process of implementing the WeChat applet to receive data uploaded by the hardware system, parameter configuration is also required on the cloud platform. First, you need to create an IoT instance product on the Alibaba Cloud IoT platform. After creating the product, you need to add devices under the product. In this embodiment, the hardware system and the WeChat applet are added to the product. In addition, a client that supports the MQTT protocol to connect to the Alibaba Cloud IoT platform is added for debugging the hardware system and the WeChat applet to connect to the cloud platform.

[0143] Device and cloud platform interconnection:

[0144] After completing the product and device configuration of the Alibaba Cloud IoT platform, the next step is to establish the connection between the hardware system and the cloud platform, and the connection between the WeChat applet and the cloud platform. Both connections rely on the device's triple information, namely "ProductKey", "DeviceName" and "DeviceSecret". These three parameters are generated by the Alibaba Cloud IoT platform when creating a device, and together they provide a unique identity for the device.

[0145] Configure the connection parameters:

[0146] When a device connects to the cloud platform, it needs to configure the relevant MQTT connection parameters according to its triplet information, including clientId, username, password, mqttHostUrl, and port. The setting and configuration of these parameters are the key steps to achieve correct communication between the device and the cloud platform. MQTT connection parameters can be configured using relevant software. Fill in the device's triplet information in the software, define the device's ClientId and configure the relevant parameters to generate the corresponding MQTT connection parameters.

[0147] This configuration process can also be completed in the device initialization code. By writing relevant programs, you only need to fill in the device's triplet information to generate MQTT connection parameters. In addition, Alibaba Cloud IoT Platform also provides MQTT connection parameters.

[0148] Hardware devices connected to the cloud platform:

[0149] The hardware end of the acquisition system is connected to the Alibaba Cloud IoT platform through the ESP8266 WIFI module, and the microcontroller controls the ESP8266 by sending AT commands. However, if ESP8266 wants to connect to the cloud platform using the MQTT protocol, first, ESP8266 needs to burn an AT firmware that supports MQTT transparent transmission, which is shared on the official website of Anxinke Technology; then, ESP8266 needs to be connected to WiFi, and after successfully connecting to WiFi, continue to send MQTTAT commands to connect to the Alibaba Cloud IoT platform. Calling the ESP8266ConnectWiFi() and ESP8266ConnectServer() functions can execute the operations of connecting to WiFi and connecting to the cloud platform. Finally, through the above steps, the hardware device is successfully connected to the Alibaba Cloud IoT platform, and the device ESP8266 in the console is displayed as online, indicating that it has been successfully connected to the cloud platform.

[0150] WeChat applet connects to the cloud platform:

[0151] WeChat Mini Program connects to Alibaba Cloud Platform through MQTT protocol by installing JavaScript file of MQTT client library. Similar to hardware devices, WeChat Mini Program also needs to configure its triplet information, namely product key (productKey), device name (deviceName) and device key (deviceSecret), to initialize MQTT connection parameters.

[0152] Using this triplet, the WeChat applet will initialize the MQTT connection parameters. This process is implemented through the initMqttOptions(deviceConfig) method. The method first creates a parameter object containing productKey, deviceName, current timestamp, and a client ID. Based on these parameters, the MQTT connection parameters are generated, including password, clientId, and username, where password is generated using the HMAC-SHA1 algorithm, and finally these parameters are returned.

[0153] After initializing the parameters, the WeChat applet calls the mqtt.connect() method and passes in the corresponding parameters to successfully connect to the Alibaba Cloud platform.

[0154] Here, the initMqttOptions(deviceConfig) method is responsible for generating MQTT connection parameters, and the mqtt.connect() method is responsible for using these parameters to establish a connection. When the WeChat applet successfully connects to the Alibaba Cloud platform, the device WXMP in the console will display an online status, which indicates that the WeChat applet has successfully connected to the cloud platform. After the connection is successful, the WeChat applet can receive data sent by the hardware device from the cloud platform and display this data to the user. At the same time, it can also send control commands to control the data collected by the hardware device.

[0155] Cloud platform data flow:

[0156] Although both the hardware device and the WeChat applet are connected to the same cloud platform, their identities on the cloud platform are independent due to their different triplet information. This means that the hardware device cannot directly receive messages from the WeChat applet, and vice versa. All messages need to be transferred through the cloud platform. After the hardware system and the WeChat applet have successfully established a connection with the cloud platform, the next focus is on how to transfer data between the two devices. This process is called "cloud platform data flow". Here, taking the data transfer of hardware devices to WeChat applet as an example, the configuration steps to achieve data flow are described in detail.

[0157] First, the WeChat applet device needs to subscribe to a Topic for receiving data. The device WXMP subscribes to a Topic of " / inzumVtOBJn / WXMP / user / get".

[0158] Next, create a parser named ESP8266_TO_WXMP in the cloud product flow, and then create the fromESP8266 data source and toWXMP data destination in this parser. The topic that ESP8266 has publishing permissions needs to be added to the data source, for example: / inzumVtOBJn / ESP8266 / user / update; finally, implement this function in the parser.

[0159] After the above steps are configured, as long as ESP8266 uses / inzumVtOBJn / ESP8266 / user / update to publish information, the cloud platform will push the information to the device that has subscribed to the Topic " / inzumVtOBJn / WXMP / user / get", and the data pushed by the cloud platform can be received in the WeChat applet. Similarly, the WeChat applet data flow can be configured to transfer to the hardware device to achieve remote control. So far, the cloud platform data flow has been successfully realized.

[0160] The above are only preferred specific implementations of the present application, but the protection scope of the present application is not limited thereto. Any changes or substitutions that can be easily thought of by a person skilled in the art within the technical scope disclosed in the present application should be included in the protection scope of the present application. Therefore, the protection scope of the present application should be based on the protection scope of the claims.

Claims

1. An intelligent collection system for agricultural soil information, characterized in that: include: Device side, cloud platform and mobile terminal; The device end includes a main control module, a sensor module and a WiFi module; The sensor module is used to collect soil information and environmental temperature and humidity information based on a soil sensor and an environmental temperature and humidity sensor; The main control module is used to receive the soil information and the environmental temperature and humidity information; The WiFi module is used to realize data interaction between the device and the cloud platform; The cloud platform is responsible for data transmission between the device end and the mobile terminal based on the MQTT protocol; The mobile terminal is connected to the cloud platform, and is used for synchronously receiving the soil information and the environmental temperature and humidity information acquired by the device end, and autonomously controlling the acquisition of data by the soil sensor and the environmental temperature and humidity sensor.

2. The intelligent collection system of agricultural soil information according to claim 1 is characterized in that: The soil sensor adopts RS485 type soil four-parameter sensor, and measures the temperature, humidity, pH value and conductivity of the soil based on the RS485 type soil four-parameter sensor.

3. The intelligent collection system of agricultural soil information according to claim 1 is characterized in that: The main control module adopts the STM32F103C8T6 main control chip.

4. The intelligent collection system of agricultural soil information according to claim 1 is characterized in that: The main control module includes a power supply circuit, a crystal oscillator circuit, a reset circuit, a startup configuration circuit and a modulation circuit; The power supply circuit is used to power the system based on the main power input pin, the analog power input pin and the backup battery input pin; The crystal oscillator circuit is used to provide a clock signal for the system; The reset circuit is used to restore the system to the initial state when the single chip microcomputer is powered on, abnormal or needs to be manually reset; The startup configuration circuit is used to configure the startup mode of the system when the single chip microcomputer is powered on or reset; The modulation circuit is used to transmit debugging-related data and control signals between the single-chip microcomputer and the debugger based on a bidirectional data line, and is used to synchronize the timing of data transmission and control signals between the single-chip microcomputer and the debugger based on a unidirectional clock line.

5. The intelligent collection system of agricultural soil information according to claim 1 is characterized in that: The device end also includes a power module, which includes three lithium batteries connected in series, and the lithium battery is a 18650 lithium battery.

6. The intelligent collection system of agricultural soil information according to claim 5 is characterized in that: The power module is connected to the step-down module, which is used to connect the input voltage of the power module to the inductor through the MOS tube, and then periodically open and close the MOS tube, and through the synergistic effect of the inductor and the filter capacitor, convert the input voltage into an output voltage that meets the working conditions of each module.

7. The intelligent collection system of agricultural soil information according to claim 1 is characterized in that: The device end also includes a display module, which is used to display the soil information and environmental temperature and humidity information based on an OLED display screen.

8. The intelligent collection system of agricultural soil information according to claim 1 is characterized in that: The mobile terminal includes an information synchronization module, a weather query module and a remote control module; The information synchronization module is used to synchronously receive the soil information and the environmental temperature and humidity information, and update the soil information and the environmental temperature and humidity information in real time; The weather query module is used to query the remote weather conditions of the soil information collection site on the current day and in the next two days; The remote control module is used to autonomously control the opening and closing of the soil sensor and the ambient temperature and humidity sensor based on the remote weather conditions of the soil information collection site on the current day and within the next two days.

9. The intelligent collection system of agricultural soil information according to claim 8 is characterized in that: The mobile terminal also includes an information display module, which includes a homepage display unit, a weather display unit and a user display unit; The homepage display unit is divided into a weather bar, a function area and an information area, and is used to display the weather conditions obtained by the weather query module based on the weather bar, display the autonomous control buttons of the remote control module based on the function area, and display the soil information and environmental temperature and humidity information obtained by the information synchronization module based on the information area; The weather display unit is used to further display the weather conditions of the day and the next two days, and the weather conditions at least include daytime and nighttime weather phenomena, maximum and minimum temperatures, humidity, rainfall probability, rainfall, wind direction and wind force level; The user display unit is divided into a user information display area and a function control area, and is used to display the user's avatar and nickname based on the user information display area, and to display the switch of the weather query module based on the function control area.