IoT Online Monitoring System on Pulp and Paper Industry Wastewater Treatment Plant

ABSTRAK –As one of the largest wastewater producers in the world, the pulp and paper industry need to monitor the waste that they generated. To carry out this monitoring process, the majority of the pulp and paper industry still uses conventional offline methods to measure parameters in their wastewater treatment plants. The monitoring procedure is carried out by taking samples from the factory wastewater treatment plant and testing these samples in the laboratory. This procedure is very prone to errors caused by human. This method also cannot detect any violation, problem, or disturbance of the wastewater parameters in real time. In addition, in 2018, the Indonesian Ministry of Environment and Forestry issued a regulation requiring the pulp and paper industry to use a real-time online monitoring system for its wastewater treatment plant. This paper presents an implementation of the system. There are several parameters that must be measured, two of them are pH and Total Suspended Solids (TSS). To measure these parameters, the regulation states that the online measurement system is carried out using the relevant electric probe sensor. Then the measurement results are displayed online on a specified platform hence that users can observe the results. This implementation uses a pH sensor to measure pH and a conductivity sensor to measure TSS. A conductivity sensor is used as a substitute due to the high cost of TSS sensor. This article analyses also the accuracy of the measurement


INTRODUCTION
The pulp and paper industry is one of the largest economic contributors to the Indonesian economy. In 2018, Indonesia's pulp and paper industry was included in the top 10 in the world, with 16 million tons paper production per year and 11 million tons pulp production per year. On the one hand, this industry is also a very large wastewater producer. The problem faced by the pulp and paper industry is the lack of information on the quality of wastewater that its produces at all time during the production process. So that the possibility of pollution due to wastewater that exceeds the quality standard cannot be detected properly.
In 2018 the Ministry of Environment and Forestry of the Republic of Indonesia issued Ministerial Regulation (Permen) of Environment and Forestry No. P93 of 2018 concerning "Continues and Online Monitoring the Quality of Wastewater for Business and/or Activities", this Regulation requires 14 industries that produce wastewater including pulp and paper industry to monitor their wastewater quality online [1]. This regulation is then updated in 2019 [2], but the main regulation remains unchanged.
Prior to the existence of this online monitoring system, monitoring of wastewater quality was carried out at least once a month by operators by taking wastewater samples and testing these samples in the laboratory. Producing measurement data of wastewater parameters using this method requires time in order of days or even weeks. Therefore, this online monitoring system can be used by the pulp and paper industry to monitor the quality of wastewater online, continuously, effectively, and in real time.
This Online Monitoring System, or Sparing, in the Pulp and Paper Industrial Wastewater Treatment Plant has the main feature of being able to monitor wastewater quality parameters in real time. In this paper the parameters being measured are TSS (Total Suspended Solids) parameter and pH parameter. This work uses electrical conductivity as a proxy for measuring TSS. This method is much more cost effective.
The system displays the data online through Ubidots platforms. The measurement results are accessible to Wastewater Treatment Plant operators at the pulp and paper mill. It gives a warning to the user when the system detects water quality that is outside the quality standard via e-mail.
The remainder of this paper is organized into four sections. In section II, studies in this topic are presented. Section III is dedicated for explaining the proposed design. Section IV presents and discusses the results of implementation. Section V Finally, concludes the paper.

