Skip to main content
  1. Projects/

Plant Watering System

Arduino Electronics Iot
Falk Zeh
Author
Falk Zeh
Data Engineer & Humanoid Robotics Student
Table of Contents

Arduino Plant Watering System

Plant Watering System - Arduino saving my plants
#

This project is an automated plant watering system designed for people like me who keep letting their plants die. It uses an Arduino UNO, moisture sensors, pumps, and a relay to provide a timely and accurate watering schedule for up to four plants. It aims to solve the problem of over watering or under watering, which are common issues in plant care.

Features
#

  • Automatic Watering: The system waters the plants automatically when the soil moisture levels fall below a certain threshold.
  • Moisture Level Monitoring: The system consistently monitors the moisture level in the soil and adjusts the watering schedule accordingly.
  • Supports up to 4 Plants: The system has the capability to water and monitor up to four plants simultaneously.

Hardware Requirements
#

  • Arduino UNO
  • Soil Moisture Sensors (4x)
  • Water Pumps (4x)
  • Relay Module (4-channel)
  • Breadboard
  • Jumper Wires (assorted male-to-male, female-to-female, male-to-female)
  • Hose (length depends on how far your plants are away from the water source)
  • (Optional) Soldering Equipment

Software Requirements
#

Installation Guide
#

Installing the Software

Download and install the Arduino IDE from the official website.

Setting Up the Hardware:

Connect the moisture sensors, pumps, and relay module to the Arduino UNO using the breadboard and jumper wires.

Humidity SensorArduinoSensor
Humidity Sensor 1A0AOUT
Humidity Sensor 15VVCC
Humidity Sensor 1GNDGND
Humidity Sensor 2A1AOUT
Humidity Sensor 25VVCC
Humidity Sensor 2GNDGND
Humidity Sensor 3A2AOUT
Humidity Sensor 35VVCC
Humidity Sensor 3GNDGND
Humidity Sensor 4A3AOUT
Humidity Sensor 45VVCC
Humidity Sensor 4GNDGND
ArduinoFour-Channel Relay
VCCVIN
GNDGND
D2IN1
D3IN2
D4IN4
D5IN5

I’m using the 5V output of the Arduino to power the sensors as well as the pumps. My super chaotic setup looks like this:

Wiring

Connecting the Hardware and Software:

Upload the project code to the Arduino UNO via the Arduino IDE:

const int NUM_SENSORS = 4;
int outputPins[NUM_SENSORS] = {2, 3, 4, 5};
int inputPins[NUM_SENSORS] = {A0, A1, A2, A3};
float values[NUM_SENSORS] = {0, 0, 0, 0};

void setup() {
  Serial.begin(9600);

  for(int i = 0; i < NUM_SENSORS; i++) {
    pinMode(outputPins[i], OUTPUT);
    pinMode(inputPins[i], INPUT);
    digitalWrite(outputPins[i], HIGH);
  }
  delay(5);
}

void loop() {
  for(int i = 0; i < NUM_SENSORS; i++) {
    Serial.print("MOISTURE LEVEL ");
		Serial.print(i);
		Serial.print(" : ");
    values[i] = analogRead(inputPins[i]);
    Serial.println(values[i]);

    if(values[i] > 750) {
      digitalWrite(outputPins[i], LOW);
    } else {
      digitalWrite(outputPins[i], HIGH);
    }
  }

  Serial.println();
  delay(500);
}

Usage
#

Once everything is set up, the system will start monitoring the moisture level of the soil for each plant. When the moisture level falls below a certain threshold, the respective pump will activate, watering the plant. The system runs continuously, ensuring your plants receive the optimal amount of water.

If you check your Serial Monitor, you should see outputs like this:

MOISTURE LEVEL 0 : 587
MOISTURE LEVEL 1 : 549
MOISTURE LEVEL 2 : 390
MOISTURE LEVEL 3 : 522

And we’re done! You can now leave your plants in the care of the Arduino. Just make sure that the Arduino is connected to a power source at all times (speaking from experience…).

Plants

Related

Hello Arduino! - Binary Thermometer
Arduino Electronics