0% found this document useful (0 votes)
6 views39 pages

IoT CO₂ Monitoring for Healthy Homes

The document introduces 'Smart Air', an IoT-based system designed to monitor and regulate CO₂ levels in indoor environments to promote healthier living conditions. It utilizes an ESP8266 microcontroller and an MQ-135 sensor for real-time detection, automatically activating ventilation and misting systems when CO₂ levels exceed safe thresholds. The project aims to enhance indoor air quality, align with sustainable development goals, and provide an affordable solution for urban residents and health-conscious individuals.

Uploaded by

sa1447
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
6 views39 pages

IoT CO₂ Monitoring for Healthy Homes

The document introduces 'Smart Air', an IoT-based system designed to monitor and regulate CO₂ levels in indoor environments to promote healthier living conditions. It utilizes an ESP8266 microcontroller and an MQ-135 sensor for real-time detection, automatically activating ventilation and misting systems when CO₂ levels exceed safe thresholds. The project aims to enhance indoor air quality, align with sustainable development goals, and provide an affordable solution for urban residents and health-conscious individuals.

Uploaded by

sa1447
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

CHAPTER 1

INTRODUCTION

1.1 Introduction to Smart Air: IoT-Driven CO₂ Balancing for


Healthier Living Room

“Smart Air” is an innovative IoT-based environmental monitoring and control system


designed to ensure healthy indoor air quality by detecting and regulating carbon dioxide
(CO₂) levels within a living room environment. With the increasing focus on smart
homes and wellness-centric living spaces, this project integrates real-time CO₂ sensing,
automatic ventilation, and misting mechanisms to maintain optimal air quality and
support healthier breathing conditions.

At the heart of this system is an ESP8266 microcontroller, interfaced with an MQ-135


gas sensor to monitor CO₂ concentrations. When the sensor detects that CO₂ levels
exceed a safe threshold (e.g., 1000 ppm), the system automatically activates a DC fan
and a misting pump powered by a 12V source to ventilate and neutralize the CO₂
buildup. Additionally, a buzzer provides audible alerts during high CO₂ conditions. The
system operates autonomously and takes readings every second to ensure rapid response
and continuous air safety.

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.

Furthermore, as people increasingly spend more time indoors—especially in post-


pandemic scenarios—the need for intelligent, affordable, and autonomous air quality
solutions becomes essential. This project addresses that need by building a smart CO₂
balancing system that not only detects hazardous levels of CO₂ but also takes immediate
action to restore safe conditions.

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.

The project encourages:

• Preventive Health: by reducing CO₂-related health issues.

• Smart Infrastructure: through automated air purification without human


intervention.

• Educational Value: promoting knowledge of IoT, electronics, and environmental


science among students and innovators.

• Energy Efficiency: using intelligent decision-making to power devices only


when necessary.

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.

By making indoor air management more intelligent, accessible, and eco-conscious,


“Smart Air” contributes to the creation of safer homes and smarter communities, driven
by sustainable and innovative technologies.

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.

o Health-conscious individuals aiming to maintain a cleaner, healthier indoor


environment.

• Secondary Audience:

o Environmental researchers or startups focusing on low-cost indoor air quality


solutions.

o Senior citizens or individuals with respiratory conditions who are sensitive to


poor air quality.

1.4.2 Needs:

• Primary Needs:

o A real-time monitoring system to track CO₂ concentration inside living rooms


or closed environments.

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.

o Power-efficient, memory-optimized embedded code suitable for ESP8266-


based microcontrollers.

o Modular hardware design that supports easy maintenance and upgrades.

4
1.4.3 Products:

• Core Product:

o A smart IoT-enabled CO₂ monitoring and neutralization system using the


ESP8266 microcontroller and MQ-135 sensor to detect high CO₂ levels, and
trigger actions like turning on a fan, mist sprayer, and buzzer for real-time
mitigation.

• Additional Features:

o A CO₂ concentration-to-PPM conversion algorithm optimized for low-memory


usage.

o Buzzer alerts for audio notifications when CO₂ exceeds safe thresholds.

o Future expandability for temperature/humidity sensing, mobile app alerts, or


machine learning-based air quality prediction.

1.4.4 Values:

• Core Values:

o Health & Safety: Promote better respiratory health by ensuring indoor air stays
within a safe CO₂ threshold.

