Internet of Things (IoT) Based Water Irrigation System

Pakistan Abstract —Agriculture plays a vital role in the economy of Pakistan. Issues concerning irrigation have been always encumbering the development of the country. Water scarcity is becoming a big issue because of climate change, in-sufficient services and rising population. Farmers are not receiving the supply of equitable water efficiently due to current methods of irrigation, such as ineq-uitable water distribution, manual reporting of mogha discharge by OFWM , change of water turn at late night and no need of water at his allocated time, tail-end user problems like either too much of water supply or no availability of water as per need of farmers. One solution to this problem is a smart irrigation system in which the system uses internet of things (IoT) based sensors to monitor water levels and communicates the water situation to the user. In this research, we elaborate on the applicability of the Internet of Things (IOT) in the irrigation system and propose an architecture of IoT based water irrigation system using a wireless sensor network to solve the problems of farmers. The IoT based smart irrigation system is based on the raspberry pi to improve the productivity of water and keep costs down. Farmer is informed about fields while there is any deviance from the expected water situation by a text


Introduction
Agriculture is the backbone of Pakistan. Water is a vital element for plant growth and plays an important role to produce food and the rise of economic Gross Domestic Product. Pakistan has the world's largest irrigation system which contributes almost 56% value of the economy of agriculture and the GDP of the agriculture sector is 18.5% and 61.2% of labor service [1]. Existing manual system performance (delivery of water supply 35-45 percent) is very poor in terms of water delivery from canal head to fields through warabandi method. The most of water loss has occurred from main canals to branch canals and so on. The loss of water is 45% in different channels of conveyance, on the whole, 91% of water is consumed by the agriculture sector [2]. Unfortunately, traditional methods of the irrigation system are used by farmers and water is being lost by these methods. Instead of traditional methods of the irrigation system, a smart IoT based system can provide an agriculture support mechanism to enhance the efficiency of the irrigation system. The aim of this work is to reduce the wastage of water, minimize manual labour and provide equitable water distribution, especially for tail-end farmers. The existing manual system is replaced to allow water irrigation according to the real time need of required water for crops.
In this system, in the agriculture field, different sensors are placed, to detect the rainfall, to check the water content in the soil, to monitor real-time water flow at mogha and nacca to help distribute the water equitably. The system also connects these smart devices and objects using raspberry pi and IoT based system helps interface with the user. The system helps to monitor the water-flow variations at the canal level continuously. The data of the real-environment such as how many water quantities are needed for fields is computed and the system help decides which channel gate is to be open and can be activated through the GSM module remotely, in case of an abnormal condition. A cloud server is used to store all the data and its processing. Users can get all the information from the android based application. So, the proposed system will permit farmers to continuously monitor the water flow and moisture in the field, controlling the supply of water remotely over the internet, thus achieving optimum irrigation using IoT

Related Work
To make the irrigation system more effective, numerous research work has been published. Many researchers presented their view and design of new technologies on the equitable water distribution system, water required on the form and different methods of an irrigation system which are used to make the system more effective. The work of researchers is grouped into the following categories: • Canal Regulation and Control System • Open-channel Flow Measurement for Water Distribution • Smart on Farm Irrigation System.

