A Smart Monitoring of a Water Quality Detector System

Received Jan 17, 2018 Revised Mar 28, 2018 Accepted Apr 12, 2018 The importance to monitor the water quality level is undeniable due to significant impact to human health and ecosystem. The project aims to develop a wireless water quality monitoring system that aids in continuous measurements of water conditions based on pH and turbidity measurements. These two sensors are connected to microprocessor and transmitted to the database by using a Wi-Fi module as a bridge. The developed system was successfully detect both the pH and turbidity values hence updating in IoT platform. Based on the results obtained, the test water sample can be classified to class IIB which is suitable for water recreational used body contact. Overall, the developed system offers fast and easy monitoring of pH and turbidity levels with IoT application for continuous maintenance of clean water. The work is just concern on the physical water parameters hence further extend to chemical parameter for verifying a better result in measuring the WQI value.


INTRODUCTION
The water quality index (WQI) is always used in order to justify or classify the level of water quality. WQI acts as mean indication of water quality measurement through the determination of physico-chemical parameters of surface water [1]. It is important to measure the level of the water quality before consuming or safe use for other purposes. For water quality classification, several physical, biological and chemical parameters that have significant impact on the water quality have to be identified. The measurements obtained are then compared to water quality standards of Malaysia.
However, water samples are normally collected at regular periods continued by laboratory analysis thus ask for larger time consumption. Besides, there are certain chemical and biological processes such as oxidation-reduction potential that require for on-site measurement to ensure accuracy and other aspects to be considered as discussed in [2]. Therefore, online water quality monitoring systems which potential to deliver continuous data is highly demanded. The objective of this work is to develop a low-cos wireless water quality monitoring system that aids in continuous measurements of water conditions. The Department of Environment (DOE) water quality parameters and index including its classes is presented in Table 1. According to Table 1, there are six parameters to be measured for water quality control which are Ammoniacal Nitrogen, Biochemical Oxygen Demand (BOD), Chemical Oxygen Demand (COD), Dissolved Oxygen (DO), pH, and Total Suspended Solid (TSS) [3]. However, since this is an initial study of water project, two parameters of DOE stated which are pH and total suspended solid (tss) are just emphasized. There are various studies of water quality monitoring system such discussed in [4] and [5]. In [4], a system which enables remote probing and real-time monitoring of the water quality parameters and enables observation of current and historical water quality status are developed. A ZigBee based on wiresless sensor network monitoring is applied. [5] implements water monitoring system which cover the analyses of pH, conductivity, dissolved oxygen and temperature's level. Sounds an alarm will be triggered if there is a water contamination or change in water quality. The parameters are measured with off-the shelf sensors and data is sent to a base station via GPRS. Meanwhile, the aim of [2] is to develop a low-cost wireless water quality monitoring system that aids in continuous measurements of water conditions. A prototype sensor as one component of the Autonomous Live Animal Response Monitor (ALARM) has been developed. The system measure temperature, light intensity, pH, electrical conductivity, total dissolved solids, salinity, dissolved oxygen and oxidation reduction potential as the parameters. On top of that, several previous works has been reviewed in terms of hardware and software selection such as microcontroller, pH and turbidity sensors.
Based on [6], the microcontroller used for the system is a Raspberry Pi (RPi) model B. This model has 256 Mb of RAM memory and 700 MHz processor and its architecture allows the development of several, different embedded system projects through the GPIO pins. This makes less demanding the collaboration with other equipment. The RPi is a very low-cost computer, with the compact size which supports Unix platforms. The difference for the proposed project is the used of WeMos D1 R2. The WeMos D1 R2 have almost same layout with the Arduino UNO except the number of analog I/O pins provided. The Arduino UNO offers six analog I/O pins while WeMos D1 only provided with one analog I/O pin. On the bright side, the WeMos is already embedded with a Wi-Fi module ESP8266 and cheaper compared to Arduino UNO. With Wi-fi module, the project is specifically use the ESP-12F that was embedded on the WeMos D1 R2.
In terms of pH sensor, [2] uses pH sensor from Phidgets. It measures the full pH range from 0 to 14 and operates in the temperature range of 0•−80• C. The Phidgets also supplies adaptor to convert BNC to analog voltage after sensing. Using this adaptor, the pH sensor data is acquired at Arduino analog pin. Meanwhile, [7] measures pH through the use of a conventional glass electrode with a reference electrode setup, the other is using an Ion-Selective-Field-Effect-Transistor (ISFET). The pH sensor will consist of a conventional glass electrode as these electrodes are more reliable and economical for long term monitoring. However, this project will use an analog pH sensor SKU:SEN0161 by DFRobot. It also measure the pH range from 0 to 14 and operates in the temperature range from 0 o C-60 o C. It has an LED which works as the Power Indicator, a BNC connector and PH2.0 sensor interface.
Meanwhile, turbidity sensor detects suspended particles in water by measuring the light transmittance and scattering rate which changes with the amount of total suspended solids (tss) in water. As the tss increases, the liquid turbidity level increases. [2] uses a light sensor to measure water turbidity which operate at 3.3V and 5V. The range of light intensity can be measured from 0−1000 lx and sensor output is of nonratiometric type. However, the project will use a turbidity sensor SKU: SEN0189 by DFRobot. Other research work studies the water monitoring dan control can be further review in [8][9][10]. The paper is organized as follows. The project implementation is explained in Section 2 while the result and analysis obtained is discussed in Section 3. The conclusion of the project drawn is next presented in Section 4.

RESEARCH METHOD
The implementation of this project can be divided into two major sections; hardware and software implementation.

