This paper presents a mathematical algorithm and an electronic device to study soil resistivity. The system was based on introducing a time-varying electrical signal into the soil by using two electrodes and then collecting the electrical response of the soil. Hence, the proposed electronic system relied on a single-phase DC-to-AC converter followed by a transformer for the soil-to-circuit coupling. By using the maximum likelihood statistical method, a mathematical algorithm was realized to discern soil resistivity. The novelty of the numerical approach consisted of modeling a set of random data from the voltmeters by using a parametric uniform probability distribution function, and then, a parametric estimation was carried out for dataset analysis. Furthermore, to validate our contribution, a two-electrode laboratory experiment with soil was also designed. Finally, and according to the experimental outcomes, our electronic circuit and mathematical data analysis approach were able to detect different soil resistivities.