in

Smart irrigation system with Arduino

arduino auto watering system

Welcome to the Quanta projects. we are back with our new smart irrigation system with the Arduino in this tutorial we will make an auto watering system based smart irrigation system. it needs when you are not able to check the water on a daily basis in your garden or farm so this can control the water without your need. it will check the soil according to the moisture level and start the system so that the soil will get the water as per it’s a requirement. it checks the soil by itself that’s why this system is known as the smart irrigation system. or we can add more feature to these projects by our critical thinking. 

if you have any farm or any garden around your home and you are not able to check the soil on a regular basis you must try this auto watering system with Arduino board. you can learn many things from this project such as how to use soil moisture sensor, how to calibrate the sensor how to interface soil moisture sensor relay and mini water pump. so you don’t worry about your learning we will provide the step by step full tutorial here. now let’s understand the working of the system.

There is a soil moisture sensor which is sensitive to water and working in the resistance when it gets contacted to the water or moisture it will show some conductivity and we can say the value of resistance will get affected when it comes in the contact of water or moisture. so we are using this property of the soil moisture sensor. we insert the soil moisture sensor in the soil and it will check the moisture level in the soil and continuously check the moisture. and send the data to the Arduino and board and now the Arduino will cross-check the data with the database and operate the system according to it.

Circuit diagram for the smart irrigation system.

code for the smart irrigation system.

#include <Servo.h>

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);

pinMode(A1, INPUT_PULLUP);

pinMode(8,OUTPUT);

Serial.begin(9600);

myservo.attach(9);

}

void loop() {

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

int m= analogRead(A0);

int n= analogRead(A1);

Serial.println(m);

delay(10);

Serial.println(n);

delay(200);

if (m>=980)

{

myservo.write(90); // tell servo to go to position in variable ‘pos’

digitalWrite(8, HIGH);

delay(1000);

}

else if(m<=970)

{

digitalWrite(8, LOW);

}

if (n>=980)

{

myservo.write(0); // tell servo to go to position in variable ‘pos’

digitalWrite(8, HIGH);

delay(1000);

}

else if(n<=970)

{

digitalWrite(8, LOW);

}

else

{

digitalWrite(8, LOW);

}

}

Upload the given code into your Arduino and make all the connections according to the circuit diagram.

all the best

What do you think?

3 points
Upvote Downvote

Written by shahid

Leave a Reply

Your email address will not be published. Required fields are marked *

Temperature and Humidity monitoring system

control servo motor with flex sensor