STATE OF THE ART
The proposed measurement system is an intersection for IoT and water quality topic, both are active research areas in scientific community. While this work more related to the IoT, research both areas need to be assessed. Those works can be classified from the position in the complete system, meaning from the IoT system, sensors acquisition, up to data analysis.
IoT topic is very broad. The paper [4] present overview and general challenges in this field. It deduces that the real-world deployment of IoT is highly dependent on the ability to devise analytical models to evaluate and predict performance characteristics, such as communication latency, reliability, and energy efficiency. Meanwhile, those performance parameters and requirements are varying across the field of application. Many research and development activities look for generic platform and model that can be used in various field. Paper [5], as an example, proposes a flexible platform that can be customized for specific fields of application. While it claims to be generic, the proposed architecture is more suitable for massive low-cost sensor network which does not have a very strict requirement in latency and contains many redundancies.
IoT Modeling is a very important topic which is not addressed by wide research community. While using the term cyber-physical system, work of a research group in UC Berkeley accomplishes to develop comprehensive concept, model, and tool to analyze IoT system [6][7] [8]. The main concern in this work is to unified models used in the physical system and computing model. Both types of models must be interacted to enable comprehensive IoT model. The utilization of this modeling technique is to analyze and design. Other work in the modeling of IoT mostly limited in specific aspect of application area such as [9].
The water quality monitoring is a very active topic. Most of the study address the technique for improving accuracy of the measurement and scheme for analyzing the data. The work described in [10] shows the use of fuzzy scheme to improve reliability in massive and fairly redundance sensor system, especially when some sensors are malfunction. Takagi-Sugeno fuzzy model is used in this work. Other paper [12] uses statistical approach to improve accuracy of the sensors. These sensors are then abstracted as "software sensors".
After, the IoT system accomplished to gather parameters of the water, the data must be analyzed. Very thorough survey on the data analysis is presented in [11]. It divides the data evaluation from classical decision tree up to recent deep learning scheme. It also accentuates the need of models in various level.

SYSTEM DESIGN AND IMPLEMENTATION
This paper describes an experiment which implement a IoT monitoring system to meet the requirement of Ministry of Environment and Forestry.
Only parts of the requirement are implemented in this experiment, which is monitoring of TSS and pH. The regulation requires the system to implement also the monitoring of COD parameter, but it is not yet implemented in the current version. The Figure 1 below describe the monitoring system. That picture depicts only the main datapath to simplify presentation. This online monitoring system consists of instrumentation system and data collector. The architecture can have several instrumentation system with single data collector. The instrumentation system consists of these following subsystems:  Three sensors: temperature sensor, conductivity sensor and the pH sensor. The pH sensor is needed as required by the regulation, the conductivity sensor is used to compute the TSS parameter, and the temperature sensor is used to compensate the data produces by pH sensor and the conductivity sensors.
 The data acquisition module used to adapt the electrical parameter of the sensors and produces the digital value of the measured parameter.
 Data processing module performs compensation from the temperature measurement and converting the measured value to the required value. In addition, in the EC-TSS measurement module, data processing module also converts TSS-conductivity parameters using the linear regression result formula.
The data collector consists of these following subsystems:  Communication module connects the system to the internet network so that it can transmit data in real time and online.
 User Interface and Data Storage use to store measurement data and display it to the user.
Besides those main data path subsystems, the board consists also power subsystem to adapt the main power supply to the requirements of each subsystem. The details are explained below.

Electric Power Supply Subsystem
This subsystem is not shown in the Figure 1 since it is not part of the datapath. The electrical power supply subsystem has a function to convert the voltage from the main terminal (220V) to the device operating voltage (5 V). The conversion flow is illustrated in the following diagram ( Figure 2). The mains adapter converts the voltage value from 220V to 9 V. The power supply module converts the 9 V voltage from the voltage adapter to 5V.

Instrumentation Subsystem (Sensors, data acquisition, and data processing)
The instrumentation subsystem in the pH measurement module consists of a pH sensor, temperature sensor, and an ESP32 microcontroller. While the instrumentation subsystem in the EC-TSS measurement module consists of an EC sensor, temperature sensor, and an ESP32 microcontroller. The pH sensor functions to measure pH parameters. The pH sensor component consists of a probe that measures the difference in voltage due to a change in the pH value, as well as a conversion board that functions to convert the voltage so that it is read by the ESP32 microcontroller. The following is an image of the DFRobot Pro pH meter used ( Figure 3). In this pH measurement module, there is a temperature sensor which functions to provide a compensation value due to temperature changes. Following are the temperature sensor used (Figure 4). As for the EC-TSS measurement module, the parameter measured in this module is the electrical conductivity which will be converted into TSS. In the EC-TSS measurement module, the instrumentation subsystem consists of an electrical conductivity sensor, a temperature sensor, and a microcontroller.  The electrical conductivity sensor directly measures the conductivity of wastewater. It consists of a probe that will be immersed in wastewater and a conversion board which converts the raw data into data that can be read by the microcontroller. It uses four points probe mechanism for measuring conductivity.
In its implementation, this system uses 2 different parts to measure electrical conductivity. The probe will use the E201WM and use the DFRobot electrical conductivity sensor converter board. The conversion from conductivity to TSS was carried out by linear regression of the samples taken.
All sensors are connected to the ESP32 microcontroller on each module so that the measurement result data can be processed, and the measurement interval can be set for every 1 hour.

