Plant Watering System Using Arduino

Automatic Plant Watering System Using Arduino

Automatic Plant Watering System Using Arduino

This project creates a smart automatic plant watering system that monitors soil moisture and waters plants only when needed. Using Arduino, a soil moisture sensor, and a water pump, this system ensures your plants get the perfect amount of water while conserving resources.


How the System Works

  • Soil Moisture Sensor continuously monitors the soil's moisture level
  • Arduino UNO processes sensor data and controls the watering system
  • Relay Module acts as a switch to control the water pump safely
  • Water Pump turns ON when soil is dry and OFF when soil is sufficiently moist
  • Li-ion Battery provides portable power for standalone operation
  • Smart Logic: System checks soil moisture every 2 seconds and waters for 3 seconds when needed
  • Water Conservation: Prevents overwatering and saves up to 70% water compared to manual watering

Materials Required


Circuit Diagram & Connections

Complete Wiring Guide:

  • Relay Module: IN pin → Arduino Digital Pin 7
  • Soil Moisture Sensor: VCC → Arduino Digital Pin 13, GND → Arduino GND, OUT → Arduino Analog Pin A0
  • Water Pump: Positive → Relay COM port, Negative → Battery Negative
  • Battery: Positive → Relay NO port, Negative → Pump Negative
  • Relay Power: VCC → Arduino 5V, GND → Arduino GND

Power Management System

The system uses efficient power management for optimal performance:

  • 7.4V Li-ion Battery: Provides portable power for complete system
  • Relay Protection: Isolates Arduino from pump motor currents
  • Arduino Power: Can be powered via USB or battery with voltage regulation
  • Sensor Power: Controlled via Arduino pin 13 for energy saving
  • Pump Control: Relay handles higher current required by water pump

Step-by-Step Assembly

1. Sensor Setup:

  • Insert soil moisture sensor into plant soil (avoid touching roots)
  • Adjust sensor depth based on plant root depth (typically 2-4 inches)
  • Ensure sensor probes are fully inserted in soil for accurate readings

2. Electronics Wiring:

  • Connect relay IN pin to Arduino digital pin 7
  • Connect soil sensor VCC to Arduino pin 13, GND to GND, OUT to A0
  • Connect water pump positive wire to relay COM terminal
  • Connect battery positive to relay NO terminal, negative to pump negative
  • Connect relay VCC to Arduino 5V, GND to Arduino GND

3. Water System Setup:

  • Place water pump inside water tank/reservoir
  • Connect water tube from pump to plant pot
  • Ensure water tank is positioned higher than plant for gravity assist
  • Test water flow before final installation

4. Calibration & Testing:

  • Upload the Arduino code
  • Test sensor in dry soil (should read LOW/0)
  • Test sensor in wet soil (should read HIGH/1)
  • Adjust watering duration in code (default 3 seconds)
  • Test complete cycle: dry soil → pump ON → watering → pump OFF
  • Adjust check interval based on plant needs (default 2 seconds)

🎥 Watch the video above for complete assembly and demonstration.


Arduino Code

Upload this code to your Arduino after completing all hardware connections:

void setup() {
  pinMode(7, OUTPUT); // output pin for relay board
  
  pinMode(13, OUTPUT); // D13 provides power to sensor
  digitalWrite(13, HIGH); // turn ON sensor power
  
  // A0 pin for sensor input (automatically input)
}

void loop() { 
  // reading the coming signal from the soil sensor
  if(digitalRead(A0) == HIGH) {
    // if sensor reads HIGH (soil is WET) then cut the relay 
    digitalWrite(7, LOW); // low is to cut the relay
  }
  else {
    // if sensor reads LOW (soil is DRY) run pump for 3 seconds
    digitalWrite(7, HIGH); // high to turn ON pump
    delay(3000); // keep pump ON for 3 seconds
    digitalWrite(7, LOW); // turn OFF pump after 3 seconds
  }
  
  delay(2000); // check every 2 seconds
}

Code Explanation:

Setup Function:

Initializes pin 7 as OUTPUT to control the relay module. Sets pin 13 as OUTPUT to provide power to the soil moisture sensor (this saves power by controlling sensor on/off). Turns ON the sensor power by setting pin 13 HIGH.

Loop Function:

Continuously reads the soil moisture sensor connected to analog pin A0. If the sensor reads HIGH (soil is WET), it turns OFF the relay (and pump). If the sensor reads LOW (soil is DRY), it turns ON the relay for 3 seconds to water the plant, then turns it OFF. The system checks soil moisture every 2 seconds for timely watering.

Customization Options:

  • Watering Duration: Change delay(3000) to adjust watering time
  • Check Interval: Change delay(2000) to adjust how often soil is checked
  • Sensor Sensitivity: Adjust sensor potentiometer for different soil types
  • Multiple Plants: Expand with multiple sensors and pumps using Arduino Mega

Why Choose This Design?

  • Water Conservation: Saves up to 70% water compared to manual watering
  • Energy Efficient: Low power consumption with controlled sensor power
  • 🌱 Plant Health: Prevents overwatering and underwatering
  • 🔋 Portable: Battery powered for placement anywhere
  • 🛠️ Simple Build: No soldering required, beginner friendly
  • 💡 Smart Automation: Works autonomously for weeks without intervention

Performance Benefits

  • Optimal Watering: Plants receive water only when needed
  • Prevents Root Rot: Avoids overwatering which causes root diseases
  • Time Saving: No daily manual watering required
  • Vacation Proof: Can maintain plants for weeks while you're away
  • Adaptable: Works with all types of plants and soil
  • Cost Effective: Saves money on water bills and plant replacements

Advanced Modifications

Take your system to the next level with these enhancements:

  • LCD Display: Add 16x2 LCD to show soil moisture status
  • Bluetooth Control: Add HC-05 module for smartphone control
  • Solar Power: Add solar panel for completely off-grid operation
  • Multiple Zones: Control multiple plants with different water needs
  • Data Logging: Add SD card module to track watering history
  • Weather Integration: Skip watering on rainy days

Comments

Popular posts from this blog

Solar Tracking System

Arduino Code

Arduino Code Car Parking System