Canal regulation and control system
First of all, we discuss the control of the gates of the canal to irrigate the fields. Developing countries are facing the problem of water management and water scarcity. On the canal level, there is a need to control the automation gate for an effective system. Sensors are used on the canal level to give control to the administration for reducing wastage water. With this system, management can control the water pressure on time with the help of canal level sensors and can manage easily according to the need of water requirement till tail-end user. Transmission of data to be based on realtime to create a modern water irrigation system. Enhancement of irrigation system has a basic requirement that's measure the water quantity. Proper communication is necessary to manage the discharge flow structure according to the standard decision support system. Habib and Abdul Hakeem Khan proposed work on a modern approach to canal-based water irrigation system [3,4]. No availability of water is a big issue for farmers during warbands (time scheduling) system. This is caused by a high degree of discharge water through the canal system. Normally, 20 to 30 percent variations occur on a daily base and after some days it becomes 50 percent or more. To reduce wastage of water, it is compulsory to be the automation of gates for a distributary irrigation canal.
To control the existing system, the unit control and automatic gates have been designed by Farwa, Ibrahim and Soban proposed a system [5]. It includes control water levels in irrigation canals and presents a proper demand response solution, providing the need of the end-user. Water is not available because of no control of irrigation system and human errors such as water theft, gives bribe to management to increase the size of water discharge machine in term of flooding condition. Computerized control of channel doors is needed which coordinates with sensors on time.
Aditya Joshi and Ruchita Raut proposed a system that represents automation and optimization of the control of gate for canal [6]. This paper describes the automation approach to monitoring the level of water and set up the controller of automatic gates of canals inflow pressure coming from dams by the real-time system. In this way, the conveyance channel and use of water can be improved flexibly via an automation system. The automation system can give the water supply as per need to the realenvironment through the android application.
Tkachev, Litvinenko and Olgarenko proposed a work [7] in which describes the water distribution during the reconstruction of canals and makes the gate automation. This paper aims to make automation of gates during the reconstruction of canals which is providing the facilities of control the water supply and its process, labour, economical productivity and irrigation services. It makes it achievable to enhance the flow of all level irrigation using new technical technologies. Furthermore, the implementation should be used in a dynamic real-environment to accurately the concept of water supply using control of automation gates. IoT based system comprises smart devices that contributes to the measurement of water flow and quantity, motor control automatic gates, water level and moisture of soil data in form of digital display and its communication for monitoring the environment.

Open-channel flow measurement for water distribution
In this section, we discuss automated outlets (mogha and nacca) control on-time scheduling and measurement of water instead of a manual reporting system for equitable water supply distribution. Pakistan is an agricultural country because most of the economical sources are developed by agriculture. Water irrigation system plays an important role in agriculture but it is an inefficient system due to stealing of water during conveyance losses more than 60 percent water, 30 percent water is being wasted on watercourses level because of leakage and seepage, 29 percent on farm level through traditional irrigation system [8]. Developing countries are facing problems regarding water irrigation and these problems can be solved by smart security technologies.
Waqas, Zahoor and Abubakr proposed a work [9] that represents methodology about determining flow in the irrigation system. It includes measuring the amount of water quantity is need for the rotational supply of water IBIS. It is a big challenge to measure the water flow of outlets because of several issues of scale, such as manual measuring, measuring large numbers of outlets in IBIS and manage to manual reporting method is not possible easily. To achieve the result, ultrasonic water sensors have been set up to measurement the discharge flow on an outlet by the wireless water meter. In which, sensors are sensing the deepness of discharge flow in the farm of digital meter and integrated with GSM or GPRS module. The outlet amount of water measurement is produced and results are compared to the accuracy.
The warabandi system observed by farmers is not providing efficiency and services. The system can be improved to develop of smart irrigation system through obtaining real-time data of the physical environment. The manual way of measurement is less feasible and does not support real-time conditions. The process of decision support system is a big challenge for the development of monitoring and its processing and analysis environment. The Management does not know the real-time system. Modern technologies can be used to improve the water irrigation system by management authorities who can track the conveyance losses, steal of water and efficiency. Reddy, Sekhar and Bhaskar proposed a system [10] on water monitoring to enhance OFWM using low-cost sensors. It includes ultrasonic sensors to observing the water on a different level like on-farm fields, distributaries and minor canal. To measuring the discharge flow of the water channel, sensors are configured in fields. The procedure is identified to develop the smart decision support system. RBC flume has been used for water flow to checking the depth of discharge flow using sensors in on-farm fields. The other sensors are sensing the soil-moisture and its temperature to provide the water when needed. It allows management to measure all levels of channels. The real-environment parameters are observed by using sensors with an accurate level that will ensure equitable distribution. The decision support system will provide the services such as discharge flow rate, automation control outlets, availability of water till tail-end user and monitoring alert system.

