Automatic Plant Watering System Using Arduino Uno © GPL3+

This system monitors the moisture of soil and waters it by 5v DC motor based water pump when needed.

  • 9,214 views
  • 19 comments
  • 24 respects

Components and supplies

Apps and online services

About this project

Whenever me and my family go for vacations, I used to get worried about my plants because they need water on regular basis. I gone through several options to solve this problem as plants need water according to the moisture level of soil. So I have made Automatic Plant Watering System Using Arduino UNO.

In this system, soil moisture sensor senses the moisture level of the soil. If soil will get dry then sensor senses low moisture level and automatically switches on the water pump to supply water to the plant. As plant get sufficient water and soil get wet then sensor senses enough moisture in soil. After which the water pump will automatically get stopped.

I have used a self made water pump in this system using 5 volt DC motor. I could use 12 volt water pump in the system but to operate this, it will require a relay module. So, to reduce all these hardware complexity, I made DC motor based water pump using diode, transistor and registers combined circuit which operates DC motor according to the Arduino code.

Circuit description:

1. DC motor using water pump:

I use DC motor to make water pump. DC motor has two leads one is positive and another one is negative. If we connect them directly to the Arduino board then it will damage the board. To overcome this problem, NPN transistor is used to control the switching activity of the motor according to the code.

Arduino pin 13 (named as WATERPUMP in code) is used to turn on and off the transistor. According to the code to control the speed of the motor we need to enter a value between 0 and 255 in the Serial Monitor. I used 200 value for the speed of the motor.

2. Soil moisture sensor:

The soil moisture sensor consists of two leads that are used to measure volume of water content in soil. These leads allow the current to pass through the soil and in return calculates the resistance value to measure the moisture level. If there is more water in soil then soil will conduct more electricity, means less resistance value along with high level of moisture. In the same manner if there is less water in soil then soil will conduct less electricity, means high resistance value along with low level of moisture.

Code

Automatic plant watering system code C/C++
int WATERPUMP = 13; //motor pump connected to pin 13
int sensor = 8; //sensor digital pin vonnected to pin 8
int val; //This variable stores the value received from Soil moisture sensor.

void setup() {
  
  pinMode(13,OUTPUT); //Set pin 13 as OUTPUT pin
  pinMode(8,INPUT); //Set pin 8 as input pin, to receive data from Soil moisture sensor.
  //Initialize serial and wait for port to open:
  Serial.begin(9600); // opens serial port, sets data rate to 9600 bps
  while (! Serial);// wait for serial port to connect. Needed for native USB
  Serial.println("Speed 0 to 255");
}

void loop()
  { 
  if (Serial.available()) //loop to operate motor
  {
    int speed = Serial.parseInt(); // to read the number entered as text in the Serial Monitor 
    if (speed >= 0 && speed <= 255)
    {
      analogWrite(WATERPUMP, speed);// tuns on the motor at specified speed 
    }
  }
  val = digitalRead(8);  //Read data from soil moisture sensor  
  if(val == LOW) 
  {
  digitalWrite(13,LOW); //if soil moisture sensor provides LOW value send LOW value to motor pump and motor pump goes off
  }
  else
  {
  digitalWrite(13,HIGH); //if soil moisture sensor provides HIGH value send HIGH value to motor pump and motor pump get on
  }
  delay(400); //Wait for few second and then continue the loop.
}

Schematics

Fritzing Diagram of the system
I had used black colored wire for ground, red-colored wire for VCC and blue colored wires for arduino inputs.
Capture 5uektpi7bg

Comments

Similar projects you might like

Arduino Bluetooth Basic Tutorial

by Mayoogh Girish

  • 454,985 views
  • 42 comments
  • 239 respects

Home Automation Using Raspberry Pi 2 And Windows 10 IoT

Project tutorial by Anurag S. Vasanwala

  • 285,493 views
  • 95 comments
  • 671 respects

Security Access Using RFID Reader

by Aritro Mukherjee

  • 229,385 views
  • 38 comments
  • 236 respects

OpenCat

Project in progress by Team Petoi

  • 195,982 views
  • 154 comments
  • 1,363 respects
Add projectSign up / Login