A moisture detection sensor for flour based on the gas in scattering media absorption spectroscopy

Flour is an essential ingredient in human daily diet, thus it is crucial to measure its moisture content. However, current detection methods are time‐consuming and labor‐intensive, hindering quick measurement. Here we demonstrate the measurement of moisture content in flour via gas in the scattering media absorption spectroscopy (GASMAS) technique. A compact sensor that includes distributed feedback laser driver, cuvette, photodetector, analog lock‐in amplifier, and analysis processing module is developed. We measure the equivalent mean path length of various flour samples, and verify the measurement sensitivity of GASMAS by studying its dependence on moisture content. A linear relationship between path length and moisture content is established by least‐squares curve fitting, corresponding to a correlation coefficient of 0.996. Compared to the drying method, our method shows a maximum error range of 6.1% for all samples, providing a highly accurate and reliable measurement of water content in flour.


| INTRODUCTION
Flour is an indispensable food item in our daily lives.During the storage process, flour in mills will absorb moisture from water vapor, which increases its moisture content.High moisture content (above 14.0%) encourages mold and bacteria growth, which can break down flour's nutritional components and attract flour beetles by consuming its starch, rendering it inedible.Flour with high moisture content tends to have poor flowability and is prone to clumping, causing storage issues like clogged bins. 1 Furthermore, moist flour in the dough and bread-making process tends to have a lower gluten content, which can cause stickiness, looseness, and excessive fermentation.All conditions make it very important to detect the moisture content of flour.
At present, drying method is considered to be the most accurate method to determine moisture content, but it has drawbacks such as lengthy measurement time, complex procedures, and instrument portability issues.Amjad et al. employed hyperspectral imaging technique to measure the moisture content of potato chips. 2 This method involves multiple steps such as image acquisition, processing, and analysis, which may not meet realtime requirements.Wang et al. employed direct current resistance method to measure the moisture content of corn, 3 but it is unable to measure samples with nonuniform moisture distribution.Chemical methods can also be used for moisture measurement, but they have higher reagent costs, installation complexity, and complicated circuitry. 44][25][26][27][28] Due to its noninvasive, fast response time, and high sensitivity, it has potential applications in the food industry, [29][30][31][32] pharmaceutical sectors, 33,34 and biomedical fields. 35,36However, pathlength determination for gas is a challenge due to the strong laser scattering in porous media. 37Persson et al. 38 obtained the path length by simultaneously monitoring gas with known concentration of water vapor, but underestimated it when the saturation conditions of water vapor were not met.With technological advancements, methods such as time-offlight spectroscopy, 39 frequency-modulated light scattering interferometry, 40 and frequency-domain photon migration 18 have been utilized to measure the average optical path length, then average concentration and porosity of materials are obtained.In this paper, we adopt an incremental method to determine the absorption path length by increasing the air with a known optical path and measuring the second harmonic signal. 41We aim to measure moisture contents rapidly in flour with GASMAS technology and compare it with the drying method to verify its accuracy.A compact sensor was developed, which consists of DFB (distributed feedback) laser driver, cuvette, a photodetector, analog lock-in amplifier, and analysis processing module.The cuvette is placed in a container for three-dimensional (3D) printing.Compared with other moisture measuring instruments, it has the characteristics of small size and easy portability.The finite impulse response (FIR) filtering algorithm is used in the analysis processing module, which improves the signal-to-noise ratio by three times, resulting in a minimum detection limit of 0.07%.It makes measurements more stable and accurate.self-made driver circuit controls the laser at 34.5°C.By scanning the current to the driver board, the laser outputs a wavelength of 1392.534nm, corresponding to the absorption line of water.The laser is absorbed by the water vapor in the sample contained in the cuvette.The sample weight ranges from 7.0 to 7.2 g.The transmitted light reaches the photodiode (G12180-02i0A; Hamamatsu Photonics), and the detected weak current is amplified to an appropriate voltage by a homemade detector circuit.The amplified raw signal is then output to an analog lock-in amplifier for further processing.The dotted square (2) demonstrates an analog lock-in amplification system.The output of the photodetector is demodulated at 2f using a high-precision balanced demodulator (AD630).Then, the demodulated signal is filtered by a low-pass filter.The processed data can be viewed on a PC. Figure 1B shows the physical diagram of the sensor.The overall dimensions of the system are 16.3 cm (length), 14.8 cm (width), and 8.5 cm (height).It is worth mentioning that, to minimize the influence of H 2 O in the air, a 3D-printed polylactic acid (PLA) cuvette container was designed, as illustrated in the inset of Figure 1B.This container can accommodate rectangular quartz cuvette with 5 mm thickness, and the light source and detector are tightly fitted to the cuvette, minimizing the air gap to reduce water absorption in the air.During the experiment, a desiccant was added to the container to maintain dry air.

