Design and Development of an Automatic Prototype Smart Irrigation Model

In the current condition, it is difficult to increase plant development and reduce expenses in agricultural sectors; nevertheless, an advanced thought leads to the use of an automated model that introduces automation in the irrigation system, which can aid in improved water and human resources management. An automated model has been developed using sensors and microcontroller technology, to make the most efficient use of water supply for irrigation. A soil moisture content detector is inserted into the soil of the crops, and an ultrasonic sensor is placed above the soil of the crops to measure the water level after irrigation has begun. A C++ program with threshold values for the moisture sensor was used to start the system in the crop field depending on the soil moisture level, and an ultrasonic sensor was used to control the water in the crop field. The Arduino UNO board is a microcontroller inbuilt of Atmel in the mega AVR family (ATMega328) and the sensors were used to lead the model in turning ON/OFF. A microcontroller was included in this model to run the program by receiving sensor input signals and converting them to soil water content and water level values in the crop field. The microcontroller began by receiving input values, which resulted in an output instructing the relay to turn on the groundwater pump. An LCD screen has also been interfaced with the microcontroller to show the percentage of moisture in the soil, field water level, and pump condition. When the soil moisture level reaches 99 percent and the water level reaches 6 cm after 2.5 and 4 minutes, respectively, the pump is turned off. This model, according to the study, might save water, time, and reduce human effort.

. Food shortage and water scarcity are becoming increasingly common as the world's population grows, and this problem can be overcome by strengthening the agricultural industry (Devika et al., 2017). However, while irrigation is applied manually in the fields, water loss creates a problem in the form of water logging. Too much irrigation wastes water and energy, and it can harm the landscape and the ecology. Over-irrigation can result in leaching nutrient and/or agrochemical, degradation of ground water supplies, potential increases in sediment-laden runoff, and erosion. Excessive irrigation also puts a burden on water supply infrastructure by raising peak demands, which can reach or exceed system design limits.
Irrigation is the most important factor in the crop's successful establishment (Bhatnagar et al., 2018). It is completely essential to have net crop water requirements because irrigation under and over is often harmful to the crop (Roy et al., 2017). Irrigation is the deceptive application of water to the land to aid in yield development. It is most frequently used in yield generation in dry zones and during precipitation setbacks, and to protect plants from ice. Farmers' busy lifestyles sometimes cause them to forget to water their plants, and as a result, the plants may not develop normally and eventually die due to a lack of adequate care (Bains et al., 2017). The automatic watering technology has been developed to continuously monitor the moisture content of the soil in the pots. When the desired level of moisture content is reached, the system responds by watering the soil with the precise amount of water needed and then turning off the supply of water. Irrigation becomes simple, precise, and practical with this concept, and it can be used in croplands in the long term to advance agricultural production to next level. Farmers and gardeners who don't have enough time to water their crops/plants will benefit the most from this project. Farmers who waste water while irrigating their crops are also covered.Irrigation to the land is usually a lengthy process that necessitates a significant number of people (Hasan & Shero, 2016). As a result, it is right time for Bangladesh to establish an irrigation automation system. In the sphere of agriculture, contemporary global technology plays a significant role (Akter et al., 2018). One of the most extensively used and beneficial automatic irrigation systems evaluated based on the microcontroller and Arduino sensor technology. When the program was loaded into the Arduino, the soil moisture sensor began to display the value of soil dryness. If the drying value is greater than or equal to the specified value, the pump will turn on and begin irrigating the system; if the value is equal to or less than the specified value, the pump will turn off, and the irrigation in the field will be done.
The system combines an ultrasonic sensor for measuring water level and a moisture sensor for fully automated watering, giving it greater capability than existing home automation systems (Asadullah et al., 2012). The rapid advancement of technology has prompted the application of cell phones to manage household appliances remotely. The system's critical components are hardware and software. Ultrasonic and soil moisture detectors are used to control the system. In the automation system, a low-cost and user friendly design is an advantage. With the use of sensors, it is also possible to reduce human labour and conserve energy. Many systems accomplished water savings in various crops. Irrigation was scheduled in a water supply by monitoring water status based on temperature, and plant distribution was performed using a thermal imaging system (Doraswami, 2017). Using Crop Water Stress Index (CW-SI), the other system has been created to schedule crop irrigation and optimize the uses. This prevents irrigating at the wrong time of day by reducing runoff from saturated soils. It improves crop yields and saves time in every way possible. Controlled Environment Agriculture (CEA) has changed the conventional farming scenario, lighting and ventilation to computer-controlled water irrigation systems (Singh & Saika, 2016). Irrigation automation necessitates the use of an automation system. An automation system can regulate an adequate flow of water to the surface with minimal human intervention. This technique can also save money, energy, and time while also conserving water. It will give facilities for the elderly and handicapped to carry out their duties. To produce 1.0 kilogram of rice, it is predicted that 2500-3000 liters of water are required (Kumar et al., 2019). As a result, this initiative has enormous potential for reducing water waste on the land. A program that makes agricultural practice easy and burden-free from the farmer's perspective is urgently needed. With recent techno-logical advancements, in a totally agricultural-based economy, increasing annual crop production output has become critical. The research goal is to develop an automatic smart irrigation system prototype that uses an Arduino UNO micro-controller to detect moisture content and level of water in the field using a soil moisture content detector and an ultrasonic sensor.
This study proposes and demonstrates an Arduinobased managed irrigation system that is both costeffective and simple to operate. The developed device employs sensors including such flow of water sensors, temperature sensors, and moisture in the soil detectors to address environmental issues such as humidity, temperature, and crop water supply quantity. Arduino collects and acquires data, which is then linked to an interactive website that displays both real-time and standard values of various crop factors. This allows users to monitor irrigation pumps and sprinkler systems remotely via a website and ensure that they meet the specified values that will assist farmers grow optimal and topnotch crops.
Studies on the laboratory prototype revealed that the built framework that can be implemented is likely to be applicable. This study proposes and demonstrates a low-cost, easy-to-use Arduino-based managed irrigation system. To handle a range of environmental factors such as humidity, temperature, and the amount of water delivered to the crops, the device uses sensors such as water flow sensors, temperature sensors, and soil moisture sensors. The developed framework that can be implemented, according to studies completed on the laboratory prototype, should be applicable.

