**6. Discussion**

Measurement outcomes have been discussed in the relevant sections. In this section, we add some comments and considerations that will help to clarify the experimental observations and will allow us to extract the VWC from the output voltage of the Capacitive Soil Moisture Sensor v1.2.

In principle, the results of the reference sensor and the Capacitive Soil Moisture Sensor v1.2 could not exactly be correlated since:


Regarding the first observation, sample preparation described in Section 4 included an accurate packing mechanism to achieve vertical homogeneity. However, this sample preparation does not guarantee uniform compaction of the soil. In [8] we demonstrated that compaction has an obvious strong influence on the results of the Capacitive Soil Moisture Sensor v1.2. The 10 cm distance between the reference sensor and the Capacitive Soil Moisture Sensor v1.2 could affect water content measurement accuracy and cause a discrepancy between the reference and the low-cost sensor. Non-uniform watering is a second source of non-uniformity, even if watering was manually performed trying to evenly distribute water. Therefore, non-uniform soil compaction and watering represent a random added error to our measurements, which should be kept at a minimum using experience and best practices.

Regarding the temperature variations during the measurements, temperature compensation of VWC could be feasible. This task has been demonstrated to be necessary in the case of a temperature spanning about 20 ◦C [27]. In that case, backpropagation neural networks have been successfully adopted for correcting the soil moisture information from a low-cost sensor using soil temperature data. However, in our experiment, the temperature variations are significantly smaller, about 2 ◦C, and a correction was not implemented.

Differently from the previous sources of error, the possible error due to different depths of the reference and the low-cost sensor could be taken into account by properly modeling infiltration and redistribution of water during and after rainfall [69–71] as explained in the next subsections. In detail, in Section 6.1 we introduce a consolidated infiltration model available in the literature to obtain the soil water content at any depth, whereas in Section 6.2 we correlate the described Capacitive Soil Moisture Sensor v1.2 output voltage with the prediction of the infiltration model for the two different soils.

#### *6.1. The Modeling Infiltration and Redistribution of Water*

To obtain the soil water content at any depth, *z*, the Corradini et al. [72] infiltration model was used (hereafter named "C et al. (97)"). As shown by Melone et al. [70,71], this model can accurately represent the infiltration process during complex rainfall patterns involving rainfall hiatus periods.

The model was derived considering a constant value of the initial soil water content, *θi*, and combining the depth-integrated forms of the Darcy law and continuity equation [72]. In addition, as the event progresses in time, *t*, a dynamic wetting profile, of the lowest depth *Z* and represented by a distorted rectangle through a shape factor *β*(*θ*0) ≤ 1, was assumed. The resulting ordinary differential equation is

