An Integration Method of UML Diagrams and Arduino UNO for Developing Water Pollution Detection System

Abstract


A. Introduction
With the rapid growth of the population in the world, which requires an increase in agricultural, industrial and other requirements, the provision of clean water and research in methods to detect water pollution are very necessary [1].Because, Water Quality Monitoring (WQM) methods have a significant impact on detecting water pollution and toxic chemicals [2].Although the traditional methods are still in vogue which includes collecting water samples, analyzing them in the laboratory, counseling, etc.However, these steps require expert advice, are expensive, time-consuming, difficult, and less efficient [3].So with the development of technology, automated methods can be used to monitor water quality instead of relying on traditional methods [4].As indicated by many researchers, human activities, industrial activities, agricultural activities and population growth are the main drivers in water pollution.This leads to high rates of cases of waterborne diseases in many countries around the world.Thus generates a major concern in health and the environment [5], [6].Moreover, there are many methods in the literature to measure water quality such as methods based on wireless communication or using an Internet of Things (IoT) platform.But the cost of these methods is very high.Therefore, WQM systems can be developed, which characterized by real-time measurement, accurate data, and low cost, by using various sensors such as pH, temperature, turbidity sensors, and etc. for analyzing water quality [7].Previous studies that have been applied by various methods to monitor water pollution which includes pH, temperature, turbidity level and so on.The parameter values' that have been used in some studies displayed on the computer using a cable [8], [9].In the other hand, the methods that have been used in other studies based on IoT technology [10], [11].In both cases, the developing methods of water quality detection systems based on microcontrollers and sensors only, without relay on design stage by the approved schemes.Unified Modeling Language (UML) used to develop and design systems.It is a standard visual system modeling language.It is an integration of graph notation and a semi-formal language for systems development, aiming to provide system requirements specifications with syntax and semantic constraints.UML includes thirteen diagrams: use case, class, activity, and others [12], [13].The importance of UML diagrams has been profoundly illustrated in the literature as an essential tool in software development.UML diagrams help visualize, analyze, and design software systems visually, making it easier to understand the complex structure of applications and communicate between team members.It also helps in identifying and analyzing requirements, and helps in documenting the design and making sure that all requirements are met.In addition, UML diagrams support improving software quality and reducing errors by providing a holistic view of the relationships between different components in the system [14].
Nasser et al. [15] proposed an efficient WSN based WQM system.Moreover, the proposed framework improved the network lifetime, assessed water quality, and stored the information.It used to monitor water with radio communication type, signal processing, and network topology.Water quality measures that have been used such as dissolved oxygen, temperature, pH, and turbidity.Similarly, another approach suggested a system that used the cloud by Vijayakumar and Ramya [16].Their approach was assessing of water quality parameters such as turbidity, temperature, electrical conductivity, dissolved oxygen, and pH.In this scope, M., Barabde and S., Danve [17] offered a complicated architecture of WQM system.It included three layers for observation, a local station and a remote station.Also, collected data have been showed on a computer and sending the notification by text message to the client.The water quality parameters used as turbidity, pH, and electrical conductivity.Also, Cloete et al. [18] introduced a WQM system that observed physical and chemical parameters of water quality such as temperature, pH, electrical conductivity and oxidation reduction potential.The sensors connected to a microcontroller that processed and analyzed the data.Then, a notification sent to the user.Hydroponic control systems have been presented in a literature, which is very important by Encinas et al. [19] proposed a WQM system using IoT.The water quality parameters used included temperature, pH and dissolved oxygen.Similarly, Simbeye and Yang [20] designed a monitoring structure for hydroponics by using a remote sensing network.The parameters used as temperature, oxygen content, pH value, and water level.The system collected data and transferred it to the computer.Then, data analyzed, prepared, and displayed.On the other hand, Hamid et al. [21] proposed an IoT-based WQM system.It was a low-cost and real-time.The sensors used like conductivity, pH, turbidity, and temperature.Furthermore, Barabde and Danve [22] offered a system that included two monitoring stations were a base station and a remote station.And, all these stations connected through a wireless communication link.The sensors used as pH, turbidity and conductivity data.Then, parameters data analyzed using MATLAB and compared with standard values.Finally, a short message service alert sent to the user.Moreover, an IoT-based WQM system that used Arduino as a microcontroller developed by Guna et al. [23].The sensors used like water leakage sensor, pH sensor and turbidity sensor.The microcontroller connected to the Wi-fi module for real-time data monitoring.Subsequently, various studies have been introduced related to water pollution detection systems and its architectural.Table 1 shows the water quality parameters that used in related works.
Table 1.The water quality parameters that used in related works.