| EXPERIMENTAL SETUP OF THE SENSOR SYSTEM
Scattering causes a substantial reduction in the received light intensity, and the signal-to-noise ratio of the second harmonic waveform also deteriorates.To address this issue, the FIR filtering algorithm was incorporated into the signal processing of STM32F405.This algorithm filters the 2f signal before calculating the peak-to-peak value.
After algorithm processing of the sample signal with a water content of 6.42%, the waveform signal-to-noise ratio of the filtered 2f signal has increased by three times, as shown in Figure 2.

| Sensor calibration
To verify the influence of pore distribution on effective optical path length of the sample, L eq of 10 samples from one brand were measured under the same experimental conditions.The L eq values of the 10 samples were compared, and the results are shown in Figure 3A. it can be observed that the L eq values of the 10 samples exhibit some fluctuation with a total error of 2.60 ± 0.08 mm.
In different brands of flour, the differing distribution of pores can also affect L eq .L eq of 4 samples from four different brands were measured under the same experimental conditions.Figure 3B represents the least-squares fit curves for the normalized 2f signal (GMS) values of the four brands of flour.GMS is the normalized signal, obtained by dividing 2f by the intensity of the light.The points of intersection between the curve and the negative half of the X-axis are as follows: 1.73, 1.82, 1.79, and 1.91 mm, with a maximum difference of 0.18 mm.The results demonstrate that the L eq values are consistent across different brands of flour.
To evaluate the accuracy of the GASMAS method, the moisture content of five samples was determined using the drying method specified in GB5009.3-2016"National Food Safety Standard-Determination of Moisture in Foods."The measurement results are detailed in Table 1, and all sample masses comply with GB/T 1355-2021.
After obtaining flour samples with a fixed moisture content through the drying method, their moisture content is measured using GASMAS.Moisture content directly affects the equivalent mean path length within the samples, and using the least-squares method to fit the data, the results demonstrate a linear relationship between the equivalent mean path length and moisture content.The linear regression curves for the equivalent mean path length and moisture content of the aforementioned samples are depicted in Figure 4.The fitting result is expressed as follows: In the equation, y represents the moisture content, and x represents the equivalent mean path length.
To verify the effectiveness and stability of the sensor, the GASMAS method and drying method were used to measure five sets of samples with unknown moisture content.Table 2 presents the detection results for the five sets of samples.It can be observed that at a moisture content of 2.76%, the measurement error is 6.1%.At a moisture content of 5.72%, the relative error is 1.9%.The test results highlight the high accuracy of the detection method and its potential for effectively measuring flour moisture content.The sensor error may originate from uncertainties such as calibration, curve fitting, and electronic equipment noise.The accuracy and robustness of the sensor need further exploration and improvement.Furthermore, to validate the measurement limit of the sensor, the signal-to-noise ratio calculation for the sample with a water content of 1.86% yields a result of 27.89, resulting in a minimum detection limit of 0.07%.

| CONCLUSION
A flour moisture detection method based on GASMAS technology is presented.The method selects the 1392.534nm wavelength by a homemade driver board, and employs the FIR filtering algorithm of a highperformance microprocessor for signal processing, thereby improving the signal-to-noise ratio by three times.The influence of pore distribution on L eq is analyzed, Moisture content (%) confirming that pore distribution has no effect on the determination of flour moisture content.By using the drying method, the moisture content of five samples was measured, and GASMAS measured the L eq of the same five samples.Data from both measurements were fitted to a curve with a correlation coefficient of 0.996.Under this calibration standard, the moisture content of five unknown flour samples was detected, with a maximum error of 6.1% and a minimum error of 1.9%.By calculating the signal-to-noise ratio of the 2f signal for a sample with a water content of 1.86%, a minimum detection limit of 0.07% was obtained.This integrated sensor demonstrates the advantages of high precision and instant measurement, making it possible to apply GSAMAS moisture detection technology in areas such as flour mills, food manufacturing, and so on.

Figure
Figure 1A shows the schematic of a flour moisture detection sensor via the GASMAS technique.The light source utilizes a 1392 nm distributed feedback semiconductor laser.As shown in the dotted square (1), a

F
I G U R E 3 L eq comparison of different sets of samples.(A) Ten sets of samples of the same brand.(B) Four sets of 0% moisture samples of different brands.GMS, normalized 2f signal.T A B L E 1 Experiment to calibrate the sample.Flour no.
Unknown sample test results.
T A B L E 2Abbreviation: GASMA, gas in scattering media absorption spectroscopy.