The Implementation of Smart Farming Application Based on the Microcontroller and Automatic Sprinkler Irrigation System of Agricultural Land

Article history: Received: 01 January, 2020 Accepted: 25 February, 2020 Online: 09 March, 2020 This research to applying the application of e-smart farming to control the sprinkler irrigation on agricultural land. This study aims to be able to help farmers to solve the watering problems that are manually carried out into watering done automatically and controlled, besides that this research also obtained data about the level of moisture content from sensor soil moisture, air temperature from the temperature sensor, and rainfall data from Rain Sensor as well as setting the right time using automatically scheduled Real-Time Clock (RTC) for watering time. This system is a combination of hardware and software components. The hardware part consists of systems and software embedded in the form of android-based applications. Consists of three sections, namely the Sensor block, the farm station controller, and the home station controller at the farmer’s house. The implementation of the smart farming application in this study obtained quite good results. The final results of this study indicate that the tools applied can assist farmers in implementing smart farming systems. The results can be seen in the success of several temperatures, soil humidity, and rain sensor tests. Moreover, there is no barrier between smart farming applications on the base station and the farm station using 2.4GHz Wireless ZigBee, and sending data in real-time from the sensor block on the farm station server using ESP8266. Besides, the sprinkler watering system also has no problems when watering agricultural land when receiving orders from the application


Introduction
Indonesia is an agrarian country, where agriculture is one of the main sectors of food production to be able to meet the demands of an increasingly growing human population. In agriculture, Irrigation is a necessary process that affects plants to be able to grow and produce. Traditional farmers always visit their farms regularly to check the level of soil moisture on their farms and based on the crop's need for water. Farmers need to wait a certain period before turning off the pump so that the water is allowed to flow in sufficient quantities in their fields. This Irrigation is a tool to save the problem of water that is not suitable for plantations and vegetation in dry places and during the dry season [1]. Moreover, the traditional irrigation method requires a lot of time and effort, especially when a farmer needs to irrigate several agricultural fields that are distributed in different geographical areas. Traditionally farmers will be present in their fields carrying out the irrigation process.
The modern agricultural sector is a transition from conventional agricultural technology to modern agriculture, namely smart agriculture. Smart farming (SF) involves the incorporation of information and communication technologies into machinery, equipment, and sensors for use in agricultural production systems. New technologies such as the Internet of things and cloud computing are expected to advance this development, introducing more robots and artificial intelligence into farming [2]. Such technologies do not suffice on their own; instead, they must be judiciously combined to deliver meaningful information in near real-time [3]. The use of smart farming techniques can increase crop yields, while simultaneously ASTESJ ISSN: 2415-6698 producing more output from the same amount of input [4]. Advances in communication technologies such as GSM and GPRS have enabled the remote control of irrigation systems [5]. However, with current technological developments, farmers can manage their agricultural land along with other jobs [6].
Smart agriculture can be a solution for the development of modern agriculture [7]. Innovative irrigation practices can enhance water efficiency, gaining an economic advantage while also reducing environmental burdens [8]. Smart irrigation systems are practical and efficient ways of Irrigation. It monitors weather, soil conditions, evaporation, and plant water use and automatically adjusts watering schedules [9]. Intelligent Irrigation is a selfcontrolled system that automatically controls the total irrigation system, where farmers do not need to be present in their fields. The system will send information to farmers about the data and conditions of their farmland. So that the intelligent system does not require more workers to embarrass the task of watering plants, and also the use of water will be more efficient [10].
Smart agriculture uses Information Technology (ICT) and specifically, the Internet of Things (IoT) and associated extensive analytic data to overcome these challenges through electronic crop tracking, as well as the environment, soil, fertilization, and planting conditions [11]. The intelligent farming system that is a system that can control; temperature sensor, soil moisture sensor, air humidity sensor and another sensor at the sensor node and The Wireless sensor network (WSN) consists of a large number of sensor nodes can collect data and are sent to the base station [12]. Smart agriculture relies on data transmission and data concentration from many sensors in remote receiving systems to allow the combination and analysis of various agricultural data that can be used as a basis for making decisions to control agricultural land [2].
Agricultural land irrigation can be used to automate the system by utilizing the development of microcontroller technology. With the microcontroller technology can be a monitor of condition soil moisture, an automatic system is needed to water the plants and observe soil moisture so that cultivation can be more comfortable than conventional agriculture [13]. The irrigation system using wireless sensor networks has installed these sensors, to collect the environment data and control the irrigation system via smartphone [14]. Predict plantation irrigation based on weather and soil measurement variables, but it is necessary to predict the irrigation needs of a field without any prior irrigation reports from the plantation [15]. The setup uses soil moisture sensors that measure the exact moisture level in the soil. This value enables the system to use an appropriate quantity of water, which avoids [16]. The use of mobile systems can quickly increase water content from online monitoring and control to realize irrigation automation [17]. This smartphone service is based on PDAs, GIS, GPS, and WS. It is not easy, flexible, mobile, practical, and smart to gather information and manage agriculture in decision making in agricultural production agriculture [18].
Automation of farm activities can transform agricultural domains from being manual and static to intelligent and dynamic, leading to higher production with lesser human supervision. Wireless Sensor Networks (WSNs), the Internet of things (IoT), and aerial mapping are nowadays being used very much in agriculture. The developed multimedia platform can be controlled remotely by mobile phone [19]. Parameter controller via a remote device or internet service and its operation is carried out with a connecting sensor, wifi, a camera with a microcontroller [20]. Smart irrigation systems use IoT based on application controlled plant monitoring and monitoring systems via Smartphones [21].
The implementation of smart farming applications based on Automatic Sprinkler Irrigation systems can provide solutions for farmers where farmers are not required to work in the field. In this paper, we propose hardware and software prototype to be able to automate irrigation control from the smart farming application fully. We also use microcontroller Arduino and three main sensors, namely Soil Moisture Sensor, Temperature Sensor, and Rain Sensor, which use Wireless sensor network connections from Zigbee and Esp8266 Module. The soil moisture sensor is a comparator (LM393), which converts analog data to discrete with two soil probes consist of two thin copper wires of 5 cm each that can be immersed in the soil under test (Kumar Sahu & Behera, 2015). Temperature sensor DS18B20, the core functionality of the DS18B20 is its direct-to-digital temperature sensor. The resolution of the temperature sensor is user-configurable to 9, 10, 11, or 12 bits, corresponding to increments of 0.5 C, 0.25 C, 0.125 C, and 0.0625C, respectively [9]. To communicate Android with the main server, we use wireless ESP8266EX to host the application. ESP8266EX can boots directly from an external flash. ESP8266EX functions as a WIFI adapter. Wireless internet access can be added to a microcontroller-based design with simple connectivity (SPI/SDIO or I2C/UART interface) [22].