Smart on farm irrigation system
In this section, we discuss the Smart Irrigation system at the farm level. Soil moisture sensors are used in different places to check the water content in soil and the motor starts automatically when there is a need for water. Kumar made a methodology work on automatic irrigation system using a microcontroller that is responding to all the sensor which is addressed on various on-farm fields [11,12]. Sensors are monitoring the soil-moisture constantly and the relay module generates the signal to activate the motor whenever the soil becomes dry. The ARDUINO-UNO board has chip "ATMEGA318" which is used to establish the sensor network and RF radio technology has been used to perform the system wirelessly. Other countries are monitoring the farm with sensors such as soil moisture, humidity, temperature and enhance the automation irrigation using smart farming technology [13].
Different sensors are used to monitoring the water quality of a real-time system by Vijayakumar [14]. Raspberry pi has been integrated with sensors that are PH sensors, turbidity sensor, temperature sensor, oxygen sensor and conductivity sensor. Received information of these sensors is delivered to the IoT device. This information is stored on the cloud using an IoT device. IoT device "USR-WIFI232-X-V4.4" is connected to a hardware unit using Raspberry Pi to improve the water quality.
Nowadays, automation plays a vital role in the field of smart irrigation systems. Sensors are being used to make system automation and it gives the control to users can access the system remotely. In this smart irrigation system [15], Raspberry Pi will give the command to cameras for image processing to capture the models of soil to check which seed can be used in these fields and then it will send to the end-user via android application interface using Wi-Fi module. The camera is mounted on the vehicle. The vehicle is stopped in front of a crop/plant. Soil and moisture electrodes will be inserted into the soil. If the electrode is not fully immersed in the soil due to any obstacle, the vehicle will move further and repeat the process unless and until the electrodes are not fully immersed. The soil-moisture can be checked through this process and if the condition of the soil is inadequate the water is turned ON accordingly.

Proposed System
To overcome the limitations and challenges of the conventional and automated irrigation system, we use the Internet of Things (IoT). The objective is the delivery of water with equitable distribution and reducing the human-interference, that is currently used to manage water flow irrigation manually. The monitoring water irrigation system divided into three sections: For on-farm water monitoring the ultrasonic sensor is selected to provide information regarding water inflow and outflow. Sensors, cloud servers and android applications are the main parts of the modern system that monitors and controls the entire system, such as, measuring the outlets of watercourses, on-farm water needs requirements and environmental parameters. The approach is used to monitor the water-flow variations of the canal, detect the rainfall from different areas and control flow from the canal in case of excess rainfall to save irrigation water. Also, the system uses a real-time flow meter at mogha and nacca to ensure equitable distribution of water, and also detect water leakages or water theft. We are using soil-moisture sensors that are placed into fields. Although, these sensors will sense the real-time environment with a fixed threshold value that is used to generate a signal and if the water is not sufficient then the user would be alerted via an SMS that will be sent to the user's mobile phone. The user can also check the flow rate of water of his farmland, water scheduling, soil moisture through the android application.
The system consists of two components, software and hardware components, Figure 1 shows the smart irrigation system design. The software part is an android based application connected to the cloud server to retrieve data. Sensors sense the physical environment parameters and send them to raspberry pi via ZigBee wireless communication protocol. The cloud server is used to store all the data and its process, to manage in a better way. Users can get the information from the android based application. The wireless network provides seamless communication. The research contributes to monitoring (moisture in the soil, measurement actual flow of discharge water, etc.) of the automation process of a water irrigation system using IoT. Smart irrigation systems can keep safe of water and more crop productivity. We will now describe in detail different components used in the system:

Rainfall sensor
A rainfall sensor is used to detect the rainfall in the fields to prevent overwatering. The device on detecting the rain in different areas and using the canal flow information, controls water flow from the canal. In case of rainfall higher than a certain range, the system will shut the irrigation supply automatically. Figure 2 shows the rain sensor.

Soil moisture and temperature sensor
The soil-moisture sensor helps out to check the water content of the soil in the land and the temperature sensor is used to check the temperature of the environment. Based on soil moisture content and current temperature, the required water for crop irrigation is computed. Figure 3 shows both sensors.

Water flow meter
The Dynasonics TFX-500w ultrasonic flow sensor is used to accounts for the volumetric flow of water that's being distributed through time-based scheduling for ensuring equity on mogha and nacca. This includes high accuracy monitoring of open channel flow, basic flow data logging capability, easy to use LUI display, menudriven parameters, and relay control feature. These features make the Dynasonics TFX-500w as shown in Figure 4 that are ideal for building automation water distribution.

