IoT-Based Smart Irrigation System for Rice Fields

Rice farming in Indonesia requires effective irrigation channels. Traditional methods are still used for the care and regulation of rice eld irrigation. Rice farmers have to come to the rice elds so that they can open/close irrigation channels, and rice eld owners must take turns to ow water to the elds because they are used together. Internet of Things (IoT) information on water requirements in rice elds can be monitored at a distance, making it easier for farmers to care for their rice elds and reducing problems in the irrigation of rice elds. In this study, two products are developed for monitoring rice irrigation equipment: automatic rice eld irrigation equipment and smartphone applications. In this test, success is proven through changes when pressing the button so that the tool can drain water to rice elds 1 and 2 and the humidity sensor works well. According to the test results for the functionality, namely in the form of IoT-based rice eld irrigation tools and applications for monitoring that were tested, from the functionality test, 100% results must be obtained to ensure that the product can be used. By calculating the percentage of feasibility, it is found that the results of the feasibility test using the functionality test are obtained if the percentage is 100%; thus, it is declared feasible and the tool can work well.


Introduction
Agriculture in Indonesia is the main source of income and the basis of the economy. This is because in Indonesia, there is fertile land that allows for cultivation of spices, vegetables, and staple food crops such as rice. Thus, Indonesia is referred to as an agrarian country. In particular, rice growth is expected to be of good quality, and this requires a fairly good distribution of irrigation channels (Harro, 2014).
The current problem is that traditional methods, which have many limitations and shortcomings, are still used for growing various plants such as rice in Indonesia. These farmers usually come to the elds every day to open the irrigation canals and take turns owing water through shared irrigation canals (D. et al., 2020).
Irrigation is imperative for enhancing plant growth while providing support to users in maintaining plants.
Many innovative irrigation methods have been introduced to increase the water e ciency and reduce the environmental damage (Karunakanth et al., 2018).
Indonesia-a country where rice is a staple food-has developed irrigation covering an area of 7.2 million hectares since the legacy of the Dutch era. However, this irrigation has damaged an area of 1.62 million hectares (22.5%), of which 0.37 million (5.1%) were heavily damaged and 1.25 million (17.4%) were lightly damaged. The land has been damaged by natural disturbances, weak operation and maintenance, and agricultural irrigation infrastructure. If this continues, it can disrupt the performance of agricultural irrigation areas and result in a low e ciency of the agricultural irrigation system (Tarlera et al., 2016).
Another problem is that farmers view water as a free resource, which leads to considerable water wastage. Additionally, the management of irrigation facilities and infrastructure remains minimal (the sense of belonging is lacking). Human resources are still low, and most farmers still lack cooperation in irrigation management, which causes quarrels among farmers. There are many obstacles to using the conventional method, such as the need for a large amount of energy to continually open the irrigation lid and discipline in the distribution of irrigation time (K & Rathi, 2017).
Consequently, many people have switched from rice to other crops that are more pro table and do not require water irrigation channels. This is done for their livelihood, rather than adapting crop failure to their farms. Additionally, the inability of farmers to inspect and control the existing irrigation system, as well as the lack of water, has resulted in a water drought in the agricultural irrigation system (Rajkumar et al., 2017).
The Internet of Things (IoT) can be used to solve these problems. Over the past few years, it has become a special jargon in the realm of technology and has become a modern development used in several agricultural industries (Miorandi et al., 2012).
IoT aims to expand the bene ts of continuous Internet connectivity and its facilities with remote control and data sharing. IoT technology can provide information on water requirements that can be monitored remotely so that farmers no longer need to come to the elds to check their crops daily (Riggan & Snyder, 2014).
Therefore, in this study, an IoT-based intelligent irrigation system for rice elds was developed, which is intended to make it easier for farmers to care for their elds and reduce problems in irrigating the elds (Sima et al., 2020). It is also hoped that the system will help farmers with irrigation and improve the Indonesian economy, which is based on agriculture, to create a prosperous country (S. et al., 2014).

