Low-Cost and Low-Frequency Impedance Meter for Soil Water Content Measurement in the Precision Agriculture Scenario

The use of low-cost embedded devices with ubiquitous connectivity systems is a possible strategy to monitor the consumption of water used in agriculture even in countries that do not have good economic resources. In this article, we propose a low-cost system based on a measuring approach of capacitive soil water content (SWC) sensors never explored previously. This solution takes advantage of the sensor properties to respond to the need to measure at the same time salinity and soil volumetric water content. For this purpose, a bifunctional system based on a modified commercial capacitive sensor and an AD5933 impedance converter integrated circuit (IC) is described. The considered frequency range for impedance measurements is 10–100 kHz, which is a “low-frequency” range compared with typical operating frequencies of professional systems devoted to water content measurements. Measurements are carried out to check the system accuracy and to characterize the impedance of the sensor both in the air and in water, which represent the two boundaries of possible operating conditions in physical soils in terms of the real part of the electrical permittivity. Variations of the imaginary part of the electrical permittivity are taken into account using water with conductivity between 1 and $2300~\mu \text{S}$ /cm. Experimental results are compared with the measurements obtained by using a laboratory inductance in honor of Heinrich Lenz, capacitance and resistance (LCR) meter, and a maximum error of +6.12% for the capacitance and +5.6% for the conductance is obtained. The proposed system is also employed to characterize silica sandy soil with different water contents and conductivities showing quite promising results useful to overcome the well-known limits of low-cost SWC sensors.

Abstract-The use of low-cost embedded devices with ubiquitous connectivity systems is a possible strategy to monitor the consumption of water used in agriculture even in countries that do not have good economic resources. In this article, we propose a low-cost system based on a measuring approach of capacitive soil water content (SWC) sensors never explored previously. This solution takes advantage of the sensor properties to respond to the need to measure at the same time salinity and soil volumetric water content. For this purpose, a bifunctional system based on a modified commercial capacitive sensor and an AD5933 impedance converter integrated circuit (IC) is described. The considered frequency range for impedance measurements is 10-100 kHz, which is a "low-frequency" range compared with typical operating frequencies of professional systems devoted to water content measurements. Measurements are carried out to check the system accuracy and to characterize the impedance of the sensor both in the air and in water, which represent the two boundaries of possible operating conditions in physical soils in terms of the real part of the electrical permittivity. Variations of the imaginary part of the electrical permittivity are taken into account using water with conductivity between 1 and 2300 µS/cm. Experimental results are compared with the measurements obtained by using a laboratory inductance in honor of Heinrich Lenz, capacitance and resistance (LCR) meter, and a maximum error of +6.12% for the capacitance and +5.6% for the conductance is obtained. The proposed system is also employed to characterize silica sandy soil with different water contents and conductivities showing quite promising results useful to overcome the well-known limits of low-cost SWC sensors.
Index Terms-Capacitive soil moisture sensor, circuits and embedded systems, instrumentation and nondestructive measurement in environmental monitoring, low-cost sensor, precision agriculture (PA), soil water content (SWC) measurement.

