You are on page 1of 12

instructables

Automatic Irrigation System Using Arduino

by The_Technocrat

Ambient Temperature and Status of Water


supply(Water Pump).

//www.youtube.com/embed/KWts8QZKIJw
Arduino UNO is the brain of this system and all the
sensors and display devices are controlled by it.

I basically got the Idea of this project from Teacher in


Hello Everybody! I am Back with another
my University and could bring the Idea to Reality
Instructables!!
with the help of these Guys. I am really thankful to
them.
In this project i will be demonstrating Automatic
Irrigation System with integrated temperature
http://www.electroschematics.com/6519/simple-soil-...
Automatic Irrigation System Using Arduino: Page 1
http://www.electroschematics.com/6519/simple-soil-...
sensor which irrigates or waters your plants
automatically. This system is best suited for drip https://www.instructables.com/id/ARDUINO-TEMPE
irrigation technique. RATUR...

A Moisture sensor is used to read the Moisture https://www.instructables.com/id/Soil-Moisture-Sens..


content of the soil. The LM35 Temperature Sensor .
reads the ambient temperature.
https://www.instructables.com/id/Connect-A-16x2-LC
This System will help you to irrigate your backyard D...
Garden or your Indoor Garden automatically and
you need not worry about watering your favorite https://www.arduino.cc/en/Reference/LiquidCrystalS..
plants in your busy schedule. .

An LCD is provided to monitor the Soil Status,

Step 1: COMPONENTS USED

The following Components are used in this * 5V Relay


project_____________________________________
_____ * BC547 or similar NPN Transistors

* Arduino UNO * Resistors ( Refer Circuit Diagram)

* Soil Moisture Sensor ( with LM393 Driver) * Potentiometer ( 10Kohm )

* LM 35 Temperature Sensor * 5mm LED

* 16x2 LCD Display * 1N4007 Diode

* Water level Switch * Terminal Strips and Screw Terminals

* Speaker * PCB

Automatic Irrigation System Using Arduino: Page 2


1

1. Soil Moisture Sensor

1 1

1. LM35 Temperature Sensor 1. LM393 Driver


2. BC547 Transistor

1 1

1. 16X2 LCD Display 1. Water level Switch

Automatic Irrigation System Using Arduino: Page 3


1 1

5 4 2

7
6 3

1. LED 1. Speaker
2. BC 547 NPN TRANSISTOR
3. 1N4007 DIODE
4. Terminal Strip
5. Potentiometer(10K)
6. Relay
7. Screw Terminals
8. Resistors

1. PCB

Automatic Irrigation System Using Arduino: Page 4


Step 2: Understanding the Working....

The Soil Moisture Sensor values depends on the following Operations....


resistance of the soil. The LM393 Driver is a dual
differential comparator which compares the sensor 1) Checks for the availability of water using water
voltage with fixed 5V supply voltage . level sensor.

The value of this sensor varies from 0- 1023. 0 being 2) If the water is available, the Pump is turned ON
most wet condition and 1023 being very dry condition. and is automatically turned OFF when sufficient
amount of water is supplied.
The LM35 is a precision integrated-circuit
temperature sensors, whose output voltage is linearly The Pump is Driven by a Relay driver circuit.
proportional to the Celsius temperature. The LM35 is
operates at -55˚ to +120˚C. 3) If the Water is Unavailable, you will be notified with
a sound.
The Water level Switch Contains a Reed-Magnetic
Switch surrounded by a floating magnet. When water The Status of soil( Dry, Moist ,Soggy) , the
is available it Conducts. temperature and the status of Pump is displayed on
the LCD Screen.
The Arduino reads the status of the soil using Soil
Moisture Sensor. If the Soil is DRY it does the

Automatic Irrigation System Using Arduino: Page 5


Step 3: Building Up the System( Circuit Construction)

Pleas refer the circuit diagram and build the circuit A0_____________________________SOIL_MOIST
accordingly. URE_SENSOR

The Arduino Connections are given A4_____________________________LM35_(TEMP


below._____________________________________ ERATURE_SENSOR)
____________________
LCD-1_____________GND
ARDUINO PINS
LCD-5_____________GND
0______________________________N/C
LCD-2_____________+Vcc
1______________________________N/C
LCD-3_____________LCD_BRIGHTNESS
2______________________________LCD-14
___________________________________________
3______________________________LCD-13 ___________________________________________
_____
4______________________________LCD-12
I have built this project on the Printed Circuit Board. It
5______________________________LCD-11 can also be constructed on Breadboard.

6______________________________N/C I have designed the Arduino shield for this project and
all the components like Led, relay, etc are embedded
7______________________________WATER_LEV in the shield itself.
EL_STATUS_LED
You can refer to my video and instructables on how to
8______________________________N/C make a PCB in this link..

9______________________________SPEAKER https://www.instructables.com/id/PCB-ETCHING-TO
NER-...
10_____________________________N/C

11_____________________________LCD-6

//www.youtube.com/embed/oouC2ioivM0
12_____________________________LCD-4

13_____________________________PUMP_STAT
US_LED)_AND_TO_RELAY

Automatic Irrigation System Using Arduino: Page 6


