You are on page 1of 5

Automated Irrigation System based on irrigation gates using fuzzy logic

Muhammad Farooq Aamir Hussain Sarfraz Hashim


2020 International Conference on Internet of Things and Intelligent Applications (ITIA) | 978-1-7281-9301-4/20/$31.00 ©2020 IEEE | DOI: 10.1109/ITIA50152.2020.9312344

Department of Computer Science Department of Computer Science Department of Agriculture Engineering


Muhammad Nawaz Sharif University of Muhammad Nawaz Sharif University of Muhammad Nawaz Sharif University of
Agriculture Agriculture, Agriculture,
Multan, Pakistan Multan, Pakistan Multan, Pakistan
farooqsahir@hotmail.com aamir.hussain@mnsuam.edu.pk sarfraz.hashim@mnsuam.edu.pk

Lin Yang Mubashir Ali


CIA Lab at School of Engineering Huazhong Department of Software Engineering
Agricultural University Lahore Garrison University
Wuhan, China Lahore, Pakistan
Lin.yang@hzau.edu.cn dr.mubashirali1@gmail.com

Abstract— Water resources in the world are running down of overwatering. In Pakistan, the watering system consumes
rapidly. In Pakistan, 93 % of water is used to irrigate agricultural 93% of the total available water, and it becomes dangerous
land, and more than 60% wasted during irrigation. The main
causes of this wastage are lack of irrigation knowledge and
when 60% of the 93% water is wasted during this watering
improper scheduling. Which causes the wastage of water, loss in practice. This irrigation failure also destroys soil fertility. The
soil fertility, loss in production, and wastage of electric power. This main reason for this wastage is improper handling of the
wastage can be controlled by adopting modern technologies in the watering system, this handling includes overwatering and bad
agriculture sector. IoT based automated solutions can facilitate to
accomplish the optimized distribution of water in the context of scheduling.
irrigation. In this study, a smart gate equipped with water level and Precision Irrigation (PA) is an IoT based agricultural system,
flow measuring sensors has been developed for open channel planned to progress the rural forms by accurately checking
precision irrigation. Multiple sensing nodes were deployed to
each step to ensure the greatest agricultural production with
collect soil moisture, temperature, and humidity from the field by
applying WSN techniques and forwarded collected data to minimized natural effect. PA can be defined as the supply of
Firebase Realtime Database. Fuzzy logic techniques have been the measured amount of water at a suitable time after the
used for decision making by evaluating collected data according calculated interval. This management results in a decrease in
to fuzzy rule-base. Smart gate delivers water content as per the
crop’s needs by calculating water quantity based on fuzzy water wastage and a rise in yield. Agriculture is a major part
decisions. The mobile dashboard provides Realtime information of the IoT application area. 70% of Pakistan’s economy is
and control to the farmer. The system has been tested on a pilot dependent on it. According to an estimate, IoT will feed 9.6
scale and MATLAB simulation. Moisture decrease rate at billion people on this earth in 2050. IoT helps to increase the
different temperatures has been tested to predict irrigation days.
productivity of yields by effective use of fertilizers and
reduced wastage. [2].
Keywords— Automated Irrigation; Internet of things IoT; In this research, we proposed an IoT based irrigation system
Wireless Sensor Network (WSN); Irrigation gates, Fuzzy Logic based on automated irrigation gates with water level and flow
sensors. Different nodes have been installed in the field for
1. INTRODUCTION: detecting the moisture using WSN technology. Fuzzy logic
has been used to decide irrigation. This system is
According to the World Bank agriculture sector account for
environment friendly, low cost, and control the overwatering.
about 70% of total water consumption, industry uses 20%,
A user-friendly mobile interface provides full control to
and 10% water used at the domestic level worldwide. By
farmers for remotely monitoring and controlling the watering
2050, the population of the world is predicted to grow up to
procedure.
10 billion, this population will consume more water and food.
2 RELATED WORK:
[1]. The watering system has been securing farming for a
A system can be developed to monitor crop fields using
long time and is the commodity of numerous societies.
sensors that are soil sensor, humidity sensor, temperature, and
Historically, it was the establishment of the economy, from
light sensors. The system will automate the irrigation. The
Asia to the Southwestern United States. The traditional
wireless technology will be used to transfer data from sensors
methods of irrigation cause the massive wastage of water,
to android/web applications. The server acts as a middle
require full human engagement, and less productive because
source and uses JSON format to encode the data; then data is

