An internet of things-based irrigation and tank monitoring system

ABSTRACT


INTRODUCTION
Water scarcity is currently one of the world's most pressing issues.Water is required for the survival of all humans, animals, and plants in our daily activities.It is a basic need for everyone and a valuable natural resource for all living things on the planet [1].Agriculture is one of the most water-intensive fields, and the availability of water in agriculture helps to regulate the temperature of the soil, cools the plants, essential for the germination of seeds, the growth of plant roots, and the multiplication of soil organisms.Due to population growth and increased food demand, agriculture alone uses about 85% of the available freshwater resources worldwide [2].Water is a limited resource for agricultural production, therefore, for greater yields, careful use of it through irrigation, which is one of the techniques for conserving and controlling water wastage, and also allows farmers to avoid dependence on rainwater [3], [4].It is important to optimize the use of available water resources, which can be achieved through a combination of crop selection, water monitoring techniques, and an efficient irrigation method.Traditional irrigation methods face many challenges such as wastage of water, high cost of hiring human power, and also the farmers must be present in their farmland in order to do irrigation process.Hence, the development of an internet of things (IoT) based smart irrigation and tank monitoring system to reduce water wastage, minimize human effort, and remotely monitoring of water level and water supply via the internet.The use of IoT allows organizations and individuals to access information, and facilitates important decision-making processes, it is based on increased machine-to-machine communication and decreased human-to-human or human-to-computer interaction.IoT refers to a wireless network between objects, enabling a new form of communication between people and things.It enables things to take action on their own, thus eliminating the human-centric mediation role [5].In general, the major importance of a smart irrigation system is its ability to save water compared to conventional watering methods that waste as much as 50% of the water used which causes inefficiencies in irrigation, evaporation, and overwatering of the crops.Several automated techniques based on IoT have been proposed for irrigation systems these include the use of Bluetooth, ZigBee, Wi-Fi, cellular, and other communication technologies to make the system smart.However, these techniques have their shortfalls such as Bluetooth and ZigBee which cannot handle long-distance transmission, and cellular-based techniques with the problem of high-power consumption and increase operating costs, but provide a wide range of communication [6].The designed system uses Wi-Fi technology to provide a low-cost design for a smart irrigation system, monitors water tank level, and is easy to access in the farmland.
The rest of this paper is prepared in the following sections.Section 2 discusses the related works in smart irrigation systems with a detailed description of existing systems.Section 3 focuses on the architecture of the designed system with details of components used, circuit diagram, and flow chart.Section 4 implementation of the design system and results are discussed.Finally, the last section discusses the conclusion and future research.

