Liquid Waste Data Collection Uses the Internet of Things (IoT) Using
Data Queues
Iwan Fitrianto Rahmad
1
, Muhammad Zarlis
2
, Helmi Kurniawan
3
and Mas Ayoe Elhias Nst
3
1
Faculty of Engineering and Computer Science, Universitas Potensi Utama, Indonesia
2
Information System Management Department, BINUS Graduate Program - Master of Information System Management,
Bina Nusantara University, Jakarta, Indonesia
3
Faculty of Computer Science, Universitas Sumatera Utara, Indonesia
Keywords:
IoT, Data Queues, NodeMCU 8266 Microcontroller.
Abstract:
Industrial wastewater can pollute the environment if not managed properly. The concept of Internet of Things
(IoT) can be implemented in monitoring liquid waste content remotely and providing notifications on Android
devices by communicating via the internet. To apply this IoT concept, the tools or sensors used to measure
the volume of liquid waste that comes out must be able to communicate with an Android smartphone or
computer. This system consists of three units: input, process, and output. The input unit consists of a Ds18b20
temperature sensor, turbidity sensor, water flow sensor, and pH sensor which are used to measure input data to
be sent to the process unit. The data received by the process unit is in the form of voltage which is converted
based on the formula on each sensor. The processing unit uses the NodeMCU 8266 microcontroller to process
data before it is sent to the output unit. The output unit consists of a 16x2 LCD and a web server which receives
data from the processing unit for display. The results of system testing show that all input, process and output
units can function properly as expected. Thus, the IoT concept can be applied to remote data collection and
monitoring of industrial wastewater content to ensure that the liquid waste discharged meets predetermined
quality standards and does not pollute the environment.
1 INTRODUCTION
Industrial liquid waste is the residue from the pro-
duction process or industrial activities in liquid form,
which is present at a time and place that can harm
the surrounding environment. Liquid waste that is
not managed properly can have a negative impact on
aquatic ecosystems, affect the environmental balance,
and even have a negative impact on living things.
Therefore, waste must be managed properly and meet
quality standards before being disposed of so as not to
pollute the environment. According to the Regulation
of the State Minister for the Environment Number 03
of 2010 concerning Industrial Liquid Waste Quality
Standards (Nursidiq et al., 2021), liquid waste that
is suitable for disposal must have a pH of 6-9. One
method of measuring pH levels in liquid waste is to
use a pH meter. In addition, the turbidity value is also
an indicator, that is, it cannot exceed 25 NTU at tur-
bidity and the temperature cannot exceed 38 degrees
Celsius. To overcome this liquid waste, it is neces-
sary to measure parameters such as temperature, pH,
and turbidity using several electronic sensors such as
DS18B20 Temperature, GE Turbidity Water Turbid-
ity, and pH Sensors. The concept of Internet of Things
(IoT) (Munawar, 2023) can be applied in monitor-
ing liquid waste remotely via the internet. In imple-
menting IoT, information such as pH, temperature and
NTU can be sent to monitor liquid waste. This infor-
mation will be sent and displayed on Web Monitoring,
and stored by the server in real-time, so that it can be
accessed via a PC or smartphone (Kusumawardhana
et al., 2018).
2 RELATED WORK
Previously, research was carried out by Pramudya
Mahardika Kusumawardhana, Mochammad Hannats
Hanafi Ichsan, and Rakhmadhany Primananda in
2018 with the title ”Implementation of Wireless Sen-
sor Data Storage with MongoDB in the IoT Environ-
ment Using the MQTT Protocol” (Kusumawardhana
et al., 2018). This study concludes that MQTT can
302
Rahmad, I., Zarlis, M., Kurniawan, H. and Nst, M.
Liquid Waste Data Collection Uses the Internet of Things (IoT) Using Data Queues.
DOI: 10.5220/0012457400003848
Paper published under CC license (CC BY-NC-ND 4.0)
In Proceedings of the 3rd International Conference on Advanced Information Scientific Development (ICAISD 2023), pages 302-306
ISBN: 978-989-758-678-1
Proceedings Copyright © 2024 by SCITEPRESS Science and Technology Publications, Lda.
be connected to the NodeMCU microcontroller in a
wifi network with an accuracy rate of 75% within a
distance of 4 meters to 20 meters. MQTTBroker can
also send data stacks of 50, 100, up to 1500 data into
a MongoDB database. Another study
conducted by Denny Kuriando, Agustinus No-
ertjahyana, and Resmana Lim in 2017 with the ti-
tle ”Detection of Water Volume in Gallons Based
on the Internet of Things Using Arduino and An-
droid” (Kuriando et al., 2017), concluded that the
water flow sensor has an error percentage of 0.48%
and is suitable for use in the manufacture of water
volume detectors. Research conducted by M. Irfan
Wahyuni, Hollanda Arief Kusuma, and Sapta Nu-
graha in 2021 entitled “Development of an Internet of
Things (IoT)-Based Water Flow Measurement Tool”
(Kusuma et al., 2021), concludes that Water Flow
Sensors can obtain information on water discharge
and water usage every minute sent to the Thingspeak
platform with an excellent data transmission success
rate of 98.1%. The signal quality at the equipment
placement location is in a sufficient and good signal
condition. In addition, research conducted by Dwi
Adhe Ayu Novitasari, Dedi Triyanto, and Irma Nirmal
in 2018 entitled ”Design of a Microcontroller-Based
Industrial Waste Monitoring System with a Website
Interface” (Novitasari and Nirmala, 2018), concluded
that the design system can transmit data readings with
sensors using Arduino Mega 2560 to read the param-
eter values of pH, temperature, and turbidity of liquid
waste. The value obtained from the measurement pro-
cess is then converted from voltage form (analog) to
digital form to be displayed on the website in graph-
ical form and data tables for sensor reading values
with an average difference in pH parameter readings
of 2.14% and temperature of 0.37% . Finally, re-
search conducted by Tri Rahajoeningroem and Asgia
Setya Mardika in 2021 entitled “Control and Monitor-
ing System of Tofu Liquid Waste Parameters as a Hy-
droponic Plant Nutrient Solution Based on the Inter-
net of Things (IoT)” (Mardika and Rahajoeningroem,
2021), concluded on the 3rd of Liquid organic fer-
tilizer/ The nutrient solution produced by the hydro-
ponic process as many as 25 pieces had a TDS content
of 833 ppm, a temperature of 26°C, and a pH content
of 6, and was off-white in
3 DATA COLLECTION
TECHNIQUE
Previously, several waste monitoring system studies
used the Arduino Uno/Mega 2560 R3 as a controller
and an ethernet shield to add network functions (Na-
jmul, 2021). In waste processing companies, waste
from other companies is taken or delivered to the lo-
cation of the waste processing company for monitor-
ing and processing. In designing a liquid waste mon-
itoring tool based on the Internet of Things, there are
several problems that must be solved, namely the tool
design system and the tool work system. This tool
design system was built to overcome problems when
designing an Internet of Things-based liquid waste
monitoring tool which is quite complicated because it
requires imagination in designing the component lay-
out, program flow, and overall tool assembly. While
the working system of this tool is designed to read
sensors and store data in a database. The data can be
accessed through the website for display. Data will
continue to be stored every 5 seconds to get the lat-
est value from the sensor. The hardware design of
an Internet of Things-based liquid waste monitoring
device begins with the creation of a system block dia-
gram. Each block is connected to each other to show
the structure of the system in a clear and simple way,
making it easier to analyze how the circuit works.
Figure 1: Data capture system block diagram.
The explanation and function of each circuit block
are as follows: NodeMCU ESP8266 : Functions as
the main controller for the entire system and connect-
ing to the network. NodeMCU ESP8266 (Pangestu
et al., 2019) can also retrieve data from other sensors
and send it to the server via an internet connection.
Ds18b20 Temperature Sensor: Serves as a tempera-
ture gauge in liquid waste. This sensor can provide
information on the temperature of the liquid waste
being monitored.WaterFlow Sensor: Serves as a mea-
sure of the volume of liquid waste. This sensor can
calculate the amount of liquid waste flowing in liters
per minute or other units.Turbidity Sensor : Serves as
a measure of turbidity level in liquid waste. This sen-
sor can provide information on how turbid the mon-
itored liquid waste is.pH Sensor : Serves as a mea-
sure of the level of acidity in liquid waste. This sen-
sor can provide information on the level of acidity in
the liquid waste being monitored. LCD : Serves as a
data display medium that can display information pro-
vided by sensors installed in the circuit, such as tem-
Liquid Waste Data Collection Uses the Internet of Things (IoT) Using Data Queues
303
perature, volume, turbidity, and acidity level of liquid
waste.
Figure 2: Overall components.
The DS18B20 temperature sensor (Saha et al.,
2021) is a single or 1 wire only digital temperature
sensor communication data line pin. Each DS18B20
sensor has a 64-bit serial number unique, meaning
that it can use multiple sensors on the same power bus
(multiple sensors connected to the same GPIO). This
is especially useful for recording data for temperature
control projects. The Waterflow (Zhang et al., 2021)
sensor works to read the resulting rotor rotation speed
by the speed of the water flow. The working principle
of this sensor measures the flow of water in a certain
way calculate the rotation of the wheels contained in
this tool. In the wheel has a magnet and when it ro-
tates it produces a corresponding magnet Hall effect
phenomenon. The phenomenon of the Hall Effect is
based on the effect of a magnetic field on moving
charged particles. The faster the current flows With
this sensor, the rotation of the rotor will be faster so
that the numbers are read on the sensor to be large.
Turbidity (Noor et al., 2019) Sensor is a sensor mod-
ule that reads the turbidity of water particles turbidity
is basically invisible to the naked eye. More particles
in water indicates that the level of water turbidity is
also high. The higher it is water turbidity Changes
in the output voltage through the sensor Measures the
pH (acidity or freedom) of liquids. Acidity meter (pH
meter) (Helmy et al., 2020) usually consists of a mea-
suring probe connected to an electronic device Mea-
sures and displays the pH value. Basics of Measuring
pH Potency for using a pH meter the electrochemical
reactions that occur between the contained solutions
in a known glass electrode with an externally sup-
plied solution34 unknown glass electrode. this prob-
lem Due to the thin layer of glass bubbles interact with
hydrogen ions Relatively small and active. LCD (Liq-
uid Crystal Display) (Aljamali and Molim, 2021) is
an electronically modulated optical device which uses
the modulating light properties of liquid crystal com-
posites with Polarizers. The LCD circuit functions to
display the currently lit data set of tools. I2C is a two-
way serial communication standard using two identi-
cal channels specifically designed to send and receive
data. The I2C (Anand and Azheruddin, 2019) system
consists of SCL (Serial Clock) and SDA (Serial Data)
channels that carry data information between I2C and
controller. IC CD4051 (Huda, 2021) is IC 4051 which
is a working IC as multiplexers and demultiplexers.
This type of IC has 8 analog channels can function
as digital automatically. When used as a multiplexer,
This IC can select one of eight inputs.
4 DATA QUEUE
Queue (Brock et al., 2019) is a type of data structure
that is used to store and organize data in a FIFO (First
In First Out) manner, meaning that data that enters
first will be issued first as well. This algorithm is often
used in applications or systems that require queuing,
such as messaging systems, customer service systems
at banks, or data retrieval systems on IoT sensors. In
its implementation, the ”queue” algorithm uses an ar-
ray as a placeholder for the received data queue. The
array has a variable ”maxsize” which determines the
maximum size of the queue. In addition, there are also
other variables needed to set the position of data in the
queue, such as ”amount” which stores the amount of
data currently in the queue, ”front” which indicates
the position of the data at the front in the queue. ,
and ”back” which shows the last data position in the
queue.
Here is a detailed description of the ”queue” algo-
rithm:
1. Declare the variable ”maxsize” as the maximum
size of the queue, which indicates the maximum
amount of data that the queue can accept.
2. Declare a ”queue” structure consisting of several
variables, namely:
”amount” which is an integer type variable to
store the amount of data currently in the queue.
”front” which is an integer type variable to in-
dicate the position of the frontmost data in the
queue.
”behind” which is an integer type variable to
indicate the last data position in the queue.
”data” which is an array of type char to store
data in a queue.
3. Create an ”enqueue” function that is used to en-
ter data into the queue. This function accepts pa-
rameters in the form of data to be included in the
queue. The steps performed in this function are:
ICAISD 2023 - International Conference on Advanced Information Scientific Development
304
Check whether the queue is full or not (if the
amount of data in the queue has reached the
maximum size). If it is full, displays an error
message and exits the function.
If the queue is not full, add data to the queue at
the ”back” position by copying the data into the
”data” array at the same index as ”back”.
Increase the ”count” variable by 1 to indicate
that the number of records in the queue is in-
creasing.
Shift the position ”back” to the next index
(modulo ”maxsize”) to indicate the position of
the new last data.
4. Create a function ”dequeue” which is used to pull
data out of the queue. This function does not ac-
cept any parameters. The steps performed in this
function are:
Check whether the queue is empty or not (if the
number of data in the queue is 0). If empty, dis-
plays an error message and exits the function.
If the queue is not empty, save the data in the
”front” position.
like the following syntax
#include <ESP8266WiFi. h>
#include <SoftwareSerial. h>
#include <QueueArray. h>
// declare pins for pH sensor (in this example,
pins D4 and D3)
Software Serial pH sensor(D4, D3);
// declare queue to store pH values
QueueArray<int> pHValues;
void setup() {
// start serial communication
Serial. begin(9600);
// set baud rate for pH sensor
pHsensor. begin(9600);
//connect to WiFi
WiFi. begin("ssid", "password");
// wait for WiFi connection
while (WiFi. status() != WL_CONNECTED) {
delay(1000);
Serial. println("Connecting to WiFi...");
}
Serial. println("Connected to WiFi.");
}
void loop() {
// declare variable to store sensor value
int sensorValue;
// send command to read pH value
pHsensor. println(’R’);
// wait for 500 milliseconds for the pH
sensor to respond
delay(500);
// read data sent by pH sensor
while (pHsensor.available()) {
sensorValue = pHsensor.read();
if (isDigit(sensorValue)) {
pHValues. push(sensorValue - ’0’);
}
}
// check if queue is not empty
if (!pHValues. isEmpty()) {
Serial. print("pH: ");
// print all pH values in the queue
while (!pHValues.isEmpty()) {
// convert pH value from integer to
floating point and print to serial
monitor
Serial. print(pHValues. pop() /
100.0, 2);
Serial. print(", ");
}
Serial. println();
}
// wait for 5 seconds before taking
the next pH reading
delay(5000);
}
Table 1: Data retrieval.
Time pH Volume Turbidity Temperature
9:47:34 7.00 0.77 39.21 27.81
9:47:40 7.00 0.77 41.38 27.81
9:47:46 7.00 0.77 41.22 27.81
9:47:52 7.00 0.77 41.61 27.81
9:47:58 7.11 0.77 41.07 27.81
9:48:04 8.81 0.77 39.28 27.81
9:48:09 8.10 0.77 40.60 27.81
9:48:15 7.79 0.77 40.68 27.81
9:48:21 7.65 0.77 40.99 27.81
9:48:27 7.42 0.77 39.90 27.81
9:48:33 7.39 0.77 40.06 27.81
9:48:39 7.31 0.77 39.05 27.81
9:48:44 7.37 0.77 39.90 27.88
9:48:50 7.54 0.77 39.44 27.81
9:48:56 7.28 0.77 39.75 27.81
9:49:02 7.31 0.77 39.21 27.81
9:49:08 7.28 0.77 39.36 27.88
9:49:14 7.34 0.77 39.28 27.88
9:49:19 7.39 0.77 40.37 27.88
Figure 3: Graph of average waste data.
Liquid Waste Data Collection Uses the Internet of Things (IoT) Using Data Queues
305
5 CONCLUSIONS
Based on the results of research that has been done, it
can be taken conclusion as follows: From the results
of the tests that have been carried out, it can be seen
that the Tool Internet Of Things (IoT) Based Liquid
Waste Monitoring that can increase the parameters
of pH, temperature, turbidity and waste volume dis-
played on a 16 x 2 LCD and website interface, Based
on the test results of the tool, the server receives data
every 300 milliseconds but the server stores sensor
data every 5 seconds, After testing the liquid waste
monitoring system as a whole with 3 different liquids
namely tap water, palm waste and coffee. Percentage
of successful tests of all monitoring systems is 100%.
REFERENCES
Aljamali, N. and Molim, J. (2021). Review on engineering
designs for laboratory chemical devices and displays.
J. Control Instrum. Eng, 7(2):38–46,.
Anand, M. and Azheruddin, M. Develoment of Verification
Environment for I2C Controller Using System Verilog
and UVM.
Brock, B., Buluc¸, A., and Yelick, K. (2019). Bcl: A cross-
platform distributed data structures library. In Pro-
ceedings of the 48th International Conf. on Parallel
Processing, page 1–10.
Helmy, H., Janah, D., Nursyahid, A., Mara, M., Setyawan,
T., and Nugroho, A. (2020). Nutrient solution acid-
ity control system on nft-based hydroponic plants us-
ing multiple linear regression method. In 2020 7th
International Conf. on Information Technology, Com-
puter, and Electrical Engineering (ICITACEE, page
272–276.
Huda, F. (2021). Handheld electrocardiogram design.
J. Electron. Electromed. Eng. Med. Informatics,
3(1):14–18.
Kuriando, D., Noertjahyana, A., and Lim, R. (2017). Pende-
teksi volume air pada galon berbasis internet of things
dengan menggunakan arduino dan android. J. Infra,
5(2):202–207,.
Kusuma, H., Wahyuni, M., and Nugrah, S. (2021). Pengem-
bangan Instrumen Pengukuran Aliran air berbasis in-
ternet of things (IoT). J. Elektro dan Mesin Terap,
7(1):47–56.
Kusumawardhana, P., Ichsan, M., and Primananda, R.
(2018). Implementasi Penyimpanan Data Sensor
Nirkabel dengan MongoDB pada Lingkungan IOT
Menggunakan Protokol MQTT. J. Pengemb. Teknol.
Inf. dan Ilmu Komput. e-ISSN, 2548:964.
Mardika, A. and Rahajoeningroem, T. (2021). Sistem
Kendali dan Monitoring Parameter Limbah Cair Tahu
sebagai Larutan Nutrisi Tanaman Hidroponik Beba-
sis Internet of Things. Telekontran J. Ilm. Telekomun.
Kendali dan Elektron. Terap, 9(1):48–59.
Munawar, Z. (2023). Fundamental Internet of Things (IoT):
Memahami Teori dan Penerapannya. Kaizen Media
Publishing.
Najmul, H. (2021). A study on data monitoring of multiple
sensors and internet service.
Noor, A., Supriyanto, A., and Rhomadhona, H. (2019). Ap-
likasi pendeteksi kualitas air menggunakan turbidity
sensor dan arduino berbasis web mobile. J. Coreit,
5(1).
Novitasari, D. and Nirmala, D. (2018). Rancang bangun
sistem monitoring pada limbah cair industri berbasis
mikrokontroler dengan antarmuka website. Coding J.
Komput. dan Apl, 6(3).
Nursidiq, M., Hadi, M., Lubis, M., and Riza, F. (2021).
Pengelolaan limbah industri sebagai upaya pencega-
han pencemaran lingkungan pada masyarakat kelura-
han tangkahan di kawasan industri modern medan. Ih-
san J. Pengabdi. Masy, 3(1):90–102.
Pangestu, A., Ardianto, F., and Alfaresi, B. (2019). Sistem
monitoring beban listrik berbasis arduino nodemcu
esp8266. J. Ampere, 4(1):187–197.
Saha, R., Biswas, S., Sarmah, S., Karmakar, S., and Das,
P. (2021). A working prototype using ds18b20 tem-
perature sensor and arduino for health monitoring. SN
Comput. Sci, 2:1–21.
Zhang, X., Shan, X., Xie, T., Miao, J., Du, H., and
Song, R. (2021). Harbor seal whisker inspired self-
powered piezoelectric sensor for detecting the under-
water flow angle of attack and velocity. Measurement,
172:108866.
ICAISD 2023 - International Conference on Advanced Information Scientific Development
306