XXX-X-XXXX-XXXX-X/XX/$XX.00 ©20XX IEEE

Authorized licensed use limited to: Miami University Libraries. Downloaded on June 15,2021 at 09:36:57 UTC from IEEE Xplore. Restrictions apply.
transferred to an android application. A limit is set for irrigation system with fuzzy logic. The architecture contains
temperature and humidity according to the requirement of different agents, they are responsible for decision making, on
crops to automation as if temperature decreases/increases and or off the irrigation system[11]. An open-loop fuzzy logic
humidity ups/lowers the appropriate action is performed system based on Mamdani Control System. Use data
automatically (e.g. turning ON/OFF exhaust fans if collecting from the temperature sensor, humidity sensor, and
temperature increases). The former can remotely control flux sensor as an input to the system. As output system
notification on the app to monitor and control field control water pump and lamp[12].
conditions. The proposed system is 93% efficient then
conservative approach [2]. 3 SYSTEM COMPONENTS:
Proposed an automatic watering system using moisture
sensor, Arduino UNO board, and ATMEGA328P. They 3.1.1 Soil moisture: The soil water substance (SWS) is the
show the information and graphs on the webpage by using the sum of water present within the soil. This substance impacts
GSM-GPRS SIM900A module for internet connectivity[3]. plan development, soil temperature, chemical transportation,
They resolve the loss of soil fertility and water wastage by and groundwater revival. The two broadly utilizes parameters
for measuring SWS or water accessibility for the plant are i)
designing an intelligent irrigation system based on fuzzy
Volumetric water substance (VWS) ii) soil matric potential.
control and crop water data. This Realtime monitoring system In this research, we used the Adafruit STEMMA capacitive
uses WSN technology to communicate[4]. Proposed a sensor for detecting moisture in the soil and set a
service-oriented architecture for irrigation management threshold value of 30% for experiment purposes by using
based on IoT. They define three layers in architecture and the formula in code.
interface for enabling all three layers, they define the float moisture = ( 100 - ( (sensor_readings/1023) * 100 ) );
execution of all processes in the water management
Soil moisture sensing is a key element to make the decisions
framework. Used a platform-independent OPC UA (OPC UA
about watering and the quantity of water to be given.
stands for Object Linking and Embedding for Process Control
Capacitive soil moisture is made of corrosion-resistant
Unified Architecture) protocol for enabling the machine to
material and operates on 3.3v to 5v.
machine data transmission. This architecture for the control
of processes in the logistics and manufacturing sectors [5]. 3.1.2 Water Level Sensing:
Introduced cloud computing, Radio Frequency Identification Water level sensing is a key parameter for decision making.
(RFID), IoT and describes how these technologies are It plays a vital role to maintain the water stream from the
creating ease for humans. Cloud computing and IoT can bring irrigation gate.
a handsome improvement in agricultural production[6]. An 3.2 HARDWARE COMPONENTS:
irrigation technique based on LoRA (Long Range Wide
3.2.1 Linear Actuator:
Area). It is an approach that provides low cost, secured, and The linear actuator creates motion in a straight line. Inside
long-range data transmission for IoT applications. Used actuator, there is a screw or leadscrew which creates the
hydroelectric generator, LoRA modules, and solenoid valve. motion. The screw works like a shaft and rotates clockwise
Develop a mobile app for controlling developed set-up[7]. and anticlockwise. The dc motor is used which operates on
IoT based irrigation system which contains the SIM900A 12v and 4amp, but ampere goes high when it drags the
module for the controlled greenhouse is based on an alarm weights. In this experiment, it goes up to 8 amperes. At the
system. The system can gather environmental information end of the shaft, there is a switch that disconnects the power
from sensors such as air temperature and air humidity. when it reaches its maximum point (200 mm).
Additionally, by using AT commands, this system can be
controlled by SMS (Sending and receiving. Data can be sent 3.2.2 Designing of the gate:
to users remotely[8]. A sluice gate has been developed with the effort of physics
The technology used in the proposed system is Wireless laws using stainless steel with a linear actuator. An irrigation
sluice gates are generally in irrigation channels. It consists of
Sensor Networks (WSNs). This technology increases the
an internal slider that slides up and down to open or close the
efficiency of the traditional watering system and helps the channel as shown in fig.3. A rubber seal has been fitted at the
irrigation system to be highly efficient. WSN is used for border of the moving panel to control water leakage.
collecting, storing, and sharing data collected by sensors[9].
Describe the controlling and monitoring irrigation, they 4 METHODS AND TECHNOLOGIES USED
collect sensors data and send that to the cloud for
prediction[10]. Present a Multi-agent architecture-based 4.1 Automation of the sluice gate using (IoT).

Authorized licensed use limited to: Miami University Libraries. Downloaded on June 15,2021 at 09:36:57 UTC from IEEE Xplore. Restrictions apply.
This research focuses on the utilize of numerous sensors as a An average has been taken of collected values from all nodes
device to control water amount in watering system and a single value has been generated which sends the
framework in real-time. The system has been designed for instruction to the connecting gate with the land or notify a
low-power utilization, low cost, water’s waste diminished, user about action
labor decreased, and data communication between sensors
4.3 Firebase Database:
hubs. IoT is the best way to connect the different things and
operate them remotely. Water level sensor and flow sensor Firebase is a NoSQL database developed by Google. This is
connected with the main controller module (MCM). a lightweight Realtime database which means it can perform
read and write the operations faster than the SQL database.
Firebase stores the data in JSON (JavaScript Object Notation
is a lightweight method to handle data) form which make a
JSON tree to store the values. Its code for reading and writing
is very shorts. In this research, we use Mobizt [13] library to
connect esp32 to firebase.
4.4 Working Diagram and layered architecture:
ESP board collects readings from the sensors and send them
to cloud database where decisions making has been done,
these decisions can be seen by the user on the mobile
application and the copy of these decisions also sent to the
Figure 1 System configuration database. All data transmission has been done through the 4G
network. Users can connect mobile app locally to the specific
A 150W solar panel that produces 9.8 amp current and 18 gate within the range.
volts has attached through a battery charger to the 12v
Data collection layer include the most important part of the
rechargeable battery and attached a voltage regulator to create
system, it based on sensor used to collect field data, these
a 5v input for ESP board. Water Level sensor and flow rate
sensors create a mesh of wireless sensor network and send the
sensor have been attached to GPIO 27 and GPIO 2,
collected data to firebase by using network gateway. The
respectively. A 43Amp driver module has connected between
sensor attached to the irrigation gate also shares their data
actuator and controller, GPIO 33 is used for upward signals,
with firebase by using the same gateway. This collected data
25 is used for downward signals and 26 is used for enabling
fetched from the database and processed by using Node.js
the signal process (fig 1).
code written on the web API and upload back the results in
the database. The mobile application syncs the processed data
4.2 Moisture Sensor Node: and shows it to the user or does operation according to the
A T-Higrow ESP32 module used as a node for moisture control situation (Auto or Normal).
sensing, this module has built-in dht22 sensor for measuring
temperature, humidity, and capacitive moisture sensing panel
with a 3000mAH lithium rechargeable battery which has 17
hours life. The sensor has been dipped 5 inches inside the soil
wrapped with a secured shield to ensure the data accuracy.
Moisture sensor gives low values on high moisture. As shown
in fig.2.
Each node sends its data to the database directly through a Figure 3 Data collection diagram and layered architecture
wireless network, to identify the nodes different identification
numbers have been given to the nodes. 4.5 Fuzzy logic: Fuzzy logic is based on observations the
Moisture in percentage formula: same as humans. This term deals with vague inputs, in real
float moisture = (100 - ((readings/1023) * 100)); life, there are many examples when a human cannot take
decisions in yes or no and have some other options also
because their fuzzy logic offers flexibility for decision. By
using this approach, uncertainties and inaccuracies can be
considered for any situation. In the Boolean system, 1.0
represents true value, and the absolute false value is
determined by 0.0. But the fuzzy logic system represents no
Figure 2 Moisture Sensing Node absolute truth or false, there is always space for more than
two outputs. Fuzzy logic represents an intermediate value
The sensor readings variable contains the analog values
which is between 1.0 and 0.0. The fuzzy architecture contains
collected by the sensor. The second value 1023 is the
these four parts: 1) RULE BASE: It includes the instructions
maximum reading which a sensor can measure.
(set of rules) and If-THEN conditions for making decisions.

