Soil Moisture Sensor – How to Use it?
Soil Moisture sensor are specifically designed to detect the amount of moisture or water soil contains. It uses capacitance to measure the dielectric constant of the soil. Dielectric constant can be called as the ability of soil to transmit electricity. The soil increases as the water content of the soil increases. Dielectric constant of water is more than any other soil component, that is why soil sensor uses that factor for moisture detection. The sensor creates a voltage proportional to the dielectric permittivity, and therefore detects the water content of the soil.
Soil Moisture Sensor have many applications in different areas like Agriculture Department, Landscape Irrigation, Gardening purpose
Project for Reference:
const int hygrometer = A0; // Soil moisture sensor analog pin output at pin A0 of Arduino
// When the plant is watered well the sensor will read a value 380~400, I will keep the 400
// value but if you want you can change it below.
value = analogRead(hygrometer); // Read analog value
value = constrain(value,400,1023); // Keep the ranges!
value = map(value,400,1023,100,0); // Map value : 400 will be 100 and 1023 will be 0
Serial.print("Soil humidity: ");
delay(1000); // Read every 1 sec