1

1. Circuit Diagram ( planning phase)

1. Arduino Shield PCB 1. Arduino shield placed on arduino.

Automatic Irrigation System Using Arduino: Page 7


1

1. Back view of the Arduino Shield

Automatic Irrigation System Using Arduino: Page 8


Step 4: Upload the Code to Arduino

The Arduino Code is written by me for the specific 4 Click Upload Botton.
task of Automatic Irrigation.
___________________________________________
This Software is distributed in the hope that it will be _________________________________________
useful but WITHOUT ANY WARRANTY; without
even the implied warranty of MERCHANTABILITY or The temperature id calculated using the following
FITNESS FOR A PARTICULAR PURPOSE. formula
X = ((Sensor value) * 1023.0)/ 5000
Procedure
Temperature in Celsius =( X/10)
1 Connect the Arduino to your computer.
If you want to change the sensitivity of the sensor for
2 Download the attached code and open it. different soil conditions alter the values of the 3
conditions commented in the Code.
3 Select your COM Port and your Arduino Board
from Tools Option.

1. open the Code 1. Select your board and serial port

1 1

1. Upload Button 1. Click Upload


2. Sketch Compiling

Download
https://www.instructables.com/ORIG/F7E/WT0D/JDF29YVR/F7EWT0DJDF29YVR.ino

Automatic Irrigation System Using Arduino: Page 9


Step 5: Testing and Implimentation

The following steps can be followed to test the water.


project.
Congratulations!!! You have successfully set up the
1) Connect the Arduino to power supply (5V) via USB system for irrigating your plants automatically!!!.
or External power source.
5) The potentiometer can be varied to adjust the LCD
2) Dip or bury the moisture sensor in the soil. Better brightness.
place the sensor near the roots of plants for accurate
measurements. Do not short the terminals. If you come across any doubts feel free to let me
know in the comments section.
3) Connect the Water pump to the Relay (N/O and
Common terminals) and switch ON the mains. Refer THANK YOU
the Circuit for connection details and pin out.
WARNING: HIGH VOLTAGES . UNDERSTAND HS Sandesh (a.k.a THE TECHNOCRAT)
THE WIRING BEFORE YOU PROCEED.

4) The temperature sensor can be placed on the PCB


itself or on the soil. Do not immerse the sensor in

please give me coding and connections

Please look for the code in step 4. The file name is " automatic_irrigation_system.ino"
Circuit connections are given in step 3.
Any doubts reply .
Thanks.!!
Sir the road is not opening

Great instructable, thank you; sketch uploaded but lcd just flashes every few seconds, any
thoughts?
Ground Arduino to ground

Hey bro.. looking at your content..I feel like you will help me too in mine project ..like you do
always...I m having problem with the codes...our reading output is exactly opposite...if the moisture

Automatic Irrigation System Using Arduino: Page 10


is high ..lcd displays low moisture and vice versa...so bro plz if u can contact me on Whatsapp ya
call on 9604164571...I will be waiting to hear from you..
hi, how to connect water pump to relay?

what is the use of the speaker in your study?

You made for me ? How rupiya (rs.)

Can we connect 0.25 hp waterpump instead of small pump you used??

khank you :)
Just one question that I wanna raise: Why do we need LM35 ?
lm35 is temperature sensor

the programm is giving redefination void setup() error. please help fast

What is the use of transistor in the circuit will it cause any change without it ?

The reason is you should not exceed the current rating of the micro controller (about 40mA here).
Might cause the micro controller to shut down or damage it.
So a transistor switch is required to operate the relay.

Thank you
what is use of LM35 Temperature sensor

which motor is used in this project

You can Connect any motor to the relay.


Make Sure your relay is Rated for the Power Rating of your Motor Pump.

another question where is the water level switch, and where can I get the switch and the pump
from?
U can get the pump from aquarium shop.. or any hardware store..Ask for fountain pump.

I have read your instructables and I really thank you for this great effort.
Just one question that I wanna raise: Why do we need LM393?
Hello,
Lm393 is a op amp comparator. It is used to measure the sensor resistance and output the
proportional voltage (between 0v-5v). This output is fed to analog input of arduino.

"The Soil Moisture Sensor uses capacitance to measure dielectric permittivity of the surrounding
medium. In soil, dielectric permittivity is a function of the water content. The sensor creates a
voltage proportional to the dielectric permittivity, and therefore the water content of the soil."
I am sorry . I mentioned resistance instead of capacitance in other comment.
Thanks.
Just one more thing: so the moisture sensor output is voltage, right???
then can`t send the signal directly to the arduino without using LM393
since Arduino itself has ADC in the analog pins???
Sorry for troubling you ^_^

Automatic Irrigation System Using Arduino: Page 11


Not exactly.. the moisture sensor does not output any voltage.. it's capacitance varies with
moisture..
Depending on that capacitance, The lm383 output voltage varies.
The ADC on Arduino can read voltage.. so the lm393 is used.

No troubles..U can leave a reply anytime.

Thanks.!
Finally ( ^_^) I understood it, thanks man.

Automatic Irrigation System Using Arduino: Page 12

You might also like