Home>Article>10.58920/dsc0201604

RESEARCH ARTICLE

Implementation of Fuzzy Logic for Monitoring Garbage Capacity in Iot-Based Drainage System

Ahmad Johan Latif, Muh Rafli Rasyid, Wawan Firgiawan

Academic Editor: Majid Rahardi

Digital System and Computing|Vol. 2, Issue 1, pp. 35-40 (2026)

1
1
0
Crossmark
  • Received

    Feb 20, 2026
  • Revised

    Jun 28, 2026
  • Accepted

    Jun 30, 2026
  • Published

    Jun 30, 2026

Abstract

Urban drainage systems are highly vulnerable to garbage accumulation that obstructs water flow, reduces hydraulic capacity, and significantly increases urban flood risk, while conventional monitoring methods remain manual, periodic, and unable to provide adaptive real-time warnings for early prevention. This study aims to design, implement, and evaluate an Internet of Things (IoT)-based drainage monitoring system integrating multiple sensors and the Fuzzy Tsukamoto method to classify drainage conditions intelligently and continuously. An experimental prototype approach was used by integrating an ultrasonic sensor, water level sensor, and water flow sensor with a Raspberry Pi 4 controller and MCP3008 converter. The fuzzy inference process included fuzzification, application of 27 fuzzy rules, and defuzzification using the weighted average method. Experimental testing was conducted on a drainage prototype with data acquisition performed automatically at regular intervals. The system produced a crisp output value of 71.5 (on a scale of 0 to 100) from input measurements of 48 cm garbage height, 38 cm water level, and 0.2 m/s flow velocity, classifying the drainage status as moderate. In addition, the system successfully transmitted monitoring results in real time through the Telegram platform, enabling remote access and rapid response. These findings demonstrate that the proposed system provides an effective, adaptive, and reliable solution for intelligent drainage monitoring and supports early flood risk mitigation in urban environments. This approach enhances decision accuracy and minimizes response delays, demonstrating practical potential for localized smart city infrastructure and sustainable urban water management in developing regions facing climate challenges.

Introduction

The rapid advancement of information and communication technologies, particularly the Internet of Things (IoT), has significantly transformed environmental monitoring systems by enabling interconnected sensing, processing, and communication infrastructures (1). Despite these developments, urban drainage systems remain vulnerable to garbage accumulation, which contributes directly to flow obstruction and flooding events. Flood incidents frequently occur due to increased rainfall intensity combined with blocked drainage channels (2). In many urban and peri-urban regions, including Kabupaten Majene, unmanaged waste disposal into drainage systems remains a persistent environmental issue. Unmanaged solid waste generated from daily human activities requires systematic control to prevent environmental degradation (3). The absence of real-time monitoring and early detection mechanisms in local drainage infrastructure increases the risk of delayed intervention, thereby intensifying flood vulnerability.

Several IoT-based monitoring systems have been developed to address environmental and drainage-related problems using ultrasonic sensors, water level sensors, and water flow sensors (4, 5). IoT architectures allow physical devices to collect and transmit environmental data efficiently (1), while platforms like Telegram provide reliable channels for remote alerting mechanisms (6). Embedded platforms such as Raspberry Pi 4 Model B provide adequate computational capability for environmental data processing and control tasks (7). However, most existing systems rely on deterministic threshold logic, where environmental states are classified into rigid binary categories. Such approaches are limited in their ability to handle uncertainty, gradual transitions, and nonlinear interactions among environmental variables. While previous implementations demonstrate reliable hardware frameworks (8), there remains a critical research gap in integrating adaptive, multi-parameter decision modeling specifically to track drainage garbage capacity under dynamic environmental transitions.

To address this limitation, fuzzy logic offers a robust decision-making framework capable of modeling uncertainty through graded membership functions and linguistic reasoning (9). Among various inference techniques, the Tsukamoto method generates crisp outputs from monotonic membership functions using weighted average defuzzification, making it computationally efficient and suitable for real-time embedded systems (10, 11).