RELATED WORKS
The researchers in [7], [8], proposed a real-time automation system based on an ARM7TDMI core 32-bit microprocessor and global system for mobile communication (GSM) module which operate through short message service (SMS) as a link between advanced RISC machine (ARM) processor and centralized unit.GSM is used to inform the user about the exact field condition via SMS.The system constantly monitors the soil moisture, water level, temperature, and humidity, and provides details about the field to the user via SMS.The GSM transmits this data to the ARM7 for processing and displays the output on a liquid crystal display (LCD).The activation instruction starts the motor and indirectly activates the transistorized relay circuit, which continuously monitors environmental parameters and turns off the motor whenever the required level is reached, sending a message to the farmer.The drawback of the system proposed by [7], is that GSM has a fixed maximum cell site range of 35 km which is imposed by technical limitations.Secondly, it is not user-friendly to farmers due to the entire complexity of AT commands, and finally, soil parameters regarding fertilizers and plant diseases are not incorporated into the system.
Wireless sensors and dual tone multiple frequency (DTMF) dialing were used in an irrigation management system [9].DTMF used is a combination of one low frequency and one high-frequency tone to identify the dialed number or a signal.The designed system allows farmers to control irrigation and provides a remote-control facility by switching it (ON/OFF) using the landline or mobile phone by dialing specific DTMF codes GSM network.However, the use of DTMF makes it less user-friendly and also offers limited control options.Similar research based on wireless networks and DTMF was proposed by [10], their proposed system used one single module to control all the sectors automatically, and maintain irrigation time.It is a low-cost design with no extra internet cost that can work over a long distance but does give information about the water tank level.
Abbas et al. [11], proposed a smart irrigation system using a wireless sensor network.The system used moisture sensors to detect the soil moisture and helps to identify the water holding capacity of different soil characteristics based on the fact that the different plants consume water differently.The design is aimed at determining the time taken for the sensors to get activated and to identify the watering zone.However, the system does not take into account other factors like monitoring the water tank level.A voice-controlled irrigation system that can be controlled using an authorized mobile phone is described in [12].The system is made up of two sub-units; a pump control unit (PCU) and a farm control unit (FCU).The soil moisture is monitored and irrigation valves are controlled by the FCU, while the pump operation is controlled by the PCU, which is based on the water level in the tank.The voice commands from the user's mobile phone and soil moisture with water level data were used to control the system.The designed system offers a low-cost design with low latency.Masaba et al. [13] proposed a smart irrigation system to improve water-energy efficiency.Their system consists of a microcontroller, sensors, and a water pump that is integrated with the decision-making system.The system makes its decision on whether irrigation is needed by developing a truth table using environmental information.The sensors used in the design are temperature and moisture sensor which serves as input parameters for the truth table and are placed in the area that requires irrigation.A decision was made based on input parameters by activating the sprinklers.The microcontroller communicates with sensors using Bluetooth technology and collects data from moisture sensors and temperature sensors.The data collected are evaluated through a truth table to determine whether the given region needs to be irrigated.Their system provides an effective irrigation schedule system and improved water-energy efficiency.
The use of a wireless network, a motor controller unit (PIC16F877A), and a GSM module with wireless valve control to provide a low-cost irrigation system is proposed for an IoT-based irrigation system and water consumption for crops in research by [14].Another smart irrigation system based on a wireless sensor network with dual tone multiple frequency (DTMF) is developed by [15].The developed system uses an 8051 microcontroller, soil moisture sensor, temperature sensor, and dual tone multiple frequency (DTMF) receiver to calculate, control, and monitor the water requirements for crops based on soil moisture data acquired by numerous sensors nodes deployed in the field.The developed system is low-cost, and it also protects the soil's fertility by significantly minimizing soil leakage.
Kumar [16] proposed an automatic irrigation and security system that uses a wireless sensor network (WSN).The designed system consists of Raspberry Pi, Arduino, a transceiver, and three sensors (soil moisture, temperature, and passive infrared sensor (PIR)).The Raspberry Pi serves as a coordinator node (CR node) and Arduino serves as an end node device with nRF24L01 transceiver for wireless communication and data transfer.The sensors read soil status and wirelessly transferred the data to the Raspberry Pi to activate the water pump.This system monitors the condition of the farm on the webpage and can turn on/off the water pump through the webpage.The PIR sensor with a buzzer was used to protect the crop from the cattle entering the field.The system has improved the problem of water wastage in farmland, hence resulting in increased yield and more profit to the farmer.A similar system was designed by Bolu et al. [17] using Arduino Mega 2568 and nRF24L01 transceiver with five sensors to perform a low-cost automated irrigation system powered by solar energy.
Savić and Radonjic [18] proposed a ZigBee-based wireless sensor network (WSN) system with a DHT11 sensor for air temperature measurement and an Arduino-based sensor node (Watermark 200SS) for soil moisture measurement and a DHT11 sensor for air temperature measurement.The system was implemented using the Libelium Waspmote microcontroller platform as the main control unit of the proposed smart irrigation system.The system is simple and low-cost to implement with reliable data transmission that delivers necessary information for independent decision-making in a smart irrigation system, but the range of operation is limited.Also, [19] proposed a wireless sensor network system for IoT-based irrigation systems using a Pic microcontroller and GSM module, their system can be monitored via smartphone or personal computer.
Also, Leh et al. [20] designed a smart irrigation system, the system is split into two parts: hardware and software.Three components make up the hardware: a soil moisture sensor, a temperature and humidity sensor (DHT 11), and an ESP 8266 Wi-Fi module connected to an Arduino Mega 2560 microprocessor.The microcontroller processes data from sensors that automatically water the plants and analyze the real-time soil status of the plants via an internet-connected smartphone.The Blynk application software is installed on the smartphone and connected to the hardware implementation, which uses the DHT 11 sensor and moisture level sensor to detect the plant's status.The designed system compared their results over a seven-day normal irrigation system.The findings show that smart irrigation systems outperformed normal irrigation systems.The system can be controlled from a smartphone by the farmer, but when implemented in large quantities, it is expensive because every plant must be equipped with sensors to know the condition of the soil, and a water pump must be installed for every plant to supply water.
Sudharshan et al. [21] proposed smart irrigation to reduce the wastage of water using a temperature sensor, humidity sensor, and soil moisture sensor with an Arduino microcontroller.The system uses fuzzy logic rules to operate the solenoid valve based on data acquired from the sensors which are later sent to the cloud using adafruit.iowhere the farmer can see the values obtained by the three sensors.The system is powered by a solar panel to run the pumps.

