Automatic Watering System for Plants with IoT Monitoring and Notification

Soil moisture related to water content which a factor that affects the plant growth. The process of watering plants is generally done manually regardless of the volume of water needed by plants. This re research discussed about an automated prototype and a system that have the function of watering plants based on the soil moisture level. The method used is prototyping which is suitable with the research purpose. The prototype and systems built with microcontroller, soil moisture sensors, relay and solenoid valve, which integrated with the IoT platform Blynk apps and Thingspeak. The process starts from the detection of soil moisture by the sensor. If soil moisture value is detected on 30% - 35%, then the device activates the watering function by opening the valve from the solenoid valve to drain water to the pipe. When the soil moisture detected more then 35% , the device stops the watering function. ThingSpeak IoT platform, used to display moisture percentage data in graphical form. Blynk apps provide notification features to the user's smartphone when the watering device is activated or deactivated. Based on the test scenario performed, it was found that the percentage of soil moisture with an initial value of 30% - 35% increased to 68.2%, after the watering process. Each component of the device and system has been tested and functioning according to the purpose, so the system has the potential to be used in the process of watering the plants automatically


INTRODUCTION
Plants need sufficient water to grow well.Watering plants is a work that needs to be done by farmers and plant lovers in caring for plants.Watering plants with suitable water volume is important because it has a direct impact on plants.Lack of water or excessive water content can make plants dry or rotten [1].
The process of watering plants can be manually or by using devices automatically.This research is related to the design of a prototype device and plant watering system that functions automatically.The prototype of the device made emphasizes the measurement of soil moisture content to control the water flow in the process of watering plants.The purpose of this research is that the watering system could control the water content needed by the plants based on the soil moisture.
In several related research has been discussed about automatically watering device.In research [2] discussed the applied of fuzzy logic and the use of Atmega16 microcontrollers, LM35 temperature sensors, and soil moisture sensors specifically for celery plants.Research [3] uses the Atmega8535 microcontroller and LM35 temperature sensor which is applied to watering plants in general.The study [4] related with an automatic sprinkler prototype on aeroponic plants using RTC timers based on the Atmega16 microcontroller.In research [5] discuss about the sprinkler watering system which triggered by the temperature and light intensity value using LM35 sensor, LDR, and Atmega8535 that applied on swallow nest farm.Research [6], proposed the control system of water tower using microcontroller, sensor and SMS, to detect the availablitiy of water in a water tank.Research [7] discussed about the design of plant sprinklers using Arduino Uno, YL-39 and YL-69 sensor, relay, water pump and Bluetooth connection to an invented Android application installed on user smartphone that display the value of the soil moisture pH.These related studies have focused on the control function of the watering devices but have no functions which connected to the internet of things (IoT) platform.
Research on IoT is developing and implemented in various aspects.For example, the use of IoT in the aspect of home security system was implemented using the Wemos board microcontroller and PIR sensor for motion detection [8].In the field of monitoring system, the IoT platform has been used to record data from MQ135 air quality sensors, processed by the system and provide notifications through the user's smartphone when pollution from harmful gases is detected [9].Another use of IoT explain in research [10] about the gas detector prototype using MQ2 sensor and Wemos board microcontroller with notification and monitoring features.Research [11] discussed the use of IoT for irrigation using a regression algorithm that aims to optimize and control water consumption.Another research [12] has implemented the smart plant monitoring system integrated with cloud-based server and mobile device based Android/iOS which help user to monitor the plant statuses of moisture, temperature, and light condition to perform the suitable irrigation and illumination for the plants.From several related studies that has been review previously, each research has various features to match the needs the research itself.
The main concered of our research about automatic watering system is to design and implemented the watering device that control the watering process according to the soil moisture needed by the plants.For that purpose, we focused on two main concerns related to the construction of hardware and integrated the system with IoT platforms.In addition to the prototype device, this research utilizes the features available from IoT platforms, namely Thingspeak and Blynk.The hardware and software that used to make automatic watering system consist of a soil moisture sensor, Wemos D1 microcontroller, relay, solenoid valve, watering pipe, Arduino IDE, Blynk apps, and Thingspeak.Each part and function are explained as follows.

Soil Moisture sensor
The function of soil moisture sensor [13] is to detect soil moisture or can also be used to determine whether there is water in the soil around the sensor.Soil moisture sensor YL-69 had been used and inserted into the soil to detect the moisture.