Application Design
This system is a combination of hardware and software components. The hardware part consists of systems and software embedded in the form of android-based applications. Consists of three sections, namely the Sensor block, the farm station controller, and the home station controller at the farmer's house. Overal engineering design can be seen in figure 1. In testing the Real-Time Clock (RTC), the first watering time setting is done at 6:30 in the morning, and the second watering is at 4:30 pm and goes on every day. While on schedule management, fertilization is done scheduling once a week, which is done at 7:00 am every Thursday. In testing and measuring the moisture content using four soil moisture modification sensors connected to the ADC module and connected to Arduino Nano and NRF24L01 as senders of moisture content data to the Farm Station and forwarded to the smart Farming application on the smartphone, sensors are placed on four plots land. This humidity sensor is designed using two stainless steel rods of 5mm in diameter for two pieces for negative and positive voltage, with a length of each iron rod that is 15cm. At the base of the stainless steel, each cable is connected as a current stream to the ADC module. The input data from each stainless-steel bar is converted to a digital value in ADC, which becomes the data Value of ADC Sensor.

The interface of e-smart Farming Application
In the application used in the control and monitoring of agricultural land by farmers using an Android-based platform with the application name smart farming, as shown in figure 2, Application Design Scheme of e-smart Farming. This e-smart farming application consists of several parts, namely: The First Form is to display the average graph in the form of temperature data with three conditions namely temperature <20 0 C = Condition of Cold Temperature, temperature >21 0 C up to <30 0 C = Temperature of medium category (Warm) and temperature > 310C categorized as hot temperature. The data of temperature displayed in the application are based on real-time input from the DS18B20 temperature sensor. On the first page there is also a moisture value/soil moisture content, which is divided into three conditions, namely soil moisture content <35%, meaning that the soil experiences drought conditions, moisture content> 35% to 69% means that the soil is moist, while the soil moisture content > 69% are categorized as wetland. This soil water content data were obtained from sensor Soil Moisture data. Besides that, there is also a display of weather conditions in real-time from the Rain Sensor input, which displays rain or no rain conditions. Sensor Soil Moisture and DS18B20 temperature sensors are each consisting of four sensors placed on four agricultural fields. The Second Form displays history in the form of a graph of average temperature and soil moisture in real-time. The Third Form is to display the scheduling of Watering, Leaf Fertilization, and Root fertilization, which in this method, watering is carried out automatically following the set schedule. The Fourth Form is to display the manual system on watering plants, which in the manual mode the watering plant is not following the set schedule in the settings menu but instead selects the on a button to activate manual watering, and the button off to disable watering manually. Besides, in this mode, there is a menu for manually mixing root/leaf fertilizers. Before the e-smart farming application can be used, what will be done is to connect an Android smartphone with esp8266 wireless on the home station. The Fifth Form is a page to set up a smartphone connection with Esp8266 wireless. The Sixth Form is the Settings page. On the settings page, there are three menus, namely automatic watering settings, leaf fertilization settings, and root fertilization settings, which on this page sets the time so that the system works automatically based on the time set. The display of the Agriculture e-smart Application can be seen in Figure 3.

