Table of Contents

Play Video

CROP PROTECTION AND WATERING SYSTEM

The project aims to protect crops from the detrimental effects of both overwatering and water scarcity, providing a crucial support system for farmers. By integrating advanced irrigation technologies and real-time monitoring systems, the project seeks to optimize water usage, ensuring that crops receive the precise amount of water they need to thrive. Overwatering can lead to root rot, nutrient leaching, and the proliferation of fungal diseases, all of which can severely damage crop yield. Conversely, water scarcity stresses plants, reducing growth and productivity. This project addresses these issues by deploying soil moisture sensors, weather forecasting models, and automated irrigation systems. These technologies work in tandem to monitor soil moisture levels, predict weather conditions, and adjust irrigation schedules accordingly. The implementation of this project not only conserves water resources but also enhances crop resilience, leading to increased agricultural productivity and sustainability. Farmers benefit economically through reduced water usage and improved crop yields, while also contributing to environmental conservation. By adopting this innovative approach, the agricultural sector can ensure food security and sustainable farming practices in the face of changing climate conditions and water availability challenges.

The Crop Protection and Watering System project is designed to optimize irrigation and protect crops using an Arduino-based setup. This project leverages sensors to monitor soil moisture and detect rainfall, automating the watering process to ensure crops receive the right amount of water.

Functionality:

  • The system continuously monitors soil moisture levels.
  • When the soil is dry, the Arduino activates the water pump to irrigate the crops.
  • If the rain drop sensor detects rainfall, the system halts watering to avoid overwatering.
  • This automation ensures efficient water usage and provides crops with consistent hydration, improving crop health and yield.

Components and Connections:

Components Required:

  1. Arduino
  2. Soil Sensor
  3. Rain Drop Sensor
  4. Water Pump
  5. Jumper Wires [Male to Male X8, Male to Female X3]
  6. Single channel Relay
  1. Soil Moisture Sensor:
    • VCC to 5V
    • GND to GND
    • A0 to A0
  2. Raindrop Sensor:
    • VCC to 5V
    • GND to GND
    • Digital Output to D2
  3. Water Pump (controlled by a relay):
    • Relay VCC to 5V
    • Relay GND to GND
    • Relay IN to D3
    • Water pump VCC and GND through the relay
  4. Servo Motor:
    • VCC to 5V
    • GND to GND
    • Signal to D9
#include <Servo.h>

// Define pin connections
const int soilMoisturePin = A3;
const int rainDropPin = A0 ;
const int waterPumpPin = 3 ;
const int servoPin = 2;

// Define threshold values
const int dryThreshold = 600;  // Adjust this value based on your soil moisture sensor readings
const int rainThreshold = 500; // Adjust this value based on your raindrop sensor readings

Servo myServo;

void setup() {
  // Initialize serial communication
  Serial.begin(9600);

  // Initialize pin modes
  pinMode(waterPumpPin, OUTPUT);
  myServo.attach(servoPin);
  myServo.write(0);  // Ensure servo starts at 0 degrees
}

void loop() {
  // Read sensor values
  int soilMoistureValue = analogRead(soilMoisturePin);
  int rainDropValue = analogRead(rainDropPin);

  // Print sensor values for debugging
  Serial.print("Soil Moisture: ");
  Serial.println(soilMoistureValue);
  Serial.print("Rain Drop: ");
  Serial.println(rainDropValue);

  // Determine soil and rain conditions
  bool isSoilDry = soilMoistureValue > dryThreshold;
  bool isRaining = rainDropValue > rainThreshold;

  if (isRaining) {
    if (isSoilDry) {
      digitalWrite(waterPumpPin, LOW); // Turn off water pump
    } else {
      myServo.write(90); // Move servo to 90 degrees
    }
  } else {
    if (isSoilDry) {
      digitalWrite(waterPumpPin, HIGH); // Turn on water pump
    } else {
      digitalWrite(waterPumpPin, LOW);  // Turn off water pump
      myServo.write(0); // Move servo back to 0 degrees
    }
  }

  // Small delay for stability
  delay(1000);
}
Scroll to Top