Application of Wireless Sensor Network in Monitoring Quality of Irrigation Water

: One of the things that needs to be considered to maximize the quantity and quality of agricultural products is the maintenance of irrigation water. Farmers still difficult to monitor the quality of irrigation water due to the high cost of laboratory tests and the need for real-time monitoring of water discharge into rice fields. Some of the impacts of not maintaining irrigation water in recent years include the roots rotting easily. This research aims to create a system that can detect and monitor the quality of irrigation water that will flow into rice fields according to water quality criteria in real time with wireless sensor network technology. In this research, the parameters of pH, conductivity, temperature, and dissolved oxygen are used to determine the quality of irrigation water quality. Based on the experiment results of two types of irrigation water; river water has good pH and conductivity values while the value of dissolved oxygen is poor, while borehole water has good pH, conductivity, and dissolved oxygen values. The calibration process was carried out under the procedures and succeeded well, characterized by sensors that can detect the quality value of irrigation water. In this research, the data from the sensors can be transferred to the server via the GSM module with a time difference between data of about 10-40 seconds. This indicates the performance of the sensor and detection system is running well.


Introduction
Water is a natural resource that is essential for the survival of all living things.Water is also needed for industrial activities, fisheries, agriculture and other businesses.In the use of water, there is often a lack of care in its use and utilization so that efforts are needed to maintain a balance between the availability and needs of water through development, preservation, improvement and protection [1] [2].
In meeting water needs, especially for water needs in rice fields, it is necessary to establish an irrigation system.The definition of irrigation is an effort to provide, regulate and dispose of irrigation water to support agriculture which types include surface irrigation, swamp irrigation, underground water irrigation, pump irrigation, and pond irrigation.The purpose of irrigation is to utilize the available irrigation water properly, namely as efficiently and effectively as possible so that agricultural productivity can increase as expected [3].
Some of the impacts of not maintaining irrigation water in recent years are that roots rot easily, tiller formation is inhibited, and fruits do not ripen simultaneously.Therefore, the quality of irrigation water is something that must be considered properly so that agricultural production can meet both quantity and quality standards [4] [5].
Sufficient irrigation water with water quality that is suitable for crops can support healthy agriculture [6].Things that are often considered to assess good water quality are pH, dissolved oxygen levels, conductivity, water temperature, salinity, copper ions, nitrates, iron, zinc and so on [7].To determine the quality of irrigation water, parameters are needed that are contained in the irrigation water quality criteria.
Research on water quality monitoring with wireless sensor network technology has been carried out by several researchers before [8] [9] [10] [11] [12].Research that discusses real-time water quality monitoring in the Internet of Things (IoT) environment using raspberry PI B + as the processing core and using temperature, PH, turbidity, conductivity and dissolved oxygen sensors as a determination of water quality [10] [12] [13].Another research is using wireless sensor network technology for realtime water quality monitoring systems using PH, turbidity and conductivity sensors where when water quality is known to be very dangerous, the system will send a message to users who have access to the system [14] [15].Another research is using wireless sensor network technology for a real-time wastewater quality level detection system using pH, temperature, conductivity, and dissolve oxygen sensors [16] [17].

Literature Review 2.1. Water
Water is one of the natural resources that has many functions and benefits for human life and living things in water as well as to promote general welfare and is a basic capital in development.Water is also one of the chemical compounds whose availability is abundant but the availability of water that meets the requirements for human and environmental needs is relatively small because it is limited by various factors.
Water quality management is very important to be monitored especially against harmful substances especially by sewage.Water quality monitoring is one of the first steps required in the development and management of water resources.Water quality monitoring is a complex subject involving solid chemical, hydrological and biological characteristics of water.
As we know that Vietnam and Thailand are the two largest rice producing countries in Southeast Asia.In agriculture or rice fields, water is one of the components that is highly treated to improve the quality and get good food production [18] [19].For this reason, efficient and effective water delivery is important for agricultural land so that it can irrigate crops in the fields as needed.In Vietnam, rivers, reservoirs, groundwater, and tidal systems are crucial sources of irrigation water, each fulfilling a distinct function in sustaining agricultural practices.Efficiently managing these water sources is crucial for maximizing irrigation, improving productivity, and promoting sustainable agricultural methods [20].One of the efforts to increase food production, especially rice, is the availability of irrigation water.
Water quality is a condition of water quality that is measured and tested based on certain parameters and certain methods based on applicable laws and regulations.Water quality criteria are water quality benchmarks for each water class.By looking at the water quality criteria, the quality of water quality can be known.Water quality criteria in each class vary depending on the designation.
Irrigation is the business of providing, regulating, and disposing of irrigation water to support agriculture which types include surface irrigation, swamp irrigation, underground water irrigation, pump irrigation, and pond irrigation.The purpose of irrigation is to utilize the available irrigation water properly, namely as efficiently and effectively as possible so that agricultural productivity can increase as expected.Parameters used to determine the quality of irrigation water based on irrigation water quality criteria set by the government.Irrigation water quality criteria include various key parameters as well as their limits and the effect of the toxicity of these parameters that will interfere with growth for either short-term or long-term use.The proposed irrigation water quality criteria can be seen in Table 1

 Temperature Sensor
The DS18S20 sensor, a waterproof, resolution-adjustable sensor, is manufactured by the DALLAS company.The sensor is used to measure temperature in water because the sensor is resistant to water.
A voltage between 3.0v-5.0v,it can measure temperatures from -55°C to +125°C within 60 seconds per reading [24] [25].Changes in pH, conductivity, and dissolved oxygen can be affected by temperature.The acidity degree (pH, Potential of Hydrogen / Power of Hydrogen) meter is a device for measuring the acidity level in water, based on the information contained in the datasheet.Produced by the manufacturer, which is able to measure the pH range between 0 to 14.Where it can take temperature measurements between 0 to 60℃, with an accuracy of ± 0.1 pH when measurements are taken at 25℃ [28] [29].
Sensor voltage reading for pH solution levels shows positive voltage for pH above 7, negative voltage for pH below 7, and voltage close to 0 for pH 7 or neutral.The origin of the term pH is from "p" which is the mathematical symbol for negative logarithm, and "H" is the chemical symbol for chemical elements.The pH formula can be explained as "pH = -log [H+]", pH is calculated based on quantitative data describing the degree of acidity or basicity associated with the activity of Hydrogen ions [30].Dissolved oxygen is oxygen gas that dissolves or exists in waters in the form of oxygen molecules, generally measured in mg/l.Several factors such as water temperature, bacteria, waste, and other factors affect the amount of dissolved oxygen in water.A decrease in dissolved oxygen levels afects the growth and development of anaerobic bacteria.
Oxygen can dissolve in water and does not interact with water chemically.Oxygen in water becomes soluble and influenced by temperature and air pressure.Dissolved oxygen or Dissolved Oxygen can be grouped into several assessments, for example a value ≥ 100% is considered very good, between 90 -100% is considered good, between 80 -89% is considered adequate, between 60 -79% is still acceptable, and below 60% is considered bad [31] [32].

Wireless Sensor Network
A Wireless Sensor Network (WSN) is a communication network that connects sensor nodes with data nodes to monitor specific environmental conditions at different locations between sensors and endpoints.WSN utilizes network hardware, such as a GSM Shield connected to an Arduino Uno, to transmit sensor data to the internet network.WSN is designed using multiple sensor devices connected to each other.Many sensors devices can be installed, reaching hundreds to thousands of sensors that can be active in remote areas.Needed to support the performance of the WSN:  GSM Shield GSM Shield is a device utilized to send GPRS signals to the internet.The GSM Shield is connected to a microcontroller, after receiving data from a connected device, the user can send data to a specific IP address to be stored on the internet.This GSM Shield has its own power supply port and must receive a voltage of 5v to function.The GSM Shield module used by Dan uses SIM908 which is equipped with a GPS/GPRS module, capable of covering a frequency range between 850 Mhz to 1900 Mhz [33]. Arduino Uno Arduino Uno is a microcontroller board that uses ATmega328P, equipped with 14 digital i/o pins and 6 analog i/o pins.This device has all the necessary features to operate a microcontroller.By simply connecting it through a USB cable to a computer, one can enter code to control any microcontroller [34].

Methodology
The general architecture of the system to be built can be seen in Figure 7.The workings of this system begin when the hardware with sensors is turned on to collect data on pH, temperature, conductivity, and dissolved oxygen.The data will then be sent via GSM Shield to the web server and presented in graphical form.The user must first fill in the form on the settings page to set the sensor value limit (value limit).The sensor data that has been entered will be stored in the database and will be used to compare the sensor value with the sensor value limit.If the sensor value exceeds or is less than the sensor value limit, a notification will appear.otherwise, the user can continue to monitor the irrigation water sensor value in real-time without refreshing the page.
All information from the pH, conductivity, temperature, and oxygen sensors taken by the Arduino Board will be transferred to the server via the GSM Shield installed on the Arduino Board.This data will be processed and displayed to the user in the form of graphs and widgets, where the graph will display the data directly without the need to refresh the page when new data enters the database.
The data sent from Arduino Board through GSM Shield to the server will be processed by the web server.If the sensor data exceeds or is less than the predetermined water quality limit, the system will store it in the database as notification data.When the user accesses the web, the system will display a popup alert notifying the user of the sensor value exceeding or less than the limit, as well as displaying the number of notifications.If the user is not active on the web, the system will display the number of notifications.

Finding and Discussion
System performance testing will be carried out to determine the performance of the system in detecting whether it is running properly.The testing data transmission system from the Arduino Board to the server using the GSM module has a time difference between the initial data and the next data ranging from 15-30 seconds.In the hardware program, data transmission is programmed with a time lag of 7 seconds but this time is not the total time because in the process of sending data with the GSM module, it takes time for the connection process to the network and the time lag is also influenced by the type of provider used.
In testing the system, detection and comparison of pH, conductivity, dissolved oxygen and water temperature values were tested.This experiment was carried out on river water and borehole water.The water used during experiment is in the form of flowing river water and static borehole water.
Comparisons were made to compare pH values in flowing river water and borehole water.Before testing the flowing river water, the sensors used, namely the pH sensor, conductivity sensor, dissolved oxygen sensor, and water temperature sensor, are first rinsed with distilled water and dried with an absorbent cloth which aims to neutralize the sensor value, then the sensor is inserted into the flowing river water.After completing the experiment on flowing river water, the pH sensor, conductivity sensor, dissolved oxygen sensor, and water temperature sensor are removed from the river water and then rinsed using distilled water, and then do the same process to test the borehole water.
System performance testing will be carried out to evaluate the ability of the system to detect whether it has operated efficiently.In testing the data transmission system from the Arduino Board to the server via the GSM module, there is a time interval between the first data and the second data of about 15-30 seconds.In the hardware program, data is sent every 7 seconds by taking into account the time lag involving the connection process and the influence of the provider type.The total time is not only limited to the data sending interval.
During system testing, the pH, conductivity, dissolved oxygen and temperature of the water being tested are identified and compared.Tests were conducted on river water and borehole water.The water used in the test consisted of flowing river water and still borehole water.

 pH
Comparisons were made to compare the pH levels of flowing river water with borehole water.Before testing the flowing river water, the pH sensor, conductivity sensor, dissolved oxygen sensor, and water temperature sensor must be doused with distilled water and dried with an absorbent cloth to remove the sensor values, before finally being inserted into the flowing river water.After finishing testing the flowing river water, the pH, conductivity, dissolved oxygen, and water temperature sensors are sprayed with distilled water before testing the borehole water.
Based on the experiments, it showed that the river water had an initial pH of 7.4 and a final pH of 7, indicating neutral properties.In contrast, the borehole water sample had an initial pH of 7.8 and a final pH of 7, indicating alkaline properties.During the five hours of observation, the pH of the water remained stable.
From the pH comparison test results, the river water had an initial pH value of 7.3 and a final pH of 7, indicating the neutral nature of the water.However, the borehole water sample had an initial pH value of 7.8 and a final pH of 7.6, indicating the alkaline nature of the water during the 3-hour monitoring.Changes in water temperature can affect changes in the pH value of water.The pH values of the river water and borehole water were within the normal range of values.

 Conductivity
