So I bought myself a soil moisture sensor and tested it out.
First, I found manuals how to connect the cables to the sensor. Then how to connect it to the raspberry pi. There are pins on the raspberry pi circuit board where you can connect sensors. After that I needed to retrieve the data from the sensor using Python code.
The sensor is actually quite sensitive. If you look at the picture below I put it in a christmas star that I waterered yesterday and it says that the soil is moist.
You can see the indication by the two red lights. The sensor sends 0 if there is no moist and 1 if there is.
Check out my project at Github!