Authors
Ref.
[21] Temperature, , Ph, Electrical Conductivity Sensor and Turbidity Barabde and Danve [22] Ph, Electrical Conductivity Sensor and Turbidity Guna et al. [23] Water Leakage, Ph and Turbidity Based on the above, water pollution is a one of the most critical problems facing the world in general.Although, there are varieos studies that presented proposed systems on water quality detection.The systems in the literatures lack integration and accuracy from the design stage to the implementation stage, and did not focuse on initial design using the UML diagrams.Moreover, each study focused on differ types of water quality measuring sensors.In addition, the high cost of water pollution detecting methods.Therefor, there is an urgent need to develop an effency method to monitor water quality parameters in real time and provide an affordable solution.
This paper aims to propose an integraiton method that focuses on developing an automated Arduino-based water pollution detection system.Our method consists of three phases, which are system's design, system's schematic and system's architecture.Also, it uses the UML diagrams.In addtion, the proposed system includes an important six of sensors that play a major role in measuring water quality which are pH sensor, oxidation reduction potential sensor, turbidity sensor, temperature sensor, electrical conductivity sensor and total dissolved solids sensor.The captured sensor values send to an Arduino microcontroller for processing and analyzing and then displaying the data on the LCD screen.

B. Research Method
In this paper, we describe the stages of research's proposed methodology for designing a prototype of water pollution detection system.The proposed method represents an integration method between UML diagrams and Arduino Uno for an efficient and consistent design.Also, it accurately represents the system's requirements and functions.The proposed methodology consists of three phases, which are system's design, system's schematic and system's architecture.The framework for the proposed research methodology is shown in the Figure 1.Moreover, the block diagram used to show the basic structure of system and sensors used.Figure 2 shows the block diagram of the proposed system that used Arduino microcontroller board and its connection to the pH sensor, oxidation reduction potential sensor, turbidity sensor, temperature sensor, electrical conductivity sensor and total dissolved solids sensor.Also, the output on LCD.

System Design Stage
The main stage of proposed method is designing of water pollution detection system.UML is a modeling language that has a great role for design and development software systems.By using UML, the system model creates in design phase.UML diagrams can be applied to software systems and embedded systems.Therefore, te first stage focuses on designing the proposed system by using UML diagrams specifications.UML standards defines the notation, syntax, and semantics specific to each diagram.The abstraction of the basic concept of UML is divided into structure diagrams and dynamic behavioral diagrams [24].It is worth mentioning, that main design of the developed system must consider two main types of UML diagrams.Thus, UML diagrams that used for the proposed system in this paper as use case diagram and sequence diagram.Due to it has an important role in explaining behavior and functions of the system in design phase.

Use case diagram
Use case diagrams provide an illustration of the relationship that occurs between system and user.Thus, it is a description of system's functions in the form of a relationship between them [25].

Sequence diagram
Sequence diagram indicates to the relationship between the interacting objects in system's scenario and also provides a sequence of events in the form of messages exchanged between the interacting objects to implement the functions of the developed system scenario [26].

System's Schematic Stage
In the seconde stage, the schematic diagram and model of the electrical circuit components connection established by using Fritzing tool.One of the most important open source Arduino support software is Fritzing, it enables users to easily and flexibly make wire connections between parts of a breadboard [27].In this paper, the physical development of the proposed system is still a future work of study; So, it was done hypothetically as an option as opposed to the actual implementation.The framework's functions and tools are properly simulated and mapped using the Fritzing application.

System Architecture Stage
The last stage of the proposed method represents by identifying the physical components.In addition to creating the general structure and architecture of the system with its physical components and connections using the Fritzing Tool.The proposed system architecture consisting of multiple sensors connected to microcontroller unit in order to measure water quality pollutants.The microcontroller unit has been chosen as Arduino UNO as the functioning of the entire system depends on it.The sensers that used namely pH sensor, oxidation reduction potential sensor, turbidity sensor, temperature sensor, electrical conductivity sensor and total dissolved solids sensor.These variables were chosen because they are the most influencing physical and chemical parameters on water quality.The components used in the proposed system architecture will be explained in the following sections.

Arduino UNO
Arduino is a microcontroller that can be connected to a set of sensors to develop a specific system.It characterized by its low cost and easy programming language.A microcontroller board based on the ATmega328P [28].

pH sensor
The pH sensor can measure the water quality to determine whether the water is acidic or alkaline.The value ranges from 0 to 14, where values greater than 7 represent an alkaline solution, and values less than 7 indicate an acidic solution.Runs on a 5 volt power supply.It can be connected directly to the Arduino [29].

Turbidity sensor
The turbidity sensor refers to the measurement of the turbidity of the water, i.e. the number of suspended particles and their concentration.The higher reading value means the higher of turbidity.It connects to an analog output from 0 to 4.5V [30].

Oxidation Reduction Potential Sensor
The oxidation reduction potential sensor indicates the activity of water oxidizers and reducers, i.e. the ability of water samples to purify themselves or break down contaminants.So the oxidation reduction potential sensor is very important for detecting water pollution.It is measured in millivolts (mV).A positive reading means the substance is an oxidant, while a negative reading means it is a reducer [31].

