Download as pdf or txt
Download as pdf or txt
You are on page 1of 12

See discussions, stats, and author profiles for this publication at: https://www.researchgate.

net/publication/330212779

An Automated Irrigation System Using Arduino Microcontroller

Chapter · December 2018

CITATIONS READS
3 33,764

4 authors, including:

Wahidah Md Shah Nazrulazhar Bahaman


Technical University of Malaysia Malacca Technical University of Malaysia Malacca
14 PUBLICATIONS   61 CITATIONS    47 PUBLICATIONS   77 CITATIONS   

SEE PROFILE SEE PROFILE

Some of the authors of this publication are also working on these related projects:

Cyber Physical Systems Security View project

Network Intrusion Detection System View project

All content following this page was uploaded by Aslinda Hassan on 08 January 2019.

The user has requested enhancement of the downloaded file.


An Automated Irrigation System Using Arduino Microcontroller

Chapter 1

An Automated Irrigation System Using
Arduino Microcontroller
Aslinda Hassan, Siah Bing Sheng, Wahidah Md Shah and Nazrulazhar Bahaman

1.1 INTRODUCTION TO IRRIGATION SYSTEM


Freshwater is needed for crop and energy production, industrial
fabrication as well as human and ecosystem needs. According to
AQUASTAT database (AQUASTAT, 2016), 69% of the total extracted
freshwater is used by agriculture sector, whereas 19% is used by
industrial sector and the rest in used by domestic segment. Therefore,
water can be considered as a critical need in agriculture sector for
future global food security However, continued increase in demand
for water by domestic and industrial sectors and greater concerns
for environmental quality have create a challenge to every country
to reduce the farm water consumption and sustain the fresh food
requirement (Flörke et al., 2013). Consequently, there is an urgent need
to create strategies based on science and technology for sustainable use
of water. Industrialist and researchers are working to build efficient
and economic automatic systems to control water usage in order to
reduces much of the wastage.
Irrigation is an artificial application of watering the land for
agricultural production. The requirement of water to the soil depends
on soil properties such as soil moisture and soil temperature. Effective
irrigation can influence the entire growth process and automation in
irrigation system using modern technology can be used to provide
better irrigation management. In general, most of the irrigation
systems are manually operated. These traditional techniques can be
replaced with automated techniques of irrigation in order to use the

3
Internet of Things: Usage and Application

water efficiently and effectively. Conventionally, farmers will present


in their fields to do irrigation process. Nevertheless, nowadays
farmers need to manage their agricultural activity along with other
occupations. A sensor based automated irrigation system provides
promising solution to farmers where the presence of a farmer in
field is not compulsory during irrigation process.
Arduino is a flexible programmable hardware platform and
designed to control the circuit logically. Central to the Arduino
interface board is the main component of an integrated circuit chip
that can be programmed using C++ language. This microcontroller
is an AVR type, which produced by Atmel firm. The device can read
the input, process the program, and produce many outputs based
on project requirements. In this chapter, the development of an
automated irrigation system based on Arduino microcontrollers is
presented. In this system, a soil moisture sensor is used to detect and
check the soil humidity of the plant. Based on the soil moisture level
from the soil, the system will let the water pump to automatic water
the plant when it is too dry and turn off the water pump when the soil
of the plant is wet.

1.2 AUTOMATED WATERING TECHNIQUES


At the previous works, considering to the automated watering
techniques, it can be found that the Arduino based sensors have
been utilized for the plant watering system (Devika et al., 2014) and
automated irrigation systems (Agrawal & Singhal, 2015; Kumar Sahu
& Behera, 2015; Singh & Saikia, 2017).
An Arduino Based Automatic Plant Watering System is
proposed in (Devika et al., 2014) where the authors developed the
Arduino microcontroller used to control two functional components
which are the moisture sensors and the motor/water pump to
automatically water the plant. The moisture sensor’s function is to
sense the level of moisture in the soil whereas the water pump supplies
water to the plants.
In (Agrawal & Singhal, 2015), a smart drip irrigation system
using Raspberry Pi and Arduino is proposed for home automation

4
An Automated Irrigation System Using Arduino Microcontroller

system. A drip irrigation system makes the efficient use of water where
the water is slowly dripped to the roots of the plants through narrow
tubes and valves. The water flow from the system can be remotely
controlled via email.

1.3
AN AUTOMATED IRRIGATION HARDWARE
IMPLEMENTATION
This project design includes several functional blocks as shown Figure
1.1, namely: acquisition block, microcontroller block, automatic
functional block and monitoring block.

