The experiment reported here, performed by advanced undergraduates as a final laboratory work, was intended as an example of the application of the electricity theory to solve problems related to environmental physics. In particular, the aim of the work was to show how we can get the electrical image of the soil and detect the presence of buried structures from simple geoelectrical measurements. First, we developed scale models in the laboratory to recognize the electrical responses of different layered structures and to evaluate the sensitivity of the method and we interpreted the results using one-dimensional inversion codes. Then we proposed a configuration which permitted simulating a buried pipeline and analyzed the electrical response applying a simple two-dimensional numerical code. Finally, we performed field work in order to compare the results with ones obtained through the laboratory scale models.