PRESENTATION OF THE DEVELOPED SYSTEM
The designed system is an Internet of Things-based irrigation and tank monitoring system, which is divided into hardware and software components.The system's hardware components are installed with an ATMEGA328P microcontroller for hardware development.The installation is accomplished in stages.The architecture of the system is shown in Figure 1.

Hardware specification
In the design of the system, the following hardware components were used to achieve the purpose; Arduino UNO microcontroller board (ATMEGA328P), HC-SR04 ultrasonic sensor, soil moisture sensor, solenoid valve, liquid crystal display (LCD), Wi-Fi ESP8266 module, power supply, driver circuit (IRF3205, 10kΩResistor, 1N4007 Diode).

Arduino UNO
The Arduino UNO is a microcontroller board based on the ATMEGA328P microcontroller, which runs at 5 V, 16 MHz clock speed, 14 digital input/out pins, 6 analog input (A0-A5) pins, 6 PWM outputs, 1 universal asynchronous receiver transmitter (UART), and programming interface (USB) via ATMega16U2.The Arduino UNO microcontroller has one or more central processing units (CPUs), memory, and programmable input/output peripherals that are geared for embedded use.It consists of a programmable circuit board and ready-to-use software called the Arduino integrated development environment (IDE), which is used to write and upload C/C++ computer code to the physical board.Arduino can also be connected to a cloud or t h e internet by interfacing it with a Wi-Fi module ESP8266. Figure 2 shows the Arduino UNO board (ATMEGA328P micro-controller) used in this designed system.

Water level sensor (ultrasonic HC-SR04)
The water level sensor monitors the amount of water in the tank and determines whether there is enough water to supply.The ultrasonic sensor HC-SR04 is used to measure distances between 2cm to 400 cm with a 3 mm precision.A floating pad is placed within the tank and it is planted on top of the water tank.The tank's depth is estimated by measuring the distance between the floating pad regularly, and any changes are recorded in the mobile app.The basic idea of ultrasonic distance measuring is based on echo; when sound waves are sent in the deployed environment, they have reflected the source as echo after contacting an obstacle (water surface).Figure 3 shows the ultrasonic HC-SR04 sensor module.This module has only four pins connected to the Arduino UNO, which are: VCC pin -5 V (ranging from 4.5 to 5.5 V) Trig pin -Sensor input (trigger) Echo pin -Output sensor (echo) GND pin-Ground The duration represents the time or response for the signal transmitted by the trigger pin of the sensor to hit the surface of the water which was later represented as distance in meters.