Literature Review
The IoT is a concept that aims to expand the bene ts of continuous Internet connectivity. Additionally, it can be used to control electronic equipment such as room lights that can be adjusted remotely via a computer network, which is useful in daily life (Gubbi et al., 2013).
IoT technology has been used to simplify jobs and various other aspects of business and daily life. For example, it is applied in agriculture, through the integration of automation with sensors (D. et al., 2020). It can help care for plants and help climate change and demonstrate the e ciency of using the IoT for irrigation systems in rice elds. Computer systems such as sensors, cloud servers, and Android applications can be used for communication in a real-time environment (Hamdi, 2021). With the sophistication of the IoT, it is possible for users to obtain real-time environmental parameters using sensors, as well as data stored in the cloud and monitored through Android applications. Thus, IoT systems can allow management departments and farmers to control irrigation from anywhere (Liu et al., 2021).
In the early 1950s, Taiwanese farmers using the Nan-hung Canal learned that rice cultivation required less water than they thought. After features of their irrigation system were changed, they changed their water control methods during periods of low water supply, which allowed signi cant changes in cropping patterns during the rst rice-growing season (Navarro-Hellín et al., 2016). Previously, farmers whose elds drew water from the ends of long canals or ditches spent more time and effort bringing water to their elds and received less water than farmers at the top of the system (Kavianand et al., 2016) Therefore, the former could not distribute the land as much as they wanted for wet rice. Because of this change, all users of the Nan-hung system now have enough water to grow as much rice on their land as they want. Additionally, those who have expended considerable effort on water control activities now only work slightly more than farmers who work in high systems. Thus, the location of a land with respect to the water source, i.e., the ditch or channel, no longer signi cantly in uences the availability of water (Jiang et al., 2014).
Additionally, machines make human work easier and more e cient. Initially, machines were made only to help humans and were operated manually. However, over time, machines were designed to operate automatically with advancements in technology. However, they have shortcomings; e.g., they cannot be controlled from a distance beyond the range of the system. To solve this problem, an IoT system has been applied with an IP address recognition machine that uses the Internet as a communication medium (for exchanging data), allowing long-distance operation (Dunn & Gaydon, 2011).
The smart eld farming system (SFCS) with probiotics and rice intensi cation-based applications (SPRI) can help farmers obtain eld environmental data inde nitely and from far away wine. It can help farmers save irrigation water while increasing the rice yield. Bhoi et al. developed a prototype of a smart irrigation system for the e cient use of water and minimal drain performance of the farmers themselves, so that the existence of prototypes can ease the work of farmers (Bhoi et al., 2021).
Cost-effective remote water-quality monitoring methods are used to prevent pollution incidents and reduce sh mortality rates in the aquaculture industry. Further research makes the WQM process more intelligent and precise by detecting and automatically adjusting for any differences in water parameters (Lezzar & Benmerzoug, 2020).
The irrigation prototype can also close the oodgates at any time, either when the schedule is not ful lled or when the irrigation schedule is implemented. If the irrigation channel has water that exceeds the limit, the water drain door can open automatically (Feki et al., 2013). Additionally, the Android application section can receive data directly from a connected server to be displayed on the application. Meanwhile, schedule settings can be applied as long as Android has an Internet connection and sends the schedule to the server. In a previous study (Rawal, 2017), a system was developed that can turn on and off sprinkler water and can be adjusted to the level of soil moisture, which can ease the work of farmers (Rawal, 2017). An irrigation control system that can operate automatically using wireless nodes and IoT was successfully designed and tested in an initial study on system development. The results of this study indicate that each device can function properly according to the design. The sensor is capable of reading the moisture parameters of dry soil, moist soil, wet soil, and water according to the actual conditions (Firas et al., 2014). This research is supported by other research indicating that the smart irrigation system ful lls the purpose of monitoring and controlling agricultural land irrigation systems. The IoT technology is integrated with several sensors, i.e., humidity, soil moisture, and pressure sensors, to control the soil status of agricultural land. The sensors are directly connected to the Internet via a Wi-Fi module (Ismail, 2019).
Several activities and studies have signi cantly contributed to the irrigation system-particularly in the rice elds of farmers. In one study (Kamaruddin, 2019), several methods were successfully implemented. One area of development is the arrangement of the sensor node packaging, whose function is to distinguish between plants. Additionally, it can perform wireless communication between sensor nodes, base stations, and Android applications to control the system in an unlimited range and use an ordinary Wi-Fi checker to overcome Internet connection drops (Bi et al., 2014).
In the case of data transfer, there must be a stable Internet connection that can handle wireless data communication. In the present study, using a cellular internet connection that is used to transfer data and collected, which is also unavoidable, it could lose the provider's signal; therefore, a special strategy and method are needed to overcome this problem (Lee & Lee, 2015).