Although fuzzy systems have been applied in automation and control domains, their use in environmental IoT monitoring has grown, as IoT systems with multi-sensor setups have been developed for real-time flood and water monitoring in Indonesia (1214). However, limited studies integrate multi-sensor IoT architectures with Fuzzy Tsukamoto inference specifically for drainage garbage capacity monitoring, despite research applying fuzzy logic combined with real-time notification via Telegram for early warning of floods (15). For instance, prototype systems using ultrasonic sensors and ESP-based microcontrollers have successfully sent Telegram alerts based on water level thresholds (16). In addition, fuzzy logic implementations with multiple environmental sensors have shown capability in classifying flood risk levels (17). IoT implementations using ultrasonic and water level sensors with Telegram notifications further demonstrate the potential of real-time environmental monitoring frameworks in Indonesia (18). Additionally, fuzzy logic has been applied in smart flood detection architectures using microcontrollers and multi-sensor data to improve alert accuracy (Irawan, Azmi & Hutasuhut, 2022). Finally, recent work on IoT-based water level monitoring confirms that ultrasonic and flow sensors can reliably detect dynamic environmental changes relevant for early warning systems (19).

Methodology

Study Design and Rationale

This study employed a quantitative experimental design combined with a prototype-based system development approach to evaluate the performance of an adaptive IoT-based drainage monitoring system integrated with the Fuzzy Tsukamoto method. The design was structured specifically to address the research gap identified in the Introduction, namely the limitation of deterministic threshold-based classification in handling environmental uncertainty and nonlinear variable interaction.

The experimental framework was developed to test whether multi-parameter fuzzy inference could provide adaptive decision outputs under dynamic environmental conditions. The Tsukamoto inference model was selected due to its capability to produce crisp outputs from monotonic membership functions using weighted average defuzzification, ensuring computational efficiency for real-time embedded processing (911). The research was conducted from April to October 2024 in a drainage channel located in Tanjung Batu, Kabupaten Majene, Indonesia.

Participants, Population, and Sampling

The population of this study consisted of drainage segments vulnerable to garbage accumulation and flow obstruction within the selected area. A purposive sampling technique was applied to select one representative drainage segment based on three criteria: visible garbage accumulation, measurable variation in water level and discharge, and accessibility for sensor installation.

Threshold parameters for the fuzzy membership functions were determined through direct field observations and structured interviews with stakeholders, defining physical boundary conditions based on local channel capacities (e.g., maximum depth of 100 cm), which aligns with established field-data calibration protocols (20, 21).

Data Collection Techniques and Instruments

The system architecture consisted of a Raspberry Pi 4 Model B serving as the central processing unit due to its reliable GPIO interface and embedded processing capability (see Figure 1) (7). Garbage height was measured using an ultrasonic sensor operating above 20 kHz frequency, which calculates object distance based on acoustic reflection (1). Water level measurement utilized a resistive water level sensor capable of detecting conductivity changes. Analog signals were converted into digital form using an MCP3008 analog-to-digital converter with SPI protocol. Water flow velocity was measured using a Hall-effect-based flow sensor that generates pulse frequency proportional to discharge.

Figure 1. System architecture of the IoT-based drainage monitoring system.

The IoT communication framework followed interconnected device architecture principles for environmental data transmission. Monitoring outputs were delivered through Telegram Bot API integration, enabling real-time remote notification.

Research Procedures

Sensor installation was conducted directly within the drainage channel. The ultrasonic sensor was mounted at a fixed reference height of 100 cm from the drainage base, and garbage height was calculated by subtracting the measured ultrasonic distance from this reference height. The water level sensor was installed along the inner channel wall and calibrated from analog readings (0–1023 resolution) into centimeter units using linear scaling. The flow sensor was positioned parallel to the water stream, and velocity was derived from pulse frequency divided by the cross-sectional area of the channel.

Each sensor underwent calibration using five repeated measurements per condition, maintaining measurement error within ±5%. Data acquisition was performed at 60-second intervals continuously for 30 consecutive days to capture environmental variability.

The fuzzy inference process transformed crisp sensor inputs into membership degrees using linear ascending and descending functions (see Figure 2). A total of 27 IF–THEN rules were constructed to model nonlinear interactions among garbage height, water level, and flow velocity. Rule implication applied the MIN operator to compute firing strength, and crisp outputs were obtained using weighted average defuzzification (11).

Figure 2. Flowchart of fuzzy Tsukamoto inference process.

Data Analysis