Result and Discussion
The results of the tests that have been carried out are by testing the Real-Time Clock (RTC), DS18B20 temperature sensor, Soil Moisture Sensor, and Rain Sensor. In checking the RTC, the first watering time setting is done at 6:30 am, and the second watering is at 4:30 pm and goes on every day. While on schedule management, fertilization is done scheduling once a week, which is done at 7:00 am every Thursday.

Testing the Real-Time Clock (RTC) Temperature Sensor
The results of the tests that have been carried out are by testing the Real-Time Clock (RTC), DS18B20 temperature sensor, Soil Moisture Sensor, and Rain Sensor. In testing the DS18B20 temperature sensor, which is testing the input temperature sensor in the form of analog data then converted to digital values to display temperature per 24 hours can be seen in Figure 4. The output result of the DS18B20 sensor is quite precise to detect changes in temperature because the DS18B20 sensor can detect the smallest temperature changes 5/ (212-1) = 0.0012 Volt with a temperature range of -10 0 C to +85 0 C, with an accuracy value of ± 0.5 0 C. On temperature measurement in the research, area is the placement of four plots of land with each sensor placed on each of these fields, then the results obtained are on land 1 to the fourth land the lowest temperature is obtained at 23.00-04.00 with a temperature value <26 0 C, temperature is happening at 07.00-10.00 am and 05.00 -08.00 pm with temperature > 26 0 C. While the temperature is classified as hot> 32 0 C occurs at 00.00 -03.00 pm. Conditions during the day with a temperature of > 32 0 C, evaporation of soil water levels are also higher, causing soil moisture also to decrease, and water absorption in plants also decreases. With real-time temperature monitoring, it is intended that the condition of the plant does not experience dryness or lack of water when the temperature conditions increase> 32 0 C. With the placement of temperature sensors on agricultural land, the system can work automatically in watering. Besides, the application also continues to receive information in the form of updating temperature data from changes in temperature detected by sensors in real-time on agricultural land.

Testing of The Performance of Real-Time Clock (RTC) and Sensor Soil MoistureFigure 4. Soil Moisture Sensor Testing
Testing of the performance of RTC and Sensor Soil Moisture is carried out. Testing of RTC is carried out by monitoring in the form of timeliness of watering at the specified time, namely the first watering at 6:30 am and second watering at 4:30 pm, in the process of watering the system can work correctly and on time according to the specified schedule. While the measurement and testing of soil moisture sensors to the level of moisture content and soil moisture use sensor Soil Moisture. Stages of testing carried out by measuring the water content for 24 hours and determine the amount of water content absorbed by the soil. Measurements were made with two methods of time starting from the first watering time, which is from 6:30 am until 04:30 pm and continued on the second measurement starting from after the second watering, which is 04.:30 pm until 06: 30 am the next day.
The results of the measurement of soil water content obtained analog values that have been converted to 10-Bit ADC values on Arduino with Reference Voltage, Vreff = 5Volt. From the measurements and testing using soil moisture sensors on sensor 1 to sensor 4 in the first method, the initial measurement data at 06:00 am was obtained, in the form of the lowest average value of the ADC of 423, the moisture content of Rh% = 89%, with the input voltage (Vin) received by the sensor which is 2.07 Volt and the sensor sensitivity value is 0.043 with the condition of the soil being wet after the first watering. Furthermore, the wet conditions only last ± 3 hours, namely 06:00 Am to 10:00 Am, with the ADC value which is increased to 571 with% Rh dropped to 67% with the input voltage rising to Vin = 2,79 Volt and the sensor sensitivity decreases namely 0.024 with the condition of the soil in humid conditions. The intensity of the sun's irradiation and soil absorption power also influence the decrease in the level of soil moisture due to evaporation and soil absorption power. The average percentage decrease in water content of about 4-5% per hour seen at the time conditions above 10:00 am to 5:00 Pm. The lowest level of water content is ADC = 758.5 occur at 17:00:00 before the second watering time, with% Rh = 39%, the input voltage has increased, namely Vin = 3.74 Volt and sensor sensitivity has decreased which is 0.011. At 05:00 pm, the condition of the soil is in a humid state or close to the dry value of 764-800.
The measurement carried out in the second method is to measure the level of water content when the second watering is done at 06:00 Pm. In the second measurement, at the beginning of 06:00 Pm from the lowest average value of the ADC was obtained from the four soil moisture sensors, namely 434.8. With the percentage value of humidity (% Rh) = 87% and the input voltage (Vin), which is 2.12v and sensitivity of 0.041 with soil conditions in the Wet. The wetness level of the second watering is to last ± 7 hours from 6: 00 Pm to 02:00 Am. In these conditions, the average decrease is % Rh = 1-2%, this is influenced by the reduced intensity of evaporation by the sun at night and is only influenced by the level of soil absorption so that the decrease in water content at night is not the same as during the day. Changes in conditions from wet to damp occur at 02:00 Am. And up to the morning when the first watering average decreases % Rh = 1-2%. In the morning before the first watering, the soil conditions were still moist with ADC = 624, the percentage of water content (% Rh) = 59%, and the Input voltage (Vin) = 2.88V and sensor sensitivity = 0.019.
The results of measurements on the first and second watering on soil moisture sensors obtained data in the form of the lowest ADC values ranging from 423 to 434.8, with the percentage of water content (% Rh) ranging from 87-89%, and Input voltage (Vin) ranging 2,07-2,12Volt. Moreover, the sensitivity of soil moisture sensors ranges from 0.041-0.043. The lowest ADC value is the condition of the soil in the wet state, namely the percentage of Rh> 75% caused by the increased intensity of water from watering. For soil conditions in humid conditions, the ADC value ranges from 525 -795, with the percentage of Rh = 33% -74%, and the voltage value at the sensor (Vin) ranges from 2.52 Volt-3.89 Volt. As well as the sensitivity of the sensor when the soil is moist, it ranges from 0.009-0.029. A comparison of measurement results from the tests carried out can be seen in Figure 5.

