Affordable Microwave Soil Moisture Detector

Monitoring the content of soil moisture is crucial in defining soil conditions and irrigation that affect agricultural efficiency. Accordingly, inexpensive and reliable devices are essential. Electromagnetism could be exploited for the quantification of soil moisture, and in particular, the real and imaginary part of the scattering parameter (<inline-formula> <tex-math notation="LaTeX">${S}11$ </tex-math></inline-formula>). Several sensors have been developed, but some limits were encountered, such as interference due to soil constituents and a cost that is not always affordable. We developed an inexpensive cheap and rapid instrumental chain based on the response of a cavity antenna in the frequency range from 1.5 to 3 GHz. Very low-cost components were assembled and used: a miniaturized commercial vector network analyzer (VNA) and a homemade cavity antenna. The antenna should be placed in contact with soil without being inserted. Tests were carried out directly in the field with a moisture content ranging from 1% to 45%. Starting from spectral variables (real and imaginary part of <inline-formula> <tex-math notation="LaTeX">${S}11$ </tex-math></inline-formula>), partial least square regression models have been developed for the estimation of moisture content (%). The main results show <inline-formula> <tex-math notation="LaTeX">${R}^{{2}}$ </tex-math></inline-formula> values of 0.872 with root mean square error (RMSE) of 4.1% (imaginary part, segmented validation). In light of the results obtained, the user friendly device developed can be very attractive for final users also in terms of affordability.