MATERIALS AND METHODS:
This prototype model has been built in the Farm Power and Machinery department of Sylhet Agricultural University, Bangladesh. Bangladesh is reliant on agricultural activity as an agrarian country. This research presents a way for achieving optimal irrigation efficiency. To create a prototype model that shows how irrigation will benefit agriculture in the future.

Materials Selection
The prototype model is based on electronics and programming. So here are the two sections, one is the hardware section another is the software section.

Hardware Requirement
Arduino Uno -Arduino Uno is a single-card microcontroller that allows for more understandable applications. This microcontroller is based on ATmega-328P microprocessor (datasheet). It is totally free and open-source platform for creating electronic devices. It contains 14 digital pins for input/output, where 6 pins are used for PWM and another 6 pins are analog input, a ceramic resonator (16 MHz), a USB connection, an ICSP header, a power jack, and a reset button. Without an extra power supply, the system can be powered simply from a USB hub.This can be connected to a 12V external power source and converts the 5V and 3.3V digital pins to 3 and 6 analog pins, respectively (Badamasi, 2014).

Soil Moisture Sensor -
The moisture sensor is an instrument that measures the amount of moisture in the soil. When there is a scarcity of water in the land, the output of the module is high; when there isn't, it is low. This sensor alerts users when it is time to irrigate their fields and monitors soil moisture levels. Capacitance, which is used in the sensor, is used to measure the dielectric properties of the surrounding soil (Oliver et al., 2005).
Ultrasonic sensor -An ultrasonic sensor is an electronic device that uses ultrasonic sound waves to detect the distance between a target items and converts the reflected sound into an electrical signal. Ultrasonic sensing is one of the most reliable methods for detecting levels and detecting proximity (Carullo et al., 2001). Ultrasonic sensors work by emitting a sound wave that is above the human hearing range.
Relay -Relays are used to operate a variety of circuits as well as to differentiate between low and high voltage circuits. Electromagnetic induction is the principle of relay and when the electromagnet was applied with some electricity it induces a magnetic field around it (Diego et al., 2014). To safeguard electrical circuits from overloads or failures, relays with calibrated operating characteristics and, in some cases, several operational coils are utilized.
LCD Display -A liquid crystal display (LCD) is an electronic screen that manages light using liquid crystals (Weinhold, 2005). Liquid crystals do not emit light in the traditional sense. Similar to digital clock, LCDs can display random or fixed visuals that can be revealed or obscured, such as digits, 7segment displays, and predefined text.
Adapter -The adapter is used to convert the higher incoming voltage to a lower one. It can convert 120V to 12V, which is sufficient enough for tiny electronic equipment. The incoming electrical surge could fry the internal components of the instrument if voltage is not regulated using an adaptor.

