Autonomous Irrigation System

About: Innovation is my Oxygen.

Intro: Autonomous Irrigation System

This is an Autonomous Irrigation System which has the capability to detect the soil's moisture and keep the plant hydrated.

*This is my first instructable.

Things required:

*DC 3 V-6 V Micro Submersible Mini Water Pump.

*Aquarium Flexible Silicone Air Tube.


*Arduino UNO.

*Relay Module With Optocoupler.

*Soil moisture sensor.

*Jumper Wires

So,let's get making!

Step 1: Making Connections.................

*Connect the Moisture Sensor to Pin 2.

*Connect the Relay module to Pin 3.

*Connect the Green Led to pin 4.

*Connect the Red Led to pin 5.

Step 2: Let's Get Coding..........

/***************************************************************************** AUTOMATIC IRRIGATION SYSTEM***************************************************************************/

  int SENSOR=2;//Moisture sensor is connected to Pin 2.  
int RELAY=3;//Relay is connected to Pin 3.
  int LED1=4;//Green LED is connected to Pin 4. 
 int LED2=5;//Red LED is connected to Pin 5.  
int VAL=0;//Will be used to store the value of the sensor. 
 void setup(){   //Configuring the pins as INPUT and OUTPUT.  
 pinMode(LED1,OUTPUT);//Set the Green LED as OUTPUT. 
  pinMode(LED2,OUTPUT);//Set the Red LED as OUTPUT.  
 pinMode(RELAY,OUTPUT);//Set the Relay Module as OUTPUT.   
pinMode(SENSOR,INPUT);//Set the Moisture Sensor as INPUT.  

 Serial.begin(9600);//Start the communication at 9600 baud.  }
 void loop(){   VAL=digitalRead(SENSOR);//Fetch the INPUT from the Moisture Sensor and store it.  
 Serial.println(VAL);//Print the INPUT gathered from the Moisture Sensor.  
 //Check whether the INPUT  is HIGH or LOW. 
  if(VAL==LOW){     digitalWrite(LED2,HIGH);//Turn on the Red LED.   
  digitalWrite(LED1,LOW);//Turn off the Green LED.   
  digitalWrite(RELAY,HIGH)//Turn on the PUMP.   
  Serial.println("DONE!!!!!!!")//Print the quoted text.    
 delay(10000);//Stop the pump for 10 Seconds.   }else{   
  digitalWrite(LED2,LOW);//Turn off the Red LED.    
 digitalWrite(LED1,HIGH);//Turn on the Green LED.  
   digitalWrite(RELAY,LOW)//Turn off the PUMP.  
   Serial.println("WATERING!!!!!!!")//Print the quoted text. 

delay(10000);//Delay between reads.
  } }

*Please Note:If the code doesn't work then please feel free to comment.



    • Metalworking Contest

      Metalworking Contest
    • Fix It! Contest

      Fix It! Contest
    • Furniture Contest 2018

      Furniture Contest 2018

    8 Discussions

    Ayush AryaArielR39

    Reply 7 months ago

    I am from Jharkhand ,India.
    To be more precise from Bokaro Steel City.

    Where do you come from?


    Hi I have uploaded the photo
    I hope you will like it.
    And there are a few changes in the code
    Is now,

    Ayush Arya

    8 months ago

    If you have any problem you can post it in the comment section .
    I will surely look into it.
    Happy coding..☺️☺️☺️

    Ayush Arya

    8 months ago

    there are a few changes in the code
    Is now,