I. INTRODUCTION
T HE increase in the world population and environmental challenges (climate change and natural disasters) Fig. 1. PA scenario. In the figure, being the soil element a porous material, its multiphase has been highlighted: solid, liquid (generally water), and gas. The volumetric water content is V w /V , where V w is the water volume and V = V s + V w + V a , the total volume (with V s and V a the solid soil particles and the air volume, respectively).
are leading farmers to adopt advanced techniques to reduce water waste and simultaneously optimize crop productivity. Therefore, it is a crucial task to find alternative solutions for measuring soil water content (SWC) using low-cost sensors, accessible to everyone in terms of cost and the technological skills required for their use [1], [2], [3]. SWC is one of the main soil physical properties to be monitored in agriculture and it is influenced by factors, e.g., infiltration and soil fertilization [4]. SWC sensors are usually installed in the soil at different depths and, while measuring, they transmit soil properties in real time to a central station by exploiting wireless sensor networks (WSNs). In the frame of the Internet of Things (IoT) precision agriculture (PA) technologies [5], [6], they should also offer low-cost sensing and additional environmental parameters, such as temperature and soil electrical conductivity (also linked to the presence of fertilizers). A typical scenario is illustrated in Fig. 1, where sensitive elements ("plant node") observe SWC, building a low-cost and wireless network [7] to provide optimal conditions for plant growth, as well as ensure intelligent and automatic irrigation to minimize the waste of a precious asset, such as water [8], [9].
Sensors for monitoring environmental parameters are also widely used in different engineering fields, including soil morphology physics, agronomy, geotechnics, and hydraulics [7], [10]. Among these sensors, the most problematic from the cost and performance point of view is certainly the sensor dedicated to the detection of SWC [11]. A standard reference method for identifying SWC is   I  STUDIES ON SOIL MOISTURE SENSORS BASED ON THE CAPACITANCE PRINCIPLE the thermogravimetric technique, which is laborious, timeconsuming, and destructive to the soil [12]. Modern techniques mainly involve sensors classified as electrochemical, electrical and electromagnetic (EM), and optical and radiometric [13]. The most commonly used sensors in PA are electrical and EM sensors due to their easy interfacing with WSN and IoT systems as well as their sturdiness and lower design cost compared to other SWC sensors [11], [12]. Most of these sensors guarantee excellent performance and typically work in the very high-frequency (VHF) band  or even at higher frequencies. Nevertheless, they are still expensive for the PA domain ranging between U.S. $150 and U.S. $5000. One of the most widely used in situ approaches for simultaneous water content and electrical conductivity monitoring is time-domain reflectometry (TDR). However, the price of TDR equipment is U.S. $3000 or more [11].
A well-known alternative to TDR is the class of capacitive SWC sensors. Their capacitance depends on the soil's apparent permittivity. Low-cost capacitive sensors typically consist of coplanar metallizations, which generate capacitances (C) whose value correlates to the relative dielectric constant of the material around them [14]. The dry soil generally has a very low relative dielectric constant (∼4) so, as it becomes wet, its relative dielectric constant is modified tending to that of water (which on the contrary is very large, ∼80). Even for low-cost capacitive sensors water salinity, hence, conductivity strongly affects the equivalent capacitance, as we will show in the following. The literature describes the capacitance sensors as relatively sensitive to soil temperature, unsuited to some soils, and characterized by a small sampling volume [15]. This being said, several capacitance sensors are available due to their satisfactory reliability and economical convenience with respect to TDR. However, the capability of very low-cost capacitive sensors (easily purchasable in the worldwide internet market) to perform as reliable SWC sensors is still a matter of scientific debate. In Table I, a summary of some of these sensors and their main advantages and major findings are highlighted together with some relevant information [16].
Low-cost capacitive sensors do not discriminate the water content in the soil with particularly high resolutions [11], [17], [18], [19], [20], [21], [22], [23], [24]. Therefore, although they are used in many applications as threshold sensors able to recognize whether the soil is wet or not, such sensors cannot be used in applications, where PA strategies are intended to be adopted, to organize the irrigation phases [7], [21]. Accordingly, the knowledge of water content and salinity is essential to the development of new irrigation systems. Consequently, in this article, an impedance measuring approach never explored previously in this field has been used. This solution exploits the sensor structure's capacitive properties to respond to the need to measure at the same time salinity and SWC [25], [26]. Salinity sensing is based on the measurement of the electrical conductivity of the soil. The nutrients in the ground modify its conductivity as measured by an electronic system [27], [28]. In a certain range of frequencies, soil capacitance depends not only on water content but also on its ionic composition [29]. In [30], a new original capacitive bifunctional sensor to measure soil moisture and salinity has been presented. The multiplication of measurement points makes it possible to reach areas sufficiently representative of the soil's hydric condition on the scale of a massive agricultural operation. Several systems have already been created, but either their cost largely limits their deployment [31] or the existing system is technologically limited for large-scale use [32].
This article extends the results reported in [33], where a bifunctional system based on a modified commercial capacitive sensor and an AD5933 impedance converter integrated circuit (IC) is introduced. The operating frequency range of interest for impedance measurements is 10-100 kHz, a "lowfrequency" range compared with typical operating frequencies of a professional system dedicated to SWC measurements and a frequency interval, where ICs based on operational amplifiers still operate within specifications. At a given frequency, soil electrical admittance depends not only on water content but also on soil ionic composition. The same holds for each component of the equivalent parallel capacitor-resistor (CR)circuit of the admittance. A parallel model was preferred since generally a parallel equivalent circuit better models a high-impedance circuit and the measured impedance values in the chosen frequency range are always greater than 1 k , up to several megaohms. Moreover, our impedances are mainly capacitive, and we prefer to model dielectric losses with a conductance. As frequency changes, the relative magnitude of the C and R components changes as well. Thus, by taking at a given frequency one complex (vectorial) admittance measurement (real and imaginary parts), in principle, the same sensor can obtain both water content and salinity. The rest of this article will also help to clarify this subject. In this work, we have extended the characterization of the system by improving the connection of the sensitive element to the acquisition system to improve the repeatability of the measurement. This investigation was carried out with the dual purpose of 1) acquiring more information on the sensitive element to identify a customized structure and a low-cost technology integrating both the sensor and the conditioning/reading electronics, eliminating external wirings and 2) characterizing the performance of the selected conditioning/reading circuit.
Compared with the literature in the areas summarized above, the novelties of this article are as follows.
1) A low-cost impedance meter normally exploited in other fields is extensively characterized for the first time to measure the impedance of the soil providing information on water and ionic content. The proposed measurement system features an expected compact size, low complexity, and low cost. It does not employ complex benchtop laboratory instrumentation. This system is tested in two extreme and homogeneous environments, i.e., air and water with very different conductivities. Air and water represent the two boundaries of possible operating conditions in terms of the real part of the electrical permittivity. All the physical soils should be included in this range. Variations of the imaginary part of the electrical permittivity were taken into account using water with conductivity between 1 and 2300 µS/cm. The system is also tested to characterize silica sandy soil with different water contents and conductivities to verify if it is able to overcome the well-known limits of low-cost SWC sensors. 2) The system accuracy is investigated by always comparing the experimental data with the measurements obtained by using a costly laboratory inductance in honor of Heinrich Lenz, capacitance and resistance (LCR) meter and a test setup to improve repeatability. 3) The sensitive element limits are investigated by considering different water conductivities and by monitoring the equivalent impedance, immersed in water and after it is removed from the water, as a function of the time to verify the effect of the waiting time between two measurements allowing us to improve the repeatability of the measurement itself. 4) The dependence of the measured admittance on the water temperature is also investigated. 5) Finally, the developed SWC sensor has been tested in silica sandy soil for two different SWCs demonstrating quite promising results in a real ambient for a sensor fabricated using commercially available low-cost technologies, i.e., a coplanar plate capacitor on a printed circuit board (PCB) substrate and an IC plus some other active and passive components.