Hardware Implementation
The hardware involves are microcontroller, pH and turbidity sensors and Wi-Fi module. In general, the microcontroller processes the data taken by pH and turbidity sensors hence sending the data to the database by using the Wi-Fi module as a bridge. Figure 1 shows a WeMos D1 R2 Arduino Compatible layout or commonly referred as WeMos D1. As discussed, WeMos D1 microcontroller has the same layout with Arduino UNO except a Wi-Fi module embedded onto the board.  Figure 2 shows an analog pH sensor SKU:SEN0161 by DFRobot. The sensor is connected to the first WeMos D1 analog pin, A0 as shown in Figure 2. Turbidity sensor SKU: SEN0189 by DFRobot is shown in Figure 3. This sensor provides analog and digital signal output modes while the threshold is adjustable when in digital signal mode. This sensor is next connected to the second WeMos D1 analog pin, A0.

Wi-Fi module
The ESP8266 module type ESP-12F is used as a Wi-Fi Module as shown in Figure 4. This Wi-Fi Module is a self-contained SOC with integrated TCP/IP protocol stack that can give any microcontroller access to Wi-Fi network. The ESP8266 is capable of either hosting an application or offloading all Wi-Fi networking functions from another application processor. Each ESP8266 module comes pre-programmed with an AT command set firmware, which can simply plug-and-play to Arduino device and get about as much Wi-Fi-ability as a Wi-Fi Shield offers. The data collected were next archived in online database, Ubidots. Ubidots are specializing in hardware and software development for IoT projects. It is an open source software that facilitates developers to easily capture sensor data and turn it into useful information. The Ubidots platform can be used to send data to the cloud from any internet-enabled device by configuring actions and alerts based on the real-time data and disengage the value of data through visual tools.
Finally, the data was displayed at webpage created by open software, Wix. The wix.com is one of the most popular HTML5 website builders (cloud-based web development). The Wix introduced a mobile editor that the size or the style better in mobile viewing. The concept of building the websites by using their online drag and drop tools is very easy to use. The block diagram of developed complete system is presented in Figure 5. The pH sensor and turbidity sensor were connected to the Arduino. The Arduino will then process the data and send it to database through Wi-Fi module ESP8266. The user will be able to receive the updated data hence allowing for water quality level classification based on DOE measurement.
The pH and turbidity data were recorded in both offline and online measurement. For offline action, the data were recorded for five days and maintained to be collected on 5pm to 6pm. The data were next continuously collected by online measurement in IoT platform.

RESULTS AND ANALYSIS
A complete system of Smart Monitoring Water Quality Detector is presented in Figure 6. As observed, the system is floated dan tested at Tasik UTeM.

Experiment Procedure of pH and Turbidity Sensors
Upon completion, the system has been tested and calibrated to achieve stability and accuracy of the measurements. The result of pH troubleshoots's are discussed:

pH sensor
The pH experiment is divided into three categories which are alkaline, acidic, or neutral. These experiments will be conducted in same order but with different test pH solution. The pH sensor is dip into the pH solutions while the reading is recorded. To ensure the reading accuracy, adjustment the "Offset" value in the codes has been done to ±0.10. Table 2-4 show the results of alkaline, acidic and neutral test pH solution using the modeled developed.
According to Table 2-4, it was proved that the applied pH sensor is accurately read the pH level; with the differences between the actual reading and the experimental value is not more than 0.9% on average of percentage error. It is noticed that the pH electrode must be initially washed with distilled water for each measurement of pH test solution for a reliable reading.

Turbidity sensor
The system was tested with filtered water that has actual reading of 0.1. Again, adjustment of "Offset" value in the codes has been done to ±0.10 to ensure the reading accuracy.

System Results
The system is next setup at "Tasik UTeM". Two assessments have been done where the data were collected in offline and online measurements.

Offline measurements
The data of offline measuremet was recorded for five days in two weeks; and maintained to be collected at every 5pm to 6pm. The results obtained are shown in Figure 7.

Online measurements
The data of online measurement was collected with the function of the IoT application. The system was connected to the Service Set Identifier (SSID) provided and transmitted the data to the online database, Ubidots. The Figure 8 shows a result collected by the online database, Ubidots.

Figure 8. pH and tss results on Ubidots platform
The pH results indicate that the tested water is in the neutral range with slightly acidic. The results also indicate a reading at pH 7 and above. The differences in reading is observed due to weather changing which in rainy or sunny days. It was studied that that weather has obviously effects to water pH level. Acid rain is comprehensively acknowledged to be accountable for acidifying soil and water in particular area, mostly in urban area [12]. The rain that fell on soil was mix with fertilizer and then flow down to the lake. This mixture are acidic, is then mix together with the water hence, may turns the water slightly acidic. Meanwhile, there were differences reading by 7 mg/l using offline and online approaches for tss measurement. It was studied that the rain gave an impact on water turbidity especially during heavy rain. It was found that rain events of the early rainy season through mid-tempestuous season are conclusive in initiating turbidity increment [13]. The rain transported the sediment into the water and turns the water murky hence increasing the tss.
The results collected can be summarized to average pH of 6.85 and tss of 50 mg/l; which reflect to class II of WQI (refer Table 1). According to WQI, the IIA needs a conventional water treatment if it uses as a water supply, while IIB is suitable for water recreational used body contact.

CONCLUSION
The project aims to develop a smart system to monitor the water quality level based on Water Quality Index (WQI) as a standard practice by Department of Environment (DOE) Malaysia. The developed system was successfully detect both pH and turbidity levels hence updating in Wix IoT platform. Overall, the system developed offers fast and easy monitoring of pH and turbidity level in ensuring clean water is continuously maintained. Based on the results obtained, the water level of "Tasik UTeM" can be classified into class IIB which is suitable for water recreational used body contact. However, the presented work was just concern on the physical water parameters hence further extend to chemical parameter for verifying a better result in measuring the WQI value.