• Acquisition block
This block consists of one soil moisture sensor which takes the
data from the soil. It depends on the moisture level of the soil
whether to send high or low voltage to the microcontroller to
show that it is wet or dry. When the soil is wet, it will send the
low output voltage, whereas when it is dry, it will send the high
output voltage. This sensor is directly connected to Arduino
microcontroller.

• Microcontroller block
In this block, Arduino Uno is the microcontroller which is
the core hardware of this project. It receives the input from
the soil moisture sensor and processes the input based on the
requirement coded in the microcontroller.

• Monitoring block
This block includes an LCD display, which is used to monitor the
level of soil moisture by showing the percentage of the moisture
on the screen. When the soil is dry the percentage will be lower
and vice versa. In addition, it also shows the pump status which
is on or off, in which users will know the current pump status.

5
output voltage. This sensor is directly connected to Arduino microcontroller.

 Microcontroller block

In this block, Arduino Uno is the microcontroller which is the core hardware of
Internet of Things: Usage and Application
this project. It receives the input from the soil moisture sensor and processes the

input based on the requirement coded in the microcontroller.

Figure
Figure1.1:
1.1: Functional Blockdiagram
Functional Block diagram

• Automatic Functional block4


This block includes the automated watering function of the
system. The automated function consists of two main controlling
hardware, which is relay module and DC watering pump. The
relay is an automatic electric switch that uses an electromagnet
to move the switch from OFF to ON or vice versa. The switch
controls the electric signal that pass through the water pump.
When the moisture level is below the threshold level, Arduino
sends a signal to the relay module to automatically open the
path for the electric to pass through the water pump to water the
plant. After the system detects the sufficient level of the water
in the soil, the relay will close the path for electric and thus the
water pump will be stop immediately pumping the water.

6
An Automated Irrigation System Using Arduino Microcontroller

All the hardware will be assembled to Arduino, which is the


microcontroller that use to control all the hardware that attached to it
and let it function. Figure 1.2 shows the details of Arduino pins and
their connection to the corresponding hardware, which are based on
theAdvances
Recent Table on
1.1.
IoT

Figure 1.2: Details of Arduino Pin for Hardware Connection


Figure 1.2: Details of Arduino Pin for Hardware Connection

Table 1.1:1.1:
Table Arduino
Arduinopins
pinsand
and their correspondinghardware
their corresponding hardware
Hardware
Hardware Pin
Pin
Soil moisture sensor A0, Vin, GND
Soil
LCD moisture
screen sensor A0,A5,
A4, Vin, GNDGND
AREF,
Relay
LCD module
screen 5V,
A4,GND, 2
A5, AREF, GND

Relay module 5V, GND, 2


Figure 1.3 shows the complete hardware setup of the proposed
system which include the Arduino board and all the necessary attached
hardware.
Figure This
1.3 shows the project
completeishardware
considered setupaofcomplete
the proposed prototype where
system which it
include

thecan be used
Arduino and
board andfunction for the attached
all the necessary daily life. From Figure
hardware. 1.3, isit considered
This project can be
seen that the Arduino is the center of this system which connects all
a complete prototype where it can be used and function for the daily life. From Figure
the required hardware. The soil moisture sensor measures the level of
1.3, it can be seen
moisture fromthat
thethe Arduino
soil, and itis is
thetransferred
center of thistosystem which connects
the Arduino boardall tothe
process
required and make
hardware. Thedecision.
soil moisture sensor measures the level of moisture from the

soil, and it is transferred to the Arduino board to process and make decision.

7
Internet of Things: Usage and Application

Recent Advances on IoT

Figure 1.3:1.3:
Figure Hardware implementation
Hardware forthe
implementation for thewhole
whole project
project (Top
(Top andand
side side
view)view)

The LCD display shows the value that the Arduino received
The LCD display shows the value that the Arduino received from the moisture sensor.
from the moisture sensor. At the same time, the data acquired is sent
Attotherelay
samemodule
time, the to
data acquired iswhether
determine sent to relay module on
to switch to determine
or off thewhether
waterto
pump.
switch on If
or the condition
off the is met
water pump. for condition
If the the wateris pump
met forto
thebewater
switched
pump on,
to be
the water pipe attached to the pump will begin to draw up the water
switched on, the water pipe attached to the pump will begin to draw up the water
from the water source, and push the water to the other side of water
from the water source, and push the water to the other side of water pipe to complete
pipe to complete the watering process for the soil.
the watering process for the soil.