Microcontroler Wemos D1
Wemos D1 [14] is a board that is compatible with Arduino Uno and has ESP8266EX as an integrated Wi-fi module.In this prototype Wemos D1 controls other electronic components such as soil moisture sensor, relay, solenoid valve and watering pipe.The ESP8266EX as the wi-fi module built-in the board, serve to connect the watering device to the internet.Relay [15] is a switch that operates electrically which can be activated or deactivated to allow or not allow the incoming electric current.In this prototype, a 1-channel relay is needed as a switch and connected to the solenoid valve to open or close water flow from water reservoir to watering pipe.

Solenoid Valve
Solenoid valve [16] is used to control the flow of liquids or gases (fluids) in certain pipes or processes.The main function of the solenoid valve is to open or close the valve to allow or disallow the water flow form the reservoir.

Arduino IDE
Arduino IDE [17] is used to insert programs into the microcontroller.The source code is an important part to control the whole process of the automatic watering system.

Blynk Apps
Blynk Apps [18] is an IoT platform application which is installed on a user's smartphone to send notifications about watering device status whether it is activated or deactivated.

ThingSpeak
ThingSpeak [19] is an IoT platform that can store the data.Data is obtained from the soil moisture sensor which is processed by the Wemos D1 microcontroller.Soil moisture data sent through internet and recorded on the ThingSpeak channel that has been configured to display a graph of the soil moisture.Users can access the graph by login into ThingSpeak account.

RESEARCH METHOD
This research based on a prototyping model 20], which focused on making prototype of an automatic watering system.Conceptual research [21] consists of communication, analysis, prototype design, prototype testing and the use of prototype.
The sources in this study consist of primary data from interviews with open questions.Primary data is also obtained from observing and recording the symptoms related with water requirements for plants.Other sources are secondary data by conducting literature studies from books, journals, and related articles.
In the functionalities testing process of the prototype and the system, we conduct the experiment with black box testing method.The black box testing is used to check the functionality of each component and the parts related to the system whether it's function properly according to the expected results or there is some function that must be fix or improve.

SYSTEM IMPLEMENTATION
The automatic watering system is shown in Figure 1.The automatic watering system consists of three main functions, namely the watering system, monitoring system, and notification system.
The watering system performs the watering function as shown in Figure 1 and explained as follows: 1.The soil moisture sensor is connected to the Wemos D1 microcontroller.2. Soil moisture is implanted into the soil to detect water content in the soil.3. Soil moisture sensor detect the water content from the soil and get analogue input signal to be processed in the microcontroller.4. The Wemos D1 microcontroller send the output signal to the relay.5.The relay received output signal from the microcontroller an act as switch to the open or close the solenoid valve according to the input given to it.6.The solenoid valve opened the valve when the relay is on and closed the valve if the relay is off.
Water flows through the watering pipe when the solenoid valve opened.7. Watering pipe is constructed on top of the plant so that the water splash to the plant and to the soil.The second function is the monitoring system, which is monitoring the soil moisture using Thingspeak and explained as follows.1.The signal for detecting the soil moisture was successfully received by the Wemos D1 microcontroller from soil moisture sensor.Wemos D1 microcontroller that has been equipped by wi-fi module and connected to the wi-fi access point, send cloud data to ThingSpeak.com.2. Users can use the browser from a smartphone or computer to access the ThingSpeak.comwebsite.3.After login, user can access data on the ThingSpeak.com to view and monitor the soil moisture through a graphical form.
The third system is the notification system which is run when the watering device has started or finished.System send a notification to the user's smartphone.When the watering device is activated, user gets a notification on the smartphone.When the watering device has deactivated, the user gets a notification that the device is disabled.The processed is describe as follows: 1. Watering system that has been active or deactivated will then send data to Blynk Apps. 2. Blynk apps get data from the Wemos D1 microcontroller, processes the data, and send the notification to the user's smartphone.3. Users can check the notification on Blynk Apps in the smartphone about the watering device whether it is activated or deactivated.
The schematic watering device is shown in Figure 2. The prototype consists of a soil moisture sensor, relay channel, jumper cables, solenoid valve, power cable and microcontroller Wemos D1 which is connected to Thingspeak and Blynk IoT. Figure 3 shown an implementation of an automatic watering device and Figure 4 shown the installation of the automatic watering device for plants.The watering pipe could be adjust according to the area of watering for plants.

