IoT CO₂ Monitoring for Healthy Homes
IoT CO₂ Monitoring for Healthy Homes
INTRODUCTION
This low-cost, energy-efficient prototype is designed to function without the need for
manual switching or complex infrastructure. Instead, it offers intelligent automation
through IoT principles, and can be expanded for integration with mobile platforms like
Blynk or ThingSpeak for remote monitoring and notifications. By proactively managing
indoor air quality, “Smart Air” enhances overall well-being and supports
environmentally conscious living.
1
1.2 Motivation
The motivation for developing “Smart Air” stems from the growing awareness of the
impact of indoor air quality on human health. In enclosed spaces like living rooms,
kitchens, or home offices, CO₂ levels can accumulate due to poor ventilation, leading
to fatigue, headaches, reduced cognitive function, and long-term health issues.
Traditional ventilation solutions often lack automation, leaving air quality management
to guesswork or manual intervention.
This project is motivated by the need to create a low-cost, automated, and scalable
solution to monitor and neutralize CO₂ buildup in closed environments. By leveraging
IoT technology and chemical absorption techniques, the system offers real-time
detection and immediate response to elevated CO₂ levels.
What makes this system particularly innovative is its minimal reliance on costly
components. Instead of using bulky air purifiers or relay-based automation, “Smart Air”
leverages simple components like an MQ-135 sensor, a TIP120 transistor, and a misting
system, making it accessible for students, hobbyists, and low-budget smart home
implementations.
The project also reflects a strong interest in learning practical IoT implementation,
sensor integration, and real-world automation, encouraging further exploration into
home automation, environmental monitoring, and green technology.
2
1.3 Sustainable Development Goal of the Project
“Smart Air” aligns with the United Nations Sustainable Development Goal 3 (SDG 3):
Good Health and Well-being, and partially with SDG 11: Sustainable Cities and
Communities. By proactively monitoring and managing indoor CO₂ levels, the project
aims to reduce health risks associated with poor air quality and create a more sustainable
and livable indoor environment.
Additionally, this system promotes the use of low-cost materials and local assembly
techniques, enabling scalable implementations in developing regions or educational
setups. Its modular nature allows for future upgrades such as mobile app integration,
solar power adoption, and machine learning-based decision-making for even smarter
air regulation.
3
1.4 Product Vision Statement
1.4.1 Audience:
• Primary Audience:
o Urban residents and families concerned about indoor air quality in their living
spaces.
• Secondary Audience:
1.4.2 Needs:
• Primary Needs:
o Automated ventilation and misting system that activates when CO₂ levels
exceed safe thresholds.
o Instant visual or audio alerts to inform occupants about poor air quality
conditions.
• Secondary Needs:
o Integration with IoT platforms (ThingSpeak) for remote tracking and historical
data visualization.
4
1.4.3 Products:
• Core Product:
• Additional Features:
o Buzzer alerts for audio notifications when CO₂ exceeds safe thresholds.
1.4.4 Values:
• Core Values:
o Health & Safety: Promote better respiratory health by ensuring indoor air stays
within a safe CO₂ threshold.
• Differentiators:
o IoT Integration: Unlike basic CO₂ detectors, this system enables remote
monitoring, data logging, and smart alerts.
5
1.5 Product Goal
The primary goal of Smart Air: IoT-Driven CO₂ Balancing for Healthier Living Room is to
redefine indoor air quality management through a smart, affordable, and accessible IoT-based
solution that empowers individuals, families, and communities to actively monitor and regulate
the CO₂ concentration in their living spaces.
As urbanization intensifies and modern lifestyles lead to increased time spent indoors, the need
for clean, breathable indoor air has never been more critical. Poor indoor air quality, especially
elevated levels of carbon dioxide, has been scientifically linked to fatigue, headaches, reduced
cognitive function, and long-term respiratory issues. Despite the importance of air quality, most
households do not have real-time monitoring systems, primarily due to the high cost or
complexity of commercial solutions. Smart Air bridges this gap by delivering a DIY-friendly,
cost-efficient, and automated CO₂ management system designed specifically for domestic use.
At the heart of this project is an ESP8266-based microcontroller that reads CO₂ levels through
an MQ-135 sensor. When the detected levels exceed a predefined safety threshold (1000 ppm),
it automatically activates a fan and a mist sprayer via a transistor-based control mechanism. A
buzzer serves as an additional warning system to alert occupants instantly. This entire process
operates autonomously and requires no manual intervention, embodying the vision of a fully
automated, intelligent environmental control system for the home.
In the long term, the project aspires to evolve into a scalable, community-driven ecosystem,
where users can share data, collaborate on improvements, and adapt the platform to suit
different use cases—from classrooms and libraries to hospitals and co-working spaces. By
blending automation, IoT innovation, and community empowerment, Smart Air envisions a
future where air quality is monitored intelligently, managed automatically, and understood
universally.
Ultimately, the goal is to foster a culture of self-sufficient, tech-enabled indoor air safety.
"Smart Air" bridges the gap between everyday users and sophisticated air monitoring, making
healthy living smarter, more accessible, and more empowering—one breath at a time.
6
1.6 Product Backlog
#US 2 As a resident, I want the system to automatically activate the fan and misting pump
when CO₂ levels exceed 1000 ppm so that air can be balanced efficiently.
#US 3 As a user, I want the buzzer to alert me whenever CO₂ levels are dangerously high
so that I get an immediate warning.
#US 4 As a user, I want the system to operate without internet so that it can run
independently in offline conditions.
#US 5 As a homeowner, I want to receive alerts on my phone through Blynk (optional) so
that I can monitor CO₂ remotely.
#US 6 As a user, I want the system to log data to a local SD card or cloud storage
(optional) so that I can analyze air quality trends over time.
#US 7 As a developer, I want to connect the 12V pump and fan safely to the ESP8266
using a transistor and diode so that the system remains electrically protected.
#US 8 As a builder, I want a simple circuit diagram for setting up the CO₂ system on a
breadboard so that it is easy to prototype and test.
#US 9 As a maintainer, I want the sensor to stabilize during startup so that I get accurate
readings post warm-up.
Each user story consist of necessary parameters like MoSCoW prioritization, Functional and
non-functional parameters, detailed acceptance criteria with linked tasks.
7
1.7 Product Release Plan
The release plan for the project Smart Air: IoT-Driven CO₂ Balancing for Healthier Living
Room follows an incremental and iterative development approach. It is structured into three
progressive releases. Each release builds upon the previous one by adding features and
improving usability, stability, and performance. The releases are aligned with the Agile
methodology and focused on delivering working, testable versions of the product at every
stage.
• Objective: Develop a basic system to monitor CO₂ levels and activate alert
mechanisms.
• Features Delivered:
• Testing:
• Features Delivered:
8
o Accurate mapping of analog sensor values to ppm for better user insight
• Outcome: Enhanced user interaction with visual real-time data; system performance
becomes more efficient and readable.
• Testing:
• Features Delivered:
o Display of historical data and live ppm values on a mobile app or dashboard
• Outcome: A complete smart monitoring solution with both local and remote
accessibility.
• Testing:
Final Deliverables
• Demonstration video.
9
CHAPTER 2
2.1 SPRINT 1
The following table 2.1 represents the detailed user stories of the sprint 1
10
2.1.2 Functional Document
[Link]. Introduction
The "Smart Air: IoT-Driven CO₂ Balancing for Healthier Living Room" project is focused
on designing and implementing a smart environmental control system that continuously
monitors indoor CO₂ levels and autonomously regulates air quality. Leveraging Internet of
Things (IoT) technology and low-cost sensors, this project provides a real-time response
system that activates ventilation and misting when carbon dioxide concentration exceeds a
defined threshold. The main objective is to improve air quality and ensure a healthier indoor
environment, especially in closed spaces like living rooms where CO₂ accumulation can go
unnoticed.
The primary goal of the Smart Air project is to create an efficient, fully automated CO₂
monitoring and neutralization system that enhances air quality in enclosed spaces. The platform
aims to:
• Continuously monitor real-time CO₂ levels using the MQ-135 gas sensor.
• Activate air-purifying mechanisms like a fan and mist sprayer when CO₂ exceeds safe levels.
• Provide both audible (buzzer) and visual alerts to indicate poor air quality.
• Operate autonomously without manual switching, ensuring constant indoor air balance.
Users:
Location:
• Target Location: Primarily urban indoor settings globally, especially in regions with
poor natural ventilation, high population density, or environments where individuals
spend extended hours indoors.
11
[Link]. Business Processes
• On startup, the MQ-135 gas sensor is warmed up and calibrated for stable readings.
• The ESP8266 microcontroller reads CO₂ values every second and converts analog
readings to estimated PPM.
3. Automated Actuation:
• If CO₂ levels exceed 1000 ppm, the fan and mist pump (connected through a transistor
switch mechanism) are triggered alongside a buzzer.
• The system uses transistor-controlled switching to safely operate 12V components from
the 3.3V logic level of the ESP8266, preventing direct load and ensuring durability.
[Link]. Features
• Description: The system reads analog values from the MQ-135 and approximates them
to CO₂ PPM.
• User Story: As a homeowner, I want to track indoor air quality in real-time so I can
maintain a healthy environment.
• Description: When CO₂ exceeds a preset threshold, the fan and misting system are
automatically activated.
• User Story: As a user, I want the system to automatically improve air quality without
needing my intervention.
12
• Description: A buzzer provides real-time feedback when unsafe CO₂ levels are detected.
• User Story: As a user, I want an audible alert when the air quality drops, so I’m
immediately aware of the situation.
• Description: The use of TIP120 transistor and diode protects the system while safely
switching 12V devices.
• User Story: As a system builder, I want the ESP8266 to control high-power devices
without damaging it.
End User Monitors CO₂ levels and receives alerts. Can view system status and feedback.
[Link]. Assumptions
13
2.1.3 Architecture Document
[Link]. Application
Modular Components:
The "Smart Air" platform follows a modular and layered architecture that separates sensing,
control, and communication concerns. This structure ensures scalability, easy maintenance, and
seamless integration with IoT and mobile platforms. The major components include:
• Sensing Layer (MQ-135 CO₂ Sensor): Responsible for real-time environmental data
acquisition, specifically air quality with a focus on CO₂ levels. The analog data is
continuously sampled by the ESP8266 microcontroller to estimate CO₂ concentration.
• Control Layer (ESP8266 Microcontroller): Acts as the central processing unit of the
system. It processes the raw sensor data, determines whether actions need to be taken
(e.g., fan and pump activation), and triggers connected actuators accordingly.
• Actuation Layer (Fan, Pump, Buzzer): Activated when CO₂ levels exceed a critical
threshold (1000 ppm). The fan and pump (connected via a single control line and driven
through a TIP120 NPN transistor using a 12V external power source) ventilate and
neutralize the air. The buzzer alerts users to unhealthy conditions.
14
[Link]. Data Exchange Contract:
• Event-Triggered Actuation:If the CO₂ reading exceeds the defined safety threshold
(1000 ppm), the actuators are instantly triggered.
Data Sets:
• Sensor Data:Includes raw analog values from the MQ-135, mapped approximately to
ppm values. Used for real-time decision making.
• Actuator State Data:Includes system status (e.g., Fan ON/OFF, Buzzer ON/OFF),
which can optionally be sent to a remote IoT dashboard.
Mode of Exchanges:
15
2.1.4 UI DESIGN
Figure 2.3 Side view image of model Figure 2.4 Front view image of model
16
2.1.5 Functional Test Cases
Steps to
Test Expected Actual More
Feature Execute Status
Case Output Output Information
Test Case
1. Power on
Test
system TIP120
automatic
2. Introduce transistor
activation Fan and pump
CO₂ source Working controls both
Fan & Pump of fan and turn ON when
(e.g., breath as fan and pump
Activation pump CO₂ exceeds Pass
or candle) expected via single
above 1000 ppm
3. Observe ESP8266
1000 ppm
fan/pump GPIO
CO₂
activation
1. Power
system
Test
2. Simulate Buzzer sounds Working Buzzer is
buzzer
Buzzer Alert CO₂ > 1000 when ppm > as directly driven
alert on Pass
ppm 1000 expected by ESP GPIO
high CO₂
3. Listen for
buzzer
1. Disconnect
Test
Wi-Fi System still System Offline
system
Offline 2. Power functions operates capability is
operation
Functionality system locally (fan, fully Pass core to safety
without
3. Simulate pump, buzzer) offline assurance
internet
high CO₂
1. Use
multimeter or
Readings Sensor
Validate gas monitor
CO₂ values in map requires warm-
mapped for
CO₂ Reading ppm range correctly, up and
analog comparison
Accuracy between 400- around Pass calibration for
CO₂ 2. Compare to
5000 65 ppm improved
readings analogRead +
ambient accuracy
mapping
output
17
2.1.6 Daily Call Progress
Sensor delay
Wrote base firmware for
Day 3 Completed needed
ESP8266 using analog mapping
stabilization
Ensured all
Functional testing of buzzer, fan,
Day 5 Completed components
and mist spray control
power correctly
Blynk setup
Day 7 Documentation, sprint wrap-up Completed moved to next
sprint
18
2.1.7 Committed Vs Completed User Stories
19
2.1.8 Sprint Retrospective
Hands-on
Using analog Cloud logging Optional fail-safe
hardware
sensors with simple and historical with battery backup
integration
mapping data analysis or watchdog reset
experience
20
2.2 SPRINT 2
The main objective of Sprint 2 is to ensure the secure and efficient integration of hardware
components—particularly the 12V fan and misting pump—with the ESP8266
microcontroller. This sprint also focuses on ensuring sensor stability during boot-up and
optimizing the source code for memory constraints of the ESP8266.
As a developer, I want to connect the 12V pump and fan safely to the ESP8266
#US 7 using a transistor and diode so that the system remains electrically protected from
overcurrent or voltage spikes.
As a builder, I want a simple and clear circuit diagram for setting up the CO₂
#US 8 system on a breadboard so that I can easily assemble, prototype, and debug it
during development.
As a student, I want the Arduino code to be optimized for memory usage so that it
#US 10
fits into the ESP8266's limited RAM and avoids runtime crashes or instability.
21
2.2.2 Functional Document
[Link] Introduction
In Sprint 2 of the "Smart Air: IoT-Driven CO₂ Balancing for Healthier Living Room" project,
the focus is placed on secure hardware implementation and internal software stability. This
sprint aims to bridge the gap between safe physical design and efficient software
management, ensuring that the system runs consistently and safely. Key aspects include
proper handling of power-hungry components like the fan and pump, accurate data
acquisition from the sensor, and fitting the codebase within the microcontroller’s limited
memory resources.
The product goal for this sprint is to solidify the hardware infrastructure, validate sensor
accuracy through proper warm-up, and streamline the code logic for efficient memory usage.
The aims are as follows:
• Securely interface the 12V fan and mist pump to the ESP8266 using electronic safety
components (TIP120 transistor, flyback diode, and resistor).
Users:
Location:
• Home workshops, school labs, university projects, and IoT training centers.
22
1. Safe Actuator Control:
o The 12V fan and pump are powered externally but activated using ESP8266’s
GPIO through a TIP120 transistor,100Ω base resistor ensures proper current
control & 1N4007 diode is connected in reverse across the motor terminals to
absorb flyback voltage and protect circuitry.
o On system start, the MQ-135 sensor is allowed a 1–2 minute warm-up phase
before using the readings.
4. Code Optimization:
[Link] Features
• Description: Ensures that 12V devices like pumps and fans are safely switched using
low-voltage control logic from ESP8266 without causing backflow or damage.
• User Story: As a developer, I want a protected circuit with transistors and diodes to
ensure my components do not burn out.
• User Story: As a builder, I want a straightforward visual guide to avoid wiring errors
and speed up testing.
• Description: The system waits for the MQ-135 to stabilize, preventing inaccurate CO₂
readings during the initial boot-up.
23
• User Story: As a maintainer, I want to avoid false CO₂ alarms during system startup
by letting the sensor calibrate properly.
• User Story: As a student, I want the code to be efficient and lightweight so it runs
properly on ESP8266 boards with limited memory.
System Can design the circuit, write optimized code, and test ESP8266
Developer integration.
Can view the breadboard diagram, assemble the hardware, and test
Builder
functionality.
Can upload code, learn from circuit visuals, and experiment with system
Student/Learner
tuning.
[Link] Assumptions
• The external 12V adapter supplies enough current for both the fan and pump.
• TIP120 and 1N4007 are rated correctly for the voltage and current requirements of
actuators.
• Breadboard pins and jumper wires are of sufficient quality to carry power and signal
without voltage drops.
24
2.2.3 Architecture Document
o Handles 12V source distribution to fan and pump & Prevents microcontroller
overload via TIP120 transistor and diode-protected circuits.
o A clear, compact wiring system where all modules are easily testable.
o Implements warm-up delay and stabilization logic for reliable CO₂ detection.
25
[Link] Data Exchange Contract
• Actuation Triggers:
o Triggered only when CO₂ readings exceed the 1000 ppm threshold.
• Startup Behavior:
• Code Behavior:
26
2.2.4 UI DESIGN
27
2.2.5 Functional Test Cases
All Labeled
Neat circuit
Assemble complete CO₂ components breadboard
Validate fits on
Breadboard circuit including sensor, working as layout helps
breadboard breadboard Passed
Circuit fan, pump, and buzzer on expected in future
layout with proper
breadboard. and layout hardware
functioning.
is clean. testing.
First
Initial delay Warm-up
readings
Test sensor Add 20-second delay in occurred, ensures
Sensor start after
stabilization code before first reading. first Passed accuracy of
Warm-up 20s, giving
delay Monitor output. reading was MQ-135
stable CO₂
consistent. readings.
values.
Code
compiles
and runs
Optimize RAM Optimization
Refactor code, remove within
code to ~35%, was crucial
Memory unnecessary strings, move ESP8266's
lower IRAM Passed due to
Optimization logic to FLASH via 80 KB
IRAM/RAM ~92%, code hardware
ICACHE_FLASH_ATTR. RAM and
usage stable. constraints.
64 KB
IRAM
limits.
28
2.2.6 Daily Call Progress
29
2.2.7 COMMITTED Vs COMPLETED USER STORIES
30
2.2.8 Sprint Retrospective
31
CHAPTER 3
A major outcome of this project is the development of a user-centric interface that caters to
both tech-savvy users and individuals with minimal technical experience. The system
leverages the Blynk IoT platform to provide users with a clean, interactive mobile dashboard
that allows real-time monitoring and control. Features include:
Another significant outcome of the system is the real-time data acquisition and alert
mechanism. The MQ-135 gas sensor continuously reads the CO₂ concentration inside the
room and sends the data to the ESP8266 microcontroller, which then transmits it to the Blynk
platform. This enables:
• Automatic notifications to the user’s mobile device when levels rise above the 1000
ppm threshold
• Visual and audible alerts via an onboard buzzer to complement mobile warnings
32
Fully Automated Fan & Spray Activation for Air Neutralization
The Smart Air system features automated hardware response to elevated CO₂ levels. When
CO₂ concentration exceeds the safe limit, the ESP8266 microcontroller triggers both a fan
and a mini mist sprayer or water pump (connected through a TIP120 transistor and powered
by a 12V external source). This combined response works to:
33
CHAPTER 4
Conclusion:
The Smart Air: IoT-Driven CO₂ Balancing for Healthier Living Room project presents a robust
and thoughtfully engineered solution to address the growing concern of indoor air pollution,
specifically elevated levels of carbon dioxide (CO₂). This IoT-powered system ensures real-
time detection of CO₂ levels, automates necessary interventions through fan and mist-based
neutralization systems, and enhances user awareness via live data feedback through both local
interfaces and remote dashboards. It caters particularly to environments where maintaining
clean, breathable air is critical—such as homes with children, elderly individuals, or individuals
with respiratory sensitivities.
The system is powered by the ESP8266 microcontroller and utilizes the MQ-135 gas sensor
for continuous CO₂ detection. When CO₂ concentrations rise above the preset threshold (e.g.,
1000 ppm), the system autonomously activates both the ventilation fan and mini mist sprayer
via a transistor-switched 12V power line, along with an alerting buzzer driven directly from
the microcontroller. This immediate response helps maintain indoor air quality without any
manual intervention, showcasing the potential of low-cost, efficient environmental automation.
Integration with cloud services and IoT platforms such as Blynk (or future integrations like
Thingspeak or Home Assistant) allows users to remotely monitor live CO₂ levels, receive
mobile notifications during high CO₂ events, and even control the system settings through a
mobile interface. This not only enhances usability but also empowers users with data to make
informed lifestyle and ventilation decisions.
Future Enhancements:
Despite its success in achieving the core objectives, this project also lays the foundation for
several exciting future enhancements that could increase its impact, efficiency, and adoption:
34
o Add automatic baseline calibration for long-term stability.
3. Multi-Gas Monitoring
o Extend the system to monitor other air quality indicators such as volatile organic
compounds (VOCs), carbon monoxide (CO), temperature, and humidity.
o Introduce an automated cleaning cycle for the misting system to ensure long-
term maintenance-free operation.
In conclusion, Smart Air: IoT-Driven CO₂ Balancing for Healthier Living Room demonstrates
how innovative, affordable, and modular technology can be used to improve human health and
comfort in indoor environments. The project's commitment to automation, environmental
awareness, and user-centric design makes it a pioneering solution in the realm of health-focused
smart home systems. With future upgrades and continued refinement, it has the potential to
become a widely adopted standard in residential and educational infrastructure where air
quality plays a vital role in well-being.
35
APPENDIX
36
B. SAMPLE CODING
37
38
C. PLAGIARISM REPORT
39