Application of Internet of Things in Smart Farm Watering System

1School of Urban and Environmental Science, Huaiyin Normal University, No. 111, ChangJang West Road, Huai’an City, Jiangsu Province 223300, China 2Department of Civil Engineering, Chung Hua University, No. 707, WuFu Road, Section 2, Hsinchu 30012, Taiwan 3College of Engineering, Chung Hua University, No. 707, WuFu Road, Section 2, Hsinchu 30012, Taiwan 4Department of Landscape Architecture, Chung Hua University, No. 707, WuFu Road, Section 2, Hsinchu 30012, Taiwan 5Department of Architecture and Urban Planning, Chung Hua University, No. 707, WuFu Road, Section 2, Hsinchu 30012, Taiwan 6Computer Engineering Department, Adamson University, 900 San Marcelino Ermita, Manila, Philippines


Introduction
In recent years, crop production worldwide has been significantly affected by factors such as climate change, pests, and diseases. Small-scale agriculture itself is both a contributor to greenhouse gas (GHG) emissions and a victim of climate change. (1) With the development of smart agriculture, wireless sensors and wireless networks are now being widely used. These networks are used to collect environmental information, such as temperature, humidity, and CO 2 content. (2) Traditional agriculture has used ordinary machinery and equipment. A major improvement in recent years has been the introduction of automation technology in the production process. Smart agriculture generally refers to the concept of applying computer and information technology to traditional agriculture. (3) For smart farms, the biggest challenge for the 21st century is to feed the world's population. Smart farms use automated equipment and management systems to replace traditional agriculture. Smart agriculture uses a combination of the Internet of Things (IoT) and information and communication technology (ICT) to improve agricultural production technology and optimize management models. This can reduce the utilization rate of agricultural resources and increase productivity. With the rapid development of 5G communication and intelligent technology, smart domestic agricultural applications are also widely used. For remote areas, the construction of communication networks is a huge and expensive task. How to reduce the cost of constructing communication systems in remote areas is currently a major topic of smart agriculture.

Research background
Although the term "smart agriculture" is widely used, it still has no commonly recognized definition. Smart agriculture is the evolution of a unified agricultural operation model combined with modern technology using various ICTs. Smart agriculture uses technologies such as information, sensors, and the Internet to increase the efficiency of agricultural production. Through this combination, agriculture can achieve the goals of sustainable development, effective use of resources, and environmental protection. The population engaged in agriculture in various countries in the world is aging. The development and application of smart agriculture can provide a solution to the problem of the aging of traditional agricultural manpower. The implementation of agricultural intelligence in planning, production, packaging, transportation, and distribution integrates the advantages of ICT into the agricultural production chain. Such integration can be used to appropriately plan product directions, achieve lean agricultural production, improve transportation efficiency, optimize the overall service quality of the industry, and realize industrial intelligence. (4)(5)(6) In this study, we use IoT sensors and communication equipment to collect the humidity and temperature of a farm, and then use set parameters to start/stop watering operations on the farm. By intelligently monitoring the environment and controlling various surrounding agricultural facilities, the burden on agricultural workers can be reduced and production efficiency can be effectively improved.

Aging population of Taiwan
Taiwan has become an aging society, and the elderly population is continuing to grow following advances in medicine and health care. According to data compiled by the Ministry of the Interior, (7) the life expectancy is 77.69 years for men, 84.23 for women, and 80.86 for the entire population of Taiwan.

Aging population issues in Taiwan rural areas
In 1994 Executive Yuan, the Directorate-General of Budget, Accounting, and Statistics of Taiwan made an appropriate definition of a main agricultural farmer as "A member who is under 65 years old and has been engaged in agricultural work for more than 90 days each year, and has an agricultural income greater than US$7200". (8) The labor shortage in Taiwan's agricultural industry has been a problem for years, and the situation has worsened. (9) The 2013 Survey on the Situation of Main Agricultural Producers (9) revealed that the average age of farmers engaged in agricultural work is 62 years old, and the average age of main agricultural farmers engaged in agricultural work is 57.5 years old in Taiwan. Although the main agricultural farmers seem to be younger and more productive, they comprise a small population of only 106419. Farmers aged 44 to 65 years account for more than 88% of the agricultural population, whereas those aged 25 to 44 years account for only 11%. The agricultural industry demands high labor intensity; therefore, it is crucial that the productivity of rural agriculture in Taiwan be increased through the application of advanced technology.

Urgent problems
The rural population in Taiwan is aging, and statistics show that by 2035, only approximately 10000 farmers will remain to sustain grain production and maintain the operation of rural society; it is this problem that the present study aims to solve. In this paper, we discuss the possibility of ameliorating or solving problems related to Taiwan's aging population and labor shortage in rural areas by integrating IoT, ICT, and relevant facilities.