FINDING
Testing was performed to find out whether the system working properly or not.Testing was conducted using the black box testing method.The test is carried out in the three parts.First part was device testing to test the functionalities of each components.Second part testing was related with the monitoring of soil moisture through the Thingspeak.Third part testing was about the notification through Blynk apps regarding the information about the device when it's activated or deactivated.
The testing results are shown on the Table .1, Table .2, Table .3 and Table .4.
1. Testing the functionalities of the watering device.Table 1 show the testing results of the watering device.The watering device consist of the soil moisture sensor, Wemos D1 microcontroller, relay, solenoid valve and watering pipe.The parameter for this testing is based on the detection results from the soil moisture sensor.In this research, the reference of the soil moisture is preferred and set in the value between 30% -35 %.
When the sensor detected the soil moisture level is between 30% to 35% then the soil is in a dry level.When the soil is dry, it means the plants need water, so the relay state ON and triggered the solenoid valve to open the watering pipe to drain the water to the plants.The scenario of the testing was conducted to get the results value of the soil moisture detected by the sensor.In these experiments we use five different 250 ml cup.The soil was put in each cup and then 150 ml water poured out to the soil.The experiments were carried out in five experiments.The special treatment was applied to test the state of the soil moisture.
The first special treatment is related with the initial value of soil moisture which set to the value of 0%.The results of soil moisture testing is shown in the Table 2. Average value of soil moisture (S) is equal then the total sum of final value of soil moisture (F) divide by number of testing (T) then multiplied by 100%.The Formula (1), could be applied to calculate the average final value of soil moisture or to calculate the average of the increment value of soil moisture.
The average final value is 60,4% which is the same with the average increment value of the soil moisture.
The second special treatment is concerned with the range of soil moisture reference value.For each experiment the initial value of the soil moisture was varies between 30% -35% as shown in the Table .3. From five experiments, the final moisture value ranges from 65% -72%.The average final moisture value had been calculated with formula (1), and the results shown 68,2%.From each experiment, the increment moisture value could be calculated simply by subtraction of the final value with the initial value of soil moisture.The average increment value of soil moisture is 35,8%.results from sensor, processed by the microcontroller to generate the watering function automatically.The system sends notification to Blynk apps, when the device activated or deactivated the watering function.The system has the monitoring feature to record the soil moisture value through ThingSpeak which display the data through graph.The system had to connected to the internet to performs the realtime monitoring and notification.When the system disconnected from the internet, monitoring and notification functions could not be proceed, but the watering device will still perform watering function.
The initial value of the soil moisture could be adjust according to the moisture needed by the plants.This can be done by reprogramming the microcontroller.For this research, we set the initial value of the soil moisture in range of 30% -35%.The testing results of the ThingSpeak soil moisture monitoring based on the experimental scenario, calculated the average final value of soil moisture is 68,2%.This means that, in one cycle of watering, the device could perform the process of moisturizing the soil with average increment calculated 35,8%.
For further research development the system could be added with more soil moisture sensors or another sensor such as temperature and humidity sensor and then conduct different experimental scenarios to gain the comparison.The watering pipe could be customized according to the area of the plants on the ground.This automatic watering system has the potential to used simply for gardening or implemented the field of agriculture.

Figure 1 .
Figure 1.The design of Automatic Watering System

Figure 5 .
Figure 5. ThingSpeak graph monitoring the soil moisture

Figure 6 and
Figure6and Figure7display the Blynk application for the notification.The Blynk application display two types of notifications sent to smartphone users.The first notification is the message when the device is turn ON and perform the watering function.When the tool has finished performing the watering function, the device is turn OFF and system send the second notification to user smartphone through Blynk apps.

Figure 7 .
Figure 7. Notification to Blynk when watering function is turn On.

Figure 8 .
Figure 8. Notification to Blynk when watering device is turn Off

5 .
CONCLUSION AND DISCUSSION The automatic watering system integrated with IoT platforms Blynk and ThingSpeak could performs the functions of watering the plant according to the purpose of the research.Soil moisture sensor detected the water moisture in the soil and send signal to Wemos D1 microcontroller.The reading Cogito Smart Journal | VOL. 4 | NO.2 | DESEMBER 2018 ◼ 325 Copyright @2018 | Universitas Klabat | CORIS Member | ISSN: 2541-2221 | E-ISSN: 2477-8079

Table 1 .
Functionalities testing of the watering device.