1. Introduction
Maintaining healthy, fertile soil requires frequent and rapid monitoring of electrical conductivity (EC), soil water content, and temperature, because EC is a direct indicator of soluble-salt content—and thus salinity stress—while temperature and water availability regulate microbial activity and nutrient uptake, ultimately affecting crop establishment and yield [
1,
2,
3,
4].
Several methods have been proposed for measuring soil EC. A widely used approach relies on electrode-based techniques, in which the measurement is performed directly in contact with the soil [
5,
6,
7,
8,
9,
10,
11]. This approach is simple and low-cost, yet its accuracy can be degraded by electrode polarization and resistance at the soil–electrode interface. Time domain reflectometry provides simultaneous measurement of soil water content and EC but requires more complex and expensive instrumentation [
12,
13]. Impedance spectroscopy has also been employed to characterize soil EC across a wide frequency range, offering rich information at the expense of higher cost and complexity [
14]. Despite these limitations, electrode-based AC techniques remain attractive for agricultural applications due to their simplicity, low cost, and portability—provided that proper circuit design and calibration are used to mitigate polarization and interface effects. Recent work further supports the reliability of this class of methods when improved electronic circuits and data-processing algorithms are adopted [
15].
Soil water content is equally important and can be determined using gravimetric or volumetric procedures as well as dielectric sensors. Although gravimetric drying is the laboratory reference for soil-water-content determination, it is labor-intensive and time-consuming, whereas dielectric techniques—such as frequency- and capacitance-based sensors—enable rapid measurements suitable for repeated field use [
11,
16,
17,
18]. Notably, recent years have seen growing reliance on wireless sensor networks in field deployments, enabling spatially distributed, real-time monitoring of soil water content and related parameters [
19,
20,
21].
Integrated and portable systems that assess soil temperature, soil water content, and EC together can substantially benefit precision agriculture, allowing practitioners to adapt promptly to changing soil conditions and optimize resource use. Various circuits have been developed to measure soil EC, often incorporating wireless communication units, microcontrollers, or signal-processing modules, and their reliable operation depends on careful design and implementation [
22]. In addition, recent studies indicate that the frequency used for EC measurements is related to salt concentration in the soil, and precise monitoring therefore requires understanding the interplay among frequency, ion concentration, and soil water content [
23].
Therefore, the objective of this study was to design and validate a low-cost, portable system for the simultaneous measurement of soil electrical conductivity, soil water content, and temperature using an AC bipolar pulse technique to minimize polarization effects and benchmark its performance against laboratory-grade measurements.
This study presents a dependable, lightweight, portable system for direct field measurement of soil temperature, soil water content, and EC. The device integrates a soil temperature sensor, a capacitive sensor for soil water content, and an AC bipolar pulse technique for impedance measurement determined by the constant current and voltage across the electrodes [
24,
25]. Four electrodes, arranged in two pairs, serve as EC and water-content sensors. The AC bipolar pulses used for EC monitoring are generated by a circuit that includes a peak detector, a precision half-wave rectifier, and a constant-current bipolar stage, which together minimize ion build-up and electrode corrosion and thus improve stability and accuracy.
An impedance analyzer was used both to benchmark the developed circuit and extract useful information across soil types, while the study investigated how frequency, EC, soil water content, and salt concentration are interrelated; at lower frequencies, the influence of parasitic capacitive and inductive effects in the electrode path is reduced, supporting more stable measurements.
While numerous soil EC measurement methods have been reported, ranging from direct-current probes to wireless sensing systems [
26,
27], the present work introduces a novel low-cost solution based on a custom analog architecture. Its originality lies in the implementation of an AC bipolar pulse technique, generated via a precision summing-amplifier configuration, to minimize electrode polarization and enhance signal stability. Unlike approaches that rely on ready-made modules or simplified excitation sources, the system features a dedicated analog front end that combines a constant-current generator, a precision rectifier, and a peak detector. This design enables accurate EC measurements over a wide frequency range (100 Hz to 10 kHz), making the approach suitable for diverse soil conditions. Moreover, the system’s performance was validated directly against a professional impedance analyzer (E4990A), with mean errors consistently below 10% across all test frequencies and salt concentrations. This comparison, rarely found in low-cost designs, demonstrates the system’s reliability.
The remainder of this paper is structured as follows:
Section 2 presents the materials and methods used for the design and implementation of the proposed sensor system, including details on the experimental setup, electronic circuits, and measurement procedure.
Section 3 discusses the results obtained from the experiments, including performance evaluation and comparison with a commercial impedance analyzer. Finally,
Section 4 summarizes the conclusions and outlines future directions for improvement and application of the system.
2. Materials and Methods
2.1. The Experimental Setup
The experimental setup for measuring the soil conductivity, water content, and temperature sensors is presented in
Figure 1, where (a) the sensors are outside the soil, and (b) the sensors are placed in the soil. It consists of a portable electronic circuit on a PCB (Printed Circuit Board) that uses a microcontroller to generate bipolar pulses of specific frequencies, displays the results on a screen, and sends the data to other devices via the SPI (Serial Peripheral Interface).
The design of the soil conductivity and water-content sensor was based on four metallic electrodes divided into two pairs. The first pair measures the soil resistance, and the second pair measures the soil capacitance, as shown in
Figure 2.
Two electrodes were used for the soil resistance measurements. The first electrode introduces a pulse current of constant amplitude into the soil, while the second electrode measures the voltage drop between the two electrodes caused by the current pulse through the soil resistance. The voltage measurement is amplified by an operational amplifier using the soil resistance as Rgain, resulting in the amplifier’s output being proportional to the soil resistance.
For soil water content measurement, the second pair of electrodes was used to measure the capacitance, which was affected by the soil water content. The second pair of electrodes had an insulating cover to ensure that only the capacitance arising from the electrostatic field between them was measured, ensuring that the measurement was exclusively influenced by electrostatic effects and not by soil conductivity. The distance between the electrodes within each pair was 1 cm, while the distance between the two pairs was 3 cm to minimize the noise and the interactions between the two pairs caused by the resistance measurement.
The length of the electrodes in this sensor is 14 cm, while only 12 cm are placed in the soil. It should be noted that the current implementation of the sensor, while effective in controlled conditions, presents certain practical limitations. The choice of long electrodes (12–14 cm insertion) was not arbitrary; it resulted from several iterations and practical experiments. During preliminary testing, we evaluated a range of electrode lengths to identify the optimal trade-off between measurement stability and sensitivity. We observed that shorter electrodes (<10 cm) produced higher signal variability and less representative measurements of the bulk soil properties, while excessively long electrodes (>14 cm) significantly increased sensor resistance and noise, particularly in soils with lower conductivity. Thus, the selected length was chosen to provide more stable and representative measurements over a larger soil volume while avoiding excessive resistance.
The measurement system scheme is presented in
Figure 3. The BQ24075 integrated circuit was chosen to accurately control charging and discharging, ensuring the safety and performance of the battery. The DS18B20 temperature sensor was used to measure the soil temperature, providing measurements with an accuracy of ±0.5 °C. The MAX1771 IC was used in the voltage boosting circuit, the ICL7660 IC was selected to convert the positive voltage to negative, and the L7808 and L7908 voltage regulators were used to produce stable voltages of ±8 V, ensuring a stable power supply to produce bipolar AC pulses. AMS1117 reduces the voltage, providing a steady output with a maximum current of 1 A.
The total cost of the proposed soil measurement system is around €55. This includes all the key components, such as the STM32F103RB microcontroller, signal-processing ICs, voltage regulators for ±8 V operation, the DS18B20 temperature sensor, stainless steel electrodes, a custom-made PCB (Printed Circuit Board), a small display module and casing materials. In comparison, most commercially available portable systems that measure soil EC and moisture—such as the Decagon 5TE, Vegetronix VH400, or Hanna HI98331—typically cost more than €150.
2.2. EC Sensor Circuit
A block diagram of the entire process and steps for measuring soil resistance is presented in
Figure 4.
In the first stage, two sequential DC pulses from two different outputs of the microcontroller (STM32F103RB) were received, each with an output voltage of 3.3 V, as shown in
Figure 4. To prevent polarization of the electrodes, which causes the accumulation of soil ions on their surface, bipolar AC pulses were generated. This technique helps to increase the lifespan of the electrodes and ensures more accurate and stable measurements. Using this method, the electrodes can withstand longer periods without oxidation, even under harsh environmental conditions.
To achieve this, the first microcontroller output, which is shown in
Figure 5 as source V1, is connected to an inverting amplifier (U1A) to change the polarity. The output of the second microcontroller (V2) is not inverted but has a time delay. Subsequently, the two pulses were directed to an inverting summing amplifier (U1B) to merge and amplify them to reach the highest possible potential (Equation (1)). (Supply voltages VSS = +7.8 V, VDD = −7.8 V)
The simulation results for the combined pulses are shown in
Figure 6.
The next stage was a soil conductivity sensor amplifier, which consisted of an inverting amplifier that used the conductivity of the sensor inside the soil. The bipolar pulse of the first stage was applied to the resistor R6. As shown in
Figure 6, both the positive and negative parts of the bipolar pulse were at a constant potential of ±6 V. The symmetric potential applied to resistor R6 causes a symmetric current through R6 at a constant value of ±0.5 mA. This current passes through the electrodes to the soil and produces a voltage difference depending directly on the soil resistance according to Ohm’s law. Consequently, the input pulse voltage was amplified by the factor of (−Zsensor/R6) (Equation (2)). Impedance, known as Z, can exhibit both real ohmic and capacitive behavior, reflecting the complex nature of a circuit element.
Figure 7 shows the conductivity amplifier circuit of the soil.
The usual values of the soil resistance for the usual moisture measured between the two electrodes were 10–3000 Ω.
Figure 8 shows the simulated voltage output of the soil sensor amplifier circuit over time using different soil resistance values (10–3000 Ω) as the variable parameters. Additionally, a linear behavior was observed as the soil resistance value increased, which is significant for reliable measurements of the circuit.
In the next stage, after estimating the soil resistance in the form of AC voltage pulses, it was necessary to convert the signal to DC for further processing. Therefore, a half-wave rectifier circuit with an operational amplifier was used to ensure high accuracy in the output voltage, as shown in
Figure 9.
At this point, it is important to note that although the half-wave rectifier suppresses the negative parts of the signal; it does not affect the process because the resistance is estimated with a positive pulse.
The half-wave rectifier (U2A) is used to cut off the negative voltages (below −0.6 V), and with the next circuit, which is a peak detector implemented by an operation amplifier (U2B), the signal is stabilized at its peak value. Capacitor C2 is used to smooth and hold the voltage, and resistor R10 is connected to allow a small capacitor discharge current so that the system can show a lower voltage if a new measurement has a smaller output.
Figure 10 shows the simulated output of the operational amplifier U2B, which maintains the peak voltage.
Finally, the stabilized signal was directed to a buffer (U2C) to isolate the stages, as shown in
Figure 10.
The soil resistance input area was 10–3000 Ω. For these values as input, the soil conductivity amplifier, using Equation (2), outputs 0.005 V to 1.5 V, respectively. Finally, the desired limits at the circuit output U2D were 0.5 V to 3 V, respectively. For these values and VDD = 7.8 V, the calculated resistor values are R11 = 7.538 kΩ, R12 = 200 kΩ, R13 = 100 kΩ, and R14 = 73.527 kΩ, as shown in
Figure 11.
The simulated output voltages are shown in
Figure 12. The minimum voltage is 0.2 V due to an offset voltage that is induced at U1D and U2B. The maximum voltage was 3.05 V and is very close to the desired value.
2.3. Soil-Water-Content Sensor Circuit
To estimate the water content in the soil, a circuit was initially developed that includes a high-frequency source, as shown in
Figure 13, and is based on the circuit proposed by [
28]. The microcontroller generated a square-wave signal with a frequency of approximately 400 kHz and a duty cycle of 50%.
This signal was fed into a low-pass filter, which was designed to attenuate high-frequency signals while allowing low-frequency signals to pass. The filter consists of a 1 kΩ resistor (R1) and a capacitor (C3).
In this context, the capacitor C3 is actually a capacitive sensor immersed in the soil, consisting of two electrodes that have an insulating cover to prevent direct contact between the metal, soil, and water. The capacitance of the soil is measured based on the amount of water it contains, because the presence of water affects the dielectric constant of the soil and alters its capacitance. As the soil capacitance changed, the cutoff frequency of the low-pass filter also changed. When the soil capacitance increased, the signal amplitude was attenuated. This method allows for the estimation of water content changes in the soil.
Subsequently, the signal from the filter is directed to a peak detector, which converts alternating current (AC) to direct current (DC). The triangular output signal from the low-pass filter was fed into the half-wave rectification circuit, which consisted of a 1N4148 diode connected in series to produce a DC signal. To improve the signal and reduce the ripple, a 1 MΩ resistor is connected in parallel with a 1 µF capacitor. The ends of the resistor and capacitor are connected to the grounding electrode. The series connection of the diode prevents the full discharge of the capacitor when the signal has low voltage, causing the capacitor to discharge only through the 1 MΩ resistor. This resulted in a discharge time constant of one second, providing a reliable and stable measurement of soil water content that can be fed into an analog input of the microcontroller to provide the percentage water content in the soil.
As shown in
Figure 14, the sensor output (V) decreases monotonically as the gravimetric water content (θv, ref, %) increases from 10% to 50%. Throughout the manuscript, we denote volumetric water content as θv and the gravimetric reference as θv, ref.
Specifically, for a water content of 10%, the output voltage of the sensor is 1.8 V, and for a content of 50%, the voltage decreases to 1.32 V. This inverse relationship suggests that the sensor can detect changes in soil moisture, providing lower voltages for higher water content. The voltage line shows a steady decrease as the water content increases, confirming the sensitivity of the sensor to changes in moisture. The practical detection limit of the proposed device is estimated at around 60%, beyond which the measurements become less reliable due to signal saturation. Beyond this range, the output voltage approaches the lower detection limit of the system, making it difficult to distinguish further increases in water content.
2.4. Measurement Methods
To ensure reliable and standardized calibration of the soil water-content sensor, the gravimetric method was used as the reference. Specifically, a known volume of soil (600 cm3) was dried in an oven at 105 °C for 24 h to obtain its dry mass. Deionized water was then added in controlled quantities to reach the desired water content levels. This procedure enabled accurate calculation of the volumetric water content (θv), which was subsequently used to calibrate the capacitive soil water-content sensor.
A specific type of soil was selected for the experiments, consisting of 72% sand, 21% silt, and 5% clay (sandy loam). Experiments were conducted at a constant soil temperature of 23 °C. Previous studies have shown that soil EC varies by approximately 2% per °C in the temperature range 15–35 °C [
29]. A specific volume of soil equal to 600 cm
3 was selected for all experiments, which was dried in an oven at 105 °C for 24 h.
In the experiments each soil sample received a specific volume of deionized water to reach the target water content (θv = 13%, 18%, or 22%). For each experimental group the required mass of KNO3 was first dissolved in this volume of deionized water to achieve the desired final concentration (0, 0.1, 0.2, or 0.4 M) in the soil solution. In the case of 0 M, only deionized water was added, without any KNO3. The resulting KNO3 solution was then added to the dry soil and thoroughly mixed to ensure even distribution throughout the sample. This procedure ensured that both the soil moisture and the KNO3 concentration were precisely controlled according to the experimental method.
Soil EC measurements were performed using two different measuring instruments for comparison: an impedance analyzer and a circuit. The impedance analyzer was an E4990A with a frequency range of 20 Hz to 20 MHz. We used it for measurements from 100 Hz to 100 kHz to study the impedance between the two electrodes. The circuit is used for frequency measurements from 100 Hz to 10 kHz, because at higher frequencies, the circuit faces operational limitations owing to power amplifiers.
The EC was calculated from the impedance measurements, using the method for resistivity determination described in [
30]. No temperature correction was applied to normalize EC values to the standard reference temperature of 25 °C. Future versions of the measurement system could implement an automated temperature correction function, which is standard practice in laboratory EC meters.
Experiments were performed at four different concentrations with three water content levels (13%, 18%, and 22%). A water content of 13% was considered as tillage moisture, and 22% represented field capacity [
31]. These water content levels correspond to the sandy loam soil used in the experiments, as the values of tillage moisture and field capacity depend on the soil type.
To measure the water content, the sensor was initially calibrated according to a previous study [
32]. The volumetric amount of water contained in the sample was calculated from capacitance measurements between the two insulated electrodes. A temperature sensor was placed in the soil and used to ensure temperature consistency during the measurements. In this study, measurements were conducted at a constant temperature of 23 °C to minimize temperature-related variability.
We then calibrated the probe against a gravimetric reference (oven-dry at 105 °C; fixed soil volume of 600 cm3). Nine moisture levels spanning approximately 10–50% θv (≈ 5% steps) were prepared, and at each level, the sensor output voltage (Vout) was recorded. A linear calibration model was fitted to predict θv from Vout, θv = a + b·Vout.
This research focused on studying the correlation between signal frequency, salt concentration, and water content, while also analyzing the errors between the two measuring instruments. The results are presented in the next section.
3. Results and Discussion
For the water-content sensor performance versus the gravimetric reference, the calibration yielded the linear model θv(%) = 141.06 − 74.26·Vout (V), with 95% CIs [111.77, 170.35] for the intercept and [−93.72, −54.80] for the slope (9 moisture levels). Goodness-of-fit metrics were R
2 = 0.921, RMSE = 3.63% θv, MAE = 3.02% θv, and negligible bias (~0.00% θv). The slope corresponds to a sensitivity of −74.26% θv per volt (≈−0.01347 V per 1% θv). Leave-one-out cross-validation yielded RMSE = 4.67% θv and MAE = 3.91% θv, providing a conservative estimate of out-of-sample performance with limited data. The response was strictly monotonic, decreasing across 10–50% θv, which defines the tested operating range.
Table 1 shows the four different concentrations (M) of KNO
3 used in the experiments.
Three levels were used to measure the water content by volume, as presented in
Table 2.
Figure 15 shows the graph showing the relationship between EC and frequency in Hertz (Hz) for two different measuring instruments: the circuit and the impedance analyzer. Conductivity was measured at four different salt concentrations (C1, C2, C3, and C4) for a constant water content of 13%.
The general trend observed was that EC increased with increasing frequency for all salt concentrations for both gauges. In addition, it appears that the impedance analyzer shows slightly higher conductance values than the circuit for the same concentrations and frequencies. This suggests that the soil exhibits various levels of polarization and ion mobility that affect conductivity at different frequencies. The curves show that EC was higher for higher salt concentrations (C4 > C3 > C2 > C1). This is expected because a higher ion concentration (due to more salts) leads to higher conductivity. The circuit exhibited limitations at higher frequencies (above 10 kHz).
Table 3 presents the average errors per frequency for all concentrations between the circuit and the impedance analyzer.
A gradual increase in mean error was observed as the frequency increased. At low frequencies the impedance has negligible capacitive and inductive behavior. At higher frequencies, parasitic effects (e.g., inductance and capacitance) and electromagnetic noise become more pronounced. With a high degree of confidence, we can assume that resistance Z approaches ohmic. The average error increases from 8.95% at 100 Hz to 9.98% at 10,000 Hz. The errors remain relatively low and close to each other at all frequencies, indicating that the two instruments have similar deviations, regardless of the measurement frequency. The stability and comparatively low increase in error with increasing frequency show that the two instruments measure consistently; however, there is a slight increase in deviations at higher frequencies. This may be a result of the properties of the ingredients or the measurement conditions.
The mean error observed in this study falls within the typical accuracy range reported for portable soil EC measurement devices in both recent and earlier research. Previous studies have demonstrated that portable sensor systems, including those based on advanced techniques such as time domain transmissiometry, can still exhibit measurement errors influenced by soil type, salinity levels, and environmental variability. The accuracy achieved by the proposed system is therefore consistent with values reported in the literature for comparable low-cost EC sensor designs, indicating that it is suitable for practical agricultural applications requiring rapid and reliable estimation of soil salinity [
12,
22].
Figure 16 shows the relationship between EC and frequency in Hertz (Hz) for three different sets of water content measurements (A, B, C) at a concentration of 0.1 M using two instruments: the implemented circuit and the impedance analysis analyzer.
In all cases, EC increased with frequency, a trend consistently observed across all measurements, regardless of the instrument or dataset. The impedance analyzer generally reported higher conductance values than the developed circuit for the same datasets and frequencies, indicating a systematic discrepancy between the two instruments. Among the measurement sets, conductivity varied, with set A showing the highest values and set C the lowest, reflecting differences in salt concentration or other sample characteristics.
A general trend of increasing error with increasing frequency was observed, particularly for C2 with a water content of 22%. The errors were relatively similar at all frequencies, with the largest deviation observed at 10,000 Hz for the C content. Errors remained below 11% across all frequencies and concentrations.
Figure 17 illustrates the relationship between electrical conductivity (EC, mS/cm) and frequency (Hz) for four salt concentrations (C1–C4) at a water content of 22%. An algorithmic trend line fitted to the C1 data yielded a coefficient of determination of R
2 = 0.932, indicating that 93.2% of the variability in EC was explained by frequency. This strong correlation confirms the reliability of the measurement approach for the C1 condition.
Figure 18 presents the relationship between EC (mS/cm) and frequency (Hz) for three measurement sets (A, B, and C) at a salt concentration of 0.4 M. For dataset A, the logarithmic trend line achieved a coefficient of determination of R
2 = 0.932, indicating that frequency accounted for 93.2% of the variation in EC, thus confirming a strong correlation between the two variables.
The plot in
Figure 19 illustrates the relationship between KNO
3 concentration (M) and EC in mS/cm at a frequency of 100 Hz. The linear voltage line is described by the following equation:
with a coefficient of determination of R
2 = 0.9898.
EC increased linearly with KNO3 concentration at 100 Hz, as confirmed by the trend line equation, highlighting the strong influence of salt concentration on solution conductivity.
The graph in
Figure 20 illustrates the relationship between water content in percentage (%) and EC in mS/cm for four different salt concentrations (C1, C2, C3, and C4) at a frequency of 100 Hz.
The trend lines show that there is a linear relationship between water content and EC for all salt concentrations. Conductivity increased as the water content increased.
4. Conclusions
This study demonstrated the effectiveness of a portable system for measuring soil EC, water content, and temperature. The study included experiments with different concentrations of KNO3 and moisture levels in a sandy loam soil using two measuring instruments: an impedance analyzer and a specially designed circuit. Although the system was validated only on sandy loam, future work will focus on other soil types to confirm the generalizability and robustness of the method. The main findings of the research include that EC increases with increasing frequency for all salt concentrations for both gauges. The impedance analyzer showed slightly higher conductance values than those of the circuit for the same concentration and frequency. The circuit faced limitations at higher frequencies (above 10 kHz). A gradual increase in the mean error was observed as the frequency increased from 8.95% at 100 Hz to 9.98% at 10,000 Hz. The errors remain relatively low and close to each other at all frequencies, indicating that the two instruments have similar deviations, regardless of the measurement frequency.
EC increased with increasing salt concentration and water content. The trend lines show that there is a linear relationship between water content and EC for all salt concentrations. The system developed provides reliable and accurate real-time measurements, and it is a useful tool for agricultural and environmental monitoring.
The correlations between frequency, salt concentration and water content contribute to a better understanding of soil dynamics and can help make better agricultural decisions. This study demonstrated that modern electronic systems and measurement methods can significantly improve soil health monitoring and sustainable agriculture by providing accurate and reliable real-time information.
In the future, we plan to test the system with a wider range of frequencies and to add automated temperature compensation. We also want to see how it performs in different soil types and under various weather conditions. Another goal is to connect it with wireless IoT monitoring networks and explore options for energy-autonomous operation. These steps would help make the system more practical and easier to scale for use in precision agriculture and environmental monitoring.