II. CAPACITIVE MOISTURE SENSOR
In this article, a capacitance probe has been used for sensing water content. It is well known [34] that the output of a capacitive sensor for water content detection in the soil depends on the complex relative permittivity ε * r of the soil (dielectric medium) where ε ′ r and ε ′′ r are the real and the imaginary part of the relative permittivity, respectively, j is the imaginary number √ −1, ε ′′ relax is the molecular relaxation contribution (dipolar rotational, atomic vibrational, and electronic energy states), σ is the electrical (ionic) conductivity, and f is the frequency. The changes in the complex relative permittivity of the soil are mainly affected by the presence of water. Fig. 2 shows the dielectric permittivity of water as a function of frequency with σ as a parameter.
The real part of the relative permittivity (ε ′ r ) measures the extent of the external electric field energy stored in a material, while the imaginary part (ε ′′ r ), i.e., the "loss factor," quantifies the dissipative or lossy properties of the material to an external electric field: ε ′′ r > 0. The electrical conductivity parameter and the relaxation property are the two main processes associated with losses. When frequency increases, slower mechanisms are no longer operating and every cutoff frequency corresponds to an abrupt decrease of ε ′ r and a peak of ε ′′ r . Relaxation typically occurs at frequencies higher than VHF, where our system is blind, while dielectric losses due to electrical conductivity mostly affect ε ′′ r at frequencies under 10 MHz, an ideal condition for a system based on an AD5933 impedance converter, able to operate up to 100 kHz. For a physical soil, the dielectric properties of the soil particles are intermixed with those of the liquid contained in the soil and changes in electrical conductivity are mainly due to the water salinity and ionic content.
For a capacitive sensor, the electrical equivalent circuit includes a component whose capacitance can be written as where G 0 is a geometric factor, ε 0 is the vacuum permittivity, and ε * r is the soil permittivity. However, the capacitance and conductance of the equivalent parallel circuit of the complete sensor also include the electrical properties of the other building materials of the sensor: FR-4, solder mask, and so on, as explained in detail in Section II-A. In Fig. 3, the used commercial "Capacitive Soil Moisture Sensor v1.2," manufactured by DFROBOT and previously advertised with the name SKU:SEN0193, has been portrayed [14], [20], [21], [22], [35], [36], [37]. The sensor has been produced by using a commercial PCB process and the cost is about U.S. $2, a very low cost when compared with other solutions available on the market and in [7] and [38]. A detailed analysis of the electrical circuits for reading the sensor (analog readout in the figure) is reported in [21], where it was shown that the duty cycle and operating frequency of the sensor are about 34.5% and 1.5 MHz, respectively. The very same circuit was published at a later time in [37], but the chosen operating frequency and duty cycle were 430 kHz and 55%, respectively. For the activity reported in this article, the "Capacitive Soil Moisture Sensor v1.2" was heavily modified and customized as highlighted in Fig. 3.
To better characterize the sensitive element (in Table II, the estimated geometric parameters are reported), the main electronic components were desoldered and two measuring wires of equal length (about 6 cm) were directly soldered onto the pads (pads #1 and # 2) connected to the two coplanar plates of the stripline capacitor [see Fig. 3(a) and (b)]. The parasitic contribution of the wires to the measured capacitance has been characterized, and it was found to be of the same order of the sensor capacitance in air, described in Section IV-B. Instead, this parasitic contribution can be neglected when considering the measurements in water ambient (see Section IV-E).

A. Finite Element Simulations
Low-frequency finite element modeling (FEM) simulations of the electrical behavior of the capacitive sensor were carried out using CST Studio Suite EM field simulation software [33]. This study aimed to understand how the measured admittance Y X of the sensor is associated with the frequency, real part of the dielectric constant, and conductivity of the environment in which the sensor is immersed where C X (ε ′ r , σ, f, T, ) and G X (ε ′ r , σ, f, T, ) are the capacitance and conductance of the equivalent parallel circuit, T is the temperature, and indicates the complete set of electrical and geometrical properties of the materials, which compose the sensor (FR-4, solder mask, etc.) and the test fixture (if present). Differently from what simple intuition could tell us, (3) shows that the capacitance of the equivalent parallel CR circuit is a function not only of the frequency and of ε ′ r but also of the soil conductivity. Dealing with FEM, we follow a bottomup approach, i.e., starting from a known set (ε ′ r , σ, f, T, ), we calculate (and possibly measure) C X (ε ′ r , σ, f, T, ) and G X (ε ′ r , σ, f, T, ). Therefore, a deep knowledge of the sensor and soil material properties at a given temperature will be required, together with proper modeling and calibration for each soil medium, in order to extract its water content and conductivity. In [33], it was shown that in water, for a fixed frequency (e.g., 50 kHz) and for constant dielectric parameters [ε ′ r and tan(δ)] of both FR-4 and solder mask, the capacitance of the equivalent parallel model monotonically increases in 1-100-µS/cm conductivity interval (10 −4 -10 −2 S/m) and then saturates. Moreover, for a constant soil conductivity (e.g., a low value of 1 µS/cm), the capacitance of the equivalent parallel model features an overall increasing behavior as a function of ε ′ r , while, in general, G X decreases. Finally, a monotonic behavior was found for C X and G X as a function of both ε ′ r (1-80) and frequency (9-1500 kHz). FEM simulations also showed that in water, the electric field extends only a few millimeters from the sensor. Therefore, the holder should not modify the qualitative behavior of C X and G X .

III. EXPERIMENTAL SETUP AND SYSTEM ARCHITECTURE
The measurement system (see Fig. 4) was built around the EVAL-AD5933EBZ evaluation board housing an AD5933 IC [39], [40], [41]. A dedicated test fixture was designed and fabricated to hold the capacitive sensor during measurements. The sensor is fastened by a PET-G fork, which is inserted into the two lateral notches of the sensor. Ambients featuring maximum distance of the real part of the permittivity were considered, i.e., air (ε ′ r = 1) and water (ε ′ r ∼ = 80). In order to take into account different water conductivities, several types of water were measured. The water surface level complies with the specification given in the datasheet of the sensor. Before every measurement in water, the internal surface of the test fixture underwent a multiple cleaning procedure, which used the same water that was going to be characterized. No fabrics were used for this rinsing to prevent the bonding of fibers to the internal surface of the test fixture.
The AD5933 IC is a low-frequency complete digital impedance meter, fully configurable with a serial I 2 C interface that generates the output sinusoidal waveform using a direct digital synthesis (DDS) block. The DDS block is clocked by an internal oscillator operating at 16.776 MHz. The datasheet shows statistics on the clock frequency at 25 • C, always greater than 16.6 MHz and less than 16.95 MHz. The temperature coefficient of the oscillator is 30 ppm/ • C. In case better frequency accuracy was needed, an internal MUX could be switched and programmed to select an external, crystal-derived clock signal. The configuration of the IC has been carried out by using the application software supplied by analog devices [39]. A laboratory LCR meter (HP 4275A) [42] was also used for comparing the measurement results of the EVAL-AD5933EBZ board.

A. Hardware
In addition to the AD5933 IC, the EVAL-AD5933EBZ evaluation board includes an analog front-end (AFE) circuit to interface a Z X unknown impedance with a dynamic range from 1 k to 10 M (see Fig. 4). The AFE circuit reduces the output impedance with respect to the range-dependent output series resistance of the AD5933 IC (from 200 to 2.4 k , [40]), while the capacitor C OUT and the connected voltage divider constitute a dc offset adjustment circuit. In addition, it helps in protecting the input stage of the AD5933, whose function, in this case, is changed from a current to a voltage amplifier to a unity-gain inverting voltage amplifier. In the measurement, the offset of excitations is fixed to half of the power supply voltage, i.e., the analog ground of the circuit. The structure of the AD5933 circuit can be divided into three main parts (see Fig. 4). The first block is the excitation voltage generator (EVG block) and consists of a 27-bit DDS core to numerically synthesize the V OUT signal at the desired frequency, a digital-to-analog converter (DAC), and a programmable gain amplifier (PGA1) to determine the signal amplitude. V OUT is a sinusoidal voltage signal with frequency and amplitude programmable by the user from 1 to 100 kHz and 198/2 mV to 1.98/2 V, respectively [40]. The second one is the current measurement stage (CMS block), which relies on a currentto-voltage converter amplifier (modified by the AFE to a unity gain inverting voltage amplifier), a PGA2, and an antialiasing low-pass filter. The current conversion resistor R IN can be connected externally by the user and the adopted evaluation board adds a series R IN to create a unity gain inverting amplifier. The last one is the data processing stage (DPS block) consisting of a 12-bit analog-to-digital converter (ADC) and a 1024-point discrete Fourier transform (DFT) engine with a sample windowing unit and a DSP engine (MAC) to estimate the spectral power of the measured current at the corresponding excitation frequency. The result of the DFT of the AD5933 is a complex number; its modulus and argument are proportional to the magnitude and phase of the measured current through an unknown impedance Z X , which, for a constant amplitude of the voltage excitation, will also be proportional to the admittance of Z X .
The measurement process consists essentially of exciting the impedance Z X with a known voltage at a known frequency, then measuring the current flowing through the unknown impedance, and computing its complex (both the real and imaginary part) DFT coefficient (at the excitation frequency). The operation is repeated for as many excitation frequencies as desired by driving the I 2 C interface. For any given configuration, the DFT coefficient, which is an image of the complex current i X flowing in Z X , is inversely proportional to the unknown impedance. In the remainder of this article, we indicate with K p this proportionality factor. The K p proportionality factor can be deduced from a previous measurement of a known impedance in the same configuration (excitation voltage and frequency, gain settings). Thus, by sweeping the frequency range of interest, one can easily measure and compute the impedance spectrum of the sample. This system is based on an EVAL-AD5933EBZ evaluation board connected to a computer; nevertheless, it could easily be integrated with a transceiver, e.g., the LoRa SX1276 module hosted on the low power, small size, and relatively low price (about 20 C for a single unit) "Heltec WiFi-Lora 32 V2" board to realize a stand-alone IoT system [42]. The Heltec board is based on an ESP32 microcontroller and the SX1276 module is suitable for the European band EU868. In Table III, the autonomy of such a system has been measured by considering the average power consumption when it is powered with a 18 650 Li-ion battery with a capacity of 3000 mAh. In the table, the power consumption of the Heltec board has been characterized by considering the average consumption in 1 h with a power supply at 3.7 V when the two operating modes of the board are implemented, i.e., the system in the transmission mode (where the average current is I ON ) for a time equal to 2.49 s (t ON ) and in the deep sleep mode (where the average current is I DS ) in the remaining time. When the device wakes up from a deep sleep state, it starts the transmission by joining the LoRaWAN network; then, it sends data and goes back to deep sleep immediately after receiving a response from the gateway. In the table, we reported the worst case condition for the average power consumption occurring with a spreading factor (SF) equal to 12. For the AD5933 IC, we consider the I ON current value reported in the reference document when it is powered at 3.3 V [40]. The system is in the normal mode (average current I ON ) for a time t ON equal to 123 ms (100 ms for the measurements at ten different frequencies and 23 ms for calibration) and in the power-down mode (where the average current is I OFF ) in the remaining time. In Table III, we also estimated the average power consumption associated with some additional components of the EVAL-AD5933EBZ, i.e., opamps and voltage dividers. The power consumption of these additional components is clearly unacceptable for an IoT device suggesting the need for duty cycling their power supply, thus drastically reducing the overall power consumption. The system should take care of acquiring the real and the imaginary part of the impedance in a frequency range. Data processing should be done in the cloud. The extracted information also supported by data acquired from other sensors will be used to make decisions possibly supported by models.

B. Application Software and System Calibration
The AD5933 provides a complex number M X = M X Re + j M X Im , with M X Re and M X Im the real and imaginary data register values, respectively [39], [40]. These two figures are proportional to the complex value of the current measured through the unknown impedance Z X . For a constant amplitude of the voltage excitation, the current will also be proportional to the magnitude of the admittance Y X . By using the application software, it is possible to set the frequency range and granularity, the waiting time before each scan (number of settling times cycles), the clock source to be used for the circuit operation, the amplitude of the excitation voltage, and any gain to be applied to the response obtained from the system (PGA2 gain). The AD5933 must be calibrated by using a known impedance Z cal . The software allows the user to choose the system calibration impedance and calculate the K p proportionality factor (gain factor), which is essential to obtain the measured impedance value and for launching the measurements from the application. The system phase (θ p ) should also be calculated after each measurement point in the sweep by placing a resistor across A and B (see Fig. 4). To calculate K p and θ p , the following formula must be applied: where |M cal | = ((M cal Re ) 2 + (M cal Im ) 2 ) 1/2 is a magnitude parameter, not to be confused with the Z cal impedance magnitude. Knowing K p , the Z X = |Z X |e jθ X unknown impedance can then be estimated by calculating where |M X | = ((M X Re ) 2 + (M X Im ) 2 ) 1/2 is the magnitude parameter when Z X has been substituted to Z cal .
In our experimental activity, we preferred to calibrate with resistors (with a tolerance of 1%) due to their much smaller tolerances with respect to standard capacitors and the bigger parasitic effects of discrete CR components in a series or parallel connection. In addition, it should be underlined that the obtained error depends on the scanning frequency. The calibration was done at excitation frequencies between 5 and 100 kHz, divided into 16 ranges with about 10% fractional bandwidth, using calibration resistors Z cal of 1 k , 10 k , 51 k , 100 k , 470 k , and 1 M , with an R FB = Z cal feedback resistor, 2-Vpp DAC amplitude, and x1 PGA2 turned on. However, in the remainder of this article, we will only show results in the 10-100 kHz, where the measuring system proved to be more reliable. A single calibration resistance value will not be enough to measure the considered frequency range with the EVAL-AD5933EBZ evaluation board. Therefore, multiple calibrations were accomplished with different couples of resistors R FB = Z cal . In our experimental activity, two resistance values were sufficient for scanning the whole Authorized licensed use limited to the terms of the applicable license agreement with IEEE. Restrictions apply. 10-100-kHz frequency range in the water ambient. In the future, a customized autoranging procedure should allow us to choose the appropriate calibration resistance value (with proper K p and θ p ) suitable for the unknown impedance.
Data are saved on a PC by using a.csv file extension for each range. Then, a Python script has been written to enable a faster analysis by merging the files, formatting and processing the data, and returning additional information (resistance, reactance, capacitance, and inductance values considering an equivalent series and parallel model of the Z X impedance). The data obtained from the measurement will be used to find out the parallel equivalent circuit in Fig. 3.

IV. CALIBRATION, MEASURING, AND RESULTS
The test setup and the application software have been described in Section III. Different measurements were defined to characterize the system. 1) Check of system accuracy by using a reference capacitance C ref = 10 pF (about the equivalent capacitance in the air) and C ref = 330 pF (to characterize the system in the water).
2) The sensor in the air.
3) The sensor in the water. 4) Sensor impedance variation with time and water temperature. 5) Sensor impedance variation for several σ values. Conductivity data of the waters are directly provided by the suppliers. 6) The sensor in the soil. The measurement results were always compared with the measurements obtained using the laboratory LCR meter, taken as reference values. The measurements in air and water were done by fastening the sensor in a sensor holder empty or full of water. The holder (shown in Fig. 4) is a 90.5-mm-tall cylinder made of Delrin© with an external diameter of 80 mm and it was manufactured with a 76.2-mm-tall (3 ′′ ) concentric inside cylindrical hole featuring a diameter of 38.1 mm (1.5 ′′ ). On the upper end of the cylinder, a 10-mm-tall (0.39 ′′ ) annulus has been carved, useful for hosting a PET-G lid manufactured with an axial 3-D printer. This lid has a rectangular cavity of the same size as the sensor section to place the sensor in a known position, improving the repeatability of the measurements.

