APPLICATION OF DIGITAL CELLULAR RADIO FOR MOBILE LOCATION ESTIMATION IIUM Engineering Journal, Vol. 23, No. 2, 2022 Maju et al. https://doi.org/10.31436/iiumej.v23i2.2168 THE DEVELOPMENT OF WATER POLLUTION DETECTOR USING CONDUCTIVITY AND TURBIDITY PRINCIPLES NURULHASANAH AMIR HAMZAH MAJU1, HASMAH MANSOR1*, TEDDY SURYA GUNAWAN1 AND ROBIAH AHMAD2 1 Department of Electrical and Computer Engineering, International Islamic University Malaysia, PO Box 10, 50728 Kuala Lumpur, Malaysia. 2 Razak Faculty of Technology and Informatic, Universiti Teknologi Malaysia, Jalan Sultan Yahya Petra, 54100 Kuala Lumpur, Malaysia. * Corresponding author: hasmahm@iium.edu.my (Received: 2nd August 2021; Accepted: 13th October 2021; Published on-line: 4th July 2022) ABSTRACT: Water pollution has caused negative impacts on human health as humans depend solely on water for drinking, cooking, and cleaning. Even more worrying is that the number of polluted rivers seems to increase as time progresses. Due to no real-time monitoring device being implemented, the authorities are unaware of any given river's real-time conditions. Therefore, this research aims to control the water pollution issue by designing and developing a low-cost device that can detect water pollutants and notifies the authorities if abnormalities occur. In this work, various water pollution sources in Malaysia have been identified: biochemical oxygen demand, ammoniacal nitrogen, and suspended solids. The general performance of the proposed device is also evaluated and analyzed. Water quality data is collected by the sensors and is sent to an IoT platform called ThingSpeak through a Wi-Fi module to be visualized and displayed. When the pollution is detected, the website will alert local authorities for their prompt actions. From the experiment conducted, the developed conductivity sensor managed to give readings with 6.84% and 6.35% error compared to the sensor in a benchmark paper and the ready- made sensor, respectively. Besides, the turbidity sensor also managed to give accurate readings according to various types of solution. The success of this research would help to reduce river pollution and provide positive outcomes to the environment. ABSTRAK: Pencemaran air telah menyebabkan kesan negatif terhadap kesihatan manusia kerana kebergantungan mereka terhadap air untuk minum, memasak dan mencuci. Lebih membimbangkan adalah, jumlah sungai tercemar yang semakin meningkat seiring tahun- tahun yang berlalu. Oleh kerana tiada alat pemantauan masa nyata yang dilaksanakan, pihak berkuasa tidak menyedari keadaan semasa air sungai. Oleh itu, projek ini bertujuan bagi mengawal masalah pencemaran air dengan merancang dan menghasilkan alat kos rendah yang dapat mengesan pencemaran air dan memberitahu pihak berkuasa sekiranya berlaku bacaan yang tidak normal. Melalui kajian ini, pelbagai sumber pencemaran air di Malaysia telah dikenal pasti: permintaan oksigen biokimia, nitrogen amonia dan pepejal terampai. Prestasi umum alat ini juga dinilai dan dianalisis. Kualiti data air dikumpulkan oleh pengimbas dan maklumat dihantar ke platform IoT yang disebut ThingSpeak melalui modul Wi-Fi bagi tujuan tinjauan dan paparan. Apabila pencemaran dikesan, laman web tersebut akan memberi amaran kepada pihak berkuasa tempatan untuk tindakan segera. Melalui eksperimen yang dijalankan, pengimbas kekonduksian yang dihasilkan berjaya memberikan bacaan dengan ralat 6.84% dan 6.35% berbanding pengimbas yang terdapat di kertas penanda aras dan pengimbas siap pakai. Selain itu, pengimbas kekeruhan yang digunakan mampu memberikan bacaan yang tepat mengikut pelbagai jenis larutan. Projek 104 mailto:hasmahm@iium.edu.my IIUM Engineering Journal, Vol. 23, No. 2, 2022 Maju et al. https://doi.org/10.31436/iiumej.v23i2.2168 ini diharap dapat membantu mengurangkan pencemaran sungai dan memberikan impak positif kepada alam sekitar. KEYWORDS: water pollution detector; conductivity; turbidity; ThingSpeak 1. INTRODUCTION Due to rapid development and lack of awareness, water quality is compromised as water pollution increases day by day. This research is designed to detect water contaminants in real-time so as to notify the authorities once the pollution occurs. The sensors used to detect the contaminants are a conductivity sensor and a turbidity sensor. This is because these sensors can be used as substitutions to detect suspended solids (SS), ammoniacal nitrogen (NH3N) and biochemical oxygen demand (BOD). These chemicals impact water bodies as highlighted by the Department of Environment in The Pollution Sources Inventory Report [1]. Water pollution can cause serious health issues to human beings such as typhoid fever and even deadly diseases like cholera [2]. The reason is that the contaminants or toxicants can enter the human’s food chain as they eat the fish or animals infected by pollution. On the other hand, in conjunction with the river pollution issue, the Department of Environment (DOE) conducted a river monitoring program. According to the Environment Quality Report 2017 [3], the percentage of clean rivers in Malaysia had slightly decreased from 47% to 46% in 2017. Unfortunately, the percentage of polluted rivers had somewhat increased from 10% to 11%. In March 2019, the country had been stunted by the news of toxic dumping in Sungai Kim Kim (Kim Kim river), Pasir Gudang, Johor, Malaysia. The impact of toxic dumping caused breathing difficulties among students in a school near the river [4]. It is believed that early detection of toxins could reduce the aftermath of a dumping incident. This incident has proven the need to have a real-time river pollution detection that can alert the authorities immediately so that prompt actions can be taken to curb the spread of toxicants. 2. METHODOLOGY This system consists of a self-developed conductivity sensor, SEN0189 turbidity sensor, Arduino UNO, ESP8266 Wi-Fi module and an IoT platform called ThingSpeak. By switching ON the switch, the LED will be turned ON and all of the system components will be activated. The block diagram of the overall system is shown in Fig. 1. Conductivity sensor Arduino UNO SEN0189 Turbidity sensor Authority (DOE) ESP8266 Wi- Fi module LiPo Battery Thing- Speak LED Fig. 1: The system's block diagram. 105 IIUM Engineering Journal, Vol. 23, No. 2, 2022 Maju et al. https://doi.org/10.31436/iiumej.v23i2.2168 First, the system started with water quality data collection. The data collected by the conductivity and turbidity sensors are sent to ThingSpeak through the ESP8266 Wi-Fi module for further data aggregation. The Arduino UNO circuit board has been used as the interface between the ESP8266 Wi-Fi module and the sensors. A coding containing a unique API key is programmed into the microcontroller to send data to the IoT platform. In ThingSpeak, the conductivity and turbidity data are processed, analyzed and visualized. All the necessary calculations and equations regarding the conductivity and turbidity are programmed into the Arduino UNO. Users can simply monitor the water quality through the website as the data are displayed in graphs and a numeric display. In the case of water pollution occurring, an email alert will be automatically sent to the user, which in this case is the Department of Environment (DOE). Considering the outdoor factors, the components are stored in a weatherproofed PVC box to avoid direct contact with the river water. The prototype is shown in Fig. 2. The schematic circuit diagram of this device can be seen in Fig. 3, and the actual system’s circuit connection can be seen in Fig. 4. Fig. 2: The system’s prototype. Fig. 3: The system’s schematic circuit diagram. Turbidity Sensor Conductivity Sensor Switch LED Weatherproofed PVC box 106 IIUM Engineering Journal, Vol. 23, No. 2, 2022 Maju et al. https://doi.org/10.31436/iiumej.v23i2.2168 Fig. 4: The actual circuit’s connection. 2.1 The Design of the Conductivity Sensor Water conductivity is the measure of the amount of electrical current that water can carry in the presence of dissolved solids such as chloride, magnesium, and calcium [5]. Conductivity can be used to detect the presence of the chemicals in the water. However, it is important to note that conductivity cannot identify the type of chemicals, only their presence. The amount of electrical conductivity allowed by DOE according to the National Water Quality Standards (NWQS) is below 6000μ𝑆/𝑐𝑚. Rivers with only 1000μ𝑆/𝑐𝑚 of conductivity readings are considered as clean rivers. Water conductivity is commonly expressed in μ𝑆/𝑐𝑚, which is derived from Ohm’s law where the voltage is equal to the product of current and resistance. 𝑉 = 𝐼𝑅 (1) V = Voltage (V) I = Current (A) R = Resistance (Ω) Conductance is the reciprocal of resistance which can be seen in Eq. (2) The conductance can be measured in Mho (℧) which is the backward spelling for resistance’s SI unit, Ohm (Ω). Another unit for conductance is Siemens (S). Both Mho and Siemens can be used interchangeably. In this work, Siemens is used. 𝐺 = 1 𝑅 (2) G = Conductance (S) By substituting the conductance into the Ohm’s law equation, the relationship between voltage and conductance is as follows: 𝑉 = 𝐼 𝐺 (3) 𝐺 = 𝐼 𝑉 (4) Turbidity Sensor Conductivity Sensor Wi-Fi Module Battery Arduino Uno LED Switch 107 IIUM Engineering Journal, Vol. 23, No. 2, 2022 Maju et al. https://doi.org/10.31436/iiumej.v23i2.2168 Next, to acquire the water conductivity value, a cell constant needs to be considered. This is because conductivity is influenced by the distance between the two electrodes and their surface area. The cell constant is defined as the ratio of the distance between the electrodes to their surface area. This is shown in Eq. (5) below. 𝐾 = 𝐷 𝐴 (𝑐𝑚−1) (5) K = cell constant D = distance between the electrodes A = surface area of the electrodes Finally, by multiplying the conductance with the cell constant, water conductivity can be obtained, as shown in Eq. (6) κ=𝐺•𝐾 (𝑆𝑖𝑒𝑚𝑒𝑛𝑠/𝑐𝑚) (6) κ=Water conductivity In this research, the conductivity sensor will collect the water conductivity data and later, the data will be sent to ThingSpeak. Generally, there are three types of conductivity sensors: two-electrode conductivity sensors, four-electrode conductivity sensors, and inductive conductivity sensors. In this work, a two-electrode method is used to design a conductivity sensor. The developed sensor is shown in Fig. 5. Fig. 4: The developed conductivity sensor. The sensor is designed using the calibration method by adjusting the distance between the electrodes. The calibration is done so that the results acquired satisfy the standard conductivity reading of tap water which is around 500−800 μ𝑆/𝑐𝑚 [6]. The sensor is injected with pulse-width modulation (PWM) to mimic an alternating current (AC). This is to avoid the polarization effect. The electrodes used in this sensor are non-insulated copper plate electrodes. The plates are rectangular and have two pill-like shaped holes. The calculated surface area of the copper plates is 12.44 cm2. Then, the distance between the copper plate is adjusted to 2 cm, 3 cm, 4 cm and 5 cm. Using the total surface area, the cell constant for each distance can be acquired using Eq. (5). The cell constants correspond to each distance as provided in section 3.1. 2.2 The Concept of Turbidity Sensor Turbidity is the measure of haziness and cloudiness of water caused by Suspended Solid (SS) and measured in Nephelometric Turbidity Units (NTU). High turbidity can cause an increase in water temperature as the suspended particles absorb heat from the sunlight. The growth of aquatic plants rate is also obstructed as sunlight cannot penetrate through turbid water and this will eventually disturb the photosynthesis process. Following the NQWS, the turbidity level for clean rivers set by the DOE is around 50 NTU and below. According to the Environment Quality Report (EQR), turbidity can be used to indicate the SS [3]. 108 IIUM Engineering Journal, Vol. 23, No. 2, 2022 Maju et al. https://doi.org/10.31436/iiumej.v23i2.2168 The turbidity sensor in this research employs the orthogonal scattered light detection principle by measuring the light transmitted and scattered rate influenced by Total Suspended Solid (TSS). In this project, the reading obtained from the sensor is processed by the microcontroller, then sent to the cloud for further aggregation process. The SEN0189 turbidity sensor used is provided in Fig. 6. Fig. 5: SEN0189 turbidity sensor. This sensor operates at 5 V and a maximum current of 40 mA. By using analog input mode, the turbidity reading gained ranges from 0 to 1023. The Arduino UNO has a 10-bit analog-to-digital converter (ADC) which means it has resolution ranging from 0 to 1023 (210 = 1024). Then, this read value is converted to a voltage using Eq. 7. The value of turbidity in NTU can be obtained from the voltage and turbidity relationship graph provided by DFRobot in Fig. 7. This was done using Eq. 8 obtained from the graph to convert it from voltage to NTU. The graph in Fig. 7 shows that the smaller the output voltage, the higher the turbidity reading. 𝑉 = 𝑟𝑒𝑎𝑑 𝑣𝑎𝑙𝑢𝑒 × ( 5.0 1024.0 ) (7) 𝑁𝑇𝑈 = −1120.4𝑉2 + 5742.3𝑉 − 4352.9 (8) Fig. 6: Turbidity and voltage relationship graph. 2.3 The Component Cost One of the aims of this research is to develop a water pollution detection system with affordable and minimal costs. Table 1 shows the cost for each item used in this research for the prototype. The total cost for the hardware is RM213.06, which is considered minimal. Other systems on the market could cost up to thousands of ringgits for similar functionality. 109 IIUM Engineering Journal, Vol. 23, No. 2, 2022 Maju et al. https://doi.org/10.31436/iiumej.v23i2.2168 Table 1: Itemised prototype (hardware) cost No. Item Quantity Per Unit Cost (RM) Total Cost Per Item (RM) 1 Arduino UNO ATmega328P 1 97.60 97.60 2 SEN0189 Turbidity Sensor 1 59.00 59.00 3 ESP8266 Wi-Fi Module 1 14.90 14.90 4 LiPo Battery (7.4 V 900 mAH) 1 20.00 20.00 5 Breadboard 1 2.70 2.70 6 Copper plates 2 2.50 5.00 7 Switch 1 1.50 1.50 8 LED 1 0.05 0.05 9 PVC Box 1 12.31 12.31 Total Cost 213.06 3. RESULTS AND DISCUSSION 3.1 Conductivity Sensor The design of this sensor was done using the calibration method. The distance between the two plates was adjusted accordingly to obtain a conductivity value that satisfies the standard tap water conductivity reading. The standardized conductivity value for tap water is 500 − 800 µS/cm [6]. The calculated cell constant, readings of current and voltage were recorded in Table 2. Table 2: Calibration result Distance [cm] Current [mA] Voltage [mV] Cell constant, K [cm-1] Conductivity [µS/cm] 2 0.60 280 0.16 344.12 3 0.57 260 0.24 528.57 4 0.53 240 0.32 709.97 5 0.43 186 0.40 928.79 From the result, the 4 cm distance between the electrodes shows a conductivity reading within the range of 500 − 800 µS/cm. Even though the conductivity reading for a 3 cm distance also falls within the same range, it is safer to choose the 4 cm distance. It can be observed that as the distance increased, the conductivity also increased. However, both voltage and current showed a decrease. This is because the farther the electrodes are from each other, the harder it is for the ions in the solution to travel because of the higher resistance. This results in a lower current flow. Next, by employing [7] as the benchmark paper, the sensor was tested by dipping it in a 500 ml of water mixed with 2 g of salt. Nine readings were taken, and the results are recorded in Table 3. 110 IIUM Engineering Journal, Vol. 23, No. 2, 2022 Maju et al. https://doi.org/10.31436/iiumej.v23i2.2168 Table 3: Conductivity result No. of readings Developed sensor [V] Developed sensor in [7] [V] Ready-made sensor [V] 1 1.74 1.81 1.90 2 1.75 1.94 1.90 3 1.77 1.87 1.91 4 1.76 1.85 1.91 5 1.80 1.90 1.85 6 1.76 1.90 1.85 7 1.77 1.93 1.89 8 1.77 1.94 1.89 9 1.78 1.94 1.89 Average 1.77 1.90 1.89 From the result obtained, it can be seen that the sensor developed in this research has an almost constant reading, in the range of 1.74 V to 1.80 V. The average voltage difference between the developed sensor in this research and the benchmark paper in only 6.84%. While the average voltage difference between the developed sensor and the ready-made sensor is 6.35%. 3.2 Turbidity Sensor The turbidity readings were taken by inserting the probe into five different types of solutions: tap, salt, soap, river, and coffee. These solutions were chosen as all of them have different clarity. The river water was collected from the Pusu River near the Female Sports Centre (FSC), International Islamic University Malaysia (IIUM), Gombak campus. The readings were taken three times for each solution to ensure accurate measurements. Table 4 below shows the turbidity result for each solution. Table 4: Turbidity result Solution Reading 1 Reading 2 Reading 3 Average Voltage [V] Turbidity [NTU] Voltage [V] Turbidity [NTU] Voltage [V] Turbidity [NTU] Voltage [V] Turbidity [NTU] Tap 4.22 -68.28 4.22 -68.28 4.21 -50.19 4.22 -62.25 Salt 4.29 -346.10 4.30 -365.05 4.29 -346.10 4.29 -352.42 Soap 4.04 565.10 4.03 581.72 4.03 581.72 4.03 576.18 River 2.47 2995.28 2.48 2997.18 2.46 2992.02 2.47 2994.83 Coffee 3.98 755.48 3.99 724.34 3.97 770.96 3.98 750.27 The table shows that tap water has the lowest average turbidity of -62.25 NTU, while river water has the highest average turbidity of 2994.83 NTU. Even though coffee is the darkest solution, it only has an average turbidity of 750.27. According to the World Health Organization (WHO), tap water is considered safe because the water should have turbidity below 5 NTU to be drinkable [8]. On the contrary, the Pusu River water shows the highest turbidity measurement, and it also exceeds the minimum safe level of turbidity in Malaysia [9], caused by high amount of silt. The high concentration of silt affects the light that penetrates through the liquid. This is because the turbidity sensor works by measuring the amount of light absorbed and scattered by the 111 IIUM Engineering Journal, Vol. 23, No. 2, 2022 Maju et al. https://doi.org/10.31436/iiumej.v23i2.2168 suspended solids in the solution. The higher the number of total suspended solids (TSS), the higher the sensor's liquid turbidity. It can also be observed from Table 4 that the higher the voltage, the lower the turbidity readings. High voltage means that the solution is less hazy because more light penetrates through the solution, resulting in higher voltage. 3.3 ThingSpeak as the IOT Platform ThingSpeak is an open-source Internet of Things (IoT) platform that allows a user to perform data collection, data aggregation, and receive an email alert. Figure 8 shows the data visualizations of the collected sensors’ data. The sampling time set at the coding is 1 second, however, for the reporting purposes, the ThingSpeak platform is 5 minutes. The sampling time and display can be set according to the specifications required by the authority. Fig. 8: Water quality measurement data visualization in terms of turbidity (NTU) and conductivity (µS/cm). 4. CONCLUSION Indeed, water is very valuable to human beings and other living things. However, preserving good water quality has become a big challenge in this modern world. Water pollution cases have increased due to lack of awareness and moral values. Thus, the development of this research aims to help reduce water pollution. In this research, the major contaminants that contribute the most to river water pollution have been identified and studied, namely the BOD, NH3N, and SS. Moreover, the water pollution detection system has been developed and designed with affordable and minimal costs. Therefore, a low-cost water pollution detection system has been achieved. Next, the water pollution detector device that focuses on detecting major contaminants in Malaysia has been designed. The general performance of the work was evaluated and analyzed. The self-developed 112 IIUM Engineering Journal, Vol. 23, No. 2, 2022 Maju et al. https://doi.org/10.31436/iiumej.v23i2.2168 conductivity sensor was able to give readings that have a difference of 6.84% and 6.35% compared to the previous paper and ready-made sensor, respectively. The turbidity sensor was also able to give the correct reading according to a different type of solution. To conclude, the research objectives have been achieved and established. ACKNOWLEDGEMENT The authors would like to express highest appreciation to the International Islamic University Malaysia and Universiti Teknologi Malaysia for providing facilities for this research to be conducted. REFERENCES [1] Department of Environment (DOE). (2017) Pollution Sources Inventory, in Enviroment Quality Report 2017, pp. 100-105. [2] Afroz R, Rahman A. (2017) Health impact of river water pollution in Malaysia. Int. J. Adv. Appl. Sci., 4(5): 78-85. [3] Department of Environment (DOE). (2017) River Water Quality, in Environment Quality Report 2017, pp. 24-60. [4] 8 critical after inhaling methane in suspected illegal chemical dumping. [Online]. Available: https://www.nst.com.my/news/nation/2019/03/466921/8-critical-after-inhaling-methane- suspected-illegal-chemical-dumping. [Accessed: 26-Jul-2020]. [5] Assad AIG. (2015) Quality of Tap Drinking Water in Kuwait: Physicochemical Characteristics. International Conference on Sustainable Mobility Applications, Renewables and Technology, SMART 2015, pp. 1-4. [6] Heyda M. (2008) Conductivity Measurement and Theory. [Online]. Available: http://www.mbhes.com/conductivity_measurement.htm. [Accessed: 14-Dec-2020]. [7] Indu K, Choondal JJ. (2016) Modeling, Development & Analysis of Low Cost Device for Water Quality Testing. 2016 IEEE Annual India Conference, INDICON 2016, pp. 1-6. [8] World Health Organization (WHO). (2017) Water Quality and Health - Review of Turbidity: Information for regulators and water suppliers. Who/Fwc/Wsh/17.01, p. 10. [9] WEPA, “National Water Quality Standards for Malaysia,” WEPA, 2017. [Online]. Available: http://wepa-db.net/en/topic/waterstandard/Malaysia_1_surface.pdf. [Accessed: 13-Mar-2020]. 113