78
Recent Advances on IoT
An Automated Irrigation System Using Arduino Microcontroller

1.3.1 The Automated Irrigation System Operation

The soil moisture sensor must be check the upper and lower boundaries of the analog
1.3.1 The Automated Irrigation System Operation
value from pin A0 before it is convert to digital value.
The soil moisture sensor must be check the upper and lower boundaries
In Figure
of the1.4, the code
analog fragment
value from reads
pin A0thebefore
sensoritvalue from the
is convert tosoil moisture
digital sensor.
value.
The In Figure
value 1.4, the
is analog code
value fragment
is then readsinto
converted thedigital
sensorvalue
value fromtothe
either be soil
used for
moisture sensor. The value is analog value is then converted into
switching on the water pump or to be displayed on the LCD screen. The code fragment
digital value either to be used for switching on the water pump or
converts
to bethe upper bound
displayed 400 LCD
on the into 100% and The
screen. lowercode
bound 900 into converts
fragment 0% respectively
the in
upper
the last boundof400
statement theinto 100% and lower bound 900 into 0% respectively
code.
in the last statement of the code.

void readSensor()
{
sensorvalue=analogRead(A0);
sensorvalue=constrain(sensorvalue,400,900);
soil=map(sensorvalue,400,900,99,0);
}

Figure
Figure1.4:
1.4:Part
Partof
ofthe
theprogram
program for readingsensor
for reading sensor

The code fragment in Figure 1.5 is mainly for the printing


The code fragment in Figure 1.5 is mainly for the printing of the percentage that is
of the percentage that is acquired from soil moisture sensor to
acquired from soil
determine moisture
whether thesensor
soil istowet
determine
or dry.whether the soil
The value fromis the
wet sensor
or dry. The
also
value determine
from whether
the sensor to switch
also determine the water
whether pumpthe
to switch on water
or off.pump
Fromonthe
or off.
code in Figure 1.5, it is shown that when the soil moisture percentage
From the code in Figure 1.5, it is shown that when the soil moisture percentage is below
is below 38%, the water pump will be switch on automatically, and
38%,the
theLCD
waterscreen
pump will
will be switch
show theonwater
automatically, and the
pump status LCD screen
is ‘ON’. Whenwill
theshow
soil moisture
the water percentage
pump status is ‘ON’.reach
When 47%,
the the
soilwater pump
moisture will be switch
percentage off the
reach 47%,
automatically, and the LCD screen will show the water pump status is
water pump will be switch off automatically, and the LCD screen will show the water
‘OFF’.
pump status is ‘OFF’.

9
8
Internet of Things: Usage and Application

Recent Advances on IoT

void loop()
{
readSensor();
lcd.setCursor(0,0);
lcd.print("Moisture = ");
lcd.print(soil);
lcd.print("%");

if (soil <= 38)


{
lcd.setCursor(0,1);
lcd.print("Pump : ON ");
digitalWrite(WATERPIN,LOW);

while(soil <= 47)


{
readSensor();
delay(100);
}
lcd.setCursor(0,1);
lcd.print("Pump : OFF");
digitalWrite(WATERPIN,HIGH);
}
}

Figure 1.5: Code


Figure Fragment
1.5: Code forforsetting
Fragment settingthe
the LCD displayand
LCD display and water
water pump
pump switch
switch

1.4 SOIL MOISTURE SENSOR TEST


1.4 Soil Moisture Sensor Test
This section describes the test strategy that is used for this project.
This section describes the test strategy that is used for this project. The test is used to
The test is used to determine whether the hardware and software
determine whether
will be test theto
early hardware and software
make sure that it iswill be test early according
functioning to make suretothat
theit is
requirement
functioning (refertoTable
according 1.2).
the requirement (refer Table 1.2).

Table 1.2: Test Case


Test Table
Soil Moisture 1.2: Test Case
Sensor
Test
Test Purpose To testSoil
the Moisture Sensor
sensor values and its functionality.
Test
TestPurpose
Environment Tooftest
A glass theand
water sensor values
Arduino and its functionality.
IDE.
Test Environment
Expected Step 1. Open A the
glass of water
serial monitorandin Arduino IDE.and see the sensor
Arduino IDE
Expected Step 1. Code to test
value for the dry condition.the soil moisture sensor with Arduino
IDE.
2. Open the serial monitor in Arduino IDE and see the sensor
2. the
value for Open the serial monitor in Arduino IDE and see
dry condition.
the sensor
3. Immersed the soil moisturevaluesensor
for the dry
into condition.
a glass of water and
3. Immersed the soil moisture sensor into a glass of
see for the wet condition in the serial monitor in Arduino
water and see for the wet condition in the serial
IDE too.
monitor in Arduino IDE too.
Expected Result The soil moisture sensor is light up in the controller when
Expected Result The soil moisture sensor is light up in the controller when
it is switched on, and it can show the lower and upper
it is switched on, and it can show the lower and upper
boundaries of the sensor value in dry and wet conditions.
boundaries of the sensor value in dry and wet conditions.