A. Check of System Accuracy
First of all, we characterized the system accuracy by considering two different discrete capacitors ("reference capacitors"), whose capacitance is of the same order of magnitude as those to be characterized, i.e., 10 pF, to simulate the capacitance measured by the sensor in the air (approximately 8 pF) and 330 pF, to simulate the capacitance measured by the sensor in water. Due to the relatively high tolerance of commercial capacitances (up to 20% and more), we selected capacitors as close as possible to 10 and 330 pF using the HP 4275A LCR meter. Data in different operating conditions were collected and the parallel CR model Z X of the unknown impedance was exploited. In Fig. 5, the parallel capacitance and conductance of the reference 10-and 330-pF capacitors in the considered frequency range are reported. Different curves correspond to different calibration resistors of the AD5933. The single points in the graphs represent the readings recorded with the HP 4275A LCR meter (4275A label in Fig. 5 and the remainder of this article). The comparison between the AD5933 and the HP 4275A measurements on the 10-and 330-pF reference capacitors shows a good agreement in the whole range of frequencies, provided the proper calibration resistance values are chosen.
In Fig. 5, the best measurement results for both capacitance and conductance were obtained using a 100-k resistor. Then, the uncertainty of the measurement was determined (see Table IV) by comparing the measurements of the EVAL-AD5933EBZ evaluation board (|Z X | M ) and of the reference HP 4275A instrument (|Z X | 4275A ). The measurement results of the AD5933 were reported by adding the measurement error calculated through the declared system accuracy of 0.5% [40]. Instead, the significant digits of the measurements taken with the HP 4275A LCR meter were obtained for the relevant accuracy specifications. In particular, the best accuracy for the impedance magnitude in our measurement range is obtained with a full scale of 1999. The instrument was used in high-resolution operating mode providing 5-1/2 digit resolution plus lesser significant digit data by averaging the measured values every ten measurements. However, the high-resolution operating mode does not add any digits to system accuracy.
In Table IV, the percentage error between the two measurements was obtained by considering the worst case condition. The absolute percentage error on the impedance magnitude increases as frequency decreases, but even in the case of a single calibration resistor with a frequency spanning one order of magnitude, the error is limited to −3.8%. The maximum absolute phase error, in this case, is about 1 • at the extremes of the frequency interval.
For the 330-pF capacitance, the uncertainty of the measurement should be investigated by considering two reference resistors: 1 and 10 k for the AD5933 (see Table V). The errors for the impedance magnitudes were calculated as before described for Table IV, whereas for the impedance phase, we referred to the specifications of the HP 4275A [43] for the impedance ranges considered in Table V, which are always better than 0.1 • . In this case, the 10-k calibration resistor has a lower overall percentage error in the magnitude for an operating frequency that belongs to the central part of the 10-100 kHz range. However, the conductance [see Fig. 5(b)] and the phase (see again Table V) have a significantly bigger error for a frequency around 100 kHz. In this particular case, a resistor of 1 k should be used to improve accuracy. This behavior is related to the dependence of the conductance on the phase of the impedance (see Fig. 6) In fact, the measured admittance could be rewritten as The relative error on the conductance can easily be calculated using the error propagation formula The error on the conductance increases steeply as the measured phase tends to −90 • . Therefore, we must be very cautious when measuring purely capacitive impedances with the AD5933. This is not the case with the measurements described in the remainder of this article.

