English

中国农机化学报

中国农机化学报 ›› 2025, Vol. 46 ›› Issue (7): 97-103.DOI: 10.13733/j.jcam.issn.2095-5553.2025.07.015

• 农业信息化工程 • 上一篇    下一篇

基于MQTT协议的肥液参数远程监测系统设计与实现

陈金龙1,  2,卢闯1,  2,任妮1,  2,戴秀1,  2   

  1. (1. 江苏省农业科学院农业信息研究所,南京市,210014;
    2. 农业农村部长三角智慧农业技术重点实验室,南京市,210014)
  • 出版日期:2025-07-15 发布日期:2025-07-02
  • 基金资助:
    江苏省重点研发(现代农业)项目(BE2021379)

Design and implementation of remote monitoring system for fertilizer parameters based on MQTT protocol 

Chen Jinlong1,  2, Lu Chuang1,  2, Ren Ni1,  2, Dai Xiu1,  2   

  1. (1. Institute of Agricultural Information, Jiangsu Academy of Agricultural Sciences, Nanjing, 210014, China; 
    2. Key Laboratory of Intelligent Agricultural Technology (Yangtze River Delta), Ministry of Agriculture and 
    Rural Affairs, Nanjing, 210014, China)
  • Online:2025-07-15 Published:2025-07-02

摘要: 水肥一体化是实现节水节肥和减少生态污染的重要技术,其中肥液EC、pH值的精准检测和肥液参数的稳定远程传输是水肥一体化装备应用研究的重点。针对水肥一体机的肥液参数精准监测开展应用研究,综合兼顾电压检测的量程及分辨力,设计高精度电压检测电路,对肥液传感器输出原始信号进行转化、分压、跟随及滤波,经高精度电压检测电路后的EC、pH传感器信号,输入至控制器高速ADC模块进行双重ADC同步规则采样,将模拟信号转换为数字信号,实现对肥液EC、pH参数采样的时序同步。综合考虑信号滤波效果及实时响应速度,合理选取滤波器长度,对ADC采样结果的数字信号实行滑动平均滤波,以滤除周期性及高频性等随机干扰信号,确保ADC采样结果的准确性。高精度硬件电压检测电路和高效传感器数据检测算法的有效融合设计,能够使肥液传感器精准检测肥液EC、pH值。对计算出的肥液EC、pH值,经由JSON格式规格化后,由控制器通过RS232通信上传至4G DTU模块,并采用MQTT协议远程传输数据至云平台端,以提供有价值的决策参考。试验验证表明,设计的肥液参数精准监测系统,电压检测电路精度高,传感器数据检测算法高效灵活,电压采集综合平均相对误差为1.98‰,远程通信稳定可靠,数据流收发成功率为99.88%。

关键词: 水肥一体化, 远程监测, 肥液参数, 双重ADC同步采样, 数据滤波

Abstract: Integrate water-fertilizer technology is a crucial method for conserving water, reducing fertilizer use, and minimizing ecological pollution. Among its core challenges, the precise detection of fertilizer liquid EC and pH value, along with the stable remote transmission of these parameters, are key areas of research in the development of water-fertilizer integration equipment. This study focused on the applied research of accurately monitoring fertilizer solution parameters in water-fertilizer integration systems. It carefully considered the detection range and resolution of voltage signals, and designed a high-precision voltage detection circuit to convert, divide, follow, and filter the raw signals output by the fertilizer sensors. After the high-precision voltage detection circuit, the processed EC and pH sensor signals were then input into the controllers high-speed ADC module for dual synchronous rule sampling. This enabled the real-time conversion of analog signals to digital signal, and synchronized acquisition of EC and pH values. To balance signal filtering with real-time responsiveness, an appropriate filter length was selected to implement a sliding average filter on the digital signal, effectively eliminating cyclic and high-frequency random noise and ensuring the accuracy of ADC sampling results. The integration of high-precision hardware voltage detection and an efficient sensor data processing algorithm enabled accurate detection of fertilizer solution EC and pH values. The processed data, standardized in JSON format by the controller, were transmitted via RS232 communication to a 4G DTU module, and then remotely uploaded to a cloud platform using the MQTT protocol. This provided valuable input for user decision-making reference or crop water-fertilizer modeling. Experimental validation demonstrated that the system achieved high-accuracy voltage detection, supported by a flexible and efficient data processing algorithm. The average relative error of voltage measurement was only 1.98‰, while remote communication was stable and reliable, with a data transmission and reception success rate of 99.88%.

Key words: water and fertilizer integration, remote monitoring, fertilizer parameters, dual ADC synchronous sampling, data filter

中图分类号: