Abstract:An in-line detection system of grain protein content was developed in this study, in order to realize the real-time identification and record the sampling geographical location information in a novel harvester combined with near-infrared spectroscopy during grain harvesting. The detection system was mainly composed of a near-infrared spectral sensor module, spiral sampling and conveying mechanism, control module, GPS/Beidou positioning module, and industrial display integrator. The specific working procedure was followed for the in-line detection system in a near-infrared spectroscopy on combine harvester. The grain first discharged from the outlet of a combine-harvester through the spiral sampling and conveying mechanism. A PID controller was used to adjust the stepper motor of sampling mechanism, according to the requirements of detection rate, thereby to realize the intermittent grain transmission. A near-infrared spectral sensor was also adjusted to capture the spectrum, when the stepper motor stopped turning. A RS485 bus was used for data transmission to host computer, where the obtained data included the grain near-infrared spectrum, and the positioning signal of GPS/Beidou positioning module. A data processing software was developed to control the near-infrared sensor and sampling mechanism. After data post-processing in the grain protein prediction model, the information of grain protein and sampling location was in situ displayed, and storage for later use. An indoor calibration, and a field dynamic test were carried out to verify the performance of prediction model for grain protein content and online detection system. In the prediction model of wheat protein content, the decision coefficient was 0.865, the absolute error range was −0.96% to 1.22%, the relative error range was −7.30% to 9.53%, and the Root Mean Square Error of Prediction (RMSEP) was 0.638%. In the prediction model of rice protein content, the decision coefficient was 0.853, the absolute error range was −0.60% to 1.00%, the relative error range was −8.47% to 9.71%, and the RMSEP was 0.516%. In the dynamic field test, the maximum relative error of wheat protein content was −6.69%, whereas, the maximum error of rice protein content was −8.02%. It infers that the sampling and analysis interval have no significantly influence on the detection system, where the system stability and detection accuracy meet the need of grain protein online detection in the field. The finding can provide a scientific basis for precision agricultural operation.