Method
In this study, an IoT-based smart irrigation system for rice elds was developed. The system was designed using the procedure shown in

Need Analysis
The product development of the IoT-based smart irrigation system for rice elds begins with the collection of information for discovering more about the IoT rice-based irrigation equipment. Then, a needs analysis is performed, with the aim of determining what is needed to produce a decent product according to the information that has been collected. Subsequently, the system is designed. After the design, the system is fabricated. In the context of product design, this stage involves creating a rice eld irrigation system and smartphone application in accordance with the content framework of the results of problem identi cation and planning. The model design stage involves describing the design of the interaction display as well as the processes that occur in the designed product. The draft is obtained in accordance with the previously obtained user needs analysis results.

System Design
This section discusses the design of the IoT smart irrigation system in detail. The system design consists of two parts: hardware and software.

Hardware Design
The hardware design of the IoT-based smart irrigation system is presented in Fig. 2, which shows a block diagram consisting of input, process, and output parts.
[Insert Figure 2 near here] Figure 2 IoT-based smart irrigation system hardware design The input part consists of a rice eld controller with an ultrasonic sensor component (HC-SR04), a soil moisture sensor, and NodeMCU (ESP32 ESP-32 Wi-Fi module IOT). The ultrasonic sensor is used to detect the water level in the elds, the soil moisture sensor (YL-64) is used to detect soil moisture, and NodeMCU functions as a microcontroller that processes data received from ultrasonic sensors and soil moisture sensors.
The process part consists of Firebase and NodeMCU as the main controller. Firebase receives data sent by the controller in the eld. NodeMCU functions as a microcontroller to process data, receives data from Firebase (sent from the eld controller), and then sends the data to the output part.
The output part consists of a smartphone, which functions as a monitor that receives data from Firebase and as a controller that regulates the height of the volume of water owing into the rice elds. The entire process uses the Internet. There is a relay, pump, and solenoid valve. The relay functions as a switch to turn on the pump and open the faucet automatically to the rice elds. The pump drains water from the reservoir to the solenoid valve, and the solenoid valve drains the water into the rice elds. Fig. 3 shows the hardware design of an IoT-based smart irrigation system.
[Insert Figure 3 near here] Figure 3 IoT-based smart rice irrigation equipment As shown in Fig. 3, the IoT-based smart irrigation device can be divided into four parts. The rst part consists of the main controller, including one MCU node, three relays, one stepdown regulator, one 12-V adapter, one pump, and two solenoid valves. In the second part, there is a water reservoir. For the third part, there are two rice elds that have two controllers consisting of two MCU nodes, two solenoid valves, two soil moisture sensors, and two water level sensors. The two sensors are placed on the edges of the rice elds.

Software Design
In developing an IoT-based smart irrigation system application, the rst task is to design, program, and create an application display using MIT App Inventor. The application consists of several parts, e.g., rice eld monitoring, which monitors the humidity and water levels in the elds, lling the water volume, and the draining of water into the elds.
[Insert Figure 4 near here] Figure 4 IoT-based smart irrigation system with a smartphone Regarding the software design, the smartphone application was developed using MIT App Inventor, where NodeMCU uses its own software, i.e., Arduino IDE. The language used in the software design was C/C++, and several additional libraries were adopted for the design of the rice irrigation system monitoring tool. The smartphone application was used to monitor the rice eld irrigation system tools using the IoT feature.

System Development
The next stage is to develop a system according to a needs analysis and system design. This process begins by preparing all the required components and then installing the components according to the previously designed block diagram. To realize this solution (Fig. 5), we used a set of sensors attached to an Arduino microcontroller (Fig. 5).

