The ioT Hygiene Ecosystem is the one of the smartest method which build up the public trusts in toilets using IoT sensors, real-time hygiene scoring, and automated sanitation actions we can detect the overall severity with helps public to trust the Public toilets.
The project targets urban, rural, and the private and public toilets under India's Swach Bharat Mission (SBM) which was introduced by our country Prime Minister, Narendra Modi .
Complete toilet hygiene management system:
- Real-time Hygiene Monitoring: Tracks the overall hygiene for the every 5 minutes .
- AI-Powered Prediction: Can predict the overall condition with the help of Iot Devices.
- Automated Staff Management: Cleaners will be assigned the work accordingly .
- Public User Experience: Interactive maps and real-time facility information
- Multi-stakeholder Dashboards: Separate interfaces for public, staff, and administrators
India has a great number of toilets , but ** people still not able to trust the public toilets**.
- 95%+ villages are ODF Plus certified which actually mean " Universal Toilet access , safe disposion and no visible excreta"
- There are only 10- 9% people which trust the public toilet and it's maintainance
- 68% people are not trusting the public toilet
- Root cause: Physcological reasons due to bad small, dirty floors and no water supply or damaged water supply.
We convert a public toilet into a "Living Smart service" that:
- That detects the overall severity/hygiene before users arrive
- Automatically access the data and calculate and predicts the ovell severity IoT-driven actions
- Displays a real-time Hygiene outside the toilet
- Makes sure the toilet is clean and free to use pre-entry validation
Figure: The DFD shows the architecture of the overall idea which shows IoT data acess , AI automation and automation layers.
Figure: The confusion matrix (random forest).
The code insure that the sensors are properly connected to the module and providing us the data as required by the AI model to be trained and reply with the proper information.
The code insure that the nodes will be connected to the other nodes if wifi range is not applicable there . if there is certain problem with he wifi the nodes automatically chnages the wifi path like an network topology.
Important update :- AI model Performace increase by 30%.
- Ammonia and bad odor live detection.
- Water and soap level tracking
- Touchless usage detection
- Live hygiene scores is displayed.
- Last cleaned / disinfected time is reflected upon the dashboard.
- Live locations of the toilet and the usability score will also mentioned throughout.
- Automatic odor detection , exhuast controls which will prevents the manual controls.
- UV-light sterlization,when user will levae the washroom.
- Live Ph level test of the wwater.
- Panic/help button if necesarry.
- Slip detection (for future).
- Privacy Protection no camera being used there .
We conducted a 10-point survey to identify what users fears of :
- Fear of bad smell of dirsty floors.
- Lack of water supply.
- Anxiety to touch any surface.
- Willingness to pay for guaranteed hygiene
- If they actually trusts in the Hygiene score .
Insight: Smell is the only one which basically effects the user first
| Sensor | Purpose |
|---|---|
| MQ-135 / MQ-137 | Ammonia & odor detection |
| PIR Sensor | User presence detection |
| Ultrasonic Sensor | Water tank level |
| Flow Sensor | Water & soap usage |
| UV-C Module | Post-use sterilization |
- High-speed exhaust activation
- Odor detection and activation fo exhaust fan.
- UV sterilization after user exits the toilet.
- Workers get the notification for cleaning the toilet.
- Solar-powered IoT
- LoRaWAN communication
- Low-internet dependency
- Can be applied in the cafes for more effectiveness.
- Pay-per-use with guaranteed cleanliness
- Live soap usage.
- Overall alert to the workers will be notified .
- Child hygiene assurance .
- User will be informed of the overall conditon of the waashroom before entering
- Remove the mental block that stops people from using the wash place
- One QR code that every visitor, local or foreign, scans to see the site's hygiene rules
- Build the wash area so the layout itself tells people what to do next
- Increased public toilet usage in the area.
- Reduced health risks and infections
- Higher citizen satisfaction scores which will build the trust among the people
- Live data will be showed in the dashboard .
- Together with Super Swachh League mission(2025).
- AI-based hygience prediction will be an amazing turn to this feild.
- Mobile app for hygiene navigation and the prediction.
- Government dashboard integration
- Predictive maintenance alerts to the workers which will increase efficiency of the public washrooms.
Public toilers need more Digital Trust rather than the infrastructure it created.
The IoT Hygiene Ecosystem builds trust between:
"There is a toilet"
and
"I feel safe using this toilet."
Developed as part of a Hackathon Project mainly focusing upo on the
IoT + AI for Public Health & Smart Infrastructure
This project is developed for educational and hackathon purposes.
- Main Application:
enhanced_auth_app.py- Flask application with real-time updates - AI Model Infrastructure: See
ai_model/directory for complete ML pipeline - IoT Integration: Sensor data processing and automation
- Multi-user Dashboards: Public, staff, and admin interfaces
# Install dependencies
pip install -r requirements.txt
# Start the main application
python enhanced_auth_app.py
# Access dashboards
# public: http://localhost:5000/public_dashboard_enhanced
# staff: http://localhost:5000/staff_dashboard
# admin: http://localhost:5000/admin_dashboard- Predictive Analytics: Hygiene degradation forecasting
- Real-time Monitoring: Continuous sensor data analysis
- Automated Alerts: Smart notification system --Task Management - The system hands out cleaning jobs and ranks them by urgency. -Route Optimization - It plans the shortest path from one dirty area to the next. -Performance Tracking - It counts how long each cleaner needs for a room. -Real-time Alerts - The phone buzzes the moment a spill needs mopping. -Supply Management - It watches the closet and warns when bleach or bags run low. -Communication Tools - Staff talk inside the app instead of hunting for radios.
- System Overview - A full set of readings that show whether the facility is healthy
- User Management - Each person receives a role - the role fixes what that person is allowed to do
- Historical Analytics - The system stores past data, draws trend lines and prints performance reports
- Configuration Management - One screen lists every setting and parameter - you change values there
- Integration APIs - The system offers open hooks so outside programs can connect and exchange data
- Security Monitoring - The system writes an audit log for every action and tracks who entered where
- Response Time: 5 minutes for the updation.
- Real-time Updates: 10 seconds delay for hygiene score.
- Uptime: 99% availability .
- Scalability: Supporta for the 1000+ users at a time.
- Data Processing: handle more than thousand reading od the sensors at particular time.
- Mobile Performance: well optimised for 4g / 5g Networks.
- Ammonia (23.9%) - Odor detection
- Water Flow (18.2%) - supply of water.
- Methane (16.9%) - gas presence
- pH (11.6%) - Water quality
- Footfall (9.2%) - Usage patterns
- Humidity (4.6%) - High humid more bacteria.
- Temperature (4.1%) - Check the room temperature.
- Performance Tracking: AI based tracking over the real data which is being supplied.
<<<<<<< HEAD
For detailed AI model information, watch the following link:- ai_model/README.md
## Dashboard Features & Performance
### Public Dashboard Features
- **Interactive Map**: Live location with the overall usablility of the toilets.
- **Live Updates**: every % minutes updates the conditon of the toilets.
- **GPS Integration**: will allows user to get the exact location of the toilets.
- **Detailed Information**: accessibility of the washrooms, occupancy status of the toilet.
- **User Ratings**: Feedback system for the improvement of the coal to be diamond.
- **Mobile Optimized**: Responsive design for all for all device screens.
### Staff Dashboard Capabilities
## Usage Examples
### Basic Prediction
```python
from hygiene_prediction_system import HygienePredictionSystem
# Load trained model
system = HygienePredictionSystem()
system.load_model('hygiene_model.pkl')
# Predict hygiene from sensor data
sensor_data = {
"ammonia": 45.0,
"methane": 35.0,
"humidity": 58.0,
"temperature": 24.0,
"footfall": 18.0,
"water_flow": 15.0,
"ph": 6.8,
"turbidity": 85.0
}
result = system.predict_hygiene(sensor_data)
print(f"Hygiene Score: {result['hygiene_score']}")
print(f"Status: {result['hygiene_status']}")
print(f"Explanation: {result['explanation']}")
# JSON API usage
json_input = '{"ammonia": 28.5, "methane": 22.1, "humidity": 61.2, "temperature": 26.8, "footfall": 12.3, "water_flow": 18.7, "ph": 7.0, "turbidity": 42.1}'
result = system.predict_hygiene(json_input)The system includes hard coded demo data and scenerios:
- low gas levels, optimal pH, high water flow
- Predicted Score: ~95 (Clean)
- medium readings of all the data average.
- Predicted Score: ~74 (Moderate)
- high ammonia or gas level , poor water PH quality, low flow of the water
- Predicted Score: ~55 (Dirty border)
- 40% Improvement: Increases the hygiene of the washrooms.
- 60% Faster Response: Faster response whether it is dahshbaord and the cleaning.
- 30% Cost Reduction: optimized uses of the devices .
- 95% User Satisfaction: A good user experience.
- 98% Compliance Rate: Extremely Usuable.
- Real-time Processing: 5 minutes updation of the washroom.
- High Accuracy: AI prediction with real and live data.
- Scalable Architecture: support the usage of the public washrooms.
- Mobile First: Optimized for smartphone access and for the screns of the every devices.
- Offline Capability: compitable with offline networks also .
- Efficiency Gains: Automated staff allocation and route optimization
- Cost Savings: Predictive maintenance and resource optimization
- User Experience: Enhanced public facility satisfaction.
- Data-Driven Decisions: Analytics and decisions.
- Algorithm: Random Forest Regressor
- Estimators: 100 trees
- Max Depth: 15 (prevents overfitting)
- Min Samples: 5 split, 2 leaf
- Sample Size: 3000+ realistic readings
- Correlations: Engineered based on hygiene science
- Validation: Realistic value ranges and distributions
- Training Time: <30 seconds on standard hardware
- Model Size: <1MB (lightweight deployment)
- Prediction Speed: <100ms per prediction
- End-to-End Encryption: Secure data transmission and storage of the data with proper encryption of data.
- User Privacy: The data of users remain private.
- Access Control: Multi-factor authentication .
- Audit Logging: activity tracking for security monitoring and privevntion against tampering.
- Data Anonymization: Personal data protection in analytics
- Intrusion Detection: Real time monitoring .
- Backup & Recovery: Automatic data backup.
- Network Security: Firewall protection and secure protocols
- Physical Security: Tamper-proof sensor installations
- Computer Vision: AI analysis and the predicton.
- Predictive Maintenance: Can predict if any node is not working and tells about the overall health of the node.
- Deep Learning Models: it enchances the prediction of the data.
- Behavioral Analytics: User pattern and detect the upcoming traffic of the peoplse and predict the severity.
- Autonomous Decision Making: automatically alerts the workers .
- Next-Gen Sensors: advanced sensor can be used for more accurate data.
- Energy Harvesting: Nodes and pair with each other to form an netowork also
- Edge AI: locally data can be calculted.
- 5G Integration: Due to 5g networks low latency is an great advantage.
- Mesh Networking: we can use various networking algorithm to connect with diconnect node.
- Multiple language Support: Multilingual.
- Regional Compliance: Makes sure of the privacy
- Cultural Adaptation: Region specified user experience is provided
- Global Analytics: Globaly analytics can be. used for the survey.
- Partnership Integration: Third party service connectivity for the betterment of eomployement.
This project is created for hackathon and demo purposes. Feel free to use,update and do whatever you thinks it will be benefit our code.
- Automated Updates: The system autmatically gets updated with the help of the sensors.
- Health Monitoring: system regulary checks the data regularly.
- Performance Optimization: Automatic and manually also the data can be calibrated.
- Data Management: Data will bew refresh and cleaned after certain period of time.
-
SBM Urban Aspirational Toilets ( SBM 2.0 )
https://sbmurban.org/aspirational-Toilets?hl=en-GB -
IoT based Hygiene monitoring System (ResearchGate, 2025)
https://www.researchgate.net/publication/393421913_An_IoT-Based_Hygiene_Monitoring_System_in_the_Restroom -
The Hindu Public Toilet Access & Cleanliness Gaps
https://www.thehindu.com/news/cities/kolkata/report-on-access-of-public-toilets-for-women-in-kolkata-reveals-huge-gaps-in-availability-safety-and-cleanliness/article70000810.ece -
Press Information Bureau (PIB) SBM Infrastructure & Funding (2024)
https://static.pib.gov.in/WriteReadData/specificdocs/documents/2024/sep/doc2024918396901.pdf
Team: Trinity - Smart Toilet Hygiene Monitoring System.





