Soil Moisture sensor based Automatic irrigation system
Circuit diagram:
This project is designed to automatically water plants based on the moisture content in the soil using a soil moisture sensor, an Arduino UNO, and a DC motor (acting as a water pump).
It helps in efficient water usage and eliminates the need for manual watering, especially useful in agriculture, gardening, and smart farming applications.When the soil moisture level drops below a certain threshold, the system turns on the DC motor, which activates the water pump to irrigate the soil. Once the soil reaches sufficient moisture, the system automatically turns off the motor, conserving water and energy.
The system waters plants automatically when the soil becomes dry and stops watering when sufficient moisture is detected. This helps in:
-
Efficient water usage
-
Smart farming applications
-
Home gardening automation
-
Reducing manual effort
Efficient water usage
Smart farming applications
Home gardening automation
Reducing manual effort
This is an excellent school exhibition and IoT beginner project.
Components Used
-
Arduino UNO
-
Soil Moisture Sensor
-
DC Motor (Water Pump)
-
1kΩ Resistor
-
LED
-
Breadboard
-
Jumper Wires
Arduino UNO
Soil Moisture Sensor
DC Motor (Water Pump)
1kΩ Resistor
LED
Breadboard
Jumper Wires
In real hardware, it is recommended to use a transistor and diode for safe motor operation.
Circuit Connections
Soil Moisture Sensor:
-
VCC → 5V
-
GND → GND
-
A0 → A0 (Arduino)
VCC → 5V
GND → GND
A0 → A0 (Arduino)
DC Motor:
-
One terminal → Digital Pin 8
-
Other terminal → GND
One terminal → Digital Pin 8
Other terminal → GND
LED Indicator:
-
Anode (+) → Digital Pin 9 (via 1kΩ resistor)
-
Cathode (–) → GND
Anode (+) → Digital Pin 9 (via 1kΩ resistor)
Cathode (–) → GND
Working Principle
-
The soil moisture sensor detects water content in soil.
-
It sends an analog value (0–1023) to the Arduino.
-
Arduino compares the value with a predefined threshold.
-
If soil is dry (value below threshold):
-
Motor turns ON (watering starts).
-
LED glows.
-
If soil is wet:
-
Motor turns OFF.
-
LED turns OFF.
The soil moisture sensor detects water content in soil.
It sends an analog value (0–1023) to the Arduino.
Arduino compares the value with a predefined threshold.
If soil is dry (value below threshold):
-
Motor turns ON (watering starts).
-
LED glows.
If soil is wet:
-
Motor turns OFF.
-
LED turns OFF.
Arduino Code
int sensorPin = A0;
int motorPin = 8;
int ledPin = 9;
int moistureValue;
int threshold = 500; // Adjust based on calibration
void setup() {
pinMode(motorPin, OUTPUT);
pinMode(ledPin, OUTPUT);
Serial.begin(9600);
}
void loop() {
moistureValue = analogRead(sensorPin);
Serial.println(moistureValue);
if(moistureValue < threshold) {
digitalWrite(motorPin, HIGH);
digitalWrite(ledPin, HIGH);
}
else {
digitalWrite(motorPin, LOW);
digitalWrite(ledPin, LOW);
}
delay(1000);
}
int motorPin = 8;
int ledPin = 9;
int moistureValue;
int threshold = 500; // Adjust based on calibration
void setup() {
pinMode(motorPin, OUTPUT);
pinMode(ledPin, OUTPUT);
Serial.begin(9600);
}
void loop() {
moistureValue = analogRead(sensorPin);
Serial.println(moistureValue);
if(moistureValue < threshold) {
digitalWrite(motorPin, HIGH);
digitalWrite(ledPin, HIGH);
}
else {
digitalWrite(motorPin, LOW);
digitalWrite(ledPin, LOW);
}
delay(1000);
}
Understanding Moisture Values
-
0 – 300 → Very Wet Soil
-
300 – 700 → Moist Soil
-
700 – 1023 → Dry Soil
0 – 300 → Very Wet Soil
300 – 700 → Moist Soil
700 – 1023 → Dry Soil
Values vary depending on soil type and sensor quality. Adjust the threshold accordingly.
Applications
-
Smart irrigation systems
-
Agricultural automation
-
Home garden watering system
-
Greenhouse monitoring
-
IoT-based smart farming projects
Smart irrigation systems
Agricultural automation
Home garden watering system
Greenhouse monitoring
IoT-based smart farming projects
Learning Outcomes
Students will learn:
-
Analog sensor interfacing
-
Conditional programming
-
Motor control using Arduino
-
Basic automation logic
Code:
Try it in Tinker cad:
Soil Moisture sensor based Automatic irrigation systemBEGINNER PROJECTS (Foundation Skills)
- Ultrasonic Distance Measurement
- Traffic Light Simulation with 7-Segment Display
- 7-Segment Display Counter
- Kids Piano Circuit (8-Key Version)
- 16×2 LCD Display with Text Output
- LCD I2C to Arduino UNO
- Temperature Measurement using Arduino UNO
- LDR Controlled Street Light
INTERMEDIATE PROJECTS (Build Your Skills)
- Servo Motor Control Using Potentiometer
- DC Motor Speed Control
- Temperature Controlled Fan
- PIR Based Theft Alert System
- LPG Gas Leakage Detection System
- Automatic Door Locking System
- Soil Moisture Based Automatic Watering System
- Simple Digital Clock using Arduino UNO
- Automatic Voting Machine (EVM)
- Joystick Control using Arduino Uno
- RGB Lamp Control using Arduino Uno
ADVANCED PROJECTS (Master Level)
- Home Automation Using Arduino UNO
- Bluetooth RC Car using Arduino Uno
- Obstacle Avoiding Robot
- Line Follower Robot
- Radar System Using Arduino UNO
- Automatic Parking System
- Bi-Directional People Counter using Arduino Uno
- Automatic Plant Watering System
- NeoPixel LED Ring Control using Arduino Uno
- Smart Gloves for Bedridden People
ROBOTICS & MOTION PROJECTS
- RC Car Using L293D Motor Driver
- Robot Arm and Leg Control Using Servo
- Smart Irrigation System using Arduino Uno

Comments
Post a Comment