o Affordability: Offer a low-cost, DIY-friendly solution accessible to students,


makers, and households.

o Sustainability: Reduce reliance on energy-heavy purification systems by


automating lightweight, targeted interventions.

• Differentiators:

o IoT Integration: Unlike basic CO₂ detectors, this system enables remote
monitoring, data logging, and smart alerts.

o Automated Neutralization: It doesn’t just detect high CO₂—it acts on it through


fan-based ventilation and chemical misting.

o No Relay Requirement: Uses direct DC load switching via transistor control,


avoiding the need for bulky relays or converters.

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

[Link] User Stories of AI E-Learning Application


#US 1 As a resident, I want the system to monitor CO₂ levels in real-time so that I can
maintain a healthy air quality in my living room.

#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.

#US 10 As a student, I want the code to be memory-optimized so that it fits in the


ESP8266's limited IRAM and RAM.
#US 11 As a developer, I want the system to be modular so that I can easily add other
environmental sensors (e.g., temperature, humidity) in future versions.

Table 1.1 User Stories of Smart Air: IoT-Driven setup


The product backlog for the Smart Air: IoT-Driven CO₂ Balancing for Healthier Living Room
project was configured using the MS planner Agile Board

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.

Release 1: Basic Sensing & Alert System

• Timeline: Week 1-4

• Objective: Develop a basic system to monitor CO₂ levels and activate alert
mechanisms.

• Features Delivered:

o Connection and calibration of MQ-135 sensor with ESP8266

o Real-time CO₂ ppm value reading (approximation via analog input)

o Threshold-based activation of buzzer, fan, and water pump

• Outcome: A fully functional standalone system capable of detecting elevated CO₂


levels and triggering appropriate hardware responses.

• Testing:

o Sensor accuracy and stability

o Fan/pump/buzzer response reliability

o Power supply efficiency

Release 2: Data Display & Optimization

• Timeline: Week 4-10

• Objective: Improve the interface and optimize system performance.

• Features Delivered:

o Code optimization to reduce IRAM usage and improve memory management

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:

o IRAM usage optimization

o Overall system load test

Release 3: IoT Integration & Cloud Connectivity

• Timeline: Week 9-12

• Objective: Enable remote monitoring and control through IoT platforms.

• Features Delivered:

o Integration with Blynk or ThingSpeak for remote CO₂ monitoring

o Display of historical data and live ppm values on a mobile app or dashboard

o Optional features like system on/off control via app

• Outcome: A complete smart monitoring solution with both local and remote
accessibility.

• Testing:

o Wi-Fi stability and reconnect logic

o Cloud communication latency

o Accuracy of dashboard readings vs. local sensor data

Final Deliverables

• Final hardware prototype on breadboard

• Finalized Arduino code with modular structure

• Project documentation (report, circuit diagram, code)

• Demonstration video.

9
CHAPTER 2

SPRINT PLANNING AND EXECUTION

2.1 SPRINT 1

2.1.1 Sprint Goal with User Stories of Sprint 1


The goal of Sprint 1 is to design, construct, and validate the initial working prototype of the
"Smart Air: IoT-Driven CO₂ Balancing for Healthier Living Room" system. This includes
implementing the core functionalities such as real-time CO₂ monitoring, autonomous
activation of ventilation (fan) and misting pump, as well as local alerting through a buzzer.

The following table 2.1 represents the detailed user stories of the sprint 1

Table 2.1.1 Detailed User Stories of sprint 1

[Link] Detailed User Stories


US #1 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 #2 As a user, I want the buzzer to alert me whenever CO₂ levels are dangerously high
so that I get an immediate warning.
US #3 As a user, I want the system to operate without internet so that it can run
independently in offline conditions.
US #4 As a homeowner, I want to receive alerts on my phone through Blynk (optional)
so that I can monitor CO₂ remotely.

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.

[Link]. Product Goal

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.

[Link]. Demography (Users, Location)

Users:

• Target Audience: Homeowners, smart home enthusiasts, health-conscious individuals,


IoT hobbyists, schools, offices, and elderly caregivers.

• User Characteristics: Technically diverse audience with an interest in environmental


quality and automated home solutions.

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

Key operational processes of this IoT system include:

1. Sensor Initialization and Calibration:

• On startup, the MQ-135 gas sensor is warmed up and calibrated for stable readings.

2. Real-Time CO₂ Monitoring:

• 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.

4. Power Management and Safety:

• 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

This project focuses on implementing the following key features:

Feature 1: Real-Time CO₂ Monitoring

• 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.

Feature 2: Automatic Ventilation Activation

• 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.

Feature 3: Audible Alerts for CO₂ Spike

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.

Feature 4: Safe Power Switching

• 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.

[Link]. Authorization Matrix


Table 2.1.2 Access level Authorization Matrix of sprint 1

Role Access Level

System Full access to hardware configurations, code updates, and real-time


Developer monitoring.

End User Monitors CO₂ levels and receives alerts. Can view system status and feedback.

Authorized to perform maintenance, adjust thresholds, and replace


Technician components.

Guest View-only access to system status through mobile dashboard or display.

[Link]. Assumptions

• The MQ-135 sensor will be calibrated in a relatively clean environment to establish a


reliable baseline.
• The ESP8266 will have stable power from USB or a 5V regulated source.
• All 12V components (fan and pump) will be connected through a safe switching
mechanism using a TIP120 transistor.
• The user will have access to a 12V power adapter capable of supplying sufficient
current.
• Users or developers may expand the system with IoT dashboards (e.g., Blynk,
ThingSpeak) in the future.

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.

[Link] System Architecture-

Figure 2.1 System Architecture Diagram

14
[Link]. Data Exchange Contract:

Frequency of Data Exchanges:

• Real-Time Sensing:Sensor readings are taken every 1 second using a non-blocking


timing method via millis(). This enables smooth, consistent performance.

• 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:

• Local Serial Communication:For basic monitoring and debugging, data is output


through the Serial Monitor.

• IoT Communication:REST APIs or platforms like Blynk/Thingspeak may be


integrated to allow remote data visualization and logging.

• Direct Hardware Signaling:Transistor control circuits enable switching of fan and


pump using digital outputs from the ESP8266.

15
2.1.4 UI DESIGN

Figure 2.2 Smart Air IoT model setup

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

Table 2.1.3 Detailed Functional Test Case od sprint 1

17
2.1.6 Daily Call Progress

Date TaskDiscussed Status Blockers / Issues

Introduced project, finalized


Day 1 Completed None
components list

Designed connection diagram


Day 2 and wiring logic for 12V fan & Completed None
pump via TIP120

Sensor delay
Wrote base firmware for
Day 3 Completed needed
ESP8266 using analog mapping
stabilization

Debugged low ppm readings,


Fixed by adding
Day 4 finalized sensor warm-up Completed
20s delay
strategy

Ensured all
Functional testing of buzzer, fan,
Day 5 Completed components
and mist spray control
power correctly

Final code optimization for


Day 6 Completed None
memory and IRAM usage

Blynk setup
Day 7 Documentation, sprint wrap-up Completed moved to next
sprint

Table 2.1.4 Daily Call Progress of sprint 1

18
2.1.7 Committed Vs Completed User Stories

User Story Committed Completed Status

#US 1: Auto fan and pump control


Yes Yes
above 1000 ppm Completed

#US 2: Buzzer alert on dangerous CO₂


Yes Yes
levels Completed

#US 3: Offline operation of the system Yes Yes


Completed

#US 4: Blynk alerts on phone Yes Yes


Completed

Table 2.1.5 Committed Vs Completed User Stories of Sprint 1

19
2.1.8 Sprint Retrospective

Liked Learned Lacked Longed For

Simplicity of Importance of Real CO₂


Inclusion of LCD
ESP8266 control sensor warm-up and calibration
display for local ppm
with single GPIO stabilization for tools for ppm
reading
for fan & pump accurate readings accuracy

Efficient control of Memory


Real-time Mobile alerts
12V components optimization
monitoring through Blynk or
via TIP120 without techniques for
interface other IoT platforms
relay ESP8266

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

Next sprint can


Offline working
How to minimize Automatic include display, OTA
ensured safety
IRAM memory calibration updates, and
even during
overload in ESP handling integration with air
network failures
quality data APIs

Table 2.1.6 Sprint Retrospective for the Sprint 1

20
2.2 SPRINT 2

2.2.1 Sprint Goal with User Stories of 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.