Authorized licensed use limited to: Miami University Libraries. Downloaded on June 15,2021 at 09:36:57 UTC from IEEE Xplore. Restrictions apply.
2) FUZZIFICATION: the conversion of numbers has been
done by this; it changes the Crips input to fuzzy sets. Exact
The Mobile app allows farmers to set a schedule for watering
measures taken by the sensor are defined as Crisp values like
by using calendar and time picker. Real-time values of
moisture content and water level. 3) INFERENCE ENGINE:
sensors are processed on the server and sent to the user’s
It matches the current input concerning a set of rules decided
mobile.When a specific date & time of schedule arrives or the
in the rule base and judge which rules fulfill the condition. 4)
water level gets lower in a specific field it alerts to the user to
DEFUZZIFICATION: It converts the fuzzy sets into Crips
set water pump in ON state and if the system is on auto then
values obtained by an interface.[14]
it set water pump ON itself.
Fuzzy logic is applied to the system to operate the gate, five
parameters have been considered to determine the 5. RESULTS AND DISCUSSION
appropriate action (1) moisture value, (2) water level near Water management or irrigation is a difficult task in
relative gate (3) humidity (4) temperature. The data of agriculture because water resources are decreasing rapidly
moisture and water level has been divided into categories and in Pakistan, approximately 60% of water wasted during
high, medium, and low, in the graphs (fig. 5) x-axis represents irrigation. In this research, a complete watering solution
the degree of membership and the y-axis represents the based on automated gates and WSN has been designed with
a low budget. The development of automated gates on the
local level and smart controlling system is the main objective
of this research. Successfully designed and installed the
system and test its accuracy, the results were satisfactory
enough.
The decrease rate in water content has been measured at
different temperatures as described in table 1. This decreased
rate provides help to predict the next irrigation day because
Figure 4 Rule Base
high temperatures can disturb the irrigation schedule [14]
percentage values. Readings from water levels are taken as Fuzzy logic and wireless sensor networks provide markable
percentages instead of inches. The rule base has been efficiency in these types of systems. Defuzzification of Crisp
designed for example when the moisture content in the field values has been done successfully, ESP board and sensor
is low then open the gate of the land and ON the turbine. worked accurately. Nodes for soil moisture detecting play a
These graphs are used in the defuzzification process to vital role in the system, when water reaches all nodes then the
operate the irrigation gate and turbine. [15] These five inputs system closes the gate and send the OFF signal to the water
considered as five subsets of set S (T temp, H humidity, N plant_need, pump. By proper scheduling of irrigation, this system reduces
M moisture, and L water level) is defined. up to 70% of water wastage.