10
9
An Automated Irrigation System Using Arduino Microcontroller

From the onFigures


Recent Advances IoT 1.6 and 1.8, the test shows that the soil
moisture From
sensor capture high values for dry condition which are
the Figures 1.6 and 1.8, the test shows that the soil moisture sensor capture high
around 893 with
values 900
for dry as the
condition upper
which boundary.
are around From
893 with 900 as the the Figures
upper boundary. From 1.7 and
1.9, the test shows that the soil moisture sensor capture low
the Figures 1.7 and 1.9, the test shows that the soil moisture sensor capture low valuesvalues for
wet condition
for wet which are are
condition which around
around 399399 with
with 400 as the400
loweras the lower boundary.
boundary.

Figure 1.6:
Figure 1.6:Moisture sensor
Moisture sensor test
test for dry Figure 1.7: Moisture sensor
Figure 1.7: Moisture sensor test for wet

for dry condition


condition
Recent Advances on IoT
test for wet condition
condition

10

Figure 1.8: COM5 (Arduino/ Figure Figure


Figure 1.8: COM5 (Arduino/Genuino Uno) test 1.9: (Arduino/Genuino
1.9: COM5 COM5 (Arduino/ Uno) test

Genuino Uno) test result from
result from sensor test in Figure 1.6 Genuino
result Uno)
from sensortest
test inresult
Figure 1.7from

sensor test in Figure 1.6 sensor test in Figure 1.7


1.5 Closure

The main purpose of this chapter is to propose an automated irrigation system that
11
water the plant without any human control. The automated irrigation system

implemented is found to be feasible and cost effective for optimizing water resources

for agricultural production. Besides the automated irrigation system, the proposed
Internet of Things: Usage and Application

1.5 CLOSURE
The main purpose of this chapter is to propose an automated irrigation
system that water the plant without any human control. The automated
irrigation system implemented is found to be feasible and cost effective
for optimizing water resources for agricultural production. Besides the
automated irrigation system, the proposed system also provides the
monitoring function where users are able to check the soil moisture
based on the reading on the LCD display. The proposed system has
been designed and tested to function automatically. For future works,
the automated irrigation system can be configured to measure the
moisture level (water content) according to the moisture requirement
of the different plants.

References
Books and Journals
Agrawal, N., & Singhal, S. (2015). Smart drip irrigation system using raspberry pi
and arduino. International Conference on Computing, Communication &
Automation, 928–932. http://doi.org/10.1109/CCAA.2015.7148526

Devika, S. V, Khamuruddeen, S., Khamurunnisa, S., Thota, J., & Shaik, K. (2014).
Arduino Based Automatic Plant Watering System. International Journal of
Advanced Research in Computer Science and Software Engineering, 4(10), 449–456

Flörke, M., Kynast, E., Bärlund, I., Eisner, S., Wimmer, F., & Alcamo, J. (2013). Domestic
and industrial water uses of the past 60 years as a mirror of socio-economic
development: A global simulation study. Global Environmental Change, 23(1),
144–156. http://doi.org/10.1016/j.gloenvcha.2012.10.018

Kumar Sahu, C., & Behera, P. (2015). A low cost smart irrigation control system. In
2nd International Conference on Electronics and Communication Systems,
ICECS 2015 (pp. 1146–1151). http://doi.org/10.1109/ECS.2015.7124763

12
An Automated Irrigation System Using Arduino Microcontroller

Singh, P., & Saikia, S. (2017). Arduino-based smart irrigation using water flow sensor,
soil moisture sensor, temperature sensor and ESP8266 WiFi module. In IEEE
Region 10 Humanitarian Technology Conference 2016, R10-HTC 2016 -
Proceedings. http://doi.org/10.1109/R10-HTC.2016.7906792

Onlines
AQUASTAT. (2016). Water Uses. Retrieved from http://www.fao.org/nr/water/aquastat/
water_use/index.stm

13

View publication stats

You might also like