I. INTRODUCTION
S OIL is a complex mixture of components in different states of matter (solid, liquid, and gaseous), and their proportion defines its quality [1].Liquid-solid interactions are the main factor responsible for the physical properties of soil, which is affected by water fluxes of the land surface, precipitation, temperature, and evapotranspiration, which all play a significant role in agricultural practices and irrigation management [2].Quantitatively, the liquid component is mainly represented by the amount of water in the pore spaces of unsaturated soil and can be expressed as gravimetric moisture content (ratio between the mass of moisture present in the sample to the dried mass) or volumetric moisture content (ratio between the volume of moisture present in the soil and the total volume of the soil).Thus, measurement of soil moisture content is fundamental, and according to the standard method, can be calculated by the difference in weight after drying the sample in an oven [3].The traditional thermogravimetric method, performed in a laboratory environment, is time-consuming, laborious, and unsuitable for real-time monitoring of soil moisture [4].
Given the importance, many alternative sensing techniques have been developed to estimate soil moisture content for agricultural purposes [5].These include remote sensing tools, which are suitable for large-scale estimations, and in situ devices for in-field assessments [6].In situ sensing methods are point-based solutions that can require, or not, physical contact with the soil.In recent years, together with the advancements in sensor technology and modern industrial communication protocols [e.g., Internet of Things (IoTs)], several soil moisture sensors have been developed with various measurement methods, including tensiometers [7], radioactive techniques based on neutron scattering probes [8], heat pulse probes [9], γ -ray projection or gamma ray attenuation theory [10], infrared spectroscopy [11], electromagnetic induction techniques [12], and dielectric methods [4].However, for continuous monitoring, these techniques have several disadvantages.For example, a tensiometer is limited in spatial variability and has high maintenance costs, while gamma-ray and neutron probes are expensive and cannot be widely adopted because of radiation hazards [4].Infrared remote sensing and dielectric spectroscopy [13], [14], [15] appear to be the most suitable alternatives.The interaction of the radio frequency electromagnetic waves with matter is described by dielectric permittivity (ε * = ε ′ -jε ′′ ), a complex number containing both real (ε ′ related to the amount of energy stored) and imaginary (ε ′′ or loss factor, related to the loss of energy) components.Water molecules show a relative dielectric permittivity of about 80 • C at 20 • C (at a frequency up to 3 GHz), a value which is higher than that of the air (1.00059 at 101 325 Pa) and other soil constituents (from 4.5 to 10) [16] such as minerals, salts, and organic matter.Even if not comparable to the role of the moisture content, texture, and bulk density can influence dielectric properties [17], [18].Several commercial sensing techniques are based on an assessment of moisture content through soil dielectric permittivity and subsequent use of specific calibration models [19], [20].These solutions include both point measurement techniques, such as time domain reflectometry (TDR) and frequency domain reflectometry (FDR), and remote measurement techniques such as ground penetrating radar (GPR).However, considering the complexity of the material and its relation with electromagnetic waves, the success of these measurement solutions is related to the ability of the calibration models to estimate the moisture content of soil and the interaction between its components, taking into account the frequency of measurements and temperature [14], [20].More recently, to set up a reliable noncontact system, attention was dedicated to a technique based on an open-ended waveguide positioned in contact with the soil surface combined with multivariate tools (PLS regression) [21], [22].The resulting spectra were influenced by differences in levels of soil moisture in both controlled laboratory conditions [22] and in a real environment experiment conducted using a portable device with the coefficients of the PLS predictive model embedded in the system [21].PLS appeared to be able to model the variability as testified by the external validation conducted on spectra acquired on a range of soil types (silty-clay-loam soil characterized by moisture content ranging between 9% and 32%), showing an R 2 value of 0.892 and a root mean square error (RMSE) of 1.0%.
Considering the needs of the primary sector need, cost is another crucial aspect of sensor development.As is known, instruments with high prices are not widely desired.Many sensors for estimation of soil moisture based on dielectric properties have been proposed in previous studies [4].However, some of these are expensive [23], [24], [25], while others are characterized by a low-cost probe and expensive instrumental chain [26], [27], [28], [29], [30], becoming incompatible for the designated purpose.A selection of applicable soil moisture techniques based on dielectric properties and characterized by low cost is reported in Table I.The present work was also added to the table for easy comparison.
As can be seen, experiments conducted ON resistance [31], [32] have possible sources of error affecting the accuracy of measurements, mainly due to the variability introduced by irrigation procedures, which continuously change the ionic concentration of soil.In addition, several studies have been conducted in laboratories with homogenous soil samples [33], [34], [35] or in a controlled environment [36] with added water, which is far from the actual hydration behavior in the field and renders samples more homogeneous.Only two studies measure the sensor's performance in the field [37], [38]; moreover, the proposed solutions must be inserted into the soil, and relative performances have been shown by only exploring calibration procedures.Probe insertion in soil does not preserve the physical characteristics of the field and can lead to possible errors [37].Considering statistical aspects, not all studies have reported predictive indexes that define the robustness of the calibration models developed.
The present work aims to be as follows.
1) Explore the potential of an inexpensive and rapid instrumental tool for the estimation of the gravimetric moisture content (%) in a real agricultural environment.2) Select and set up an instrumental chain composed of a miniaturized commercial nano-vector network analyzer (VNA) and a cavity antenna as a probe that is not to be inserted into the soil but just placed in contact with it.
3) Develop a multivariate statistical model; both real and imaginary parts of the scattering parameter S11 are combined with PLS regression models to estimate the target physical parameter.