B. Sensor in Air
In Fig. 7, the equivalent capacitance and conductance of the sensor immersed in the air and water are reported. To measure the system response, the sensor was simply inserted into the empty holder taking care to lock the sensor at the predetermined height. To increase the accuracy of the measurement system, all possible parasitic effects due to connections have also been reduced, by reducing the length of the connection cables between the sensor and the EVAL-AD5933EBZ. The calibration resistance that spans most of the range is 100 k (the same value used for the 10-pF sample capacitance); a better reading at low frequencies can be obtained by using a 470-k calibration resistor. Similar to the previous case, the percentage error on the magnitude of the sensor impedance was calculated using a single calibration resistance of 100 k . The worst case error for the absolute magnitude and the phase is smaller than 5% and 2%, respectively.

C. Sensor in Water
To carry out the measurements in water, the holder was rinsed and filled to a predetermined level. Fig. 8 shows the equivalent capacitance and conductance in water with unknown conductivity. In this case, the optimal calibration resistance is 10 k . For a good reading at low frequencies, a 100-k calibration resistor could also be used, but inadequate above 10 kHz. The equivalent capacitance slightly decreases with increasing frequency, while the equivalent conductance increases, in agreement with the simulations presented in [33], based on the permittivity of water ε ′ r = 78.4 and an operating temperature of T = 20 • C. These values can also be used to correctly estimate the phase. In this case, it should be underlined that as the frequency increases, the phase tends to move away from −90 • (see Fig. 9), since the measured impedance shows conductance components in parallel which increase with increasing frequency. Finally, the absolute maximum error obtained for the impedance magnitude and phase is equal to 4.8% and 1.89%, respectively. These first measurements in water were also useful for understanding how the AD5933based system behaves with respect to the HP 4275A for capacitance values measured in water.

