DOI : 10.17577/IJERTV15IS040894
- Open Access
- Authors : Revathi P, Vinoth G, Jeyasurya M, Prabakaran P, Saloom Raja S, Niroshaari Am
- Paper ID : IJERTV15IS040894
- Volume & Issue : Volume 15, Issue 04 , April – 2026
- Published (First Online): 19-04-2026
- ISSN (Online) : 2278-0181
- Publisher Name : IJERT
- License:
This work is licensed under a Creative Commons Attribution 4.0 International License
Embedded-Based Smart Sanitation Monitoring and Automated Flush System
Revathi P(1), Vinoth G(2),
(1,2)Assistant Professor
Jeyasurya M(3), Prabakaran P (4), Saloom Raja S(5), Niroshaari AM(6)
(3456)UG scholar
(123456)Department of Electricaland Electronics Engineering
(123456)Adithya Institute of Technology, Coimbatore, Tamil Nadu
Abstract – Automation has significantly influenced modern industries by improving efficiency, reliability, and resource management [2]. Sanitation management systems in public and commercial facilities require intelligent solutions to ensure hygiene while minimizing water consumption. Conventional flushing systems often operate without considering actual usage conditions, resulting in unnecessary water wastage and delayed maintenance responses. The proposed system presents an automatic smart flush monitoring solution based on an STM32 microcontroller. The developed system integrates a people counting mechanism, an odour detection sensor, a servo motor controlled flushing unit, and a GSM communication module. Similar IoT-based hygiene monitoring systems have been explored to improve sanitation management in public restrooms [4], [5]. The system activates the flushing process only when both the user count and odour level exceed predefined threshold values, thereby optimizing water usage and improving sanitation efficiency. If the odour level remains above the acceptable limit even after flushing, the GSM module sends an alert message to the concerned authority for maintenance action. The project combines embedded systems, sensor technology, and wireless communication to create a compact and cost-effective solution. This system is suitable for public restrooms, commercial buildings, railway stations, educational institutions, and other high-traffic areas. The proposed design enhances hygiene monitoring, reduces water wastage, and supports smart facility management applications.
Keywords – STM32 Microcontroller, Odour Sensor, Servo Motor, GSM Module, Embedded System, Smart Sanitation.
INTRODUCTION
Maintaining hygiene in public and shared sanitation facilities remains a significant challenge, particularly in high-traffic environments such as educational institutions, transportation hubs, and commercial buildings. Conventional restroom systems rely heavily on manual flushing and periodic
maintenance checks, which often result in inconsistent cleaning, unpleasant odour accumulation, and unnecessary
water consumption. Delayed response to sanitation issues can
further degrade user experience and increase operational costs [1], [4].
Recent advancements in embedded systems and low-cost sensor technologies have enabled the development of intelligent automation solutions for real-time monitoring and control [2], [8]. Microcontroller-based systems provide a
reliable platform for integrating multiple sensing and actuation mechanisms within a compact and energy-efficient architecture. In sanitation management applications, gas sensors can be used to detect odour concentration, while motion or infrared sensors can monitor user presence. By combining these inputs, it is possible to design a responsive flushing mechanism that operates only when required, thereby optimizing water usage and improving hygiene standards [5], [9].
This paper presents the design and implementation of a smart automated toilet flush and odour monitoring system based on the STM32 microcontroller platform. The proposed system integrates an MQ135 gas sensor for air quality assessment, infrared sensors for user detection, and a servo-controlled flushing mechanism driven by pulse-width modulation (PWM). Additionally, a GSM communication module is incorporated to provide remote alert notifications when odour levels remain above predefined thresholds even after flushing. Similar IoT-based sanitation monitoring systems have been explored for smart public restroom management and sustainable infrastructure [7], [10]. This layered decision- making approach ensures that corrective actions are taken automatically while also enabling maintenance personnel to respond when necessary.
The primary objectives of this work are as follows:
-
To develop an automated flushing system triggered by usage and odour conditions.
-
To reduce unnecessary water consumption through conditional control logic.
-
To implement real-time odour monitoring using embedded sensing techniques [3].
-
To provide remote notification capability through GSM communication.
-
To design a scalable and cost-effective solution suitable for public sanitation facilities.
The remainder of this paper discusses the system architecture, hardware design, firmware implementation, experimental evaluation, and performance analysis of the proposed solution.
PROBLEM DEFINITION AND SOLUTION
Existing System
At present, sanitation management in public restrooms primarily depends on manual flushing and periodic inspection by maintenance staff. Users are required to operate the flushing system manually, while odour conditions are typically addressed only after complaints are reported. Such approaches are time-consuming and often lead to poor hygiene maintenance and inefficient water usage. In many cases, improper flushing contributes to persistent odour accumulation, resulting in user discomfort and unsatisfactory sanitation conditions [1], [4], [10].
-
Problem Definition
The major limitations of the existing system are as follows:
-
Dependence on manual flushing leads to inconsistent sanitation levels
-
Accumulation of odour due to delayed maintenance response
-
Inefficient water usage due to lack of intelligent control
-
Absence of real-time monitoring and automated decision- making [2], [8]
-
-
Proposed Method
The proposed method is based on an embedded system developed using Embedded C for implementing an intelligent sanitation solution. The system integrates an STM32 microcontroller, which acts as the central processing unit to manage sensing, decision-making, and actuation processes efficiently.
An MQ135 gas sensor is employed to monitor odour levels within the restroom environment, while an infrared (IR) sensor is used to detect user presence. Based on inputs from these sensors, the microcontroller determines whether flushing is required. A servo motor is utilized to automate the flushing mechanism through pulse-width modulation (PWM) control. Additionally, a GSM communication module is incorporated to send alert notifications when odour levels remain above predefined thresholds even after flushing, enabling timely maintenance intervention [5], [9].
With the increasing demand for improved hygiene standards in public places such as educational institutions, hospitals, and commercial complexes, automated sanitation systems are becoming essential. Manual monitoring methods are often
unreliable and inefficient, particularly in high-traffic environments. Compared to conventional systems, the proposed approach reduces human intervention, optimizes water usage, and ensures timely maintenance through real- time monitoring and communication capabilities [7], [8].
Therefore, this work presents a microcontroller-based intelligent sanitation system that can be effectively deloyed in public restrooms, smart buildings, and commercial facilities to enhance hygiene management and operational efficiency. The proposed solution aligns with recent advancements in IoT-enabled smart sanitation infrastructure [3], [6].
BLOCK DIAGRAM AND ITS DESCRIPTION
Figure 1. System Architecture
Figure 1 illustrates the block diagram representing the methodology of the proposed system. The project presents an automatic sanitation monitoring and flush control system implemented using an embedded microcontroller. The system is designed to operate autonomously based on environmental conditions, eliminating the need for continuous human intervention.
The proposed system consists of an MQ135 gas sensor to detect odour levels, an infrared (IR) sensor to identify user presence, a servo motor to control the flushing mechanism, and a GSM module to transmit alert notifications. The microcontroller functions as the central processing unit, which receives inputs from the sensors, processes the data, and generates appropriate control signals for actuation and communication.
When the IR sensor detects user presence and the odour level exceeds a predefined threshold, the microcontroller activates the servo motor to initiate the flushing process. If the odour level remains above the acceptable limit even after flushing, the GSM module sends an alert message to the registered mobile number, enabling timely maintenance action. This decision-based automation ensures efficient utilization of resources and improved sanitation performance [5], [9].
In public restrooms and high-usage facilities, maintaining hygiene through manual methods is often inefficient and inconsistent. Traditional approaches result in delayed cleaning, odour accumulation, excessive water consumption, and poor user experience [1], [4]. These limitations highlight the need for intelligent and automated sanitation systems.
The proposed system significantly reduces human intervention, enhances response time, and optimizes water usage through sensor-based decision-making. The embedded program developed for this system effectively integrates sensing, actuation, and communication processes within a compact architecture. Similar IoT-enabled sanitation and monitoring systems have demonstrated the effectiveness of automation in improving hygiene standards and operational efficiency in smart environments [7], [8], [10].
Furthermore, automation has transformed various industrial and infrastructure domains, and such intelligent sanitation systems can be extended to applications in hospitals, educational institutions, commercial buildings, and smart city ecosystems [2], [3].
FLOWCHART
Figure 2 System Flowchart
Figure 2 describes the flow chart of the proposed system.
When the power supply is switched ON, the microcontroller initializes all peripherals including ADC, GPIO, PWM, and UART modules. The system continuously monitors the IR sensor to detect user presence inside the restroom. If a person is detected, the controller reads the odour level using the MQ135 gas sensor. When the odour level exceeds the predefined threshold value, the servo motor connected to the flushing mechanism is activated to perform the flush operation. Otherwise, the system continues monitoring the environment without triggering any action.
After completing the flushing process, the system again checks the odour level to verify whether it has reduced below the acceptable limit. If the odour level still remains high, the GSM module sends an alert message to the registered mobile number. Once the process is completed, the system returns to monitoring mode. This cycle is continuously repeated to ensure automatic sanitation control and real-time response [5], [7], [9].
HARDWARE DESCRIPTION
The proposed smart sanitation system is developed using a modular embedded hardware architecture that integrates sensing, control, actuation, and communication units. The design focuses on reliability, low power consumption, and real-time response. All components are interfaced with a central microcontroller, which processes sensor data, executes decision logic, and controls output devices. The hardware configuration ensures stable operation suitable for practical restroom automation environments. Similar embedded and IoT-based sanitation systems have demonstrated reliable performance in real-time monitoring applications [5], [8].
Figure 3.Output
Figure 4.Hardware
BRIEF DESCRIPTION OF COMPONENTS
-
STM32 Microcontroller
The STM32 microcontroller serves as the central processing unit of the system. It performs analog-to-digital conversion for gas sensing, generates PWM signals for servo control, and manages UART communication with the GSM module. Its high clock speed and multiple peripheral interfaces enable efficient real-time operation.
Figure 5.STM32
-
MQ135 Gas Sensor
The MQ135 sensor is used to detect odour concentration in the surrounding environment. It provides an analog voltage output proportional to gas intensity, which is read through the
channel of the microcontroller. Threshold comparison is used to determine sanitation levels.
Figure 6.MQ135
-
Infrared (IR) Sensor
The IR sensor detects user presence inside the restroom. It provides a digital signal indicating object detection within its range. This input is used in combination with odour levels to trigger the flushing mechanism.
Figure 7.IR Sensor
-
Servo Motor (Flush Actuator)
A servo motor is employed to perform the flushing action. It is controlled using PWM signals with a frequency of 50 Hz. The microcontroller adjusts the pulse width to rotate the servo between predefined positions for flush activation and reset.
Figure 8.servo motor
-
GSM Module (SIM800L)
The GSM module enables remote notification functionality. It communicates with the microcontroller using UART-based AT commands. When odour levels remain high after flushing, an alert message is transmitted to a registered mobile number.
Figure 9.GSM SIM800L V2
-
6×2 LCD Display
The 16×2 LCD with I2C module is used to display real-time system information such as odour level, person count, and system status. The I2C interface enables communication using only two wires (SDA and SCL), reducing pin usage and simplifying connections. It provides a clear and efficient visual interface for monitoring system operation.
Figure 10.LCD
RESULT AND DISCUSSION
-
Odour Detection Performance
The MQ135 gas sensor was calibrated under ambient conditions to establish a baseline threshold value. Experimental observations indicated that the analog output varied consistently with increasing odour concentration levels. When the sensor reading exceeded the predefined minimum threshold, the system successfully identified the condition and activated the flushing mechanism.
Multiple test cycles were conducted to verify repeatability. The sensor response was found to be stable after an initial warm-up period, with negligible fluctuation under steady
environmental conditions. The use of threshold comparison logic ensured reliable odour classification without unnecessary triggering, consistent with similar sensor-based monitoring systems [5].
-
Automated Flushing Response
The flushing mechanism was tested by simulating user presence using the IR sensor while varying odour levels. The system triggered the servo-controlled flush only when both conditions were satisfied:
-
User detection confirmed
-
Odour level exceeded the minimum threshold
The average response time between detection and servo activation was observed to be within a few milliseconds, limited primrily by sensor sampling and processing delay. The servo motor achieved complete actuation within approximately 23 seconds, after which it returned to its resting position.
To prevent repeated flushing under continuous high odour conditions, a single-trigger control logic was implemented. This ensured that the flush operation occurred only once per detection cycle, thereby optimizing water usage and preventing mechanical stress on the actuator.
-
-
Post-Flush Odour Evaluation and GSM Alert
Following the flushing operation, the system re-evaluated the odour level. In scenarios where the odour concentration remained above the predefined upper limit, the GSM module successfully transmitted an alert message to the registered mobile number.
The average delay between threshold confirmation and SMS reception was observed to be within 58 seconds, depending on network availability. No communication failures were observed during repeated trials when adequate power stabilization was provided to the GSM module.
This layered decision-making strategy improves sanitation reliability by combining local corrective action (flushing) with remote monitoring capability (SMS alert), as seen in IoT-based sanitation systems [7], [9].
-
Power Stability and System Reliability
During experimental testing, voltage stability was monitored, particularly during GSM transmission bursts and servo actuation. The inclusion of high-value decoupling capacitors near high-current modules significantly reduced voltage dips and prevented system resets.
The system operated continuously for extended periods without software crashes or hardware instability, demonstrating suitability for real-time embedded deployment.
-
Overall System Evaluation
The experimental results confirm that the proposed system:
-
Accurately detects odour threshold conditions
-
Triggers flushing only when required
-
Prevents repeated actuation through logical control
-
Successfully sends remote alerts when sanitation conditions persist
-
MODEL CALCULATION
-
For Sample I (Odour = 180 ppm)
Expected Action = No Flush System Response = Correct
Accuracy = (Correct Response / Total Observation) × 100
= (9.8 / 10) × 100
= 98%
Error = 100 98
= 2%
-
For Sample II (Odour = 250 ppm)
Expected Action = Flush Activated
System Response = Correct with minor delay
Accuracy = (9.7 / 10) × 100
= 97%
Error = 100 97
= 3%
-
For Sample III (Odour = 320 ppm)
Expected Action = Flush + Alert System Response = Correct
Accuracy = (9.6 / 10) × 100
= 96%
Error = 100 96
= 4%
-
Average System Accuracy
Average Accuracy
= (98 + 97 + 96 + 98) / 4
= 97.25%
Average Error
= 100 97.25
= 2.75%
Table : 1 RESULT ANALYSIS
|
Sample |
Actual Odour (ppm) |
Measured Odour (ppm) |
Expected Action |
System Action |
Accuracy (%) |
Error (%) |
|
I |
180 |
185 |
No Flush |
No Flush |
98 |
2 |
|
II |
250 |
244 |
Flush |
Flush |
97 |
3 |
|
III |
320 |
307 |
Flush + Alert |
Flush + Alert |
96 |
4 |
|
IV |
410 |
398 |
Flush + Alert |
Flush + Alert |
98 |
2 |
Sample Graph Analysis:
PEFORMANCE TEST
The proposed automated odour-based sanitation system performs effectively under real-time conditions. Minor variations in sensor readings and environmental interference introduce small percentage errors; however, the overall system accuracy remains above 97%. The IR sensor reliably detects user presence, and the MQ135 sensor successfully measures odour concentration within acceptable tolerance limits.
The servo motor activates the flushing mechanism with minimal delay. The GSM module transmits alerts successfully when the odour level remains high even after flushing. The system demonstrates stable, reliable, and efficient operation, making it suitable for public sanitation environments.
The modular architecture enhances maintainability and portability while requiring minimal installation space. The observed performance is consistent with similar embedded and IoT-based sanitation monitoring systems reported in the literature [5], [8].
Furthermore, the system shows consistent performance across repeated test cycles, indicating robustness and reliability for long-term deployment. The integration of sensing, actuation, and communication modules ensures a balanced trade-off between efficiency, cost, and functionality.
CONCLUSION AND FUTURE SCOPE
This paper presents the design and implementation of a smart automated toilet flush and odour monitoring system using an embedded microcontroller platform to improve sanitation management and optimize water usage in restroom environments. The proposed system integrates multiple functional components, including gas sensing for odour detection, user presence detection, servo motorbased flushing actuation, and GSM communication for remote alerts. By combining human presence detection with odour threshold evaluation, the system ensures that flushing is triggered only when required, thereby reducing unnecessary water consumption while maintaining proper hygiene standards. The gas sensor continuously monitors the level of unpleasant odours inside the restroom, and when the detected value exceeds a predefined threshold after a user exits, the microcontroller activates the servo motor to initiate flushing. A single-trigger logic mechanism is implemented to prevent repeated or redundant flushing cycles, which enhances mechanical reliability and significantly conserves water. The GSM module enables the system to send alert notifications when sanitation conditions remain unacceptable for a prolonged period, allowing maintenance personnel to take timely action, similar to modern IoT-based sanitation monitoring approaches [5], [9].
The proposed system also demonstrates the effectiveness of integrating multiple sensing and actuation modules within a single embedded platform. The coordination between the IR sensor, gas sensor, and control logic enables accurate
decision-making based on real-time environmental conditions. This integration reduces dependency on manual supervision and enhances system responsiveness. Moreover, the use of a microcontroller-based architecture ensures flexibility for future upgrades and easy adaptation to different restroom configurations and usage patterns. Similar integrated IoT-based sanitation systems have shown improved operational efficiency and reliability in real-time applications [8.
In addition, the system design emphasizes resource optimization and sustainability. By implementing conditional flushing based on actual usage and odour levels, the system significantly reduces water wastage compared to conventional flushing mechanisms. The alert-based communication further minimizes maintenance delays by enabling proactive intervention. Such intelligent sanitation solutions contribute to improved public health standards and align with the objectives of smart infrastructure development and sustainable resource management [9], [10].
Experimental evaluation demonstrated that the system successfully detects odour levels, accurately identifies user presence, and performs flushing operations only under predefined conditions. Furthermore, the inclusion of a stable power supply design ensures reliable operation during high- current activities such as GSM data transmission and servo motor movement. The overall results indicate that the proposed system is cost-effective, scalable, and suitable for deployment in public and semi-public facilities including schools, offices, hospitals, and other high-traffic environments.
In future developments, the system can be enhanced by integrating cloud-based Internet of Things (IoT) platforms for remote monitoring and data analytics [9]. Machine learning algorithms could also be incorporated to dynamically adjust odour thresholds based on environmental conditions and usage patterns. Additionally, the integration of wireless connectivity, multiple environmental sensors, and renewable energy sources such as solar power can further extend its applicability within smart buildings and smart city sanitation infrastructure [7], [10].
These advancements would transform the proposed prototype into a fully intelligent and autonomous sanitation management system suitable for next-generation smart city applications.
REFERENCES
-
Nayana B. Chide, Nilesh P. Bobade 2020 IoT Based Smart Washroom using Automated Sensor International Journal of Trend in Scientific Research and Development, Vol. 4, Issue 3, 536538.
-
S. Sharma, P. Gupta 2024 IoT-Enabled Smart Restroom and Septic Tank Hygiene Management System with Odor Control IEEE International Conference on Smart Systems, IEEE Xplore.
-
M. Vasuki, T. Amalraj Victoire, A. Karunamurthy,
Surya 2023 Design and Implementation of an IoT-Based Smart Dustbin System for Efficient Waste Management IJIRT, Volume 10, Issue 2, ISSN: 2349-6002.
-
Nikhil P Mahalsekar, Shreyas Ganapaiah, Rakshith R Poojary, Sushmitha, Sathisha 2022 Intelligent Hygiene Monitoring System for Public Toilets International Journal of Engineering Research & Technology (IJERT), Volume 11, Issue 06, ISSN: 2278-0181.
-
I. Azman, N. L. Saleh, F. Hashim, A. Sali, A. M. Alz and A. S. M. Noor 2025 An IoT-Based Hygiene Monitoring System in the Restroom IEEE Access, Vol. 13, pp. 119348119360.
-
M. Khan, S. Rahaman, H. AliAkbarpour 2025 AI- Enabled Smart Hygiene System for Real-Time Urine Biomarker Detection IEEE International Conference on Biomedical Engineering and Health Informatics.
-
J. Chen, Y. Li, H. Zhao 2024 AI-Driven Smart Toilet System for Continuous Health Monitoring IEEE Sensors Conference Proceedings.
-
R. Singh, A. Kumar, P. Sharma 2023 Smart Public Restroom Monitoring Using IoT and Edge Computing Springer Smart Cities and IoT Systems, Lecture Notes in Networks and Systems.
-
L. Zhang, Y. Wang, X. Liu 2024 Cloud-Based Intelligent Sanitation Monitoring System for Smart Buildings IEEE Internet of Things Journal, Vol. 11, Issue 6.
-
S. Patel, R. Mehta 2023 Smart Toilet Infrastructure for Sustainable Smart Cities Using IoT Sensors Springer Sustainable Computing and Smart Infrastructure, Vol. 9.