Research objectives
To solve problems associated with an aging population and the labor shortage in rural areas, in this study, we employed IoT and ICT to establish an ideal intelligent watering system that enables decision-making, remote monitoring, wireless operation, and voice control. The aims of this study are as follows: A. Review the literature concerned with aging populations and labor shortages in rural areas and that addresses the consequences of associated problems, and evaluate the current situation of IoT adoption in intelligent farming. B. Establish a framework for an intelligent watering system, apply suitable sensor components and control panels, build a prototype of the intelligent watering system, program control software that controls the amount of watering according to soil moisture, and provide remote control buttons and voice control to turn the watering system on and off. C. Develop automatic timed watering software and design a system that waters crops automatically according to time and duration settings, thus enabling watering to be initiated at the most suitable times. D. Install human presence detection sensors and a webcam, and apply a LINE (10) reporting system developed using If This Then That (IFTTT) (11) to deliver a LINE notification message whenever the sensor detects a human presence, enabling operators to employ appropriate measures and issue voice alerts.

Literature Review
Agriculture was once the main foundation of human life. To meet the challenges of climate change, an increasing population, labor shortages in agriculture, food safety, and other factors, it is necessary to take effective measures to increase crop yields. The introduction of IoT technology has become an important task to assist the development of smart agriculture. This can minimize the impact of various uncertain factors on agriculture. (12)

Smart agriculture
Smart agriculture emphasizes the use of various ICTs in the management of physical farms. New technologies such as the IoT and cloud computing are expected to take advantage of this development to introduce more robots and artificial intelligence in agriculture. (13) With the application of smart machines and sensors on farms, the increase in the amount of farm data, and the expansion of the range of applications of technologies, the operation of farming processes will be more systematically driven by real-time data. The development of the IoT and cloud computing is rapidly promoting the phenomenon of smart agriculture. Romeo (2015), chief analyst at Beecham Research, stated in his article that smart agriculture is precision agriculture. However, because it is easier to compare smart agriculture with other M2M (machine to machine; serial communication technology between objects) technology-related issues (such as smart cities), the term smart agriculture is more adaptable. (14) According to Romeo, compared with farmers relying on their own experience and intuition to make decisions in the past, information is more important in the era of smart agriculture because it can be used to more accurately understand the actual growth of crops, animal behavior, and the conditions on the farm. This can result in better decision-making, reduce waste, and maximize production efficiency. He also mentioned that data is the most important element in smart agriculture. By collecting and analyzing data related to the factors that affect the growth of crops, including soil, weather, fertilizers, and animal and plant health, we can determine the impact of each factor on the output and manage the factors that affect crop production. (15) In a smart farm, it is possible to properly maintain and manage the growing environment of crops and livestock by installing remote or automatic ICTs in greenhouses, barns, orchards, and other agricultural environments. (2,16,17) Smart agriculture makes full use of modern technology, combining applied statistics, network technology, IoT technology, imaging technology, wireless communication technology, and professional wisdom and knowledge to realize visualized remote diagnosis, remote control, disaster warnings, and other intelligent management. Specific solutions based on IoT smart agriculture need to be implemented in each farm. This will improve the use of intelligence and promote energy conservation, environmental protection, and the recycling of resources, thereby reducing costs and improving efficiency. Specific implementation directions can be integrated into the following aspects: (1) Agricultural resources: land, water resources, and production materials can be effectively adjusted to achieve high efficiency. (2) Agricultural ecological environment: Agricultural organisms rely on various natural environmental factors for survival and reproduction, including soil, water, atmosphere, and organisms. (3) Use of smart equipment: the agricultural production process is more suitable for intensive cultivation and green planting. (4) Agricultural product and food safety: postproduction storage and processing, logistics, and transportation can be realized, and relevant information of the entire supply chain can be obtained instantly. (5) Equipment and facilities: information sharing, remote diagnosis and control, and service demand scheduling can be realized. (18)

Smart irrigation system
One of the biggest problems currently facing the world is a shortage of water resources. Agriculture consumes a lot of water and therefore requires an efficient water use system. A smart irrigation system can estimate the amount of moisture around plants and control an irrigation system to provide water when needed while minimizing excess water consumption. (19) Akubattin et al. examined countries with an agriculture-based economy and found that climatic conditions will cause lack of rainfall. Farmers working on farmland rely entirely on rainfall and drilling wells to irrigate the land. Even if there are pumps available, farmers need to manually turn them on and off when necessary. The main purpose of this research is to minimize farmers' manual operation of water-related facilities, which has the following two advantages: (1) Because rain is unpredictable and the area has very little rainfall, it is necessary to use sink wells for irrigation. A smart irrigation system can accurately provide the right amount of water at the required time, so it can save a lot of water. (2) Irrigation is started only when the soil moisture is insufficient, and a threshold value determines when to turn the water pump on or off, saving farmersʼ time. This measure also reduces the time taken by farmers to travel between the farm and their homes, allowing them to engage in other activities. (16) The key points of the smart farm application are as follows: A. Low-cost implementation and attractive to farmers. B. Automatic and timely alerts on variations in climate parameters. C. Analysis of various environmental/climate parameters such as soil moisture level, temperature, and humidity. D. Use of renewable energy sources, i.e., solar energy, to power the devices during daytime.
The control of soil moisture in irrigation systems originally used tension and volume techniques. These techniques are relatively simple, but these quantities are determined by a soil moisture characteristic curve specific to the soil type. (20) The current information on crop growth and environmental conditions enables smart farm operators to check the growth environment at any time and issue timely instructions, thus improving the productivity and quality of agricultural products while reducing labor and energy requirements. (21)(22)(23)

Research Design
We have developed a Smart Farm Watering System that integrates IoT and ICT. We link related sensing components, control panels, and control facilities; develop management software; integrate IoT and ICT technologies; and design the architecture of the Smart Farm Watering System. Through the testing of soil humidity sensor components, combined with a control panel and watering facilities, as well as software development and webcam settings, we propose a smart watering mechanism for reference in future studies.

Equipment applied in this study
The following IoT equipment was applied for the development of an intelligent watering system.

A. Arduino control panel
Arduino (24,25) (Fig. 1) is a company that manufactures computer hardware and software, and designs and produces single-chip microcontrollers and package management systems for digital devices and interactive objects to detect and control objects on the basis of physical and mathematical concepts. Arduino circuit boards are equipped with digital and analog inputs and can be connected to various types of expansion boards, sensors, and other controllable components. These circuit boards possess serial ports, and control software is also available for personal computers.

B. Webduino control panel
The word Webduino is a combination of web and Arduino. (26) A Webduino control panel not only allows an Arduino control panel to access the Internet but also updates firmware on its cloud space; additionally, software can be developed using different programming languages and can be controlled when using Wi-Fi. The Webduino control panel has this capability because it is designed for cross-platform and cross-device operation without the restrictions of using an Arduino panel. Webduino development is a type of web development. The evaluation board of IoT is managed over the web; the corresponding JavaScript should be downloaded to control the evaluation board pin through its matching application programming interface (API).  C. Webduino Blockly editor The Webduino Blockly (Fig. 2) online editor is a graphical editing tool developed by Webduino using the Google Blockly application. (27) The Webduino Blockly editor enables people who are unfamiliar with programming languages to complete projects and realize creative ideas within a short period of time. One of the characteristics of Webduino Blockly is that it can convert block-based coding into standard program coding available for applications. Webduino Blockly can be managed through four types of evaluation boards, namely, Wi-Fi, serial ports, Bluetooth, and WebSocket.

Sensor components
A. Soil moisture sensor A soil moisture sensor (Fig. 3) is a device that evaluates soil moisture. The output of the analog value decreases when soil is deficient in moisture and increases when soil has adequate moisture. The intelligent watering system equipped with this sensor prevents plants from withering due to lack of moisture. In this study, the soil moisture sensor activates the watering system when the soil moisture level drops below a set value and terminates the watering system when the moisture level exceeds this value.

B. Microwave radar motion sensor module
We employed an RCWL-0516 microwave radar motion sensor module that uses Doppler radar techniques (Fig. 4). The module is highly sensitive, with high reliability and wide sensing and supply voltage ranges, and is commonly applied in various induction lighting products and anti-theft alarms.

A. LED matrix display
We used a MAX7219 LED matrix display (Fig. 5), which is a common type of integrated serial input/output cathode display driver. It connects a microprocessor to an 8-digit, 7-segment digital LED display and can also be attached to a bar graph display or 64 separate LEDs.

B. Webcam
Each webcam possesses its own IP location, allowing users to access camera footage through the Internet. The remote monitoring function can be used with computers and smartphones. We employed a webcam-smartphone connection to monitor crops. When controlling the irrigation system remotely, the operator can inspect the situation with the webcam. When the microwave radar motion sensor detects a human presence, the system sends a LINE notification to the owner of the crop field. The owner can access webcam footage with a smartphone to examine the situation and implement appropriate measures.

Intelligent control mechanism
A. IFTTT IFTTT (11) provides Internet auto-connect services and determines whether to perform a task on the basis of triggered conditions. The functions and features that it employs are as follows: a channel, which is a series of websites that trigger instructions; triggers, which are the conditions that trigger actions; actions, which are the outputs of the previously input triggers; and the task, which refers to the entire procedure.