Table 1 DECREASE IN MOISTURE

Figure 5 Membership functions

4.6 Mobile Dashboard


An android application is also developed that allows the user
to distantly control the system.

TABLE 1: explains the decrease in moisture content after


irrigation, to conduct the experiment node readings has been
taken after the interval of the 4 hours in the daytime moisture
decrease rate MDRday is greater than MDRnight. The
timestamp was to measure the accuracy of the data. These
readings had been taken under 23C at 10:30 am, 26C at 14:34,
25C at 18:33, and 19C at 22:34.
MDRday =AVG2nd - AVG1st = 12.16-8.315= 3.84%
MDRnight =AVG4th - AVG3rd = 16.125-14.407 =1.725 %
Figure 6 Mobile App MDR day > MDRnight by 2.115 %

Authorized licensed use limited to: Miami University Libraries. Downloaded on June 15,2021 at 09:36:57 UTC from IEEE Xplore. Restrictions apply.
Editor (Ed.)^(Eds.): ‘Book IOT based crop-field monitoring
TABLE 2 RESULTS OF EXPERIMENTS and irrigation automation’ (IEEE, 2016, edn.), pp. 1-6
3 Rawal, S.: ‘IOT based smart irrigation system’,
S Temp Moist Actu Decrea Wat Chan Gate International Journal of Computer Applications
r. . . al se in er ce of Status
Chan Tem Humid Leve dry 2017, 159, (8), pp. 7-11
ge p ity l 4 Gao, L., Zhang, M., and Chen, G.: ‘An intelligent
1 2.5 Wet Cold 3.6 6 18 % OFF irrigation system based on wireless sensor network and fuzzy
2 1.5 Wet Cold 3.7 7 19% OFF control’, Journal of Networks, 2013, 8, (5), pp. 1080
3 2.2 Wet Cold 5.7 7 19.80 OFF
%
5 Robles, T., Alcarria, R., de Andrés, D.M., de la
4 3.2 Wet War 5.6 7 22% Alert/O Cruz, M.N., Calero, R., Iglesias, S., and López, M.J.J.: ‘An
m FF IoT based reference architecture for smart water management
5 3.6 Wet War 5.6 7 31.6 Alert/O processes’, 2015, 6, (1), pp. 4-23
m % FF 6 TongKe, F.J.: ‘Smart agriculture based on cloud
s6 4.3 Mediu War 3.6 7 35% Alert/O
m m FF computing and IOT’, Journal of Convergence Information
7 4 Mediu Hot 5.0 7.6 41.09 Alert/O Technology, 2013, 8, (2)
m % FF 7 Zhao, W., Lin, S., Han, J., Xu, R., and Hou, L.:
8 3.5 Dry Hot 4.9 7.9 47% ON ‘Design and implementation of smart irrigation system based
9 4 Dry Hot 7.4 8.3 56% ON
on LoRa’, in Editor (Ed.)^(Eds.): ‘Book Design and
1 3.9 Dry Hot 6.8 7 62.8 ON
0 % implementation of smart irrigation system based on LoRa’
Results presented in table 2. are driven by taking (IEEE, 2017, edn.), pp. 1-6
experiments. The table shows the change in temperature and 8 Kansara, K., Zaveri, V., Shah, S., Delwadkar, S.,
its effects on the moisture decrease rate, soil dry rate and Jani, K.: ‘Sensor based automated irrigation system with
prediction, and controlling of irrigation gate. The change rate IOT: a technical review’, International Journal of Computer
in the temperature describes the fluctuation in the actual Science & Information Technologies, 2015, 6, (6), pp. 5331-
temperature. The table shows the relation between a decrease 5333
in the moisture content with the increase in temperature. 9 Hussain, M., Gawate, S., Prasad, P., and Kamble, P.:
6 CONCLUSIONS: ‘Smart irrigation system with three level access mechanisms’,
in Editor (Ed.)^(Eds.): ‘Book Smart irrigation system with
For developing a smart irrigation system, soil moisture three level access mechanisms’ (IEEE, 2015, edn.), pp. 0269-
estimation is the most important and critical factor. Moisture 0275
is affected by several environmental factures such as 10 Paucar, L.G., Diaz, A.R., Viani, F., Robol, F., Polo,
temperature, light intensity, and humidity. We can increase A., and Massa, A.: ‘Decision support for smart irrigation by
the agricultural production and income of food producers by means of wireless distributed sensors’, in Editor (Ed.)^(Eds.):
deploying automated and controlled irrigation procedures. As ‘Book Decision support for smart irrigation by means of
automated irrigation mechanism will reduce wastage of water wireless distributed sensors’ (IEEE, 2015, edn.), pp. 1-4
at trail ends of the field which will reduce surface evaporation 11 Salazar, R., RANGEL, J.C., PINZÓN, C., and
with night irrigation. Also overwatering make water cause a Rodríguez, A.: ‘Irrigation system through intelligent agents
loss in soil fertility and decrease crop yield, so controlled and implemented with arduino technology’, Advances in
timely irrigation will increase the yield of the crop and reduce Distributed Computing, 2013, 2, (3), pp. 29-36
wastage of water. This system can perform a key role to 12 Izzuddin, T., Johari, M., Rashid, M., and Jali, M.:
overcome water wastage, labor cost in irrigation, and power ‘Smart Irrigation Using Fuzzy Logic Method’, Journal of
cost. Applied Sciences, 2018, 13, (2)
13 (Mobizt): ‘K. Suwatchai Download from:
ACKNOWLEDGEMENT: https://github.com/mobizt/Firebase-ESP32’, The MIT
License (MIT)
The authors acknowledge supports from the Fundamental 14 Suntaranont, B., Aramkul, S., Kaewmoracharoen,
Research Funds for the Central Universities M., and Champrasert, P.: ‘Water Irrigation Decision Support
(2662019QD002), Natural Science Foundation of Hubei System for Practical Weir Adjustment Using Artificial
province (2020CFB867). Intelligence and Machine Learning Techniques’,
Sustainability, 2020, 12, (5), pp. 1763
15 Azhar, F.C., Irawan, B., and Saputra, R.E.:
REFERENCES:
‘Controlling and monitoring ornamental plants care remotely
1 https://www.worldbank.org/en/topic/water-in- using android application’, in Editor (Ed.)^(Eds.): ‘Book
agriculture Controlling and monitoring ornamental plants care remotely
2 Rajalakshmi, P., and Mahalakshmi, S.D.: ‘IOT using android application’ (IEEE, 2017, edn.), pp. 12-18
based crop-field monitoring and irrigation automation’, in

Authorized licensed use limited to: Miami University Libraries. Downloaded on June 15,2021 at 09:36:57 UTC from IEEE Xplore. Restrictions apply.

You might also like