[Link] Detailed User Story

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 maintainer, I want the sensor to stabilize during startup so that I receive


#US 9
reliable and accurate CO₂ readings after the necessary warm-up period.

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.

Table 2.2.1 Detailed User Stories of Sprint 2

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.

[Link] Product Goal

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).

• Provide a clear, breadboard-friendly schematic to ease physical assembly for students,


hobbyists, and developers.

• Ensure the Arduino sketch is memory-optimized for ESP8266, minimizing stack


overflows or slow response times due to limited IRAM/RAM.

[Link] Demography (Users, Location)

Users:

• Developers, builders, and electronics hobbyists working on IoT prototypes.

• Technical students and beginners experimenting with sensor-based automation.

Location:

• Home workshops, school labs, university projects, and IoT training centers.

• Breadboard-based rapid prototyping stations, where stability and simplicity are


essential.

[Link] Business Processes

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.

2. Breadboard Setup and Circuit Visualization:

o A detailed, annotated circuit diagram shows all wiring on a breadboard.

3. Sensor Warm-Up Routine:

o On system start, the MQ-135 sensor is allowed a 1–2 minute warm-up phase
before using the readings.

4. Code Optimization:

o The code is reviewed to eliminate memory leaks and reduce RAM/IRAM


usage.

[Link] Features

Feature 1: Hardware-Level Actuator Protection

• 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.

Feature 2: Simplified Breadboard Design

• Description: A step-by-step breadboard layout and labeled circuit diagram simplifies


the assembly and verification process for new builders.

• User Story: As a builder, I want a straightforward visual guide to avoid wiring errors
and speed up testing.

Feature 3: Sensor Warm-Up Handling

• 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.

Feature 4: Memory-Optimized Embedded Code

• Description: The ESP8266 sketch is cleaned up and optimized to consume less


memory and run reliably without crashes.

• User Story: As a student, I want the code to be efficient and lightweight so it runs
properly on ESP8266 boards with limited memory.

[Link] Authorization Matrix

Role Access Level

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 evaluate sensor stability and monitor component protection during


Maintainer
runtime.

Can upload code, learn from circuit visuals, and experiment with system
Student/Learner
tuning.

Table 2.2.2 Access level Authorization Matrix of Sprint 2

