AUTOMATIC PLANT WATERING SYSTEM USING ARDUINO UNO

Automatic Plant Watering System using Arduino UNO | MakeMindz
🌿 Arduino Project Tutorial

Automatic Plant Watering System using Arduino UNO

Smart irrigation that monitors soil moisture in real time and automatically waters your plants — no human effort needed.

⏱ ~90 min build 📊 Intermediate 🌱 Smart Agriculture 💡 IoT Beginner Friendly

The Automatic Plant Watering System is an efficient smart irrigation project that continuously monitors soil moisture and activates a water pump whenever the soil becomes dry. Built around an Arduino UNO, this project is perfect for school robotics, IoT beginners, and smart agriculture demonstrations — all while reducing water wastage and ensuring healthy plant growth.

Working Principle

1
Sense Moisture The soil moisture sensor is inserted into the soil and continuously measures the moisture level, outputting an analog voltage.
2
Analog Reading The sensor sends an analog value (0–1023) to the Arduino UNO via the A0 pin. Lower values mean wetter soil.
3
Threshold Comparison The Arduino compares the moisture reading against a predefined threshold (e.g., 600) to determine if the soil is dry or wet.
4
Automatic Response Based on the comparison, the Arduino triggers the pump, buzzer, and LCD display accordingly (see below).
🏜️

Soil is Dry (value > 600)

  • Water pump turns ON
  • Buzzer activates
  • LCD shows "Soil Dry – Watering"
💧

Soil is Wet (value ≤ 600)

  • Water pump turns OFF
  • Buzzer stops
  • LCD shows "Soil Wet – OK"

Components Required

×1
Arduino UNO
Microcontroller — the brain of the project
Core
×1
Soil Moisture Sensor
Analog output; senses capacitive moisture level
Sensor
×1
16×2 LCD Display (Non-I2C)
Shows moisture % and watering status
Display
×1
DC Water Pump / Motor
Submersible mini pump; 3V–6V
Actuator
×1
Relay Module (5V)
Safely switches the pump via Arduino signal
Control
×1
Buzzer (Active)
Audio alert when soil is dry
Output
×1
10kΩ Potentiometer
For LCD contrast adjustment
Passive
Jumper Wires + Breadboard
Male-to-male and male-to-female wires
Wiring
×1
External Power Supply (6V–9V)
Powers the water pump separately from Arduino
Power



Circuit Diagram

The diagram below shows the complete wiring of all components. The soil moisture sensor feeds analog data to A0, the LCD runs in 4-bit mode on D2–D7, the buzzer connects to D8, and the relay (controlling the pump) connects to D9.

🔌 Automatic Plant Watering System — Full Circuit
ARDUINO UNO 5V GND A0 D2 D3 D4-D7 D8 D9 SOIL MOISTURE SENSOR VCC GND VCC AO VCC GND A0 16×2 LCD DISPLAY Moisture: 65% Soil Wet - OK RS→D2 EN→D3 D4→D4 D5→D5 D6→D6 D7→D7 BUZZER + RELAY MODULE NO COM NC → Controls Pump SIG GND DC WATER PUMP 6V-9V External PSU: 6V–9V Wire Legend: 5V (Power) GND Analog Signal Digital Signal

💡 Tip: Use Tinkercad to simulate this circuit before building it physically. Jump to simulation →


Wiring Guide

🌡️ Soil Moisture Sensor → Arduino

Sensor PinArduino PinWire Color
VCC5V🔴 Red
GNDGND⚫ Black
AO (Analog Out)A0🟡 Yellow

📺 16×2 LCD Display → Arduino (4-bit mode)

LCD PinArduino PinNotes
VSS (Pin 1)GNDGround
VDD (Pin 2)5VPower
VO (Pin 3)PotentiometerContrast adjust
RS (Pin 4)D2Register Select
RW (Pin 5)GNDAlways Write
EN (Pin 6)D3Enable
D4 (Pin 11)D4Data bit 4
D5 (Pin 12)D5Data bit 5
D6 (Pin 13)D6Data bit 6
D7 (Pin 14)D7Data bit 7
A/BL+ (Pin 15)5VBacklight +
K/BL- (Pin 16)GNDBacklight −

🔔 Buzzer → Arduino

Buzzer PinArduino Pin
+ (Positive)D8
− (Negative)GND

⚡ Relay Module → Arduino & Pump

Relay PinConnects ToNotes
VCC5V (Arduino)Relay power
GNDGND (Arduino)Common ground
IN (Signal)D9 (Arduino)Control pin
NO (Normally Open)Pump +Pump power circuit
COM (Common)External PSU +6V–9V supply

Step-by-Step Instructions

01

Gather All Components