Total Dissolved Solids Sensor
Total dissolved solids sensor refers to water quality.It measures the levels of dissolved solids in the water, such as salts and minerals dissolved in the water.The input voltage uses 3.3V or 5V.Higher levels of dissolved solids indicate that the water contains more pollutants [32].

Temperature sensor
The temperature sensor monitors the water temperature accurately, it's cheap, its results are digital, it's waterproof and it has a single wire connection that connects to the microcontroller [33].

Electrical Conductivity Sensor
The Electrical conductivity sensor is an analog electrical conductivity meter, which measures the electrical conductivity in water.It is low cost with high accuracy and easy to use.It indicates the concentration of the electrolyte present in the water.The higher the concentration of solids, the greater the conductivity [34].

Light Emitting Diode ) LED(
In our system we used two different color of LED (red and green) sensor value high and low respectively.LED has cathode and anode pole which indicates either negative or positive [35].

Liquid Crystal Display (LCD)
LCD used as 16 × 2 liquid crystal display is interface to display the sensors values [36].

C. Result And Discussion
The main aim of this paper is to design water pollutant detection system by an integration method.The proposed integration method has achieved from UML diagrams and system architecture that consisting of water quality sensors and Arduino Uno.The results demonstrated method for a system developing that can assess water quality through proper monitoring water quality sensors as well as data collecting and analyzing.There are no specific boundaries or specialized area for system implementation.It can be implemented in homes, schools and hospitals.The system is successfully developed to meet the intended objectives and gain plenty of experience in the relevant field which will contribute to academic and professional skills.The result shows the proposed system designing based on the proposed method's stages namely are system's design, system's schematic and system's architecture as described in the following subsections:

System Design Stage
The water pollution detection system designed according to the proposed methodology in this paper by using UML diagrams.It relied on a use case diagram that describes the main system's functions, and a sequence diagram that describes the workflow of the system.

Use case diagram
The use case diagram in Figure 3 shows water pollution detection system functions.In addition, the actors of the proposed system will be the Scientist, Arduino and Sensors.The functions are data collection, view data collection, data analysis, view data analysis and sensors reading that includes the lower level functions, which are the water quality sensors used in the system.

Sequence diagram
In Figure 4 , it can see that four classes interact with each other namely water, arduino, sensors, and LCD.In sequence diagram of the entire pollution detection process, the administrative system (Scientist) will perform a water quality check by using the sensors (inside the water sample).Then, Arduino receives sensor request, Then data will be collected from sensors, and then transmitted to Arduino.Finally the collected data will display on screen.After receiving data, the operator can request to display data analysis.

System's Schematic Stage
In this paper, the proposed system's functions and compenents are properly simulated and mapped using the Fritzing tool.In the scope of the proposed system, the Arduino board is the microcontroller that controls the sensors, data collection and analysis.Finally, the LCD displays the reading values obtained from the sensor readings.The schematic diagram of the water pollution detection system is shown in Figure 5.The schematic diagram shows the connections of system components in detail.Each sensor connected to Arduino through three links, negative, positive, and input, whether it is digital or analog.

System Architecture Stage
The system architecture indicats to connect all major system's components that includs pH sensor, oxidation reduction potential sensor, turbidity sensor, temperature sensor, electrical conductivity sensor and total dissolved solids sensor, LCD display, and LED with Arduino Uno microcontroller by using Fritzing tool.The result of system architecture shown in Figure 6.Firstly, the sensors sense the water quality values and Arduino Uno colectes and anlyzes the sensors data.Then, data display on LCD screen.As the water sensors scale values change, the LCD screen display changes accordingly.

D. Conclusion
Despite the development of technology, the increasing population in the world, the scarcity of potable water, and the exorbitant cost of water pollution detection devices are major challenges.So, we need to develop accurate, flexible and inexpensive water pollution detection systems.These systems are an important factor for detecting water pollution and help in controlling water quality in different fields such as irrigation, residential use, industry, etc.This paper proposed an integration method for developing an automated Arduino-based water pollution detection system.In addition, the proposed method included three stages, namely system's design, system's schematic and system's architecture.Also, it used UML diagrams in system's design stage.The water pollution detection system consisted six important sensors for water quality factors as pH, oxidation reduction potential, turbidity, temperature, electrical conductivity and total dissolved solids connected to Arduino Uno.The proposed system are automatic, low cost and good flexibility by adding new sensors.
This paper focuses on designing a prototype, not on implementing the proposed system in its final form.This prototyping will help to clarify and identify the basic requirements and functionalities are made before the full implementation of the system.For the future development of an integrated IoT

Figure 2 .
Figure 2. Block Diagram of Water Pollution Detection System.

Figure 3 .
Figure 3. Use case diagram of the proposed system.

Figure 4 .
Figure 4. Sequence diagram of the proposed system.

Figure 5 .
Figure 5.The schematic of the proposed system.

Figure 6 .
Figure 6.System architecture of the proposed system.