[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.

• The MQ-135 sensor is operated in a well-ventilated, room-temperature indoor


environment during calibration.

24
2.2.3 Architecture Document

[Link] Application Components

The second sprint focuses on these modular design layers:

• Power Management Layer:

o Handles 12V source distribution to fan and pump & Prevents microcontroller
overload via TIP120 transistor and diode-protected circuits.

• Physical Interface Layer (Breadboard):

o A clear, compact wiring system where all modules are easily testable.

o Jumper wires, breadboard rails, and correct polarity are emphasized.

• Sensor Conditioning Layer:

o Implements warm-up delay and stabilization logic for reliable CO₂ detection.

• Software Optimization Layer:

o Incorporates memory-friendly practices in embedded code, keeping firmware


compact and efficient.

[Link] System Architecture

Figure 2.5 system wiring architure

25
[Link] Data Exchange Contract

• Sensor Read Frequency:

o Readings are taken every 1 second post-stabilization using a millis()-based


timer.

• Actuation Triggers:

o Triggered only when CO₂ readings exceed the 1000 ppm threshold.

• Startup Behavior:

o On boot, sensor stabilization is prioritized; CO₂ values are considered valid


only after warm-up time completes.

• Hardware Signal Flow:

o GPIO → Resistor → TIP120 Base → 12V Collector-Emitter path →


Pump/Fan

• Code Behavior:

o Lightweight loops, minimized global variables, and static memory allocations


help ensure reliable execution.

26
2.2.4 UI DESIGN

Figure 2.6 Thingspeak interface showing realtime co2 levels

27
2.2.5 Functional Test Cases

Expected Actual More


Feature Test Case Steps to Execute Status
Output Output Information

Fan and Fan and


Test
pump run pump Used TIP120,
transistor- Connect fan/pump
without activated 1N4007
12V Safe based through TIP120 + diode.
damaging smoothly Passed diode, and
Connection control of Send HIGH signal from
ESP or without 100Ω resistor
fan and ESP.
heating up voltage effectively.
pump
components. issues.

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.

Table 2.2.3 Functional Test Cases of Sprint 2

28
2.2.6 Daily Call Progress

Day Progress Summary

Analyzed ESP8266's power limitations. Planned transistor-diode


Day 1
integration for 12V components.

Designed and tested TIP120 + diode switching circuit on


Day 2
breadboard.

Day 3 Warm-up logic implemented; MQ-135 stabilized before reading.

Refactored and optimized the code. Moved logic to flash using


Day 4
ICACHE_FLASH_ATTR.

Conducted memory usage testing. Documented final wiring and


Day 5
behavior.

Table 2.2.4 Daliy call progress of sprint 2

29
2.2.7 COMMITTED Vs COMPLETED USER STORIES

User Story Committed Completed Status

#US 7: connect the 12V pump and fan


Yes Yes
safely to the ESP8266 Completed

#US 8: simple circuit diagram for setting


Yes Yes
up the CO₂ system Completed

#US 9: sensor to stabilize during startup Yes Yes


Completed

#US 10: code to be memory-optimized so


that it fits in the ESP8266's limited Yes Yes
Completed
IRAM and RAM.

Table 2.2.5 Committed Vs Completed User Stories of Sprint 2

30
2.2.8 Sprint Retrospective

Liked Learned Lacked Longed For

The smooth Schematic Better real-time


How to safely use a
integration of 12V drawing tools or monitoring of
transistor (TIP120)
hardware using simulation CO₂ data on both
and diode (1N4007)
safe circuit design software for quick LCD and mobile
with ESP8266.
was satisfying. testing. apps.

Breadboard Optimizing code for


A debug tool to
prototyping ESP8266 memory Integration with
inspect
allowed flexible is essential and OTA updates or
IRAM/RAM in
and quick doable with flash cloud dashboards.
real-time.
iterations. memory strategy.

Table 2.2.6 Sprint retrospective for the sprint 2

31
CHAPTER 3

RESULTS AND DISCUSSION

3.1 Project Outcomes


The Smart Air: IoT-Driven CO₂ Balancing for Healthier Living Room project is designed to
provide a reliable, automated, and intuitive solution for monitoring and controlling indoor air
quality, specifically focusing on carbon dioxide (CO₂) levels. The system offers a real-time
IoT-based interface, automated air purification response, and remote mobile access, aiming to
promote well-being and healthier living spaces. The following key outcomes highlight the
impact and benefits this project delivers:

Enhanced User Experience through a Simple and Accessible Interface

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:

• Live display of CO₂ levels with color-coded status indicators

• Alert notifications when CO₂ levels exceed safe thresholds

• User-configurable safety thresholds for personalized control

• Single-click access to enable or disable ventilation modes

Real-Time CO₂ Detection and Instant Mobile Alerts

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:

• Accurate, real-time updates every second on CO₂ concentration

• 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:

• Disperse and dilute excess CO₂ effectively

• Maintain a consistently breathable environment without requiring user action

• Improve energy efficiency by only activating when needed

• Operate safely without the need for relays or step-down converters

3.2 Committed Vs Completed User stories

Figure 3.1 Bargraph representation of Committed Vs Completed User stories

33
CHAPTER 4

CONCLUSION & FUTURE ENHANCEMENTS

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:

1. Improved Calibration & PPM Accuracy

o Incorporate more advanced CO₂ calibration algorithms or digital sensors like


the MH-Z19B for more accurate and reliable ppm readings.

34
o Add automatic baseline calibration for long-term stability.

2. Mobile App Control & Customization

o Expand Blynk/IoT app functionality to allow dynamic threshold adjustments,


scheduling, and manual overrides via smartphone.

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.

4. Voice Assistant Integration

o Enable compatibility with voice assistants like Amazon Alexa or Google


Assistant for hands-free control and monitoring.

5. Battery-Powered Mobile Version

o Develop a portable version of the system powered by rechargeable batteries or


solar cells for mobile usage or outdoor applications.

6. Community Sharing & Alerts

o Integrate neighborhood-level alerts for shared spaces like apartments or schools,


fostering community-level environmental awareness.

7. Auto-Cleaning Sprayer Mechanism

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

A. PATENT DISCLOSURE FORM

36
B. SAMPLE CODING

37
38
C. PLAGIARISM REPORT

39

You might also like