ArrowtronElectronics Store
Free shipping over ₹999
100% genuine components
Dispatch in 1–2 days
Secure payments · UPI, Cards

Automatic Plant Watering System with Soil Moisture Sensor

Never forget to water your plants again. This project senses how dry the soil is and switches on a small water pump only when your plant actually needs a drink.

Beginner~1 hour6 components

What you’ll build

An Arduino Nano reads the soil moisture sensor every few seconds. When the reading crosses your dryness threshold, it fires a relay that powers the mini water pump for a short burst, then waits for the moisture to rise — fully automatic watering with no timers to configure.

Components you’ll need

ComponentQtyPrice
Arduino Nano ATmega328P Compatible Board1₹149
Soil Moisture Sensor1₹29
5V Single Channel Relay Module for Arduino1₹49
Mini Water Pump1₹19
400 Point Breadboard1₹299
Male to Female Jumper Wires 40pcs 20cm Multicolour1₹49
Total₹594

Step-by-step guide

  1. Insert the soil moisture probe into the pot and connect its module: VCC to 5V, GND to GND, and A0 to the Nano’s A0 pin.
  2. Wire the relay module: VCC to 5V, GND to GND, and IN to pin D7.
  3. Connect the mini water pump through the relay’s NO (normally open) contact so it only runs when the relay clicks on. Power the pump from a separate 5V supply if it stutters.
  4. Run a small tube from the pump into the pot, with the pump submerged in a water reservoir.
  5. Upload the sketch and open the Serial Monitor to see live moisture readings.
  6. Water the soil once manually, note the “wet” reading, let it dry and note the “dry” reading, then set THRESHOLD between the two and re-upload.

The code

The sketch averages a few analog readings, compares them with your threshold, and pulses the pump with a safety cooldown so it can never flood the pot.

const int sensor = A0, relay = 7;
const int THRESHOLD = 550;   // higher = drier (calibrate!)
void setup(){ pinMode(relay,OUTPUT); digitalWrite(relay,HIGH); Serial.begin(9600); }
void loop(){
  long sum=0; for(int i=0;i<10;i++){ sum+=analogRead(sensor); delay(20); }
  int moisture = sum/10; Serial.println(moisture);
  if(moisture > THRESHOLD){
    digitalWrite(relay,LOW);   // pump ON (active-low relay)
    delay(3000);               // water for 3 seconds
    digitalWrite(relay,HIGH);  // pump OFF
    delay(30000);              // let water soak in
  }
  delay(2000);
}

Build this project

Add all 6 required components to your cart in one click — total ₹594.

Add all components to cart
Scroll to Top