D. Sensor Impedance Variation as a Function of Time
To investigate the variation of the sensor impedance when the probe has been immersed in water, a characterization of the sensor was performed by considering several water types with different σ values. In this section, we report on the water with a nominal σ = 25.5 µS/cm. Also, in this case, a calibration resistor of 10 k was used. In Fig. 10, the equivalent parallel capacitance (C p ) and conductance (G p = 1/R p ) when the sensor is immersed in water with a nominal σ = 25.5 µS/cm have been reported. The performed monitoring shows a significant variation in the first 2 h of sensor immersion. After 3 h, the absolute percentage difference between the collected data and the final value in a frequency range of  kHz is below 5% for the capacitance and below 15% for the conductance. This instability of the capacitive SWC sensor was previously reported in [22], [35], [36], and [37], where the samples were left for different time intervals (1-20 min) to attain equilibrium. Our measurements were always obtained after the careful cleaning procedure of the test fixture described in Section IV. It is therefore unlikely that the water contained in the test fixture would change its properties in 48 h. Instead, it is very likely that the water is absorbed by the sensor changing the dielectric properties of the different layers that make it up. According to most authors, a great part of this moisture incorporation will probably occur during the first minutes of soaking, but the process undoubtedly continues for several days. Starting from a dry sensor, from Fig. 10, the equivalent capacitance increases by 46% in 48 h at 10 kHz and decreases by 13% at 100 kHz. Instead, the equivalent conductance increases at all frequencies of the 10-100 kHz Capacitance and conductance of the equivalent parallel circuit measured by the sensor after it was removed from the water (σ = 25.5 µS/cm) it had been immersed in for 24 h.
interval. From the initial measurements in the wet ambient described in Section IV-D, it is evident that the materials and the manufacturing processes used for producing the low-cost SWC sensor are inadequate to guarantee the waterproofness of the sensor. In the opinion of the authors, the most significant measurements are those taken at time t = 0. However, it is almost impossible to take measurements immediately after placing the sensor in the unknown ambient. Therefore, further research on the building materials of low-cost sensors is necessary to guarantee their waterproofness.
Then, we investigated the sensor electrical behavior after it was removed from the water it had been immersed in for 24 h (see Fig. 11). Through data analysis, we found that the capacitance changed from the value the sensor showed before it was immersed in water is less than 1% after 30 min for all frequencies, while the conductance takes about 24 h to reach the same 1% value. This result suggests that the reduction of water absorption using efficient and better-suited coatings is a necessary improvement for the implementation of a new sensing element.
The analysis of the capacitance and conductance dependence on water temperature (see Fig. 12) has also been performed by considering three different temperatures of the water at an external ambient temperature of 20 • C. The impedance measurement was made immediately after immersing the sensor in the holder filled with water (σ = 25.5 µS/cm) at three different temperatures (T _H 2 O in the figure). The temperature probe is inserted directly into the holder before the immersion of the sensor. In the frequency range, the equivalent capacitance increases with the water temperature, while the conductance decreases until it reaches the same value at 100 kHz.
E. Sensor Impedance Variation as a Function of σ In Fig. 13, the equivalent parallel capacitance and conductance components are considered after the sensor was Capacitance and conductance of the equivalent parallel circuit measured by the sensor for three different water temperatures.
immersed in several water types with different conductivities for 4 h. In the figure, it can be noted that only the conductance increases with the frequency. Since the operating ambient is always water with an approximately constant value of ε ′ r , an inattentive reader could expect approximate constant values of capacitance. Instead, higher conductivities correspond to higher equivalent capacitances, in agreement with the conclusions of [33, Sec. III-A].
For all conductivity values, the equivalent conductance increases with increasing frequency. In addition, for the smallest conductivities (1 and 25.5 µS/cm), both capacitance and conductance show different behaviors when the frequency increases with respect to the waters with higher conductivity. For increasing conductivity, the general behavior of the parallel conductance in Fig. 13 shows a decreasing trend. This behavior should not be surprising. In fact, the conductance of the parallel model is G p = R S /(R 2 S + X 2 S ), where R S and X S are the series resistance and reactance, respectively. This parallel conductance features a maximum for R S = X S , and for R S < X S , the behavior is counterintuitive: for decreasing series resistance (i.e., increasing conductivity), the parallel conductance decreases as well. In Fig. 14, the percentage error between the AD5933 and the HP4275 values for the capacitance and conductance for waters with different conductivities is reported. The maximum errors for the capacitance and conductance are 6.1% and 5.6%, respectively.