The dataset consisted of garbage height (cm), water level (cm), flow velocity (m/s), fuzzy output score, and final drainage classification. Descriptive statistical analysis was performed to evaluate environmental variability and system stability. System reliability was calculated as the percentage of successful detections relative to total monitoring instances. Sensor accuracy was assessed through percentage error analysis. Functional validation was conducted using black-box testing to verify input–output conformity across 27 distinct operational rule configurations (Supriyono, 2020), ensuring the system reliably map dynamic sensor arrays to expected linguistic classes without processing failures (8).

Results and Discussion

Electronic System Design

The proposed IoT-based drainage monitoring system was successfully designed, implemented, and tested using the Fuzzy Tsukamoto method to classify drainage conditions into three categories: normal, moderate, and clogged. The system integrates ultrasonic, water level, and water flow sensors connected to a Raspberry Pi 4, which processes sensor data and transmits classification results via the Telegram platform. The electronic system design, prototype implementation, and fuzzy computation results are presented in Figure 3, Figure 4, and Figure 5, respectively.

Figure 3 shows the electronic system design of the drainage monitoring system. The Raspberry Pi 4 functions as the main controller connected to multiple sensors and an MCP3008 analog-to-digital converter. The ultrasonic sensor is used to measure garbage height, the water level sensor detects water level, and the water flow sensor measures flow velocity. The MCP3008 module converts analog sensor signals into digital data so that the Raspberry Pi can process them.

Figure 3. Hardware wiring diagram and component layout for the IoT-based monitoring system: (a) Raspberry Pi Zero W, (b) HC-SR04 ultrasonic sensors, (c) water flow sensor, (d) digital sensor module, (e) pull-down resistor, and (f) MCP3008 ADC IC.

This configuration enables automatic environmental monitoring and real-time data processing. The Raspberry Pi executes the fuzzy logic algorithm and transmits the monitoring results to the Telegram platform. This finding is consistent with Yanwar Seto dkk. (2023), who stated that IoT-based systems enable efficient real-time environmental monitoring. The integration of sensors, microcontroller, and communication modules ensures that environmental conditions can be monitored continuously and accurately.

Prototype Implementation

Figure 4 presents the physical implementation of the system prototype. The figure shows that the ultrasonic sensor was installed above the drainage channel to measure garbage height, while the water level and water flow sensors were placed inside the drainage channel to measure water level and flow velocity. All sensors were connected to the Raspberry Pi controller.

Figure 4. Prototype implementation of the proposed system.

The prototype operated successfully and was able to collect environmental data in real time. The experimental setup demonstrates that the system can function properly in drainage environments. This result supports Prabowo dkk. (2022), who reported that IoT-based monitoring systems improve environmental monitoring efficiency and provide accurate data for decision-making. The successful implementation confirms that the proposed system design is feasible and applicable for real-world drainage monitoring applications.

Figure 5 shows the fuzzy logic computation result generated by the system (Gambar 4.5 Hasil Perhitungan Program Fuzzy Logic). Based on sensor measurements, the garbage height was 48 cm, water level was 38 cm, and water velocity was 0.2 m/s. These values were processed using the Fuzzy Tsukamoto inference method.

Figure 5. Fuzzy logic computation and classification result.

The fuzzification process converted the input values into fuzzy membership values. For example, garbage height had membership values of 0.2 in the medium category and 0.8 in the high category. Water level had membership values of 0.4 in the medium category and 0.6 in the high category, while water velocity had membership values of 0.5 in both slow and medium categories.

The rule evaluation process calculated firing strength values (α) and output values (Z) for each fuzzy rule. The defuzzification process then generated a crisp output value of 71.5. Based on this value, the system classified the drainage condition as moderate.

This result demonstrates that the fuzzy logic system successfully processed sensor data and generated an appropriate classification result. The ability of fuzzy logic to handle uncertainty and nonlinear environmental conditions is consistent with findings reported by Burhanuddin (2023), who stated that the Fuzzy Tsukamoto method produces accurate and reliable classification results in environmental monitoring systems (11).

Furthermore, the use of Telegram as a communication platform enables real-time monitoring and remote access to system information. This feature improves monitoring efficiency and enables faster response to drainage problems, as reported by Ghazi A dkk (2024) (18).

Overall System Performance