II. MATERIALS AND METHODS A. Soil Characteristics
Two fields with two different crops (rocket salad for seed, Eruca Sativa, and salad, Lactuca Sativa) were selected.The fields, characterized by the same texture and chemical composition, are located in Italy, in the northeastern Emilia Romagna region.The Emilia Romagna regional institute constantly monitors the composition of agricultural soils, and an interactive site (https://agri.regione.emilia-romagna.it/Suoli/)allows consultation of the cartography of soils and maps of the natural foundation with all the relative characteristics are reported and available for all users.
Accordingly, the land sites are precisely identified, and the characteristics are further reported.Loamy loam soil is very deep with a moderate, fine texture.The soil is scarcely calcareous and slightly alkaline in the upper part, while moderately alkaline and very calcareous in the lower part.The substratum is alternated by silty and sandy alluvium.The chemical-physical analysis of the soil revealed the following composition: 21.7% sand, 35.5% clay, pH 8%, and total calcium 4.8%.The organic matter is 1.8%, total nitrogen 1.3%, and P 2 O 5 34 mg/kg with K 2 O 158 mg/kg.
Both fields were irrigated by the flooding method.Water was released twice during the season, from May to August 2022, and fields were leveled and milled.Traditional flood irrigation is still in use, and it involves simply letting water flow over the ground.Water is released in intervals; soil is leveled to be more efficient and limit evaporation, infiltration by capillarity, and loss by transpiration.Sensors can help the management of irrigation, especially the flooding method, by paying attention to the in-depth strategic placement of the probe.

B. Device Design: Principle of Detection
In electrical engineering, losses caused by the line, antenna, and standing waves are undesirable, and signal analysis helps to control correct wave propagation along a cable, minimizing distortions [40].In the present work, the reflection of the wave becomes an opportunity to study soil behavior.The response regarding dipole rotation of molecules and energy storage producing loss can be used to characterize the chemical-physical properties of the material being tested.
Considering constant composition and field milled treatment to be in very similar geometry of the ground analyzed, the moisture content could be considered the main parameter affecting electromagnetic wave interaction in the microwave range.
In a radio frequency incident signal on one port, part of this signal is sent to the probe and reflected back to the port, while the loss of the signal power is dissipated and absorbed.S-parameters represent the response obtained when the electromagnetic wave encounters a discontinuity, in our case soil, causing the scattering of the signal.The reflection  coefficient ( ) is related to the load impedance and the real and imaginary parts of S11, according to the following equations: where Z ln is the load impedance normalized to R 0 , the system reference impedance, and S11 re and S11 im are the real (resistive) and imaginary parts (reactive) of S11, respectively.Accordingly, real and imaginary parts of S11 can be used as signal parameters to correlate with soil properties.

C. Layout of the Instrumentation
The instrumental chain is characterized by a rectangular cavity antenna connected via port CH0 with a semi-rigid coaxial cable (50 ) to a NanoVNA, V2 (HCXQS in collaboration with OwOComm, China) and interface via USB with a PC (Fig. 1).These elements have been described, even if separately, in previous works [41], [42], [43].Working as a probe, the dimensions of the internal section of the cavity antenna are 96 to 46 mm.The NanoVNA was fastened to the cavity antenna with a specific support.
An antenna usually operates at or near its resonant frequencies, where its reactance equals zero [40].The reactance (X ) of the self-manufactured cavity antenna of the probe was measured using R-140 VNA (Copper Mountains) interfaced via USB to a computer with appropriate software.For the cavity antenna, according to Fig. 2 showing the reactance (X ) Authorized licensed use limited to the terms of the applicable license agreement with IEEE.Restrictions apply.
against frequency (Hz), the resonant frequencies are 1.56 and 2.46 GHz (in air).
Its producer kit (HCXQS in collaboration with OwOComm, China) calibrated the device, accounting for open, short, and load correction.The VNA has already been used by other authors [42], [43], and is a very affordable instrument.In addition, the NanoVNA is also very promising for in-field applications as it is portable and has an internal rechargeable battery.
Data were acquired using the NanoVNA-saver software (GNU, General Public License, version 0.3.8,Rune Broberg), averaging ten consecutive acquisitions.Each was composed of 301 spectral points acquired in about 30 s.
The NanoVNA acquisitions were set from one port in the frequency range from 1.5 to 3 GHz and provided the real and imaginary parts of the scattering parameters (S11).Furthermore, the device penetration depth (the depth to which the instrumentation can detect a reflection) was empirically estimated to evaluate the feasibility of self-manufactured probes.In the microwave range, the penetration depth varies as a function of moisture content; the lower the percentage of water, the greater the thickness probed.Measurements were conducted on soil hydrated at 5% humidity (dry basis), representing a low moisture value.A metal plate was put into the material at different heights (3, 6, 9, 12, 15, and 28 cm) to directly measure the signal influence at different depths.

D. Experimental Setup
The experimental plan included 315 in-field acquisitions, conducted by performing three probe rotations for each sampling area (with a step of about 45 • ).Measures of the three probe rotations were averaged.Accordingly, 105 samples were then used for model building.At the same time, soil samples were collected in correspondence with the probe position for assessment of moisture content (%).Measurements were conducted ten times from May to August 2022, early in the morning, to limit the large oscillation in temperature.Soil temperatures between 17.5 • C and 29.0 • C (±0.2 • C) were detected.Although within a closer temperature range, as Franceschelli et al. (2020) observed, the moisture content significantly influenced spectral waveforms more than the temperature in the frequency range explored.
The target parameter (moisture content, %) used for the statistical inference was obtained by the traditional destructive oven method by drying soil samples at 105 • C for 24 h [21].The thermogravimetric method was selected for its recognized accuracy.In detail, the moisture content was assessed on the first 5 cm of soil depth and ranged between 1.3% and 45.9%.

E. Statistical Analysis
A multivariate method was selected to build the regression models from real and imaginary signals (the spectral variables).These signals were used as independent variables (X ) to build predictive models for the estimation of moisture content (Y ) using a bilinear regression tool, i.e., partial least squares regression (PLSR) analysis.PLS projects X and Y in a new orthogonal space where T is the latent vector called the score matrix of X , P is the loading matrix of X , U is the score of Y matrix, and Q is the loading of Y matrix [44], [45].Starting from the simultaneous calculation of the projections of the X and Y matrices and maximizing the correlation of the two new spaces, β coefficients and weights of the X matrix are obtained [44], [45] Data were organized in two matrices composed of 105 samples and 301 spectral variables (for both real and imaginary parts).Spectral sample outliers were detected before the model-building procedure on the entire dataset.
Segmented and test set validations were then considered to understand how the models performed with unknown samples.Twenty segments, with five samples each, were randomly selected for segmented validation.Assuming the test set validation, 20% of the samples were randomly extracted from the calibration dataset (80% of the samples) and used to validate the model.The procedure was repeated ten times, and the results were averaged.The model's ability to estimate soil moisture (%) was considered in terms of coefficient of determination (R 2 ), RMSE, and significative PLS components (LVs) for both calibration and validations.The bias, known as the systematic difference between measured and predicted values, was also computed as the average of the residuals.Regression coefficient beta (β) and X -loading weights were exploited to show which part of the spectral range mainly contributes to sample variability in terms of moisture content.

III. RESULTS AND DISCUSSION
The instrumental chain described above was first tested in the laboratory to estimate the depth of penetration in the soil of the radio frequency device, as described in the Materials and Methods.As an example, the real part of S11 of the soil analyzed with and without a metal plate placed at a depth of 28 cm is shown in Fig. 3.As observed, at this depth, the antenna is still sensitive to the metal plate.Accordingly, even if empirical, the penetration depth of the device can reach at least 28 cm, considering soil characterized by a low moisture content (5%).
In Fig. 4, the real, imaginary parts, and magnitude of the S11 for the in-field soil measurements, colored to distinguish differences in moisture content, are shown in the frequency range of 1.5-3.0GHz.
As observed, variations in moisture produce spectral modifications in terms of peak intensity and slope.The largest differences can be appreciated in the first part, between 1.5 and 1.9 GHz, of the frequency range, considering real, imaginary, and magnitude.In particular, magnitude does not show an apparent, univocal behavior according to variations in the moisture content.Thus, a different effect of water in terms of absorption or reflection can be observed within  the spectral range.The phenomenon could be related to the complexity of the characteristics of the device-soil system (e.g., the cavity antenna's geometry, soil's cloudiness, and radiation mode close to near-field conditions).As observed in previous research, for different types of soils changes in the moisture content led to appreciable differences in the spectral waveforms in the 1.5-2.7 GHz frequency range in terms of gain and phase, especially in the 1.5-1.9GHz and 2.5-2.7 portions [21], [22].
Water is the main physical substance in the microwave range that produces electromagnetic wave interaction, and the above-cited ranges seem promising for their indirect estimation of water in different soil types [40].It is known that soil texture can affect measurements and related regression models; however, tailored sensor calibrations with several soil textures and dedicated regression models could be a means of overcoming this.
Results in terms of R 2 , RMSE, LVs, and bias of calibrated and validated PLS regression models obtained from averaged real and imaginary parts of S11 spectra are summarized in Table II.
Considering the real part of S11, PLS-validated models demonstrated a good prediction ability in terms of R 2 values ranging from 0.854 (Segmented) to 0.825 (Test set) and RMSE values (between 4.4% and 4.9%).The imaginary part reaches slightly higher results with R 2 values ranging from 0.872 (Segmented) to 0.862 (Test set), and RMSE values ranging from 4.1% to 4.3%.Another parameter confirming the good performance of the model is the low values of bias or the error linked to the prediction.Considering the variability of soil samples measured in the field, the wide range of the moisture content, and the influence of temperature, PLS regression models seem to accurately estimate the moisture content (%).Better prediction appeared to be related to the imaginary part of S11, while the magnitude of S11 did not improve the predictive performance of the model.
Predicted versus observed values of moisture content (%) for segmented validation and calibration of PLS models (see Table II) for both real and imaginary parts are shown in Fig. 5.
The regression model of the real and imaginary parts of S11 yields an equation in which the regression β-coefficient and X -loading weights express a linear combination between observed and predicted values.Accordingly, which part of the signal contributes mainly to explaining data variability Authorized licensed use limited to the terms of the applicable license agreement with IEEE.Restrictions apply.by plotting the β-coefficient (Fig. 6) and X -loading weights (Fig. 7) against frequency can be observed.
For both real and imaginary parts of S11, the maximum variation of the β-coefficient and X -loading weights of the first three LVs are around 1.6 and 2.6 GHz.
These two-frequency sub-ranges are the most sensitive for the cavity antenna, as shown in Fig. 8, which describes the soil reactance (X ) versus frequency (Hz) (moisture content of 45%).
The values of the maximum sensitivity of the cavity antenna are represented by the points in which the reactance (X ) (45% of soil moisture content) is zero, and it behaves as a resonator.These two sub-ranges, around 1.6 and 2.6 GHz, correspond to the frequency with the highest spectral variability.In addition, several studies have previously identified the frequency range 1.6-2.6GHz as one of the promising for estimation of moisture content.Accordingly, the β regression coefficient and X -loading weights of the models show the highest variability in these frequency ranges and contribute to the highest prediction of moisture content (%).

IV. CONCLUSION
A rapid, simple, and nondestructive technique based on a cavity antenna coupled with a VNA was established to assess moisture content directly in the field on silty-clay-loam soil.The device's accuracy, as far as the device penetration was examined by providing a considerably mature base for commercial needs.At present, the economic aspect is important for large-scale implementation, and the device presented meets this requirement, with a current estimated cost of $200 USD.
Real and imaginary parts of were used to build PLS multivariate models.The best results in terms of coefficient of determination R 2 values were 0.854 (RMSE 4.4%) for the S11 real part and 0.872 (RMSE 4.1%) for the S11 imaginary part (segmented validation).The best external validation results regarding R 2 values were 0.825 (RMSE 4.9%) and 0.862 (RMSE 4.3%) for the real and imaginary parts, respectively.The optimal operating bandwidth was determined to be from 1.5 to 2.6 GHz.The limited bandwidth could give further strength to the affordability of the device.
The cost-effective and easy-to-use device that can monitor in real-time and regulate moisture levels in the field appears and worthy of being further improved to meet the needs of agricultural in an increasingly digitized V. FUTURE WORK Future studies should be carried out to validate the feaof the device for soil moisture estimation in soil characterized by different granulometry and cloudiness.For this purpose, the development of calibration models that are to a certain soil type may be required.One possibility, already implemented on other instruments, could be to perform and test different predictive models (e.g., based on nonlinear PLS or artificial neural network) on the same samples or samples with similar characteristics.Moreover, some attempts be made to implement a single model for a cluster of soil typologies considering only the three main types: silty, loam, and clay.

Fig. 1 .
Fig. 1.Instrumentation layout comprises a rectangular cavity antenna, a NanoVNA, and a personal computer.

Fig. 3 .
Fig. 3. Real part of S11 of soil (5% moisture) with and without a metal plate at a depth of 28 cm.

Fig. 4 .
Fig.4.Real and imaginary parts and magnitude of S11 highlight differences in spectra due to moisture content.