F. Sensor in Soil for Different Water Contents
To investigate the variation of the sensor impedance when the probe has been immersed in soil, a characterization of the sensor as a function of water content was performed in silica sandy soil with a declared conductivity of 300 µS/cm (using UNI EN 13038). Samples were prepared using the gravimetric water content principle [44] with two different water conductivities σ 1 = 25.5 and σ 2 = 580 µS/cm, respectively. Due to the relatively high conductivity of the considered   sand, the impact of a small gravimetric percentage of the low conductivity (σ 1 ) water on the overall conductivity is almost negligible. Dry sand was prepared, a percentage of water was added, and the sample was hand mixed. Then, four different samples were prepared in sequence for each water conductivity. In this case, we used a plastic graduated cylinder with a diameter of 140 mm, wide enough to minimize the influence of the holder. In Fig. 15, the equivalent parallel circuit measured by the sensor immersed in the sand is reported for both water conductivities. In the figures, the water content spans the interval of 0%-15%. We verified that for this type of soil, larger water contents caused the measurements to be unreliable.
Looking at the plots, it is apparent that a measurement at a single frequency could not be enough for distinguishing the contribution of the water content and the conductivity to the measured admittance. However, considering the whole frequency range of the adopted digital impedance meter, Fig. 15 clearly shows the separated plots of both capacitance and conductance for several water contents. Moreover, different conductivities show different first-and second-order derivatives of the curves. This behavior looks quite promising for defining appropriate algorithms for extracting the unknown water content and salinity of a given soil, thus overcoming the well-known limits of low-cost SWC sensors, considered till now only as reliable threshold sensors.