Collect all components listed above. Make sure your Arduino IDE is installed (version 1.8+ or 2.x) and the LiquidCrystal library is available (it's built-in).

02

Place Components on Breadboard

Position the Arduino, LCD display (use a separate breadboard section), relay module, buzzer, and moisture sensor. Keep the pump wiring away from signal wires to avoid noise.

03

Wire the Soil Moisture Sensor

Connect VCC → 5V, GND → GND, and AO → A0 on Arduino. Insert the sensor prongs into the soil of your plant pot. Do NOT power the sensor continuously — you can use a digital pin to power it intermittently to extend its lifespan.

04

Connect the LCD in 4-bit Mode

Wire VSS to GND, VDD to 5V, and VO to the wiper of a 10kΩ potentiometer (other ends to 5V and GND). Then: RS→D2, RW→GND, EN→D3, D4–D7→D4–D7. Connect backlight pins 15→5V and 16→GND.

05

Wire the Buzzer

Connect the buzzer's positive pin to D8 and negative pin to GND. If using a passive buzzer, you'll need to generate a tone in code (use tone(8, 1000)).

06

Connect the Relay and Water Pump

Wire the relay module: VCC→5V, GND→GND, IN→D9. For the pump circuit: connect the external power supply (+) to relay COM, relay NO to pump (+), and pump (−) and PSU (−) to a common GND. Never power a motor directly from the Arduino 5V pin.

07

Upload the Arduino Code

Open Arduino IDE, connect your Arduino UNO via USB, paste the code below, select board (Arduino UNO) and correct COM port, then click Upload.

08

Test and Calibrate

Open Serial Monitor (9600 baud) to watch moisture values. Adjust the threshold variable in code to match your specific soil and sensor. Typically, dry soil reads above 600 and wet soil reads below 400 on a 10-bit scale (0–1023).


Complete Arduino Sketch

Copy and paste this code into Arduino IDE. The threshold is set at 600 — adjust based on your sensor readings.

🌿 automatic_plant_watering.ino
// ============================================
// Automatic Plant Watering System
// makemindz.com | Arduino UNO Project
// ============================================

#include <LiquidCrystal.h>

// LCD: RS, EN, D4, D5, D6, D7
LiquidCrystal lcd(2, 3, 4, 5, 6, 7);

// Pin Definitions
const int sensorPin  = A0;  // Soil moisture sensor
const int buzzerPin  = 8;   // Buzzer
const int relayPin   = 9;   // Relay (controls pump)

// Threshold: above this = soil is DRY
const int DRY_THRESHOLD = 600;

void setup() {
  lcd.begin(16, 2);
  pinMode(buzzerPin, OUTPUT);
  pinMode(relayPin,  OUTPUT);
  digitalWrite(relayPin, HIGH); // Relay OFF (active LOW)
  Serial.begin(9600);

  lcd.setCursor(0, 0);
  lcd.print("Plant Watering");
  lcd.setCursor(0, 1);
  lcd.print("System Ready!");
  delay(2000);
}

void loop() {
  int rawValue = analogRead(sensorPin);

  // Convert to moisture percentage (invert scale)
  int moisture = map(rawValue, 0, 1023, 100, 0);

  Serial.print("Raw: ");
  Serial.print(rawValue);
  Serial.print("  Moisture: ");
  Serial.print(moisture);
  Serial.println("%");

  lcd.setCursor(0, 0);
  lcd.print("Moisture: ");
  lcd.print(moisture);
  lcd.print("%  ");

  if (rawValue > DRY_THRESHOLD) {
    // SOIL IS DRY → Activate pump & buzzer
    digitalWrite(relayPin, LOW);  // Relay ON (pump starts)
    digitalWrite(buzzerPin, HIGH);
    lcd.setCursor(0, 1);
    lcd.print("Dry! Watering...");
  } else {
    // SOIL IS WET → Stop pump & buzzer
    digitalWrite(relayPin, HIGH); // Relay OFF (pump stops)
    digitalWrite(buzzerPin, LOW);
    lcd.setCursor(0, 1);
    lcd.print("Soil Wet - OK   ");
  }

  delay(1000); // Check every 1 second
}

Tinkercad Simulation

Test the full circuit virtually in Tinkercad before assembling the physical components. You can interact with the moisture sensor slider and see the LCD, buzzer, and pump respond in real time.

🖥️ Open in Tinkercad

Simulate the complete Automatic Plant Watering System circuit — no hardware needed to get started!

Launch Tinkercad Simulation
⬇️ Download Project Files (Google Drive)

Features & Applications

💧

Prevents Overwatering

📊

Real-Time Moisture %

🔔

Audio Alert Buzzer

Fully Automatic

💰

Low Cost Build

🌿

Conserves Water

Where You Can Use This

🏡
Home Gardens
🌾
Smart Agriculture
🏫
School Projects
🏭
Greenhouse Automation
📡
IoT Farming