Breadboard -
The breadboard is a rectangular plastic board with a smattering of small holes. It's a popular tool for quickly building and testing circuits before finalizing any circuit design. It's employed as a cluster based on an electronic circuit's makeup. Because the connections on a breadboard are temporary, it was simple to replace an item if a mistake was made, or simply start again a new one.
Jumper wire -A jumper wire is a group of cables or electrical wires having a connection or pins on each end that is used to link the internal parts of the breadboard or other prototype or sample circuit.
Pump -A pump is a mechanical device that moves fluids, usually by converting electrical energy into hydraulic energy. The water is pumped into the experimental plots using a small submersible type water pump that runs on a 3-6V DC.

Software Requirement
The Arduino IDE (Integrated Development Environment) Software is used to do coding using a C++ programming language in the prototype model. It's compatible with Windows, Mac OS X, and Linux. This software is designed to work on Windows. The Arduino IDE includes a text editor for writing code, a message area, a text console, a toolbar with buttons for basic activities, and a menu system (Fezari & Ali, 2018). It is an open-source programming language that is mostly used for authoring and compiling programs. The Arduino Uno, Arduino Mega, Arduino Leonardo, Arduino Micro, and others Arduino modules are all compatible with this software. Microcontrollers, that can be programmed and accept data in code form, are found on the boards of these modules. The IDE platform's core code, also referred as a sketch, finally generates a hex file, which is delivered to the board's controller and uploaded. The Editor and Compiler are the two primary components of the IDE environments, with the former has been used to create the proper code and the latter that are used to compile and upload the program to the Arduino Module. This environment supports the C and C++ programming languages.

Project Framework
In the physical layer (Fig 1), a moisture sensor and an ultrasonic sensor collected data on water and soil level conditions. These data were transferred by the transport layer to the microcontroller (Arduino), where they were converted into meaningful information and allowed to pass through into the decision-making layer. Program logic takes centre stage in this layer. Sensors gathered information, but they were unable to make any decisions during the process. The actuator was in charge of making these decisions. As a result, after collecting data for operating the mechanism, the sensors sent control signals to the actuator. The actuator turned on/off the model after receiving the information as a signal. The control layer was responsible for this conceptual distinction. An application for monitoring the system operation could be developed to build an operation interface for the model and provide a service to the user. The irrigation field received sufficient water as a result of this application. The system generates an LCD monitor to display this data, on which the user can be informed of the soil moisture, water level in the field, and pump condition.

Working Principle
The model's automation employed various components to create a program using the Arduino IDE software. The program was then uploaded to the Arduino UNO via the Communication (COM) port. The soil moisture sensor and ultrasonic sensor were connected to the Arduino UNO via jumper wires and a breadboard. To connect the LCD to the Arduino UNO, jumper wires were used. Then, with the help of jumper wires, a relay was connected between the pump and the Arduino UNO. The relay and pump were both powered by the pump's power supply. The moisture sensor sensed the soil's dampness, while the ultrasonic sensor measured the level of water, and the data was gathered by the actuator through WSN. Using the programming, the actuator responded to the data. In the programming section, a minimum and maximum limit value was set. The moisture sensor's percentage value sat up in (Fig 2).
When the sensor detects a drop in soil water level below 50%, the pump is activated immediately. When the model was turned on, the water supply in the field began. An ultrasonic sensor was used to cut off the field's supply of water at a specific point. The water level was set at a height of approximately 5 cm. An ultrasonic sensor detects the level of water. If the water rises above 5 cm, the model will automatically shut down. The loop is completed when the moisture in the soil level falls below 50%. As a result, the water supply was kept at a water content greater than 50% and a level of water less than or equal to 5 cm. Based on demand, these values could be adjusted in the programming section. For this prototype model, the water content level, level of water, and pump state were all displayed on the LCD.

Design and Implementation
An experimental plot of 840 cm 2 and a pump with a discharge capacity of 25.64 cm 3 /sec were used to implement the prototype model.

Step 1. Build up a program
Using the Arduino IDE software, a program was created that followed the working concept. Setup () and loop () were the two functions coded in the software. The initialization of variables was defined by the Setup () function. Loop () defined the fundamental working functions. The program was developed in three stages. The initial stage was to convert the soil water content analog value to a percentage value using the software language's map function. In second stage, the sensor's ultrasonic waves are employed to measure distance in the second stage. An ultrasonic sensor sends and receives sounds that are less than 20Hz. The time interval between these sounds as measured in seconds. Finally, the following formula was used to compute the distance:

Distance (cm) = Velocity (cm/sec) × Time (sec)
The distance between the fixed height of the ground and the ultrasonic sensor was subtracted to determine the water level. To turn the model ON/OFF, some if/else conditions were utilized.
Step 2: Upload the code The software was used to compile the code, which was then transferred to the Arduino UNO via a COM port and a USB cable.

Step 3: Circuit Construction
Circuit was built after considering all of the design features. The circuit assembly diagram is shown in  Step 4: Setup the connections All connections were made in accordance with the circuit schematic. A pin-to-pin connection was used. The Arduino board, as well as the soil moisture sensor, ultrasonic sensor, LCD, and relay, were wired together. To connect the pump to the power source, a relay was used.
Step 5: Power Supply This prototype model was powered by direct current (DC). A 12V adapter, which converts AC power to DC, was used to power the model. Once the configuration was completed, the model was ready for use in the field. During field irrigation, the soil moisture sensor was properly placed in the soil. The ultrasonic sensor was set above the threshold value in the field, allowing the LCD to display a zero-water level. To turn the system ON and OFF, an external switch was used.

Data collection
The data was collected from the model's LCD and compared to the laptop's serial monitor. On the LCD and serial monitor, the soil moisture sensor and ultrasonic sensor displayed the same data.

Data Analysis
The initial soil moisture was 3% and the water level was 0.00 cm and the pump was started as soil moisture percentage was <50% and water level was <5 cm. The results show that the pump has been stopped when soil water content was increased 99% and 6 cm water level after 2.5 and 4 minutes respectively. Because the system cannot handle fractional values, the pump was turned off when the water level reached 6 cm. However, the threshold was set at 5 cm.

RESULTS AND DISCUSSION: Validation of the smart irrigation system
The application was written in the C++ programming language. The program was compiled using the Arduino IDE, and certain variables were converted to integers. The serial monitor, LCD, ultrasonic sensor, and relay's job was set in the void set-up section. Some logical statements were transformed to conditional statements in the void loop section. The system's output was created by those conditional statements.The program compiled to run the system as shown in Fig 6 (a), (b), and (c).
The prototype model was tested in dry soil whose moisture level was <50% and the pump started automatically. Water begun to infiltrate into the soil and the level water into the soil was gradually increased. After a while, the ultrasonic sensor detects that the water level was above the threshold value by delivering the signals to the Arduino board and the Arduino board stopped the pump using the relay. The prototype model was performing perfectly in consistent with the objectives.  Because the pump runs on a fixed sche-dule, it could prevent water waste. It saves time and human labor during irrigation in the field as it is auto-mated. The model also conserves water in this way. It could also be adapted to greenhouses where physical supervision is minimal. By replacing the DC pump with an AC pump, this prototype device might be used in the practical field.
This model can be applied to a wide range of crops.
To do so, modify the threshold settings in the programming section based on the water level of different crops while keeping the rest of the setup the same.So, if this approach is implemented correctly in the field, irrigation might be simple, precise, and practical. It may be encouraged in agriculture in the future to help accomplish the SDGs.

CONCLUSION AND RECOMMENDATION:
To reduce water loss and improve irrigation efficiency, an automatic irrigation application was developed using sensor technology. The research is being carried out in order to make better use of water and other resources. Increased irrigation efficiency has the potential to make agriculture more competitive and sustainable. The moisture sensor determined the amount of water in the soil and sent signals to the micro-controller. When the moisture level (water content) fell below the specified level, it sent signals to the microprocessor, causing the water pump to turn on and supply water to the fields. The system came to a halt and the pump was turned off when the ultrasonic sensor detected the desired moisture level. When there isn't enough rain and adequate irrigation isn't possible, smart irrigation technology like this is ideal. An automatic irrigation system works without the need for human intervention. Because it is primarily aimed at creating a fully automated system, this project has the potential to solve the labor issue. The system's components are dependable and lowcost, making it easily affordable. It also has self-intelligent capability, allowing it to meet the objectives. There has been a lot of research done on this topic, but no such condition that is preferable for Bangladesh has been implemented. As a result, the scope of this project in Bangladesh will be indefinite. An automatic irrigation system functions without the need for human intervention. This project may be able to solve the labor problem because it is primarily aimed at a fully automated system. The system's components are both dependable and inexpensive, making it easily affordable. It has self-intelligent capabilities, allowing it to achieve the goals. Despite extensive research in this area, no such situation that Bangladesh prefers has been implemented. As a result, the scope of this initiative in Bangladesh is indefinite. The following are some suggestions for this prototype automatic smart irrigation model: