Development of Automatic Warning System for Water Salinity in Bangkachao, Thailand

Currently, local people, especially cultivators, suffer from poor water quality, that is, saline water, which has caused the recent reductions in crop yield and changes in land use. This issue can be ameliorated by gathering the necessary data and planning the best water management to avoid problems caused by poor water quality. A number of sluice gates and a manual water quality measurement system were built in many areas, such as Bangkachao, but issues were not resolved efficiently because data were not collected on time. To resolve this, we have developed a system providing telemetric measurements to detect salinity and water level values, which are simultaneously uploaded to a cloud server, and an online automatic warning system to classify data and provide instantaneous notifications online. This system can broadcast the data rapidly and automatically through the website (http://www.bangkachao-wateronline.com/) and LINE to inform the local cultivators about the situation and enable them to make plans on time. Moreover, the online warning system provides a database of the data with a filter feature to assist current and future water planning and protection.


Introduction
Recently, the amount of fresh water has been observed to be inadequate for various human activities. This problem has been increasing owing to population growth and climate change.
Moreover, the quality of on-and sub-ground waters is affected by climate change in addition to human activities. In Thailand, water intrusion due to an increase in sea water level is a severe problem in many areas, especially during the dry season. (1) It has been clearly observed that water supply, agriculture, and fishery have been affected by these changes. Particularly in crop production, (2) saline water has a severe impact on a wide variety of crops, the impact depending on the crop species. The increase in water level around a delta is an important parameter that indicates the initial degree of sea water intrusion. In addition, the excessive water demand for agriculture is also affected by this issue.
Despite the fact that the study area is protected by a law restricting construction, the environment has also been deteriorated by the construction of floodgates to regulate water demand. These structures may have an unpredictable effect on water quality if the staff who control the gates do not have enough data. Thus, a telemetric measurement system is necessary. The warning system in the Ping basin, located in the north of Thailand, shows the water level and flow rate at each station, including a map indicating the management and prevention plans for floods. (3) Despite providing these parameters, water quality measures, such as the level of salinity, are not easily observable. A database of run-off water quality provides many parameters that are measured daily, including electric conductivity, an indicator of the level of salinity. This database can provide an early warning to better manage local and regional land use. (4) Therefore, a system providing telemetric measurements and an early warning system have been developed by surveying and co-agreement between local departments and people. The stations are equipped with automatic warning systems that receive data on salinity and water levels from a telemetric measurement system every minute. Furthermore, all measured data are simultaneously broadcast on the domain (http://www.bangkachao-wateronline.com/) and in a LINE group, and updated every hour.

Study Area
Bangkachao, which is called "the green lung of Bangkok", is selected as the study area. It is almost an island and is shaped like a pig's stomach owing to the bend of the Chao Phraya River and a canal at its western end (Fig. 1). The government has ordered its protection and preservation for biodiversity conservation. With the area facing several threats from different types of development, the government has also imposed some strict local planning codes that prohibit land development and construction in the area. Infrastructure development such as the construction of water gates and buildings has led to water management issues in Bangkachao. Despite its name, which means the land of egrets, this area consists of six subdistricts: Bangkachao, Bangnamphueng, Bangkobua, Bangyo, Bangkrasop, and Songkhanong, where many canals from Chao Phraya River merge. An increase in sea level has led to sea water intrusion and high salinity in the soil and local orchards. Moreover, the 30 constructed water gates may obstruct the natural drainage of intruding tidal water flows.

Method
This research starts from finding areas with high salinity and then determining the best locations to install equipment. Before installing devices, the tools are calibrated using control substances. Simultaneously, systems are designed to receive data from the measurement tools. Next, a beta system is used to re-examine and find flaws in the system. Finally, an early warning system is launched on a website and LINE. Figure 2 shows the process of the early warning system on the website and LINE. When the data is read from a sensor, the sensor ID is validated and the read raw data is examined for null. Then, the raw data from the sensor is converted to the parameter data and added to the database. The process in the web application is shown on the right-hand side of Fig. 2. Graphs, tables, and raw data of both water and salinity levels can be exported by general users, while authorized users can manage and change the system.

Salinity and water level sensors
The equipment for salinity measurement is selected on the basis of previous salinity levels. The conductivity transmitter used with a measuring cell in the equipment has several ranges of properties as shown in Table 1. (5) In this sensor, the basic equation for calculating the conductivity is where l is the length of the material, R is the measured resistance, A is the cross-sectional area, and y is the conductivity, which is in the unit of decisiemens per meter (ds/m). (6) Subsequently, the conductivity is multiplied by 0.640 to change the unit from ds/m to g/dm 3 . The results after this process are used to warn cultivators of the need to manage the water flow into their orchards to increase the crop yield, which is also shown on the website, as reported in Sect. 4. A diagram of the basic conductivity meter is shown in Fig. 3. (7) The resistance of the fluid is calculated as the inverse of the conductance. The resistance can be practically computed from current and potential measurements.
For the measurement of water elevation, which is the distance between the ground base and the water surface, radar reflection is applied. The standard methods used for installing the equipment in this research are shown in Figs. 4-6. (8) These methods can also be used for the   (Fig. 6). The onsite characteristics should be evaluated to select the best method of installing the equipment.

Locations of water measuring stations
To avoid errors in the data, the water level and electricity should be considered because if the water level is zero or the equipment has no supply of electricity, the data cannot be measured. In addition, the distance between stations is also important because if the stations are too far apart, the system cannot accurately present and describe the water quality in a particular area. For this reason, we surveyed the surrounding areas and communicated with local cultivators to determine suitable locations for the measuring stations. The obtained results are shown in Table  2 and Fig. 7. The name of each station located inside and outside the area starts with "IN" and "OT", respectively. All stations are used to monitor the water quality and water level in Chao Phraya River around the study area and the canals in the study area.

Warning system
Recently, the Internet and cloud storage have been widely used in various areas including our study area. These systems involve different sectors and include private, public, academic, business, and government networks of local to regional scope. In addition, they can carry a large number of information resources and provide various services. We make use of their benefits and apply them as tools to make the information public and create awareness among local people. The measurement information is disseminated through LINE. A LINE group is created and the salinity data is sent every hour to local people to avoid excessive notifications. The warning messages contain four major pieces of information: date and time, station code, station details, and salinity and water levels. Furthermore, organizations and other users can access and download the complete data and graphs through the website. The website provides and filters the database containing not only real-time data but also historical data.

Installation and measurement results
All devices were successfully installed, and an example of a station is shown in Fig. 8. Figure 9 shows the salinity data measured at three locations, namely, OT05, OT04, and OT02. The measurement was performed from 2 pm (14:00) to 4 pm (16:00). It was observed that the average salinity levels at the locations are relatively constant during the time of measurement. The salinity level at OT04 is the highest, while that at OT05 is the lowest among the three locations. The reason that the water at OT04 is highly saline is that OT04 is closest to the Gulf of Thailand and is significantly affected by sea water, while the water farther away from the gulf has a lower salinity level. The salinity is related to the distance from the ocean. This configuration demonstrates the benefits obtained from the database and representative graphs.

Warning system
The results from this warning system can be grouped into the following two systems: the main website for relevant departments, researchers, and residents and LINE for providing warnings. The central website (http://www.bangkachao-wateronline.com/) consists of the following six pages: 1) Home, 2) Graphs, 3) Download, 4) Raw data, 5) Documents, and 6)   (Table 3). For example, typical users can access the home page, view graphs, download data tables, download the selected data, and view documents. Figure 10 shows the home page designed for the viewers to understand the entire study area and measurement locations easily. The user/visitor only needs a short time to find out the current water situation by clicking on the stations that appear on the map, and a bubble shows the latitude and longitude, and water and salinity levels. Simultaneously, the right-hand table of the page shows the status of individual measuring devices, i.e., sending/receiving data and salinity levels. The stations are listed in order from upstream to downstream. Figure 11 shows the Graph tab. The tab shows graphs indicating the salinity and water levels at different locations for selected time ranges. The users select the range of dates and indicate the type of data to show, i.e., salinity or water level. Then, the users click on "create graphs" to create the corresponding graphs. The figure also shows the water elevation measured at all stations on June 26, 2019, when the option "level" is selected instead of "salinity". Figure 12 shows the page of the Download data tab. The users select the time duration, station, and parameters. More than one station and one parameter can be chosen from the data tab. Thus, several parameters and stations can be downloaded at one time. Then, "create table" is clicked and the users can download this data table in Excel.
If a user is added into the LINE group, he/she will receive the data on the level of salinity at each station. An updated message is sent every 10 min. The information provided in the message consists of the date and time of the notification, the station ID and name, and the salinity level in g/liter as shown in Fig. 13. The QR code in Fig. 14 is provided to facilitate the membership of the LINE group.    In summary, this system significantly improves the data quality from discontinuous data to continuous in space and time. Hence, the data can be analyzed to predict situations with greater precision. Additionally, the instant notification via the system is a powerful tool for effective planning to manage the gate operation in the surrounding canals. Moreover, the Document page in the project website enables local people to exchange knowledge, which will lead to a stronger water-based community. Lastly, the LINE group not only sends warning messages but also provides a platform for local people to exchange their experience about water quality and best practice.