Figure 5 Rice irrigation system tool design
The microcontroller in this system uses an adapter, a stepdown regulator, NodeMCU, a relay, a DC pump, a soil moisture sensor, an ultrasonic sensor, and a solenoid valve. The sensors, solenoid valve, and relay are connected directly to NodeMCU (Fig. 5).
NodeMCU functions as a microcontroller that manages work ows by entering commands into the microprocessor and acts as a link between Firebase and other components. Ultrasonic sensors are used to detect the water levels in rice elds, soil moisture sensors are used to detect moisture in paddy elds, solenoid valves are used to open water channels automatically, and relays function as switches.
The ultrasonic sensor was successfully applied in rice elds, as shown in Fig. 6, where the yellow column presents the initial application display before the rice eld was supplied with water, which was equal to 2.3%, and the red column presents the application display after the rice eld was supplied with water, where the ultrasonic sensor detected the water level in rice eld 1 and displayed it in the application worth (13%).
[Insert Figure 6 near here] Figure 6 IoT-based smart irrigation application display The success of the ultrasonic sensor in rice eld 2 is shown in the gure above, where the white column presents the initial application display before rice eld 2 was supplied with water, which was equal to 2.1%, and the black column presents the application display after the rice eld was supplied with water, where the ultrasonic sensor detected the water level in rice eld 2 and displayed it in the application that is worth (25%).
In this test, two soil moisture sensors, which were placed in rice elds 1 and 2, were used to detect moisture. This soil moisture sensor was tested for success, as evidenced by the detection of water moisture displayed in the application (smart irrigation).
The success of the soil moisture sensor in rice eld 1 is shown in the gure above, where the yellow column presents the initial application display before the rice eld was supplied with water (the humidity is worth 23%), and the red column presents the application display after the rice eld was supplied with water, where the soil moisture sensor successfully detected the humidity of rice eld 1 and displayed it in the application (48%).
Furthermore, the success of the soil moisture sensor in rice eld 2 is con rmed by the gure above, where the white column presents the initial application display before the rice eld was supplied with water (the humidity was 45%), and the black column presents the application display after the rice eld was supplied with water, where the soil moisture sensor detected the humidity of rice eld 2 and displayed it in the application (54% cm).
In this test, the success was proven by lling in the water level percentage and then pressing the ow button so that the tool could drain water to rice elds 1 and 2. The water level percentage in the application increases according to the content of the water level percentage that has been previously lled.
In the gure above, there is a column for lling the water level percentage, and the ow button is marked with a black and white column, where we can ll in the water level according to the desired percentage, with the maximum height given as 100% = 8 cm. In the black column, we see that the initial appearance of the lling column for the water level percentage is still empty for both rice elds 1 and 2. With soil moisture values of 23% for rice eld 1 and 45% for rice eld 2, the height value of rice eld 1 was 2.3%, and that of rice eld 2 was 2.1%.
In the white column, the water level percentage was lled. Rice elds 1 and 2 were given height percentages of 10% and 20%, respectively. After the ow button was pressed, the tool drained water to rice elds 1 and 2 so that the percentages of soil moisture in rice elds 1 and 2 were 48% and 54%, respectively, and the water level percentages in rice elds 1 and 2 were 13% and 25%, respectively.

System Testing
There are several main components to be tested in testing an IoT-based smart irrigation system. The objective is to con rm that the tool functions properly, as evidenced by the successful testing of each of its components, according to the functions of these components.

Testing Tool Connections with Apps Through Firebase
The objective of this test was to determine whether the MCU node can send data to smartphones via Firebase and whether smartphones connected to the Internet can be used to monitor the humidity and water levels in rice elds 1 and 2 (smart irrigation). The real-time database test results are shown in Figs. 7 and 8, indicating that the tool can be connected to Firebase so that the MCU node can be used and run properly.
[Insert Figure 7 near here] In Figs. 7 and 8, H1, H2, T1, and T2 exist, where H1 represents the humidity of rice eld 1, H2 represents the humidity of rice eld 2, T1 represents the height of rice eld 1, and T2 represents the height of rice eld 2. Fig. 7 shows the real-time database display when the rice eld irrigation was active/running. The yellow text indicates that Firebase temporarily sent data to the app, and the appearance of black text followed the data delivery; thus, the yellow and black text alternated continuously. With a better network, the delivery process is faster, and this depends on the speed of the network to which the rice eld irrigation equipment is connected. Fig. 8 shows the real-time database display when the rice eld irrigation equipment was deactivated. The data shown were the last data that appeared when the rice eld irrigation equipment stopped operating/turning off.

Functionality Test
Functionality is assessed according to the results for the ability of each component of the rice eld irrigation tool. The features contained in the application can perform their respective functions, which ultimately determines whether the tool can run/ ow water to the elds and is suitable for use. The results of the functionality tests are presented in Table 1. The functionality of the developed instrument was tested. The suitability of the function of the performance of tools and applications that occur states that the prototype of IoT-based smart irrigation for rice elds produces good products and is in accordance with its function.
For testing the functionality of the IoT-based rice eld irrigation monitoring tools and applications, several items were assessed, consisting of 20 test questions. In the test, a result of 100% must be obtained for the product to be used; i.e., if one of the test items is "wrong"/ "no," the product cannot be used. The feasibility percentage for the tool developed in this study was 100%; thus, it can work well.

