Back to Advanced Projects

🚰 Automated Watering System

Never forget to water your garden. Trigger water pumps automatically when soil gets dry.

📋 Overview

Scaling up the soil moisture monitor, this project takes action. When moisture drops below a critical threshold, a relay turns on a submersible water pump until the soil is wet again.

What you'll learn: Hysteresis (preventing pump rapid-cycling), relay safety, and multi-sensor logic.

Estimated time: 2-3 hours. Difficulty: ⭐⭐⭐ Intermediate.

🧩 Components Needed

ComponentSpecificationQtyNotes
Arduino Uno R35V1
Soil Moisture SensorsCapacitive2For two plants
Relay Module2-Channel1
Submersible Pumps5V or 12V DC2
Silicone TubingMatched to pump1

📖 Step-by-Step Tutorial

1

Wiring Relays

Connect the pumps to an external power supply through the relays (NO and COM terminals). Do not power pumps from the Arduino!
2

Wiring Sensors

Connect sensor 1 to A0, sensor 2 to A1.
3

Add Hysteresis

Turn pump ON when moisture < 30%. Turn pump OFF when moisture > 60%. This gap prevents the pump from rapidly clicking on and off.
4

Test the Plumbing

Place pumps in a reservoir (bucket) and run the tubes to the plants.
💡
Ensure your water reservoir is lower than the plants. If it's higher, water can siphon out even when the pump is off, flooding your plants!

💻 Code / Configuration

auto_water.ino
INO
// Automated Watering
const int sensor1 = A0;
const int pump1 = 8;
const int dryThresh = 400; // Value for 30% moisture
const int wetThresh = 600; // Value for 60% moisture

bool isWatering = false;

void setup() {
  pinMode(pump1, OUTPUT);
  digitalWrite(pump1, HIGH); // Assuming active-low relay
}

void loop() {
  int moisture = analogRead(sensor1);
  
  if (moisture < dryThresh && !isWatering) {
    isWatering = true;
    digitalWrite(pump1, LOW); // Turn pump ON
  } 
  else if (moisture > wetThresh && isWatering) {
    isWatering = false;
    digitalWrite(pump1, HIGH); // Turn pump OFF
  }
  

Reviews & Ratings

0 reviews
5★
0
4★
0
3★
0
2★
0
1★
0
...

Loading reviews...