Red Paper
International Journal of Communication and Information Technology

Impact Factor (RJIF): 15.06, P-ISSN: 2707-661X, E-ISSN: 2707-6628
Printed Journal   |   Refereed Journal   |   Peer Reviewed Journal
Peer Reviewed Journal

2026, Vol. 7, Issue 4, Part A

Smart drain blockage detection system using IoT


Author(s): K Madhushree, M Dhivya, S Jeyashree, K Muthumanickam

Abstract: Blockage in the drainage system is one of the many problems encountered in urban and residential areas and causes water to stagnate and overflow, causing unhealthy and even hazardous conditions as a result of emission of gas. The conventional technique of drain inspection is cumbersome and cannot continuously monitor the drain. This research proposes an internet of things based Smart Drain Blockage Detection and Monitoring system using ESP32 microcontroller, Ultrasonic sensor, and Gas sensor. The Ultrasonic sensor gives the distance between the sensor and the obstruction or water level while the Gas sensor detects the presence of harmful gases in the drain. A Light Emitting Diode alerts the user when there is an abnormal condition in the drain. This system can offer continuous monitoring at low cost and fast detection of drain blockage and gas build up without manual inspection.

DOI: https://www.doi.org/10.33545/2707661X.2026.v7.i4a.91287

Pages: 07-14 | Views: 132 | Downloads: 58

Download Full Article: Click Here

International Journal of Communication and Information Technology
How to cite this article:
K Madhushree, M Dhivya, S Jeyashree, K Muthumanickam. Smart drain blockage detection system using IoT. Int J Commun Inf Technol 2026;7(4):07-14. DOI: 10.33545/2707661X.2026.v7.i4a.91287

Keywords: Drainage Monitoring, Internet of Things, Sensor, Gas Monitoring, Firebase, Real time monitoring

Introduction

One of the systems involved in maintaining the environment of the urban city clean and healthy is the drainage system. Among the problems associated with the blocked drainage system are the stagnant water, flood, bad odor, and emission of gases. The process of manual inspection is one of the processes that help in checking the status of the drain. The process involves the physical inspection of the drain after some certain periods of time. Thus, it is necessary to have an automated system that will help in monitoring the status of the drain.

It is possible to use the Internet of Things (IoT) technology in monitoring the drainage system since it requires continuous monitoring of the status of the drain. The IoT device collects the data collected from the sensors and transmits it through the network. In the current project, ESP32 will be the IoT device that connects to the internet and transmit the data. The sensor used in measuring the depth of the drain in order to indicate the extent of the blockage is the HC SR04 Ultrasonic Sensor. The suggested system will be made up of the web dashboard through which the operator will be able to view the sensor readings as well as the drain status in a real time manner. In the suggested system, local LEDs have been used in order to provide an indication about the presence of any blockage or excessive amount of gas. The objective of this research work is to design a cost effective smart drain monitoring system that will help in monitoring the condition of the drain, detecting the presence of any blockage and excessive amount of gas and storing as well as visualizing the data through Firebase database and web dashboard.

2. Related work

An existing work (Naim et al., 2026) [1] has designed IoT based flood detection system with real-time data logging and notifications. However, the system mostly concentrates into flood monitoring as opposed to drain blockage and gas detection. Another work (Kumar et al., 2025) [2] has proposed a smart drainage monitoring system based on ESP for monitoring water accumulation. The system provides cloud based monitoring without providing any mechanism for toxic gas detection. An IoT based sewage monitoring system (Maruthupandi et al., 2024) [3] has been designed in the past for blockage detection. The system provides alerts based on threshold without GPS location identification and cloud dashboard visualization facility.

An IoT based manhole monitoring system (Islam et al., 2024) [4] using ultrasonic and gas sensors for cloud and web monitoring has been proposed in the past. However, location identification using GPS facility was not included in the system. A LoRaWAN based water-flow monitoring system[5] concentrates on monitoring flow anomalies and leakage as opposed to drain blockage. A similar work which was based on IoT and GIS (Vishalsanker et al., 2024) [6] based water pipeline surveillance system using flow and pressure sensors with LoRa communication. However, it focuses on pipeline leakage rather than drain blockage and gas detection.

Dayana R. et al.[7] has proposed a web-based smart manhole monitoring system for smart-city maintenance. Hazardous gas monitoring facility was not provided. The authors Abinaya K. et al. (Sujithra et al., 2022) [8] proposed an IoT based manhole monitoring system, which provide automatic alerts; however, the sensing parameters were limited. Roshan A. et al. (Bharathi et al., 2023) [9] used ultrasonic, water level, tilt and MQ2 gas sensors for monitoring the manholes and drainage; however the system was equipped with GSM without any GPS based location facility for alerts. Vaishali B. Niranjane et al.[10] provided an IoT based manhole monitoring system equipped with water flow, temperature and tilt sensors through ThingSpeak, however, the system had no gas sensing capability.

Table 1. Overview of the Existing Drainage and Manhole Monitoring Methods
ModelFeatures

Technology/

communction

Output/ Limitation
FDSFlood detection and real time data logging
IoT sensors
Cloud platform

Real time flood detection and data recording.

Focuses mainly on flood monitoring

SDPSSmart drainage and flood prevention
ESP microcontroller
Cloud platform

Water accumulation monitoring

Does not focus on gas detection

SBDSewage monitoring and blockage detection
IoT sensorsmonitoring

Blockage monitoring

Limited dashboard visualization

MMSManhole monitoring and safety detection
Ultrasonic + Gas sensors
Cloud/Web monitoring

Remote manhole monitoring

No GPS based location identification

WFMWater flow monitoring and anomaly detection
Water flow sensors
LoRaWAN

Flow anomaly detection

Focuses on water flow rather than blockage

PWDSPipeline surveillance and leak detection
Flow + Pressure sensors
LoRa + GIS

Leakage monitoring

Designed for pipelines rather than drains

WSMMSmart manhole monitoring and cleaning
IoT sensors
Web based system

Web based monitoring

Limited hazardous gas monitoring

I-MMDSManhole monitoring and detection
IoT sensors
Automatic alert system

Automatic alert system

Uses limited sensing parameters

IMDMSManhole and drainage monitoring
Ultrasonic + Water-level + Tilt + MQ-2
GSM

Multiparameter monitoring

No GPS based alert location

MDSManhole detection and monitoring
Water flow + Temperature + Tilt
ThingSpeak
IoT based monitoringNo dedicated gas sensing

Based on previous researches, the use of IoT systems have been proven to increase the efficiency of the drainage system and the manholes using the real time sensing capability and remote alert mechanism. However, majority of the existing IoT systems are only capable of monitoring one factor, whether it is the water level, flow or leakages. In some cases, wherein multiple sensors are used, these can be limited to technologies such as GSM, LoRaWAN and certain clouds. The proposed system will combine the ultrasonic sensing for measuring distances and gas sensing using ESP32. The data from the sensors will be sent through WiFi to Firebase, and an LED will serve as a local alert mechanism.

3. Proposed hybrid methodology

The above system will be utilized to detect drain clogging and presence of harmful gases using IoT Technology. The whole system methodology will involve the collection of sensor readings, processing of sensor data, detection of blockage, data transfer through Firebase and the web monitoring process. The ESP32 will act as the central processing unit which receives and analyzes the data from the HC SR04 ultrasonic sensor and MQ2 gas sensor.

Collection of data from system

The system continually gathers the data of the drain through the use of two sensors. The HC SR04 ultrasonic sensor is used to measure the distances in the drain, while the MQ2 is used to measure the presence of any harmful gas. The sensor data of the ultrasonic distance and gas are obtained by the ESP32 at specified time intervals The sensor data are compared with predefined threshold values.. Based on the obtained data, the drain state can be normal, warning, blockage or poisonous gas state.

B. Feature extraction and drain state determination

The important factors adopted in the proposed system are as follows:

  • Ultrasonic distance - To know abnormal drain blockage states.
  • Gas value – To detect hazardous gas.
  • Drain state – Which is produced based on sensor data.
  • The ESP32 processes the above mentioned factors to find out the state of the drain.
Figure 1. Flowchart of the Smart Drain Blockage Detection System.

Algorithm 1: Sensor Data Collection

Input:

  • HC SR04 ultrasonic sensor
  • MQ2 gas sensor

Output:

  • Distance value
  • Gas value

Algorithm:

  1. ESP32, HC SR04 and MQ2 sensor initialization
  2. Sensor initializations
  3. The procedure for measuring distance from drain
  4. Reading value of gas sensor
  5. Saving distance and value of sensor
  6. Repeat the cycle

The values obtained from the HC SR04 ultrasound sensor and MQ2 gas sensor are based upon the state of the drain. The values of the HC SR04 and MQ2 are used by the ESP32 in deciding whether any potential obstructions are there as well as any hazardous gas. The values are compared with the threshold value in order to classify the state of the drain currently. In accordance with the status category, the LED alarm as well as the status update is sent to the Firebase database. This process is represented by Algorithm 2.

Algorithm 2: Drain condition detection from sensor readings

Input:

  • Distance: Value of distance from ultrasonic sensor.
  • Gas value: Value of gas from MQ2 sensor.
  • Thresholds: Threshold values of distance and gas.

Output:

  • Drain status: Drain status.
  • Led alert: LED alert status.

Algorithm:

  • Get the value of distance from HC SR04 sensor.
  • Get the value of gas value from MQ2 sensor.
  • Determine whether distance and gas value are in normal range in comparison to predefined thresholds.
  • If yes, the value of drain status will be Normal.
  • If not, the value of drain status will be Warning.
  • If the value of distance/gas crosses the threshold value, then the value of drain status will be Blockage/Toxic Gas.
  • If there is any abnormality in the blockage or gas value, then an alert will be generated through LED.
  • Values will be passed to Firebase.

The identified drain state was utilized to provide real time local and remote monitoring. Upon the occurrence of the sensor values identifying an anomalous state, the LED glows to notify the user of the issue visually. Additionally, the ESP32 transmits the sensor values and the state of the drain over WiFi to the Firebase Realtime Database. The obtained information is then used by the web dashboard in order to provide continuous monitoring. As such, the current drain state and the sensor readings can be kept up to date. The features that could be extracted from the sensors data collected using the proposed system were chosen depending on the features which could be used to classify the condition of the drains. The ultrasonic distance data and the MQ2 gas data were considered the most important features from the sensors because the distance data was related to the condition of the drains while the gas data referred to the amount of poison gas.

C. Sensor data processing methodology

The proposed methodology utilizes the sensor values of the ultrasonic and gas sensors to monitor and detect the status of the drain. This is performed by continuously capturing the sensor values with the ESP32 and processing it according to the threshold levels. The measured distance by the ultrasonic sensor assists in detecting the blockages while the gas sensor values from MQ2 detect if there are any harmful gas levels. The combination of the processed sensor values will determine the status of the drain. The data collected from the ultrasonic sensor will be used to classify whether the drain pipe is blocked or not. HC SR04 Ultrasonic sensor is used to sense the distance between the sensor and the obstruction or surface of the water. The distance sensed by the ultrasonic sensor will be compared with the threshold distances. If the distance sensed is normal, it will be considered as drain is normal. Otherwise, the drain pipe might be blocked.

Figure 2. Data Processing and Classification Flowchart.

The analysis process of the data from the gas sensors is utilized to identify whether there are any harmful gases present in the drain. The MQ2 sensor senses the gas level and sends the sensor value to the ESP32. The value of gas detected is compared with the predefined threshold values. The value in the normal range reveals that the situation is safe, whereas the increase in the value reveals the warning situation. If the gas level goes beyond the critical threshold, it is detected as toxic gas situation, and the LEDs are switched on to reveal the warning.

Figure 3. Data Processing and Classification Flowchart.

Hybridized classification stage utilizes the results that are derived from the ultrasonic sensor and MQ2 gas sensor. The ESP32 considers the condition of both sensors in classifying the drain status. The system recognizes the drain condition as Normal as sensor values are normal. In case any of the sensors is found to be exceeding the warning threshold, the condition of the drain is classified as Warning. When the blockage or gas level is found to have crossed the critical threshold, the system classifies the condition of the drain as Blockage / Toxic Gas. The classified sensor data above is incorporated together with Firebase Realtime Database for the continuous monitoring and recording of the data. After the process of classifying the drain status by the ESP32, using the data collected by the ultrasonic and gas sensors, the data and status are uploaded to Firebase with the help of a WiFi. The latest data gathered which includes the distance, gas value, and drain status, is recorded in the database. The database is accessed by the web based application where it gets the data and presents the status of the drain.

In order to effectively monitor the drain in real time, ESP32 with Firebase Realtime Database will be used. Data gathered from the sensors will be continually processed by the ESP32. The ultrasonic sensor will gather distance values, while the MQ2 gas sensor will collect gas values. The sensor values collected will be helpful in ascertaining the drain status. ESP32 will process the data that is collected from the sensors and will compare it with the threshold ones. Based on the values, one will be able to identify the drain status as normal, warning, blockage or toxic gas. In case there are any abnormalities, the LED will be turned ON. The data processed by ESP32 will be uploaded into the Firebase through a WiFi connectivity. The data that will be uploaded to the database will encompass the distance, gas value and drain status. Web dashboard will get the data from the Firebase and will showcase the current values of the sensors and the drain status.

Figure 4. Deep Learning-Based Classification Architecture.

The complete system consists of the process of acquiring sensor data, preprocessing, extracting features, classifying drain condition, transmitting data to Firebase and monitoring this data using dashboard. The full process of drain condition classification is given in Algorithm 3 and the steps for transmitting and monitoring the classified sensor data using Firebase is given in Algorithm 4. Firstly, ultrasonic and gas sensor data is acquired using ESP32. The analysis of the distance value is helpful in concluding any kind of blockage whereas analysis of gas value concludes whether there are harmful gas conditions. These two analyses help in concluding the status of the drain. The result that has been classified is transmitted through Firebase together with the respective sensor values.

Algorithm 3: Drain condition detection using ESP32

Input: The sensor input values of ultrasonic distance D and gas value G

Output: The condition of the drain as Normal, Warning, or Blockage/Toxic Gas

  1. The initialization of ESP32, HC SR04 ultrasonic sensor, MQ2 gas sensor and LED
  2. The get sensor input value of ultrasonic distance D from HC SR04 sensor
  3. The get sensor input value of gas G from MQ2gas sensor
  4. The preprocessing of sensor input values
  5. The checking if the value of ultrasonic distance D is greater than the blockage threshold defined
  6. The checking if the value of gas G is greater than the gas threshold defined
  7. The combination of the outputs of ultrasonic sensor and gas sensor
  8. The output Normal condition if the sensor inputs fall in the normal region
  9. The output Warning condition if any of the sensors exceed the warning threshold
  10. The output Blockage/Toxic Gas if the value of blockage/toxic gas exceeds the critical threshold
  11. The turn the LED ON if the drain condition is abnormal
  12. The send sensor readings and drain condition to Firebase through WiFi
  13. Return: Drain condition detected
Algorithm 4: Real Time Drain Monitoring with Firebase

Input: Distance D, Gas G, Classified Status of the Drain S

Output: Stored data of sensors and new drain status in Firebase

  1. Initialization of Firebase Realtime Database
  2. Creation of WiFi connection using ESP32
  3. Reading of the processed values of sensors D and G from ESP32
  4. Reading of the classified drain status S
  5. Creation of sensor data record with the distance, gas value, and drain status.
  6. Sending of the sensor data record to Firebase
  7. Storage of the recent sensor data in Firebase Realtime Database
  8. Updating the status of the drain based on the recent values of the sensor
  9. Retrieval of the information from the web dashboard
  10. Displaying of the distance, gas, and drain status on the web dashboard
  11. Repeat continuously for real time monitoring of the drain.
  12. Return: Updated sensor data and drain status on the web dashboard.

4. Experimental results and discussion

The proposed Smart Drain Blockage Detection and Monitoring System was designed and developed using ESP32, HC SR04 ultrasonic sensor, MQ 2 gas sensor, LED, Firebase Realtime Database, and web dashboard. Different drain conditions were experimented in order to test for the blockage and presence of harmful gases.

The performance of the proposed Smart Drain Blockage Detection and Monitoring System was determined through the readings from the sensors that were attached to ESP32. The HC SR04 ultrasonic sensor was used to measure the distance inside the drain, whereas MQ 2 sensor was employed to measure harmful gases. The readings from the sensors were processed by the system, and accordingly it classified the drain condition based on threshold values. In case of normal condition, the system showed Normal status. However, when there was any obstacle or gas concentration level increased, the system generated appropriate warning messages.

The sensor data was uploaded to Firebase Real time Database using Wi Fi. The website dashboard displayed the last distance, gas value, and drain status, thus it was possible to monitor remotely the drain conditions. Based on the experiment, it is possible to state that the proposed solution can provide continuous monitoring of sensors, obstruction detection, hazardous gas detection, Firebase database upload, and dashboard visualization in real time.

Table 2. Performance of the proposed system in various drain state
Drain StateDetection stateLED statusFirebase update
Normal stateNormalOFFYes
Warning stateWarningONYes
Blocked stateBlockedONYes
High gas stateToxic GasONYes
Table 3. Comparison between existing methods and the proposed system
ApproachUltrasonic SensingGas SensingReal Time SensingFirebaseAlert Using LED
Conventional InspectionNoNoNoNoNo
Water Level Monitoring

No

No

Yes

Sometimes

No

IoT Based Drain Monitoring
Yes
No
Yes
Sometimes
Yes
Manhole MonitoringYesYesYesSometimesYes
Proposed SystemYesYesYesYesYes
Figure 5. Comparison of Existing Methods with the Proposed System.

.

Figure 6. Performance Evaluation of the Smart Drain Blockage Detection System
Figure 7. Confusion Matrix for Smart Drain Blockage Detection System

