Automatic Plant Watering System Using Arduino Uno and Soil Moisture Sensor

 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

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

 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)

DC Motor:

  • One terminal → Digital Pin 8

  • Other terminal → GND

LED Indicator:

  • Anode (+) → Digital Pin 9 (via 1kΩ resistor)

  • Cathode (–) → GND


Working Principle

  1. The soil moisture sensor detects water content in soil.

  2. It sends an analog value (0–1023) to the Arduino.

  3. Arduino compares the value with a predefined threshold.

  4. If soil is dry (value below threshold):

    • Motor turns ON (watering starts).

    • LED glows.

  5. 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);
}

Understanding Moisture Values

  • 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


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 system

BEGINNER PROJECTS (Foundation Skills)

  1. Ultrasonic Distance Measurement
  2. Traffic Light Simulation with 7-Segment Display
  3. 7-Segment Display Counter
  4. Kids Piano Circuit (8-Key Version)
  5. 16×2 LCD Display with Text Output
  6. LCD I2C to Arduino UNO
  7. Temperature Measurement using Arduino UNO
  8. LDR Controlled Street Light

INTERMEDIATE PROJECTS (Build Your Skills)

  1. Servo Motor Control Using Potentiometer
  2. DC Motor Speed Control
  3. Temperature Controlled Fan
  4. PIR Based Theft Alert System
  5. LPG Gas Leakage Detection System
  6. Automatic Door Locking System
  7. Soil Moisture Based Automatic Watering System
  8. Simple Digital Clock using Arduino UNO
  9. Automatic Voting Machine (EVM)
  10. Joystick Control using Arduino Uno
  11. RGB Lamp Control using Arduino Uno

    ADVANCED PROJECTS (Master Level)

    1. Home Automation Using Arduino UNO
    2. Bluetooth RC Car using Arduino Uno
    3. Obstacle Avoiding Robot
    4. Line Follower Robot
    5. Radar System Using Arduino UNO
    6. Automatic Parking System
    7. Bi-Directional People Counter using Arduino Uno 
    8. Automatic Plant Watering System
    9. NeoPixel LED Ring Control using Arduino Uno
    10. Smart Gloves for Bedridden People

      ROBOTICS & MOTION PROJECTS

      1. RC Car Using L293D Motor Driver
      2. Robot Arm and Leg Control Using Servo
      3. Smart Irrigation System using Arduino Uno


      Comments