$$\frac{d\theta\_0}{dt} = \frac{(\theta\_0 - \theta\_i)\beta(\theta\_0)}{F\left[ (\theta\_0 - \theta\_i)\frac{d\beta(\theta\_0)}{d\theta\_0} + \beta(\theta\_0) \right]} \left[ q\_0 - K\_0 - \frac{(\theta\_0 - \theta\_i)G(\theta\_i, \theta\_0)\beta(\theta\_0)\,pK\_0}{F'} \right] \tag{4}$$

where *p* is a parameter linked with the profile shape of the soil water content, *θ*, *θ*0 is the soil water content at the surface, *K*0 is the hydraulic conductivity at the soil surface, *F* is the cumulative dynamic infiltration amount, and *G*(*θi*,*θ*0) is expressed by the following equation:

$$G = \frac{1}{K\_s} \int\_{\theta\_i}^{\theta\_s} D(\theta) d\theta \tag{5}$$

where *θ*0 and *K*0 were replaced by *θs* and *Ks*, with *Ks* the saturated hydraulic conductivity. *D*(*θ*) is the soil water diffusivity, defined by *D*(*θ*) = *K*(*θ*) *∂ψ∂θ* , where *K* is the hydraulic conductivity and *ψ* the soil water matric potential. Equation (4) can be applied until a second rainfall pulse happens, with the profile shape of *θ*(*z*) approximated [72] by

$$\frac{\theta(z) - \theta\_i}{\theta\_0 - \theta\_i} = 1 - \exp\left[\frac{\beta z(\theta\_0 - \theta\_i) - F'}{(\beta - \beta^2) - F'}\right] \tag{6}$$

Functional forms for *β* and *p* were obtained by calibration using results provided by the Richards equation applied to a generic silty loam soil, specifically:

$$\beta(\theta\_0) = 0.6 \frac{\theta\_s - \theta\_i}{\theta\_s - \theta\_r} + 0.4 \tag{7}$$

$$
\beta \cdot p = 0.98 - 0.87 \exp\left(-\frac{r}{K\_s}\right) \quad \frac{d\theta\_0}{dt} \ge 0 \tag{8}
$$

$$
\beta \cdot p = 1.7 \quad \frac{d\theta\_0}{dt} < 0 \tag{9}
$$

Equation (4) can be solved numerically. For *q*0 = *r*, with *F* = (*r* − *Ki*)*<sup>t</sup>*, it gives *θ*0(*t*) until time to ponding, *tp*, corresponding to *θ*0 = *θs* and *dθ*0/*dt* = 0, then after *tp*, with *θ*0 = *θs* and *dθ*0/*dt* = 0, it provides the infiltration capacity (*q*0 = *fc*) and for the period with *r* = 0, with *q*0 = 0, it gives *dθ*0/*dt* < 0 thus describing the redistribution process.

The involved parameters were estimated through the volume balance criterion along with a best-fit procedure for the water content measured at 5 cm depth by the reference sensor. The initial water contents were set equal to those observed before each experiment, which was found to be almost invariant with depth. Figure 18 shows the results of the model calibration for both the study soils at different depths.

**Figure 18.** Modeling results for infiltration and redistribution of water ("C et al. (97)" model) during and after rainfall at different depths (1, 2, 3, 4, and 5 cm) for (**a**) Silty Loam and (**b**) Loamy Sand. The model was calibrated with respect to the measured values at a 5 cm depth (Reference sensor). For example, in the figure "C et al. (97)\_1" stands for the modeling result at a 1 cm depth.

#### *6.2. Correlation of the Capacitive Soil Moisture Sensor v1.2 Output Voltage with the Prediction of the Hydraulic Model*

In Section 3.1.1 we listed two equations used to correlate and calibrate the output voltage of the Capacitive Soil Moisture Sensor v1.2 with certified water content for two different types of soil: Silty Loam and Loamy Sand. However, the experiments described in the present paper provide a reference water content at an average depth of 5 cm, which is for sure greater than the average detection depth of 2 or 3 cm of the Capacitive Soil Moisture sensor v1.2, which spans a depth from 0 to 5 cm. A possible solution to this problem is to correlate the VWC from Equations (2) and (3) with the extrapolations of the infiltration and distribution Corradini et al. model at a depth of 2 or 3 cm.

In the remainder of the paper, we show the results obtained for the two different soils.

#### 6.2.1. Water Content in Silty Loam

A three-parameter least-square best fit was calculated between the VWC function obtained using the Corradini model (hereafter indicated as "C et al. (97)" [72] at different depths of 2 and 3 cm, with Equation (1), obtaining two triplets of A, B, and C values shown in Table 3 where the Placidi model "P et al. (20)" [8] is referred to different depths. Similarly, a two-parameter least-square best fit was calculated with the Hrisko model "H (20)" at 2 and 3 cm depths and the model from "C et al. (97)", obtaining two couples of P and Q values shown in Table 3.

**Table 3.** Least-square best-fit parameters of Equations (2) and (3) in Silty Loam.


The plots reporting the water content obtained by using the three models for the two different depths are reported in Figure 19.

**Figure 19.** Comparison among the water infiltration and redistribution "C" model for Silty Loam at a depth of 2 and 3 cm with the VWC obtained from the voltage measured by Node #1 using Equation (2) ("P" curves) and Equation (3) ("H" curves).

In Figure 20 a statistical analysis between all the possible couples of the "C et al. (97)" model and voltage measured by Node #1 using Equation (2) ("P" curves) and Equation (3) ("H" curves) at different depths has been reported. The analysis has been performed by using scattering plots, cross-correlation values, and kernel density estimation accomplished by using the Seaborn Python3 tool [73]. In the figure, the eight plots in the main diagonal are the calculated histograms of the corresponding eight quantities, together with the estimated Gaussian mixture probability density function. The plots in the lower triangular part represent the scattering plots of each couple of quantities, together with the locally weighted

regression curve whereas the values in the upper triangular part, instead, represent the correlation coefficients between each couple of quantities.

**Figure 20.** Statistical analysis with scattering plots, cross-correlation values, and kernel density estimation (KDE) obtained by using the Seaborn Python3 tool [73–75] in Silty Loam.

Looking at homogeneous values (i.e., correlation data obtained at the same depth), The best correlation values we obtained (0.94) are between "C et al. (97)" and "P et al. (20") at a depth of 3 cm. The 0.94 correlation coefficient is slightly greater than the value of 0.91 obtained between "C et al. (97)" and "P et al. (20)" at a depth of 2 cm. In Figure 21 the comparison among the best results obtained from the correlation are reported for the three models. Even if peaks and valleys of the hydraulic model are not always perfectly reproduced by the Capacitive Soil Moisture Sensor v1.2 fitting equations, the overall behavior of the "P et al. (20)" model can capture the main features of the VWC at a shallow depth. We note that, due to the peculiarities of experimental systems involving natural soils, it is impossible to obtain results that are completely reproducible from mathematical schemes. For example, inserting different sensors into the soil produces different preferential waterways that can turn out in minimally different results, especially when the experimental behavior is compared with mathematical model performances.

**Figure 21.** Comparison among the best results obtained from the correlation procedure for the three considered models.

#### 6.2.2. Water Content in Loamy Sand

A three-parameter least-square best fit was also calculated in Loamy Sand between Equation (1) and the VWC function obtained using the "C et al. (97)" model at different depths of 2 and 3 cm. The two triplets of A, B, and C values are reported in Table 4 where the model "P et al. (20)" is referred to different depths. Similarly, a two-parameter least-square best fit was calculated with the Hrisko model "H (20)" at 2 and 3 cm depths and the model from "C et al. (97)", obtaining two couples of P and Q values shown in Table 4.


**Table 4.** Least-square best-fit parameters of Equation (2) and Equation (3) in Loamy Sand.

The plot with the water content for the three models for the two different depths is reported in Figure 22.

**Figure 22.** Comparison among the water infiltration and redistribution "C" model for Loamy Sand at a depth of 2 and 3 cm with the VWC obtained from the voltage measured by Node #1 using Equation (2) ("P" curves) and Equation (3) ("H" curves).

Then a statistical analysis with scattering plots, cross-correlation values, and kernel density estimation was accomplished by using the Seaborn Python3 tool (Figure 23) between all the possible couples of models at different depths. Looking at homogeneous values (i.e., correlation data obtained at the same depth), the best correlation values we obtained (0.58) are between "C et al. (97)" and the "Hrisko model". A much worse correlation was obtained for Loamy Sand compared to Silty Loam. However, as highlighted in [54], the behavior of coarse-textured soil (as the Loamy Sand) can be mathematically modeled with greater difficulty than that of fine-textured soil (as the Silty Loam).

**Figure 23.** Statistical analysis with scattering plots, cross-correlation values, and kernel density estimation (KDE) in Loamy Sand.

Figure 24 shows the comparison among the best results obtained from the correlation procedure. Even if a first sight comparison of the three curves shows significant differences, it should be noted that for practical applications of sensors for measuring the soil water content, differences of a few percent are often irrelevant.

**Figure 24.** Comparison among the best results obtained from the correlation procedure for the three considered models.
