Soil Moisture sensor with comparator