Overall, the experimental results confirm that the proposed IoT-based drainage monitoring system operated successfully and performed according to the designed objectives. The system was able to measure environmental parameters, including garbage height, water level, and water flow velocity, using the integrated sensors. The collected data were then processed using the Fuzzy Tsukamoto method to classify the drainage condition automatically into normal, moderate, or clogged categories. Furthermore, the system successfully transmitted the monitoring results in real time through the Telegram platform, allowing users to access drainage condition information remotely. The integration of IoT technology and fuzzy logic provides an effective and intelligent solution for drainage monitoring, particularly in handling environmental uncertainty and supporting real-time decision-making processes. Unlike conventional single-threshold binary alarm setups that frequently trigger false alerts during temporary surges, the integration of the Fuzzy Tsukamoto method enables a multi-layered evaluation. By cross-referencing garbage accumulation with water level and velocity trends, the system establishes a nuanced index that mitigates premature warning triggers. This confirms the operational benefits noted by Prabowo dkk. (2022) and Burhanuddin (2023) (9, 11), while remaining bounded by the physical dynamics of the localized test channel. Therefore, the proposed system has strong potential for implementation in smart drainage management applications to support early detection of blockage conditions and reduce the risk of flooding, while also improving the overall efficiency of environmental monitoring systems.

Conclusion

The proposed IoT-based drainage monitoring system integrating ultrasonic, water level, and water flow sensors with the Fuzzy Tsukamoto method was successfully designed and implemented for real-time drainage condition classification. The system produced a crisp output value of 71.5 for input parameters of 48 cm garbage height, 38 cm water level, and 0.2 m/s flow velocity, which was classified as moderate, demonstrating its capability to model nonlinear environmental interactions adaptively. Therefore, the system provides an effective and intelligent solution for early detection of drainage blockage risk and supports preventive flood mitigation through real-time monitoring. While this study confirms the structural viability of the prototype, operational constraints—including reliance on continuous cellular network stability and the scaling of sensor configurations within wider municipal systems—represent distinct limitations. Future work will focus on long-term field deployments across varied drainage networks and exploring hybrid fuzzy logic methods to optimize network efficiency.

Declarations

Conflict of Interest

The authors declare no conflicting interest.

Data Availability

Data supporting the findings of this study are available from the corresponding author upon reasonable request.

Ethics Statement

Ethical approval was not required for this study.

Funding Information

The authors declare that no financial support was received for the research, authorship, and/or publication of this article.