Results And Discussion
Initially, automation systems were only developed in the industrial world, but now all types of systems can be automated-not only those in the industrial sector (Sima et al., 2020). Automation in agriculture is currently under development. This advanced technology is used by agricultural technicians and even farmers, and innovations have been made in the form of IoT-based smart irrigation (Rawal, 2017), which makes it easier for farmers to irrigate rice elds (Nuvula et al., 2017) and monitor them from home. Two products were developed in this study: an automatic rice eld irrigation tool and a smartphone application as a monitoring tool for rice eld irrigation.
In general, the tool employs an IoT system. Thus, for it to be used, there must be a good Internet connection. The microcontroller used in this tool is NodeMCU V3, which requires a hotspot/Wi-Fi to be connected to the internet so that data can be sent from the sender to receiver (Roy et al., 2021).
The tool consists of three controllers. The rst controller (main controller) is the receiving controller that regulates the operation of the water pump and solenoid valve. This controller receives data from Firebase in the form of water level data, soil moisture, and rice eld water volume settings originating from a smartphone application, which are processed to determine whether the water pump and solenoid valve will be turned on or off. The main objective of the project is to monitor and control the water level in the eld, which signi cantly affects the energy e ciency and water consumption. Speci c characteristics of rice cropping irrigation were considered, such as the long distances involved and different working schemes of water pumps (P tscher et al., 2011).
This smartphone application was developed using MIT App Inventor. It consists of three main items: 1) humidity (the data are percentages obtained from Firebase); 2) altitude (the data are percentages obtained from Firebase); and 3) ll column and ow button (the desired water level percentage is lled in this column). The stream button is pressed to send the setting data to Firebase (Roy et al., 2019).
The system uses in situ soil water potential measurements, weather condition parameters, and set point data provided by the user to decide when to apply water to the irrigated eld and how much water to apply. The soil moisture content and climatic parameters are monitored using a microprocessor-based data acquisition and distribution controller system under the supervision of the host computer. A bidirectional serial link allows the host computer to receive, store, and display the overall status of the irrigation system on the screen of a personal computer (PC) in real time. Additionally, the PC can transmit data to the controller and instruct it to operate in one of three modes (Miraz et al., 2015).
This IoT-based rice eld irrigation system has several advantages and disadvantages. The advantages are as follows: 1) the IoT is used to control all the work functions of both the tool and the application and 2) the tool can be used to monitor rice eld irrigation anywhere and anytime. The disadvantages of the tool are as follows: 1) it lacks protection for its components; 2) there is no switch to turn it off (to turn off the tool, the adapter must be removed); 3) the water level sensor is inexpensive, making the sensor readings unstable; and 4) the Internet network stability affects the device performance.

Conclusion
Increased production of rice agricultural crops can be achieved through two approaches: intensi cation (increasing land productivity) and extensi cation (expansion of the planted area). The latter can be done by expanding the area of rice elds, which requires adequate irrigation support.
Increasing the intensity of rice planting in paddy elds-particularly with regard to irrigation-is not di cult, and it is necessary. A touch of the latest technology that can control the irrigation system of rice elds in the area, with several advantages. For example, 1) the IoT is used to control all the work functions of both the tool and the application and 2) the tool can be used to monitor rice eld irrigation anywhere and anytime.
In testing the functionality of the IoT-based rice eld irrigation monitoring tools and applications, a result of 100% must be obtained for the product to be used; i.e., if one of the test items is "wrong"/ "no," the product cannot be used. The feasibility percentage for the tool developed in this study was 100%; thus, it can work well.

Declarations
Con ict of interest statement included.
On behalf of all authors, the corresponding author states that there is no con ict of interest.

Figure 3
IoT-based smart rice irrigation equipment IoT-based smart irrigation system with a smartphone Figure 5 Rice irrigation system tool design IoT-based smart irrigation application display Figure 8 Real-time database display has stopped operating

Supplementary Files
This is a list of supplementary les associated with this preprint. Click to download.