Testing of Rain Sensors
For measurement and testing of rain sensors, it aims to measure the occurrence of rain or not. Which way the sensor works is that when there are raindrops and on the sensor panel, there will be an electrolysis process by rainwater to deliver electricity from the rain sensor module. In the measurement and testing of the rain sensor, it is done by observing analog values when the intensity of the raindrops, heavy rain, and no rain. Observation in figure 6 shows that the sensor ADC data when the conditions of heavy rain ranged from <250, and the conditions of raindrops> 250 and <500, and the conditions for not raining were ADC> 500. the results of the Rain Sensor Measurement in the trial can be seen in Figure 6.

Summary
The implementation of the smart farming application in this study obtained quite good results. The final results of this study indicate that the tools applied can assist farmers in implementing smart farming systems. The results can be seen in the success of several temperatures, soil humidity, and rain sensor tests. Moreover, there is no barrier between smart farming applications on the base station and the farm station using 2.4 GHz Wireless ZigBee, and sending data in real-time from the sensor block on the farm station server using ESP8266. Besides, the sprinkler watering system also has no problems when watering agricultural land when receiving orders from the application.
Data obtained in the form of soil conditions and soil moisture are still in a standard condition that is very good for plant growth, due to regular and automatic watering twice a day, so that moisture and moisture content of the soil is maintained. In this study no dry or critical soil conditions were obtained, even though in the system and application the standard values of soil dryness were established with ADC values ranging from 800 to a maximum of 1023, percentage (Rh) = 33% -0%, and input voltage (Vin) = 3.91Volt-5Volt and sensor sensitivity 0.008-0. If the condition of the sensor detects that the water content has been greatly reduced and the soil experiences drought, the system will give an alarm in the form of a warning to the smartphone farmers that the land is experiencing drought. So that the automation system on the Esmart Farming application can anticipate by doing automatic watering on agricultural land even though it is outside the morning or evening watering schedule. With applications and systems that can regularly work, scheduled and automatically, it is expected that plant growth in agricultural areas will also increase

Conclusion
The implementation of the smart farming application in this study obtained quite good results. The final results of this study indicate that the tools applied can assist farmers in implementing smart farming systems. The results can be seen in the success of several temperatures, soil humidity, and rain sensor tests. Moreover, there is no barrier between smart farming applications on the base station and the farm station using 2.4GHz Wireless ZigBee, and sending data in real-time from the sensor block on the farm station server using ESP8266. Besides, the sprinkler watering system also has no problems when watering agricultural land when receiving orders from the application. If the condition of the sensor detects that the water content has been greatly reduced and the soil experiences drought, the system will give an alarm in the form of a warning to the smartphone farmers that the land is experiencing drought. So that the automation system on the Smart Farming application can anticipate by doing automatic watering on agricultural land even though it is outside the morning or evening watering schedule. With applications and systems that can regularly work, scheduled, and automatically, it is expected that plant growth in agricultural areas will also increase.