Soil moisture sensor
The water content in the soil is measured by a soil moisture sensor.It makes use of the electrical resistance of the soil, which has two probes that operate as a variable resistor.Increased water content in the soil results in better conductivity between the probes and lower resistance.The module has four pins, VCC, ground, and A0 are connected respectively to the Arduino board and will be set based on the datasheet.
It is used to detect moisture in the field and send it to a microcontroller, which then controls the water tank or solenoid valve (ON/OFF).Figure 4 shows the soil moisture sensor module used in the design.The ADC is used to convert the analog output of the soil moisture sensor to digital.The moisture sensor is used to determine if water is present around the sensor.It is inserted into the soil, uses two probes to conduct an electrical current through the soil, and then measures the resistance to determine moisture content.The more water in the soil, the easier it is to conduct electricity (less resistance), while dry soil conducts electricity poorly (less resistance).Hence, it measures from 0-1023 in resistance, where 300 below indicates much water, 300 to 800 indicates moist soil and 800 above indicates dry soil.In this research, less than 600 indicates that the soil is wet, while above 800 indicates that the soil is dry.

Solenoid valve
A solenoid valve is a basic electromagnetic device that converted electrical energy directly into linear mechanical motion.It was used as a water control valve.The solenoid valve used in the designed system converts electrical energy to mechanical energy, which then drives a mechanical valve to regulate the flow of water through the system by opening, closing, or adjusting the position of the valve.The valve is closed with no power, but when supplied with 12 V, the value will open.To control this valve with the micro-controller which runs on 5 V, the solenoid valve is connected to a driver circuit to switch on the 12 V with the small circuit input supplied by the micro-controller.Figure 5 shows the solenoid valve used in the implementation.The solenoid valve used in this research is rated:

Wi-Fi module ESP8266
The data must be transferred to the internet and monitored remotely when all of the parameters have been measured and validated.This is accomplished by the use of a Wi-Fi module, which enables real-time response.The ESP8266 Wi-Fi module is a self-contained system-on-a-chip (SOC) with an integrated TCP/IP protocol stack that can be used to connect to your Wi-Fi network from the microcontroller.The ESP8266 was used in this designed system to run an application or delegate Wi-Fi networking functions.Data exchange between this module and the microcontroller is achieved by a logic level shifter circuit because the microcontroller is powered with 5volt and the ESP8266 is powered by 3.3 V. Pins are arranged in two rows, having 4 on each row.Figure 6 shows the Wi-Fi module and its pin arrangement The Wi-Fi module pin is as: -GND (ground from the power supply)

Liquid crystal display (LCD)
Liquid crystal display (LCD) has been used to provide a better user interface by showing messages on the display, which is an easier way to make the user follow the right instruction.This LCD consists of 2 rows, each can handle 16 characters.Figure 7

Driver circuit
The solenoid valve works at a different voltage compared to that of the Arduino board and the two cannot be directly connected as the solenoid valve works with 12 volts while the Arduino and the sensors work with 5 V. Hence, the driver circuit is employed to act as a bridge and as well as a switch.The driver circuit comprises the IRF3205 MOSFET, 10 kΩ resistors, and diode.The resistor was connected to the leg of the gate, one leg of the diode was connected to the drain and to 12 V power supply (this prevented the current from going to the Arduino board), and the source was connected to the ground.The MOSFET allows a small dc voltage (5 V) from the Arduino digital pin to switch a larger 12 Vdc voltage to the solenoid.It can be thought of as a switch, applying a current to the Gate which allows current to flow.The diode (1N4007), which is used in this circuit as a flyback diode connected across the inductive load (solenoid valve) in order to eliminate voltage spike across the load as well as prevent the 12 V from the external supply from going back into the circuit in order not to damage the board.

Software requirements
The system is implemented with the following: -Arduino integrated development environment (IDE) for writing the Arduino code which is in C programming language -Proteus 8 simulator; Proteus is one of the best simulation software for circuit designs of the microcontroller which has almost all electronic components readily available.This is used to draw the system circuit diagram - The hypert ext markup language (HTML) was used with the C programming in the Arduino integrated development environment (IDE) to write the program -Text editor (e.g., notepad and notepad++) used to type the HTML and CSS code to send data to the ESP8266-Arduino circuit and save it as an HTML document - The hypertext markup language (HTML) was used to tell the browser what to show on a web page, cascading style sheets, and is used to change the appearance and layout of the Web page -ESP8266 firmware version AT 0.22, software development kit (SDK) 1.0.0 -ESP flash tool was used for downloading the ESP8266 firmware into the module's flash memory

