Design of Resistive Grain Moisture On-line Detector

Grain moisture detection is of great significance to the acquisition, transportation, storage, processing and trade of grain. This paper designs and develops a resistive grain moisture on-line detector, which uses the least squares method for data calibration and stores the calibrated data in the STC15F2K08S2 microcontroller. The grain moisture content is obtained by processing the collected grain resistance and grain temperature. When the grain moisture content exceeds the set value of grain moisture detector, the microcontroller will automatically control the opening of grain drying equipment so as to prevent the grain moisture content from being too high and causing mildew. Through the experimental data analysis and operation test, the detector can accurately detect the moisture content of wheat, barley, rapeseed, rice and other grain and automatically control the drying equipment, and it has the advantages of fast response, high accuracy and strong practicality, so it can meet the national grain testing accuracy requirements and automatic drying requirements.


Introduction
The survival of mankind is based on grain, and grain plays an important role in national economic construction and all walks of life.In order to ensure the quality of grain, it is necessary to accurately measure the moisture content of grain before grain storage.However, due to many factors, the traditional method is difficult to achieve real-time detection of grain moisture in the process of grain drying, as well as intelligent control of drying equipment [1].Therefore, the modern science and technology theory are applied to achieve moisture on-line accurate detection and intelligent control of drying equipment in the process of grain drying, which has a significant role in improving grain quality and economic efficiency.
According to the different principles of grain moisture detection, the detection method can be divided into the following: drying method, chemical method, electrical measurement method, near infrared method, microwave method [2,3].Drying method and chemical method measure the grain moisture value through the heating or chemical reaction and other means.This measurement method has the advantages of accuracy and reliability, but it wastes time.Generally, it is only suitable for professionals to operate.The electrical measurement method includes the resistance method and the capacitance method, which measure the grain moisture value by measuring the dielectric constant of the grain [4,5].This measurement method has the advantages of simple principle, convenient operation and low cost, but the capacitance method is easy to be influenced by temperature and other factors [6].
Near infrared method and microwave method have the advantages of high accuracy and fast response, a but their structure is complex and they are expensive.They are rarely used at present.
Therefore, this paper designs a resistive grain moisture on-line detector, which uses the resistance method to detect the grain moisture in the grain drying equipment in real time, and uses the single chip microcomputer to automatically control the operation of the grain drying equipment.The detector can prevent the grain moisture content from being too high and producing mold.And it saves a lot of manpower and material resources.The detector structure is simple and the measurement results are accurate.And it can enable the production process to be automated and intelligent.

Detection principle of resistive grain moisture on-line detector
Experimental studies have shown that when the grain moisture content is between 9% and 20%, the grain moisture content is an approximate linear relationship with the logarithm of grain resistance, and when the moisture content increases, the grain resistance will rise from tens of megohm to less than one thousand ohm.At the same time, there is a linear relationship between grain resistance and grain temperature.When the temperature is between -10°C and + 50°C, the grain moisture content will be reduced by 0.1% for every 1°C rise in temperature [7].Therefore, grain moisture content can be obtained by measuring the grain resistance and grain temperature in grain drying equipment.
Resistive grain moisture on-line detector uses constant current source circuit to measure grain resistance and temperature compensation circuit to measure the grain temperature in the drying equipment.Constant current source circuit can make the power supply output voltage constant and the current flowing through the grain resistance constant and large.So when the voltage flowing through the grain resistance is measured, the grain resistance value can be determined, and then grain moisture content can be obtained.

Composition and principle of resistive grain moisture on-line detector 3.1 The overall structure
Figure 1 shows the structure of the resistive grain moisture on-line detector, which is composed of the lower computer and the host computer.The lower computer is mainly composed of electrode roller and shell.The electrode roller is a rotatable crushing electrode and is mainly used to crush the grain between the gap of the electrode roll to collect grain resistance.The host computer is mainly composed of knobs, buttons, digital tube and shell.The knobs and buttons are mainly used to select the types of grain to be tested and the detection methods.The digital tube is mainly used to display the grain moisture value.

Lower computer
Host computer

