Works like this
https://components101.com/modules/soil-moisture-sensor-module
https://five.nocrew.org/raspberry-pi/moisture-sensor/