The proposed system was compared to conventional inspection, water level monitoring, Internet of Things (IoT) based drain monitoring, and manhole monitoring systems according to the list of characteristics shown in Table 3. The comparison is based on ultrasonic sensing, gas sensing, real time sensing, Firebase based monitoring, and LED based warnings. The conventional inspection technique does not provide continuous monitoring through sensors, whereas water level monitoring techniques concentrate only on water conditions. IoT based drain and manhole monitoring provide real time sensing, but utilize other techniques of sensing and cloud based monitoring. The proposed solution involves ultrasonic, gas, and real time sensing, Firebase based data storage, and LED based warning techniques. The comparison provides information on the characteristic set of the proposed system. Thus, the results prove that the proposed solution incorporates several monitoring functions of continuous drain condition monitoring.

5. Conclusion

In the proposed Smart Drain Blockage Detection and Monitoring System project, an IoT based model was used to monitor the status of the drain in real time. In the system, the ESP32 acquires the data from the HC SR04 ultrasonic sensor and MQ2 gas sensor to identify the potential blockage and presence of hazardous gas. Then the data is sent in the Firebase Realtime Database through Wi Fi. The LED was used as an indicator to provide information about the abnormal status of the drain. Therefore, the suggested system can be utilized in continuous monitoring of the drain, detection of drain blockage, identification of the presence of hazardous gases, and remote viewing of the sensor data. It is a cost effective approach for monitoring the status of the drainage system without regular inspection.

References

  1. 1.Naim MAB, Isa RM, Kasran FAM, Hassan SLM, Zakaria WNW. Smart IoT based flood detection and alert system with real time data logging. IEEE Conference Publication. 2026.
  2. 2.Kumar RA, Gowthami CM, Kumar PMP, Chethan YK, Sahana AN, Harshitha D. IoT based smart drainage and flood prevention for subway and underpass using ESP microcontroller and cloud platform. IEEE Conference Publication. 2025.
  3. 3.Maruthupandi J, Nirmala M, Pavan V, Krishna BVS. IoT based sewage monitoring and blockage detection system. IEEE Conference Publication. 2024.
  4. 4.Islam S, Chisty NA, Saha T. Design and implementation of IoT based manhole monitoring system. IEEE Conference Publication. 2024.
  5. 5.Chandra B. IoT based water flow monitoring system using wireless network (LoRaWAN). IEEE.
  6. 6.Vishalsanker SV, Govardhine K, Rajeshkannan S. IoT and GIS based real time water pipeline surveillance and leak detection system. IEEE Conference Publication. 2024.
  7. 7.Dayana R, Ghosh S, Sinha A, RoyChowdhury K. Web-based smart manhole monitoring and cleaning for smart city. 2024 IEEE International Conference on Recent Advances in Electrical, Electronics, Ubiquitous Communication, and Computational Intelligence (RAEEUCCI). 2024.
  8. 8.Sujithra M, Velvadivu P, Rathika J, Priyadharshini R, Preethi P. A study on psychological stress of working women in educational institution using machine learning. 2022 13th international conference on computing communication and networking technologies (ICCCNT). 2022:1-7.
  9. 9.Bharathi V, Monikavishnuvarthini A, Dhakne A, Preethi P. AI based elderly fall prediction system using wearable sensors: A smart home-care technology with IOT. Meas. Sens. 2023;25:100614.
  10. 10.Preethi P, Dineshkumar P, Sakthy SS, Muthumanickam K, Mohanadevi A. Integrated framework for yield prediction and seed quality assessment in chickpea (Cicer arietinum L.) using artificial intelligence. Legume Research. 2026;49(8):1347–1353.
  11. 11.Preethi P, Saravanan T, Mohanraj R, Gayathri PG. A real-time environmental air pollution predictor model using dense deep learning approach in IoT infrastructure. GLOBAL NEST JOURNAL. 2024;26(3).
  12. 12.Abinaya K. I-MMDS: Manhole monitoring and detection system using IoT. IEEE Conference Publication. 2024.
  13. 13.Roshan A, Thrideep S, Koushik B, Chakkaravarthy AP. IoT based manhole and drainage monitoring system. 2024 9th IEEE International Conference on Communication and Electronics Systems (ICCES), Coimbatore, India. 2024.
  14. 14.Niranjane VB, Niranjane P, Punwatkar KM. Manhole detection and system monitoring controlled by IoT. 2024.
International Journal of Communication and Information Technology

International Journal of Communication and Information Technology

International Journal of Communication and Information Technology
Call for book chapter
Journals List Click Here Research Journals Research Journals