Water level monitoring
Monitoring the levels of fluids, especially, water is challenging for any non-contact sensor. Trusense sends a laser beam to the surface that reflects back to the sensor and can give accurate level measurements over long distances. TruSense S300 (Figure 5), laser technology is a better way to monitoring water level variations on different areas of canals.

Raspberry pi controller
Raspberry Pi 4 is a light weighted micro-computer that can do everything that your computer system does like programming, games and other jobs. Raspberry Pi works as a base station in this system. The different base stations can be created in case of a large area to the covered irrigation system. Different sensors are connected to perform tasks with Raspberry Pi. Raspberry collect the data from these sensors and store to clouds continuously.

Implementation
The proposed system consists of one raspberry pi 4 light-weighted minicomputer, GSM module, servo motor, relay module and different sensors of nodes. Raspberry Pi 4 is responsible for integration several sensor nodes. All sensor nodes consist of: • Sensors • ZigBee radio communication protocol • Microcontroller The sensor node has in charge of the process of collecting and data distribution from the sensor network. Sensors are located in numerous places on fields. Water flow sensor to measuring the allocated water and flow, water level sensor to control canal discharge water gates and soil moisture sensor to check water need requirement is used in this system. The coordinator collects the data from these sensors and integrates it with raspberry pi 4 via ZigBee communication protocol. Sensors are connected to the microcontroller which is addressed in the fields. Then Xbee module sends the data to raspberry pi wirelessly. Different topologies are discussed that is divided by Xbee networks with the router, coordinator and end-device [16,17]. The coordinator is responsible to get data and supply information about the network and each network use exactly one coordinator and providing safety solutions (not to sleep) that need to supply the package to nodes of the end-device. Routers; connects with other devices and coordinators and are commonly used to extend the network. End Devices; generally, sensors have features to talk it inherit nodes, which could be router or coordinator.
The whole system is based on raspberry pi to perform the working of these components. Each device is communicating with another through the methodology of ZigBee radio technology. Microcontrollers are linked using water level sensors set up to control the gates of the canal according to needed flow and water discharge flow of outlets are calculating by the water flow sensor [18], which calls GSM module guard if needed. The outlet gates are controlled by administration using servo motors which are located on different fields for water supply to equitable distribution. Rainfall sensor and GPRS linked forecast weather will contribute to deciding to control the gates of canal and outlets. The relay module will generate a signal to start the motor (open or close gate or power-motor) when time scheduling criteria of allocated water is met for irrigation fields. The service of SMS will be generated by GSM which has a slot of SIM card and security guard threads will also show the notification to use android application for attached with their land using the internet. The data is continuously stored on the cloud and can access to check whether water is needed or not. All the sensors are sensing the data of the real-environment such as how many water quantities are needed for fields and which gate is to be open and security threads can be activated through the GSM module in case of an abnormal condition. The whole communication is shown in figure 7.

Fig. 7. IoT gateway communication bridge
In this communication bridge, all the sensor nodes are connected to the IoT gateway to send data to clouds using the raspberry pi mini-computer. Raspberry pi is communicating with clouds and sensors using wireless technology. It gives the help to reduce the complication of deployment. Android-based application is to be developed to show the interface of system information and can improve the system.

Conclusion
The system of water irrigation is necessary to be updated to increase the productivity of crops. The traditional methods (warabandi) of water irrigation is being used since the independence of Pakistan. Farmers are facing many problems that are inequitable water especially to tail-end users, manual reporting of mogha discharge, over-watering while rainfall and theft of water from canals and watercourses. Furthermore, because of several problems, the system has issues of maintenance and management. Traditional methods of water irrigation are needed to be fixed with modern technology. Sensors, cloud servers and android applications or computer systems are a source of communication with a real-time environment. User can know the real-time environmental parameters by IoT based sensor and data stored in cloud storage and control through android application. The project concludes that IoT based water management system can give control to management departments like OFWM and farmers to control the irrigation from anywhere. Thus we are saving 95% water, labor and time issues. Furthermore, consumption of water can be seen on the application interface to improve the water irrigation system, thus we can prevent the theft of water and contributes to increasing the water supply with a smart way 6