Volume 8, Issue 4, April – 2023 International Journal of Innovative Science and Research Technology
ISSN No:-2456-2165
IoT BASED HEALTHY TOILET
Advaith P. K Sourav Govindadas
Department of Computer Science and Engineering Department of Computer Science and Engineering
College of Engineering, Thalassery College of Engineering, Thalassery
Kannur, Kerala Kannur, Kerala
Akhil A Yadhukrishna Sreekumar
Department of Computer Science and Engineering Department of Computer Science and Engineering
College of Engineering, Thalassery College of Engineering, Thalassery
Kannur, Kerala Kannur, Kerala
Asha Vijayan
Prof., Department of Computer Science and Engineering
College of Engineering, Thalassery
Kannur, Kerala
Abstract:- Toilets are an essential amenity for comfortable environment inside the toilet while keeping
maintaining good hygiene and sanitation, but the build- energy consumption to a minimum. The system is integrated
up of unclean emissions and frequent use can lead to with a mobile app that allows the owners/cleaners to check
poor indoor air quality. This project aims to develop an occupancy and air quality .
IoT-based toilet system that uses sensors to detect air
quality and alert cleaners or owners when it is time The project has significant implications for
for cleaning. The system consists of a microcontroller maintaining the cleanliness and excellent air quality in
connected to air quality and motion sensors. A cloud- public/private toilets, improving the user experience, and
based algorithm analyzes the data to determine when reducing the spread of infections. This project is also
cleaning is needed, while an exhaust fan maintains a expected to have a positive impact on the environment by
comfortable environment and energy efficiency. The reducing the use of cleaning chemicals and minimizing
system can also integrate with a mobile app to check energy consumption.
occupancy and air quality. By improving cleanliness and
air quality in public/private toilets, this project can II. MOTIVATION
enhance user experience and reduce the spread of
infections. The motivation for developing an IoT-based toilet system
is primarily driven by the need to maintain good hygiene
Keywords:- IoT, Sensors, Air Quality, Microcontroller, and sanitation in public and private toilets. Public toilets
Infection Control. are commonly used in densely populated areas, workplaces,
and public spaces. However, public toilets can be
I. INTRODUCTION sources of harmful gases and unpleasant odors, which
can lead todiscomfort and health risks for users.
In today’s world, maintaining proper hygiene and
sanita- tion in public toilets is of utmost importance to III. RELATED WORKS
prevent the spread of diseases and ensure a safe and healthy
environment. However, it can be challenging to maintain Several studies have explored the use of IoT-based
good indoor air quality in toilets due to frequent use and systems to improve sanitation and hygiene in public spaces.
unclean emissions. To address this issue, a new IoT-based For example, the paper [3] developed an IoT-based smart
toilet system is being developed, which uses sensors to toilet system that integrates sensors and data analytics to
detect the air quality inside the toilet and alert the toilet monitor and optimize water usage and quality, while also
attendants or owners when it is time for cleaning. providing real-time feedback to users. Similarly, the paper
[4] proposed an intelligent restroom system that uses sensors
The IoT-based toilet system comprises a and machine learning algorithms to predict toilet occupancy
microcontroller that is connected to a set of sensors, and reduce waittimes for users.
including air quality sensors(MQ-7 and MQ-135), and
motion sensor. The mi- crocontroller uses a cloud-based Other researchers have focused on the use of gas
algorithm to analyze the sensor data and determine when the sensors to monitor indoor air quality and detect hazardous
toilet needs cleaning. Additionally, the system operates an pollutants. For instance, the paper [1] designed an IoT-based
exhaust fan based on the air quality data, maintaining a air quality monitoring system that uses multiple sensors to
IJISRT23APR2170 www.ijisrt.com 1960
Volume 8, Issue 4, April – 2023 International Journal of Innovative Science and Research Technology
ISSN No:-2456-2165
measure various indoor pollutants, including carbon
monoxide and ni- trogen dioxide. Similarly, the paper [2]
developed a gas sensor network that uses machine learning
techniques to classify and identify different types of gas
emissions in a variety of indoor environments.
While these studies provide valuable insights into the
devel- opment and implementation of IoT-based systems for
public spaces, they often focus on specific aspects of the
problem, such as water usage or gas detection, and may not Fig. 1. ESP-32
address the full range of challenges faced in public
restrooms. In contrast, our proposed system aims to provide
a comprehensive solution to improve the air quality and
cleanliness of public and private toilets by integrating MQ-7
and MQ-135 gas sensors, a cloud- based server using
Firebase, and a mobile app.
IV. HARDWARES AND SOFTWARES USED
In this section, we provide a brief overview of the Fig. 2. MQ-7
hardwaresand softwares used our proposed system.
offices, and other indoor environments. The sensor can
A. Hardwares detect the presence of a wide range of gases, including
ESP-32: ESP32 is a low-cost, low-power system on a ammonia, nitrogen oxides, and carbon dioxide, as well as
chip (SoC) microcontroller with integrated Wi-Fi and other organic compounds.
Blue- tooth capabilities.Shown in Figure 1. It is widely
used in IoT applications due to its versatility and The MQ-135 sensor operates on the principle of metal
compatibility with various sensors and modules. . oxide semiconductor (MOS) technology, similar to the
MQ-7 Carbon Monoxide Sensor: The MQ-7 carbon MQ-7 and MQ-136 sensors. When the sensor is exposed to
monoxide sensor is a low-cost gas sensor that is widely a gas, the gas molecules interact with the MOS material,
used for indoor air quality monitoring. The sensor can causing a change in the resistance of the sensor. This
detect carbonmonoxide (CO) concentrations in the change in resistance is then measured and converted into a
range of 20 to 2000parts per million (ppm), with a voltage signal, which can be processed by a microcontroller
response time of less than 10 seconds. The MQ-7 or other electronic device. The MQ-135 sensor has a
sensor is based on a metal oxide semiconductor (MOS) detection range of 10 to 300 ppm for ammonia (NH3)
technology and operates on low power, making it an and a response time of less than 10 seconds. The sensor
ideal choice for battery-powered IoT devices. also has a high sensitivity to other gases, such as nitrogen
oxides (NOx), carbon monoxide (CO), and organic
MQ-135 Gas Sensor: In addition to the MQ-7 sensor, compounds, making it a versatile choice for indoor air
we also used the MQ-135 gas sensor in our system to quality monitoring.
detect the presence and concentration of other gases in
the restroom environment. The MQ-135 sensor is a In our system, we used the MQ-135 sensor to
low-cost gas sensor that is commonly used for air detect the presence of ammonia and other gases in the
quality monitoring in homes, restroom environment. The sensor was connected to the
ESP32 micro- controller, which processed the sensor data
In this project, we used the ESP32 microcontroller to and transmitted it to the Firebase real-time database for
collect data from the gas sensors and transmit it to the storage and analysis. By monitoring the levels of ammonia
Firebase database. We programmed the ESP32 using the and other gases in the restroom environment, our system can
Arduino Integrated Development Environment (IDE). The help to improve indoor air quality and ensure the safety and
ESP32 was connected to the gas sensors using analog comfort of restroom users.
input pins, and the sensor data was processed and
transmitted to the Firebase database using the ESP32 Wi-Fi
module.
IJISRT23APR2170 www.ijisrt.com 1961
Volume 8, Issue 4, April – 2023 International Journal of Innovative Science and Research Technology
ISSN No:-2456-2165
B. Softwares In addition to the code editor, the IDE includes a serial
monitor that allows the user to communicate with the
Arduino board via the serial port. This is useful for
debugging purposes and for sending and receiving data to
and from the board.
The IDE also includes a library manager that
allows the user to easily download and install libraries,
which are pre- written code that can be used to extend
the functionality of the Arduino board. These libraries can
be searched and downloaded from a centralized repository
Fig. 3. MQ-135 within the IDE, making it easy to find and use them in a
project.
Firebase: Firebase is a mobile and web application
development platform developed by Google. It provides a Overall, the Arduino IDE provides a simple and
suite of services for building and managing mobile and powerful development environment for programming
web appli- cations, including real-time databases, Arduino boards, making it accessible to both beginners and
authentication, hosting, and cloud storage. Firebase experts alike.
allows developers to build scalable and reliable
applications quickly and easily, with minimal setup and V. PROPOSED METHODOLOGY
configuration required.
In this section, we describe the proposed methodology
In our project, we used Firebase to store and for the system. Our system uses two gas sensors, MQ-7 and
manage data from our IoT sensors. Specifically, we utilized MQ-135, to measure carbon monoxide and ammonia,
Firebase Realtime Database to store the real-time sensor respectively. These sensors were chosen because they are
data and Firebase Cloud Functions to process the data and low-cost, small in size, and provide accurate readings for
trigger alerts based on predefined thresholds. We also the target gases.
utilized Firebase Authentication to secure access to the data
and Firebase Hosting to host our web-based dashboard A. Sensor Calibration
for viewing andanalyzing the sensor data. Before deploying the sensors, they were calibrated
using a gas calibration chamber to ensure accurate and
Firebase provided us with a robust and reliable consis- tent readings. The calibration process involved
platform for managing our sensor data, processing it in real- exposing the sensors to known concentrations of carbon
time, and visualizing it in a user-friendly dashboard. Its ease monoxide and ammonia gases, and recording the output
of use and integration with other Google services allowed us voltage from the sensors. These calibration data were used
to quickly develop and deploy our IoT-based toilet to develop a linear regression model for converting sensor
monitoring system. output voltage to gas concentration.
Flutter: Flutter is an open-source mobile application B. System Architecture
development framework developed by Google. It allows Our proposed system architecture is shown in
de- velopers to build high-performance, natively Figure 4. The system consists of the two gas sensors, an
compiled appli- cations for mobile, web, and desktop ESP32 mi- crocontroller, and a Firebase database and web
platforms from a single codebase. Flutter provides a rich application for data storage and visualization. The ESP32
set of pre-built widgets and tools, making it easy for microcontroller is responsible for reading the sensor data
developers to create beautiful and responsive user and transmitting it to the Firebase database via Wi-Fi.
interfaces. Additionally, Flutter offers hot reload
functionality, allowing developers to make changes to
the code and see the results instantly, speeding up the
development process. With its fast development cycle
andability to target multiple platforms, Flutter is an ideal
choice for building cross-platform IoT applications,
including ourproposed toilet system.
Arduino IDE: The Arduino IDE is an open-source soft-
ware development environment used for writing,
compiling, and uploading code to Arduino boards. It
supports multiple programming languages, including C Fig. 4. Proposed System Architecture
and C++, and provides a user-friendly interface for
writing and debugging code. The IDE includes a code C. Features of the Proposed System
editor with features such as syntax highlighting, code Our proposed system is designed to continuously
completion, and error highlighting, making it easy to monitor the air quality inside a toilet and maintain a
write and debug code. comfortable and healthy environment for the users. The
IJISRT23APR2170 www.ijisrt.com 1962
Volume 8, Issue 4, April – 2023 International Journal of Innovative Science and Research Technology
ISSN No:-2456-2165
system includes several features that work together to integrated health monitoring system (IHMS) using
achieve this goal: smart triboelectric pressure sensors and image sensor ,
Wireless Control of Exhaust Fan: The system analyzes 2021
air quality data collected from multiple sensors and
wirelessly controls the exhaust fan to maintain a
comfortable and healthy environment inside the toilet.
This approach is very efficient and consumes minimum
energy.
Machine Learning-Based Data Analysis: Using machine
learning algorithms, the system further analyzes the air
qualitydata to continuously monitor the ability of the
exhaust fan and ventilation system to maintain a healthy
environment. If the pollution level goes above a certain
threshold and the exhaust fan and ventilation system fail
to maintain a healthy environment, a manual cleaning
request is sent to the email of the cleaning person or
authority.
Color-Coded Status Indicators: Based on the condition
of the inside air, the system produces a color signal to
inform the user whether the toilet is safe to use or not. A
green light means that the toilet environment is safe and
comfortable to use. A yellow light means that the air
quality is not good enough, and the user should wait
until the exhaust fan returns it back to a better
condition. A red light means that the toilet is not usable
until a person cleans it.
In summary, our proposed system provides a
comprehensive solution for monitoring and maintaining the
air quality inside a toilet. With its wireless control of the
exhaust fan, machine learning-based data analysis, and
color-coded status indicators, it ensures a comfortable and
healthy environment for the users while minimizing energy
consumption.
VI. CONCLUSION
In this paper, we proposed an IoT-based system for
mon- itoring indoor air quality using low-cost gas sensors
and a Firebase database and android application. Our
experiments showed that the system was able to accurately
measure the concentrations of carbon monoxide and
ammonia gases and detect changes in gas concentration
levels over time. The system has the potential to provide
real-time monitoring of indoor air quality, which is critical
for ensuring the health and safety of occupants in indoor
environments.
REFERENCES
[1]. Kurubaran A, Varun Krishna S, Vignesh K, Bhaskaran
A, ”Air Pollution Monitoring System using Android
Application,” 2017
[2]. Huirong Luo, Li Wang and Xiangcheng Wu, ”Design
of indoor air quality monitoring system based on
wireless sensor network,” 2018.
[3]. Farzana Shaikh, Feza Shaikh, Khadija Sayed, ”Smart
Toilet Based On IoT,” 2019
[4]. Zixuan Zhang , Qiongfeng Shi , Tianyiyi He , Xinge
Guo, Bowei Dong , Jason Lee , Chengkuo Lee
.Artificial intelligence of toilet (AI-Toilet) for an
IJISRT23APR2170 www.ijisrt.com 1963