Abstract:Soil electrical conductivity is an important parameter that characterizes soil quality and physical properties. The rapid acquisition of soil electrical conductivity can provide effective data support for accurate management of agricultural products such as variable-rate fertilization, variable-rate seeding, and other soil improvement operations. At present, the collection of field electrical conductivity is carried out before agricultural production, and special electrical conductivity detection equipment is needed to carry out large-scale data collection and generate a spatial distribution map of electrical conductivity for planting plots. The operation of this method is cumbersome, time-consuming, and laborious., and the detected electrical conductivity value is difficult to accurately reflect the real conductivity in each link of agricultural production (such as sowing) due to at the time lag. Aiming at the above problems, a rapid in-situ detection sensor for soil electrical conductivity was designed based on the principle of the AC "current-voltage" four-electrode method. It is used to carry on different agricultural production machines to realize the real-time detection of soil electrical conductivity and online adjustment of operating parameters. The STM32 processor was taken as the core component of the sensor, cooperating with the power supply circuit, AC signal source circuit, effective value detection circuit, and other peripheral circuits to build a hardware and software architecture, to realize the high-precision in-situ and rapid acquisition of soil conductivity. The four probes of the sensor are in direct contact with the soil, all of which are made of stainless steel solid material with a length of 65 mm and a diameter of 3 mm. The probes are fixed on the PVC fixing plate with a pitch of 20 mm between them through the nut. The sensor probe and the main shell are connected by the shield wires to avoid the cross-interference of signals. The fixing plate can be separated from the main shell to adapt to different working environment requirements. The STM32 processor controls the AD9833 signal generation module of the AC signal source module through SPI to output a sine wave signal with adjustable frequency and amplitude. It obtains data through the communication between IIC and the RMS detection module, and processes, displays, stores and transmits the data. The LCD1602 liquid crystal display module adopts four-wire communication to display the output value of the electrical conductivity sensor in real-time. An integrated SD card storage module is used for real-time storage of data. WiFi wireless module is integrated with ESP8266 as the core component to realize wireless data transmission. The reserved interface can also be equipped with GPS equipment for location information acquisition, which is convenient for later function expansion. The designed power supply circuit adopts an independent power supply for each functional module and main chip to eliminate signal interference and improve detection accuracy. The designed electrical conductivity sensor has been calibrated and tested for working stability. The calibration test results show that the electrical conductivity values output by the electrical conductivity sensor are significantly linear with that measured by the DDB-303A conductivity instrument, and the linear fitting correlation is 0.995. The experimental results show that the standard deviation of the measured value is less than 0.76 μS/cm under different soil electrical conductivity levels. Soil samples with different conductivity concentrations (moisture content<15%) were prepared under laboratory conditions (temperature 25 ℃). The contrast test of soil conductivity detection accuracy and response time was carried out by using the designed conductivity sensor and JXBS-3001 sensor. The test results show that with the increase of soil conductivity, the measurement errors of the JXBS -3001 sensor and designed conductivity sensor also increases. Among them, the absolute error of the JXBS-3001 sensor is ?13.8-30.3 μS/cm, the relative error is ?2.46%-3.74%. And the absolute error of the designed electrical conductivity sensor is ?5.9-19.4 μS/cm, the relative error is ?1.05%-2.39%, indicating that the designed conductivity sensor has a smaller measurement error than the JXBS-3001 sensor at a lower production cost, and the measurement accuracy is reliable. The response time comparison test results show that the response time of the JXBS-3001 sensor in the two states is 2.23 s, and the response time of the designed electrical conductivity sensor is less than 2.01 s. Conductivity sensors were used to measure the conductivity at different locations of the field at a temperature of 20.6 ℃, and the results were compared with those obtained in the laboratory. The results show that the absolute error is ?11.36-25.30 μs /cm, and the relative error is ?7.91%-7.88%. The designed sensor can switch between different working states more quickly, and realize the rapid and effective acquisition of the information of the soil electrical conductivity. In summary, the designed soil electrical conductivity sensor can rapidly and accurately detect soil electrical conductivity, which can provide a high-precision detection tool for soil information collection in unmanned farms.