Flowchart of the design system requirements
Figure 8 shows the flowchart of internet of things-based irrigation and tank monitoring system design using IoT components.The Arduino UNO connects the soil moisture sensor and the pumping motor.The output of the system is sent to the farmer via a Wi-Fi module and either displayed on the personal computer or smartphone.The soil moisture sensor is used to check soil moisture to measure soil electrical conductivity.

RESULTS AND ANALYSIS
Figure 9 shows the interfacing of each component of the system to the Arduino ATMEGA328P microcontroller and while Figure 10 shows the outer view of the system.The system was first experimented with using a simulating software proteus 8.The components were then assembled and tested to achieve the aim of the designed system.Figure 9. Components interface with ATMEGA328 Figure 10.The outer view of the designed system

Working principle of the proposed system
The sensor module, soil moisture sensor, and ultrasonic sensor are positioned at their field (in the soil and at the top of the water tank).These measures the water content in the soil and the level of water in the tank respectively.The microcontroller reads the values measured by the sensors and displays the values and information on the liquid crystal display.The Wi-Fi module ESP8266 interfaced with the microcontroller connects the system to the internet, where a mobile phone or laptop can access it.This device (mobile phone or laptop) searches for the system's Wi-Fi to connect to it, with this device the user then opens the browser to control the irrigation with the web application developed for this purpose and monitor the Irrigation process that is the status of the water tank and the soil is done by loading the IP address 192.168.4.1 on the web browser.To control the irrigation process, the user simply toggles the pin13 on the web application interface where the solenoid valve is connected on the board to turn the solenoid valve on/off.Also, the Wi-Fi module enables the microcontroller to upload the values measured to the web by loading the IP address 192.168.4.1.The LED turns on whenever the solenoid valve is activated and turns off when the solenoid valve is deactivated.Figures 11(a Table 1 shows water conservation on a developed IoT-based irrigation system over a traditional irrigation system for 15 days while irrigation is done every 3-day for these periods.The results show that the developed irrigation system used 51% of the total quantity of water used by the traditional irrigation system and conserved water for 49%.This finding expected that water conversation to increase when implement on a larger scale to drastically reduce water wastage.

CONCLUSION
The system is a model of IoT based remote-controlled irrigation system and monitoring water tank.Farmers can get an update about farmland anywhere using any internet-enabled device as a means to access data and control the irrigation system.The device is connected to the internet via the ESP8266 Wi-Fi module and can be operated remotely through internet-enabled mobile devices such as mobile phones and laptops.The system has demonstrated that water can be preserved while achieving quality irrigation of crops.The use of a soil moisture sensor helps to detect and monitor the level of water in the soil which solves the problem of an uncontrolled irrigation system.The designed system is a low-cost system with very reliable efficiency which tends to reduce human effort and wastage of water.
The system is limited to the supply of water from the tank to the field only, refilling or pumping water to the tank was not considered.In the future, the camera can be incorporated into the system to monitor farmland and detect intrusions such as animals and humans in the agricultural field using PIR sensor or image processing techniques.In addition, the system can be improved upon by adding a solar power system which provides constant power to the system for pumping the water tank.Finally, the designed system can be implemented in large farm areas to ease the stress.

Int
An internet of things based irrigation and tank monitoring system (Tayo Dorcas Obasanya) 67

Figure 1 .
Figure 1.The architecture of IoT based smart irrigation and tank monitoring

Int
An internet of things based irrigation and tank monitoring system (Tayo Dorcas Obasanya) 69

Figure 8 .
Figure 8. Flow chart of the design of smart irrigation system

Figure 8 :
Figure 8: Flow chart of the design smart irrigation system

Figure 11 .Figure 12 .
Figure 11.Working principle of (a) Traditional irrigation system and (b) IoT based irrigation system

Table 1 .
Readings of water consumption on traditional irrigation and developed IoT based irrigation system