The experiment was conducted to compare the conductivity values of river water and borehole water.Before testing river water, the conductivity sensor must be cleaned with distilled water and dried with an absorbent cloth so that the sensor value is neutral, then the sensor is inserted into a flowing river.The experiment was completed within five hours.After the test was completed, the conductivity sensor was washed with distilled water after being withdrawn from the river water and then inserted into the borehole.
Tests showed differences in conductivity values between river water and borehole water, with river water having an initial value of 190.4 mmhos/cm and a final value of 216.8 mmhos/cm, indicating a good conductivity category.Meanwhile, borehole water had an initial value of 661.9 mmhos/cm and a final value of 909.6 mmhos/cm, also indicating a good conductivity state.Changes in conductivity values can be caused by several factors such as temperature and measured resistance.

 Dissolved Oxygen
The experiment was conducted to compare the dissolved oxygen content in river water and borehole water.Before being tested in river water, the dissolved oxygen sensor must be cleaned using distilled water and an absorbent cloth to neutralize the sensor, before being inserted into river water.The experiment was conducted within five hours.After the river water test was completed, the dissolved oxygen sensor was washed with distilled water before being inserted into the borehole water.
The experiment showed that river water had a dissolved oxygen value that increased from 2.03 mg/L to 7.58 mg/L, a good water category.While borehole water has a stable dissolved oxygen value, from 5.4 mg/L to 6.5 mg/L, a good dissolved oxygen state.Some factors that affect changes in dissolved oxygen values are atmospheric pressure, salinity, and temperature.

 Temperature
The temperature sensor is inserted into the river water flow to measure the water temperature.The test was carried out in five hours.After the river water sample test was completed, the temperature sensor was moved from the river water into the borehole.The test showed that the river water temperature sensor went from 27.3 o C to 28 o C, while the borehole water temperature sensor went from 31.5 o C to 29.2 o C. Changes in water temperature occur due to changes in air temperature.

Conclusion
This research examines pH levels, conducting conductivity tests, temperature and measuring dissolved oxygen levels in river and borehole water.Before the experiment, sensors were calibrated with distilled water to guarantee precise measurements.The results show that the pH levels of river water were neutral, whereas borehole water showed alkaline characteristics.The findings indicated that the conductivity levels in borehole water were notably higher than in river water, both of which were classified as having good conductivity.Variables like temperature and the resistance being measured can impact conductivity values.Findings show a notable rise in oxygen levels in river water, as opposed to a constant level in borehole water.Both bodies of water had dissolved oxygen levels within the ideal range.Factors like air pressure, saltiness, and heat can impact levels of oxygen that is dissolved.
Various factors such as air pressure and temperature can cause fluctuations in dissolved oxygen sensor values.Other things that may have an impact on the instability of the dissolved oxygen sensor value are atmospheric pressure and salinity.Fluctuations in conductivity values can occur due to various factors, such as water resistance values and temperature changes during the five hours of observation.This happens because the test was conducted in an open environment where the water temperature is affected by the fluctuating air around it.
From the experiment on two types of irrigation water, river water showed good pH and conductivity but poor dissolved oxygen, while borehole water had good pH, conductivity, and dissolved oxygen.
In this research, the data from the sensors can be transferred to the server via the GSM module with a time difference between data of about 10-40 seconds.The cellular network used on the GSM module affects the data transmission time.In future research, it is recommended to set up atmospheric pressure and salinity reader sensors, to improve the performance of the device and also for more indepth exploration.

Figure 7 .
Figure 7. General Architecture of WSN-based Irrigation System

Table 1 .
[23][22][23].Irrigation Water Quality Criteria * room temperature is taken to be in the range 20 to 25°C with an average of 23°C2.2.SensorSensors are devices that can detect changes in the physical or chemical environment, which are then converted into electrical signals such as current or voltage.In this study, researchers utilized various types of sensors such as pH sensors, conductivity sensors, temperature sensors, and dissolved oxygen sensors to monitor water quality in irrigation water.