B. LINE reporting system
The combination of LINE (10) and the Internet is convenient and has been commonly applied worldwide in recent years. This communication software delivers text, pictures, and videos; additionally, it enables instant communication within chatrooms, making it a practical communication tool in terms of social interaction, communication, and even management. We adopted IFTTT to integrate the messages delivered by the sensor components of the intelligent watering system and distribute the messages to corresponding LINE users and chatrooms for the adoption of appropriate measures.

C. Normally closed solenoid valve
In contrast to an ordinary faucet, a solenoid valve is operated by electricity. When powered, the coil in the solenoid valve causes the valve body to open and thus allows water to pass; however, when the power is off, the valve body remains closed and water does not pass through. Normally closed solenoid valves (Fig. 6) are generally employed in crop fields. Watering is initiated when the solenoid valve is powered and ceases when it is unpowered.

D. Relays and irrigation control equipment
A relay (Fig. 7) is a type of electronic control device generally used in automatic control circuits. It is an automatic switch that controls a higher current using a lower current. In this study, the watering system is turned on and off by a Webduino smart plug on a relay.

E. Webduino smart plug and submersible motor
Typically, solenoid valves are used in crop fields to operate irrigation systems, but here, we adopted Webduino smart plugs (Fig. 8) to control the pumping of a submersible motor to simulate crop field irrigation. When the smart plug receives electricity, the submersible motor ( Fig. 9) initiates watering; however, when the electricity supply is cut off, the watering ceases. Furthermore, the soil moisture sensor triggers the operation of the submersible motor, which is controlled by the relay.

Framework of the intelligent irrigation system hardware
The hardware framework of the intelligent irrigation system is illustrated in Fig. 10, where (1) is the Webduino control panel, (2) is the soil moisture sensor, (3) is the LED matrix display, (4) is the Webcam, and (5) is the relay. Figure 11 is a hardware wiring diagram of the Smart Farm Watering System. Figure 12 presents the organizational diagram of the proposed system. We developed an intelligent watering system using IoT and ICT. The framework of the system was established by  connecting sensor components, control panels, and facilities; developing management software; and integrating IoT and ICT. We also designed control software and a LINE reporting system and propose a practical intelligent watering mechanism. After the control panels, sensors, and control mechanism have been tested and connected, the system begins operation. A. In terms of the management of soil moisture, the display device presents the evaluated soil moisture, as depicted in Fig. 13. When the soil moisture sensor detects that the soil moisture reaches 30%, the smart farm watering system automatically stops watering. When the soil moisture level is less than a set value, the submersible motor begins pumping water. When the soil moisture level reaches the set value (30% in this study), the submersible motor stops pumping (Fig. 14). B. The operator can operate a webcam via a smartphone to inspect crop fields and activate the watering function if necessary (Fig. 15) or employ remote voice control of the watering device to realize intelligent farming. C. Whenever the microwave radar motion sensor detects a human presence near the crop field, it delivers a LINE notification message through IFTTT (Fig. 16). The owner of the crop field can access footage captured by a webcam (Fig. 17) and issue a voice alert to warn trespassers that their actions are being recorded, helping the owner to protect their property. In this study, an IoT automatic watering system was actually installed on a farm. Figures  18-21 respectively show photographs of the connection of the controller and the water pipe; the connection of the solenoid valve and the water pipe; a sprinkler head; and the watering of a farm monitored remotely from a smartphone.

Advantages of system
The advantages of the proposed system are: A. A soil moisture detector is used to automatically control the sprinkler system, so that the growth of plants will not be affected by a lack of water, nor will precious water resources be wasted through excessive sprinkling. B. The automatic and remote control of watering reduces travel time to and from the farm, saving manpower and resources. C. When the motion detector detects a person approaching the farm, the system will issue a warning signal. Managers can talk to strangers through microphones and issue warnings to persuade outsiders to leave, helping protect the farmer's property.

Conclusions
We established an intelligent watering system through the integration of IoT and ICT. By adopting appropriate sensor components, control panels, and control systems to develop intelligent watering software, agricultural producers can practice automatic and intelligent watering, which can serve as a solution to problems related to the aging population and labor shortage in rural areas of Taiwan. The system developed in the present study offers the following benefits: A. Watering can be performed remotely through the Internet, thereby reducing the burden on an aging population in rural areas. B. Farm water can be managed precisely, thus conserving water and achieving sustainable development. C. Transportation costs are reduced because watering can be performed remotely. D. Watering can be performed automatically at optimal times according to soil moisture settings, thus reducing cost and increasing productivity. E. Through the use of sensors to detect the presence of humans and the issuing of voice alerts, theft is less likely to occur.
The proposed system helps farm producers implement automatic and intelligent watering and conserves water through precise management of the time and amount of watering. In the future, information regarding the optimal amount and time of watering may be collected and analyzed through the use of big data, which would contribute greatly to increasing the productivity of agriculture and sustainable development.