Soil Moisture Sensor
Soil Moisture Sensor
Nigdi, Pune
• WORKING PRINCIPLE : The sensor applies a small voltage across its probes and measures
the current flow to determine soil moisture level.
• As water is a good conductor of electricity therefore the soil with water content has low
resistance whereas the dry soil has large resistance.
• Ohm’s Law (V=IR) is used to calculate resistance
• More water content → Higher conductivity (Lower resistance).
• Dry soil → Lower conductivity (Higher resistance).
5.Microcontroller (Arduino/Raspberry Pi) processes the voltage and displays the moisture percentage.
Interfacing diagram
Python Code
import RPi.GPIO as GPIO # Main loop
import time try:
while True:
# Use BOARD numbering (physical pin numbers) moisture = GPIO.input(SOIL_SENSOR_PIN) # Read digital output
GPIO.setup(SOIL_SENSOR_PIN, GPIO.IN) # Set soil sensor pin as input time.sleep(1) # Wait 1 second before reading again
GPIO.setup(RED_LED, GPIO.OUT) # Set Red LED as output
GPIO.setup(GREEN_LED, GPIO.OUT) # Set Green LED as output except KeyboardInterrupt:
print("\nExiting program")
GPIO.cleanup() # Reset GPIO settings before exiting
Applications:
• Automatic irrigation systems :Automatically waters plants when soil moisture is low, saving water
and improving plant health.
• Precision Agriculture – Optimizes irrigation in farms by monitoring soil moisture at different
locations.
• Greenhouse Monitoring System – Controls irrigation, humidity, and temperature for ideal plant
growth in greenhouses.
• Urban Gardening & Smart Home Gardens – Automates watering for home gardens and integrates
with smart home systems.
• Environmental Monitoring & Research – Tracks soil moisture in forests, wetlands, and
conservation areas for ecological studies.
• Landslide & Flood Prediction System – Detects high soil moisture levels to predict and warn about
landslides or floods.
• Disaster Recovery & Drought Monitoring – Collects long-term soil moisture data to aid in drought
prediction and response planning.