Smart Irrigation System using Arduino

Welcome to the Techatronic, In this article, we will share with you how to make a smart irrigation system using Arduino. this is a very popular project nowadays. if you are searching for the project you are in the right place. you will learn a lot of things in this article regarding smart irrigation systems.



it is actually a precision automatic watering system for the plant which automatically watering the plant without your engagement with the system. this is made up of Arduino which can easily make by nontechnical persons also so it is the Arduino irrigation system this system is using in gardens and farms widely. So many of the students searching for this project over the internet as final year project for ece. the smart irrigation system is not using only the garden and farms it is implementing into the crops and smart greenhouse also. we are having more Arduino projects also you can see this awesome Bluetooth Rc car project.

smart irrigation system

How does smart irrigation work?

As we are using a soil moisture sensor that senses the moisture content in the soil. and send this data to the Arduino that we are using. Soil moisture sensors can send data in both. in analog as well as in digital. so we are using the analog data here to get the accuracy in the project. we insert the soil moisture sensor in the soil and connected it to the Arduino and the sensor sends the data to the Arduino about the moisture inside the makes the smart irrigation controller. the Arduino will get the action on the data. according to the condition given in the program. if the soil moisture sensor detects no moisture or very little moisture then the pump will get started and watering the plants.

I would like to mention too that this is an advanced version of the smart irrigation system which recognizes the less moisture contain soil in the various field. in this ece final year project, the water pipe is connected to the servo motor which rotates according to the requirement. if there are two crops A & B. and if A having less amount of moisture then the servo motor rotates toward crop A. and starts the watering and when it will fill up it will rotate towards crop B. this is one more benefit of this project.

Learn 10+ basic activity & sensor interfacing with our Arduino ebook. Well explained program. And brief circuit diagram WhatsApp and email support. which will help you to learn basic electronics, Arduino Coding, Sensor interfacing with Arduino, Arduino, and much more. buy Arduino Ebook to learn

Smart irrigation system Components required:-

  • Arduino Uno
  • Servo motor
  • Soil moisture sensor
  • mini water pump
  • jumper wires.
  • Relay module
  • Breadboard


Components Table / Buy Link

S.No Component Name Quantity Link
1. Arduino UNO 1
2. Soil Moisture Sensor 2
3. Servo Motor 1
4. DC Mini Water Pump 1
5. Jumper Wire 30
6. Breadboard 1
7. Single Channel Relay Module 1
8 12 Volt DC Adaptor 1


Right now a framework, we took a soil moisture sensor that can detect the Moisture in the soil. Soil moisture sensor gives some an incentive to the microcontroller which we use in the framework for directions.  we prescribe utilizing the simple worth. since on the simple worth, you can adjust the dampness level with the yield gadget. for instance, Soil moisture gives the worth 0 to 1023. so you can align the sensor as your soil condition. yet, on the advanced yield of the sensor, you can not align the sensor by the code as indicated by the Soil moisture. there is a potentiometer to adjust the sensor. for more precision utilize simple sensors. The keen smart irrigation system framework is useful for a conclusive year venture.

In the wake of adjusting the sensor, I found that the cut-off value is 970. at this worth, the moisture level is exceptionally low in the dirt. that is to say, on the off chance that the Soil moisture sensor detects the worth more than 970, at that point the water pump is on. what’s more, if the sensor detects the worth under 970 the water pump will stop. in this way, align your sensor.


Circuit Diagram for smart irrigation system:-


smarft irrigation system circuit diagram


Fritzing Diagram



Connection Table


Arduino UNO Soil moisture Sensor
A0 Soil Sensor 1 – A0
A1 Soil Sensor 2 – A0
Arduino UNO Servo Motor
PN  8 Signal Pin Orange Wire
VCC VCC Red Wire
GND GND Black Wire
Arduino UNO Single-channel Relay Module
PIN  9 Signal PIN
Water Pump Single-channel Relay Module
Terminal 1 Normally Open
Normally Closed
Terminal 2 GND
Arduino UNO Relay Module
Normally Open
VCC Common
Normally Closed

Smart irrigation Arduino Code

#include <Servo.h> // servo library

Servo myservo; 
int m=0;
int n=0;
int pos = 0; 
void setup()
  // put your setup code here, to run once:
pinMode(A0, INPUT_PULLUP);           // Soil Moisture Sensor 1 PIN A0
pinMode(A1, INPUT_PULLUP);           // Soil Moisture Sensor 1 PIN A1
pinMode(8,OUTPUT);                             // Relay Module PIN D8
Serial.begin(9600);                                  //  Sensor Buart Rate
myservo.attach(9);                                   //  Servo PIN D9

digitalWrite(8, HIGH);                           // Relay Normally Hight for OFF condition

void loop() 

  // put your main code here, to run repeatedly:

int m= analogRead(A0);                         // Soil Moisture Sensor 1 PIN A0
int n= analogRead(A1);                           // Soil Moisture Sensor 1 PIN A1
if (m>=980)
 myservo.write(90);              // tell servo to go to position in variable 'pos'
  digitalWrite(8, LOW);       // Relay ON

else if(m<=970) 
 digitalWrite(8, HIGH);      // Relay ON

 if (n>=980)

  myservo.write(0);              // tell servo to go to position in variable 'pos'
  digitalWrite(8, LOW);       // Relay ON

else if(n<=970)

  digitalWrite(8, HIGH);    // Relay OFF
  digitalWrite(8, HIGH);   // Relay OFF



upload the code in the Arduino bu using the Arduino IDE

download Arduino IDE


Video Sample