A. Communication Subsystem
The communication subsystem connects the system to the internet and sends data received from the instrumentation system to the user interface and data storage that requires an online connection. The communication subsystem functions to connect to the internet network via WiFi so that measurement data can be sent. The communication system uses a built-in WiFi module which is already installed on the ESP32. The Arduino IDE Library Manager is used to set up the connection.
After successful connection, the system can send data to the user interface and data storage subsystem.

B. Data Storage
Data storage is divided into two, namely online and offline. Online data storage using Ubidots cloud storage. Meanwhile, offline data storage uses an SD Card. Offline data storage is being used so that the system can still measure data even if there is a disruption in the connection to the internet network. In addition, the Real Time Clock module is used and have a function to show the measurement time for offline data storage.
The following Figure 7 shows the SD card module which will act as offline data storage for the system. Offline data storage also uses RTC (Real Time Clock) for time saving purposes which does not require internet connection. In addition, the Real Time Clock module is used to show the measurement time for offline data storage.

C. IoT Platform: Ubidots
This subsystem displays measured data. The implementation of the user interface is the use of Ubidots. The Ubidots platform is used also as online data storage. ESP32 will communicate with Ubidots servers using the MQTT communication protocol.

A. Implementation
All components in this online monitoring system are integrated on a PCB and installed on the panel box. The Figure 8 shows all the components of the appliance on the panel being light up to test the power supply The equipment is then placed in the effluent basin of the wastewater treatment plant as follows.

B. Sensor Mounting
Each measurement module consists of one main sensor probe and one temperature sensor. Therefore, mounting is needed to place the two sensors. The following is the result of making these mounts. The mount is installed on the wall of the wastewater disposal basin whose area has been described in the installation area point. Mounting is made of aluminum so that it is resistant to rust. The anti-rust material is needed because the mounting is installed in an outdoor area. In addition, the mounting length and the depth of the probe can be adjusted.

C. EC-TSS Regression and pH Calibration
As mentioned above, the TSS parameter is computed from conductivity measurement. It is then necessary to develop relationship between measured conductivity and TSS. To this end, data is needed. The data must show the measured conductivity and the corresponding TSS. The TSS is determined in the laboratory.
The sample of wastewater is taken from PT. Papyrus, a company produces paper from pulp in Bandung. The corresponding TSS is determined in chemical laboratory of Balai Besar Kertas dan Pulp, a government agency in Bandung (part of Ministry of Industry). Wastewater is collected using clean water bottles ( Figure 12). The sample is tested for TSS parameters and their conductivity. Testing the TSS (Total Suspended Solids) parameter was carried out using the gravimetric method with SNI 06-6989.3-2004 related to TSS testing. Meanwhile, testing the EC (Electric Conductivity) parameter is carried out by a method that is standardized on SNI 06-6989.1-2004. From the data collected as shown in the Table 1, it can be seen that the increase in conductivity correspond to the increase in TSS. However, it appears that the data do not follow this trend. This is due to several factors that affect the conditions of the test sample. The variance of the TSS measurement value is wide enough for a small TSS measurement. So that the measured value has a wide upper and lower limit value. To obtain linear regression, some data were excluded and indicated as errors. From this data linear regression was carried out with the results deicted in the equation (1).