V. CONCLUSION
In this work, a low-cost and low-frequency impedance meter based on the AD5933 IC for measuring capacitive sensors used in the PA scenario has been presented. For the experimental measurements, ambients featuring the maximum distance of the real part of the permittivity were considered, i.e., air (ε ′ r = 1) and water (ε ′ r ∼ = 80). The study aimed to understand how the measured admittance of the sensor correlates with both frequency and water conductivity. Different measurements were carried out to check the system accuracy and the equivalent impedance of the sensor in the air and different types of water characterized by conductivities between 1 and 2300 µS/cm. Experimental results were compared with the measurements obtained by using a laboratory LCR meter and a maximum error of +6.1% for the capacitance and +5.6% for the conductance is obtained for the measurements in water with six different conductivities. Moisture soaking was also detected in the materials used to manufacture the sensor, highlighting the necessity to improve the manufacturing process of low-cost sensors. The proposed system was also used to characterize silica sandy soil with different water contents and conductivities showing quite promising results useful to overcome the well-known limits of low-cost SWC sensors. In the future, the integration of an AD5933 IC and a microcontroller into the capacitive sensor board with proper calibration resistors will lead to a strong innovation in the field of IoT PA and, possibly, other engineering fields, whereas the measurement and monitoring of SWC is fundamental.