Working principle
The lower computer is installed at the hopper of the grain drying equipment, its internal motor drives the electrode roller to rotate, crushing the grain particles between the gap of the electrode roll.At the time, the constant current source circuit will collect the potential difference on the grain resistance, the potential difference is amplified by the signal amplification circuit and transmitted to the single chip in the lower computer, single chip gets the grain moisture value by A/D conversion.The moisture value is corrected by the temperature compensation circuit and transmitted to the single chip in the host computer for display.At this time, the single chip in the host computer controls the start and stop of the motor and the drying equipment by comparing the measured grain moisture value with the set moisture value, the working principle flow chart is shown in Figure 2.

Hardware circuit composition
The hardware circuit of the resistive grain moisture on-line detector mainly includes the lower computer circuit and the host computer circuit.The lower computer circuit is mainly composed of power supply circuit, constant current source circuit, signal amplification circuit, temperature compensation circuit, and single chip system.The host computer circuit is mainly composed of power supply circuit, digital display circuit, motor and dryer control circuit, control knob and button circuit, and single chip system, the hardware circuit block diagram is shown in Figure 3.

Software design
Figure 4 shows the main program flow diagram of the resistive grain moisture on-line detector, which is designed in a modular way.And according to the needs of the main program, the system will be initialized and subroutine calls.
The work process of the resistive grain moisture on-line detector is as follows: after the resistive grain moisture on-line detector power is running, first rotate the "grain selection" knob on the top panel to select the grain species to be dried in the drying equipment, at this time, wheat, barley, rapeseed, rice, and corn can be selected.Then adjust the "water setting" knob, the set value of the grain moisture detector will be displayed on the digital tube.Finally select the measurement method, at this time, the motor will drive the electrode roller to rotate, the drying equipment will also begin to work, the digital tube begins to measure the number of the extruded grain, when the number reaches 100 and the measurement value of the grain moisture is less than the set value, the motor and drying equipment will stop working.At this time, the value of the digital tube is the grain moisture value, otherwise, the motor and drying equipment will continue working.Under the condition of room temperature, 20 kinds of wheat samples with the same variety and different humidity were selected, and the actual water value of wheat was measured by Qifeng QLY-T grain moisture analyzer.The potential difference of the output end of the signal amplification circuit was measured by Fluke 15B+ high precision digital multimeter respectively.The signal amplification circuit amplifies the potential difference on the wheat resistance by a factor of 50.The results of the measurement data are shown in Table 1.The data measured in Table 1 are fitted using the least squares method in matlab.The fitting results are shown in Figure 5.With the increase of water content of wheat, the logarithm of the potential difference will also increase.When the water content of wheat is between 9.8% and 19.8%, the logarithm of the potential difference on wheat resistance is approximately linear with the moisture content of wheat.The equation is lgu = 0.0523 W +0.831.Similarly, the calibration of barley, rapeseed, rice and corn can be carried out.

Error test
Table 2 shows the results of the moisture measurements of wheat which are measured by the self-designed resistive grain moisture on-line detector and the actual moisture value of wheat which are measured by Jufeng QLY-T grain moisture analyzer.As can be seen from the data in the table 2, the minimum resolution of the moisture detector reached 0.5% of the national standard, and the measurement results are accurate [8].

Conclusion
This paper analyzes the principle of resistive grain moisture on-line detector and puts forward the method of measuring grain resistance by constant current source circuit.On basis of this, hardware design, software design and instrument calibration are completed.Through the experimental test, the resistive grain moisture on-line detector can accurately detect grain moisture content and control grain drying equipment.And it has advantages of automatic operation, fast response, high precision, low cost, strong practicality.So its application prospects are very broad.

Figure 1 .
Figure 1.The structure of the resistive grain moisture on-line detector.

Figure 2 .
Figure 2. The working principle flow chart.

Figure 3 .
Figure 3.The hardware circuit block diagram.

Figure 4 .
Figure 4.The main program flow diagram of the resistive grain moisture on-line detector.

Figure 5 .
Figure 5.The fitting result of actual water value and amplified potential difference.

Table 1 .
Measurement data of actual water value and amplified potential difference.

Table 2 .
Comparison of moisture measurements and actual moisture value of the wheat.