= 0.123 × ( ) − 41.593
(1) Figure 13. Linear Regresion Conductivity -TSS The regression results have a multiple R value or a correlation coefficient of 0.777 (≈0.78). The correlation coefficient indicates that the relationship between EC and TSS parameters is classified as a very strong correlation.
For calibrating the pH sensor is much easier. In the calibration, the pH module is used to test 3 pH points, namely pH 4.0, pH 7.0, pH 10.0. Testing for this pH measurement module is carried out using standardized solutions with a certain pH value. The solution is obtained from a pH powder which has a standard pH value as well. Each powder was mixed into 250 mL of distilled water. Following are pH powders used to test pH sensors: 4.0,7.0, and 10.01.

D. Instrumentation Subsystem
The EC-TSS module is then tested on various solutions including those used for calibration. The solutions used were 0.084mS/cm, 1.413mS/cm, 5.446mS/cm, and 12.88mS/cm. First, the system needs to be turned on and connected to the internet, insert a probe into the solution, and finally observe the results on the LCD and online platforms. TSS results are received at Ubidots using a feature called synthetic variables. Here are the results with the error percentage.   From the data for calculating the percent error, an average percentage of error is 0.845%. Therefore, in relation to the accuracy parameter, the sensor is able to measure the conductivity value with an error deviation of about 0.845%. This shows that the device has shown accurate measurement results. From the data for calculating the percent error, an average percentage of error is 0.45%. Therefore, in relation to the accuracy parameter, the sensor is able to measure the TSS value with an error deviation of about 0.45%. This shows that the tool has shown accurate measurement results.
In addition, to check the system's capability, a measurement test is carried out for the pH parameters so that the performance of the sensor probe used is known. From this test, the following data were generated. From these data, it can be seen that the pH sensor has succeeded in making measurements relatively accurately (small percent error) and precision (for the same measurement value the difference is not far away). The sensors have a resolution of up to 0.01 pH values but are accurate for a resolution of 0.1 pH values. This is in accordance with the specifications provided by the developer of this sensor [3].
In each measurement module, the ESP32 microcontroller has 1 hour measurement interval. So, after pH measurement and data transmission to the user interface and data storage are complete, the ESP32 microcontroller enters deep sleep mode. The deep sleep mode is deployed for saving electrical power.

E. Communication Subsystem
This Communication System sub-system is basically a sub-system that realizes the function of sending data from the Instrumentation System to the UI and Data Storage. The ESP32 microcontroller component is used to implement it. The reason is the ESP32 is able to function as a data acquisition controller and it has a built-in Wi-Fi module which allows the ESP32 to be connected to the internet network. The ESP32 has Wi-Fi built in 802.11b/g/n which can connect to the 2.4 GHz internet network.
After connecting to the internet network, the system communicates with the Ubidots servers. It uses the MQTT communication protocol.

F. UI and Data Storage Subsystem
In this online monitoring system, existing UI platform ( Figure 14) is used to make it easier for users to control the measurement result data.
On this page the user can see the measurement results of the measurement variables in graphs and also a list that is sorted according to the time the data was measured with the last measured data being at the top. On this page, users can also export data in the form of spreadsheets to be sent to email, delete all measured data, delete data within a specified range, compute historical data, and delete variables. It has also capacity to send various warning to the users. This type of system will adequate for application such as [14][15].

CONCLUSIONS AND SUGGESTIONS
As described, the paper has proposed an implementation of wastewater real-time monitoring system. Based on the test results described above, it can be seen that the IoT online monitoring system for pH and EC-TSS measurement module has successfully fulfilled its function to carry out pH and EC-TSS measurements properly, the system has high accuracy in measuring electrical conductivity, the system has also been able to display the measurement data real time and can be accessed by users online, and TSS can be measured in real time by using electrical conductivity as a substitute. The average error of ECC measurement is 0.45%, meanwhile the average error of H measurement is 0,35%. Both are within the requirement of the regulation.
For future development suggestions, even though the sensors used now have succeeded in meeting measurement needs, for future development, sensors that have a smaller resolution can be used so that the measurement results can describe the results in more detail.