References

  1. Rahmansa R, Kalsum TU, Alamsyah H. Sistem Monitoring Kapasitas Sampah Pada Bak Sampah Secara Real-Time Berbasis Internet of Things. digitech. 2023;3(1):74-82. doi: https://doi.org/10.47709/digitech.v3i1.2473
  2. Amal B, Purnama DD, Nurkhaerani F, Pebrian A, Al Jamilah FM. Innovative strategies for managing hydrometeorological disaster risks: optimizing environmentally friendly drainage systems (eco-drainage) to prevent flooding and overflow in climate change adaptation in karawang regency. jpensil. 2024;13(3):356-369. doi: https://doi.org/10.21009/jpensil.v13i3.48630
  3. Arteaga C, Silva J, Yarasca-Aybar C. Solid waste management and urban environmental quality of public space in Chiclayo, Peru. City and Environment Interactions. 2023;20:100112. doi: https://doi.org/10.1016/j.cacint.2023.100112
  4. Saputro FE. Perancangan dan Implementasi Sistem Monitoring Kualitas Udara Berbasis IoT. Seminar Nasional Teknik Elektro, Sistem Informasi, dan Teknik Informatika (SNESTIK). 2025;5:667-674. doi: https://doi.org/10.31284/p.snestik.2025.7381
  5. Faisal M, Mutiara Z, Awwal Miftah Hidayat S, Rinaldi Basrida A, Fazrin MT. Prototype of Water Level and Rainfall Detection System as Flood Warning Based On Blynk Iot Application. ITEE. 2023;2(1):1-10. doi: https://doi.org/10.33050/itee.v2i1.361
  6. Bestari DN, Wibowo A. IoT Based Real-Time Weather Monitoring System Using Telegram Bot and Thingsboard Platform. Int. J. Interact. Mob. Technol. 2023;17(06):4-19. doi: https://doi.org/10.3991/ijim.v17i06.34129
  7. Karan K, Alidin M, Fadilla R. Optimasi knn dengan pso untuk klasifikasi kasus hukum di australia menggunakan n-gram. Seis. 2021;5(1):26-34. doi: https://doi.org/10.37859/seis.v5i1.8644
  8. Mukhtar H, Perdana D, Sukarno P, Mulyana A. Sistem Pemantauan Kapasitas Sampah Berbasis IoT (SiKaSiT) untuk Pencegahan Banjir di Wilayah Sungai Citarum Bojongsoang Kabupaten Bandung. Jurtekling. 2020;21(1):56-67. doi: https://doi.org/10.29122/jtl.v21i1.3622
  9. Prabowo YA, Mandala Putra LEU. Perancangan hour meter berbasis internet of thing menggunakan logika fuzzy. JIRE. 2022;5(1):53-61. doi: https://doi.org/10.36595/jire.v5i1.513
  10. Basriati, M.Sc S, Safitri, M.Mat E. Penerapan Metode Fuzzy Tsukamoto dalam Menentukan Jumlah Produksi Tahu. Sitekin. 2021;18(1):120. doi: https://doi.org/10.24014/sitekin.v18i1.11022
  11. Burhanuddin A. LEDGER: Journal Informatic and Information Technology. Vol. 2. 2023.
  12. Insani CN, Arifin N. IoT-Enabled Real-Time Monitoring and Tsukamoto Fuzzy Classification of Mandar River Water Quality via Web Integration for Sustainable Resource Management. J. Tek. Inform. (JUTIF). 2025;6(5):3079-3092. doi: https://doi.org/10.52436/1.jutif.2025.6.5.5249
  13. Akbar A, Clinton M, Ashari IF. Analysis and Implementation Monitoring Flood System Based on IoT Using Sugeno Fuzzy Logic. Komputika. 2023;12(1):25-34. doi: https://doi.org/10.34010/komputika.v12i1.7089
  14. Muhammad Iqbal Dwiyanto, Ari Eko Wardoyo, Dewi Lusiana Pater. Rancang Bangun Sistem Peringatan Dini Bencana Banjir Berbasis Iot Menggunakan Metode Fuzzy Sugeno. Justindo. 2025;10(1):62-72. doi: https://doi.org/10.32528/justindo.v10i1.2670
  15. Enggar Prastyo, Siswanto S. Penerapan Fuzzy Logic untuk Sistem Deteksi Banjir Menggunakan Mikrokontroler ESP32-CAM dan Notifikasi Telegram. Ticom. 2023;11(2):75-80. doi: https://doi.org/10.70309/ticom.v11i2.85
  16. Ovid A, Efri Yandani, Asril. Prototype Sistem Pemantauan Tinggi Muka Air Berbasis Esp32 Untuk Sistem Pringatan Dini Banjir Melalui Telegram. JKN. 2025;5(3):1081-1089. doi: https://doi.org/10.58794/jekin.v5i3.1634
  17. Pitriyanto R. IMPLEMENTASI FUZZY LOGIC UNTUK PERINGATAN DINI BANJIR (Studi Kasus : Kali Krukut, Jakarta Selatan). Multitek Indonesia. 2024;18(1):44-56. doi: https://doi.org/10.24269/mtkind.v18i1.5912
  18. Ghazi A, Syaputra IA, Salam N, Setiawan K. Implementasi Alat Pendeteksi Banjir Berbasis Internet Of Things Via Telegram Pada Kampung Pengarengan. Intecoms. 2024;7(5):1509-1513. doi: https://doi.org/10.31539/intecoms.v7i5.11514
  19. Irawan I, Azmi Z, Hutasuhut M. Iot Pada Sistem Monitoring Kecepatan Air Sungai Babura Sebagai Peringatan Dini Banjir Berbasis Node Mcu. Jurnal Sistem Komputer Triguna Dharma (JURSIK TGD). 2024;3(3):80-87. doi: https://doi.org/10.53513/jursik.v3i3.9289
  20. Apriansyah FA, Pramudwiatmoko A, Wibowo MS, Widiyastuti E, Jiwandono TA, Sari V. Penerapan Metode Fuzzy Tsukamoto Untuk Mendukung Pengambilan Keputusan Berdasarkan Data Jumlah Resi dan Profit. JTIK. 2025;9(4):1309-1321. doi: https://doi.org/10.35870/jtik.v9i4.3917
  21. Purba YG, Avianto D. Implementasi Logika Fuzzy Tsukamoto untuk Optimasi Jumlah Produksi Es Batu Kemasan. Malcom. 2024;5(1):119-129. doi: https://doi.org/10.57152/malcom.v5i1.1736