0% found this document useful (0 votes)
8 views68 pages

Report

Uploaded by

shaiksadiq786900
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)
8 views68 pages

Report

Uploaded by

shaiksadiq786900
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
You are on page 1/ 68

DEPARTMENT OF COMPUTER APPLICATIONS

T. JOHN COLLEGE
(Affiliated to Bangalore University & Approved to AICTE)
Gottigere, Bengaluru – 560 083

PROJECT WORK
IoT Based Environment Data Monitoring and Alerting
System

Bonafide Work Done By

POORVI SURESH

(Reg.No.U03ML21S0008)

The project submitted in partial fulfilment of the requirements for the award of Master of
Computer Applications, of Bangalore University, Bengaluru.

__________________ ____________________________
GUIDE HEAD OF THE DEPARTMENT

Submitted for the Viva-Voce Examination held on _____________________________

_______________________________ _______________________________
INTERNAL EXAMINER EXTERNAL EXAMINER
DEPARTMENT OF COMPUTER APPLICATIONS

T. JOHN COLLEGE

(Affiliated to Bangalore University & Approved to AICTE)

Gottigere, Bengaluru – 560 083

IoT Based Environment Data Monitoring and


Alerting System
A project report submitted to the Bangalore University in the partial fulfilment Of the
requirements for the award of the degree of

BACHELORS OF COMPUTER APPLICATIONS

Submitted by

POORVI SURESH

(Reg.No.U03ML21S0008)

Under the guidance of

Dr. FELCY JUDITH P.

(Associate Professor, Department of Computer Applications)

JUNE 2024
DECLARATION

I, POORVI SURESH (Reg No. U03ML21S0008) hereby declare that the


project entitled IoT Based Environment Data Monitoring and Alerting
System is my project work carried out during the final year BCA at T. John
College, Bengaluru, under the guidance of Dr. Felcy Judith P. Associate
Professor, Department of Computer Applications, T. John College and has not
submitted previously for the award of any other degree or diploma by me to any
institution or university according to the best of my knowledge.

SIGNATURE OF THE CANDIDATE

Place: Bengaluru

Date:
ACKNOWLEDGEMENT

The project titled IoT Based Environment Data Monitoring and Alerting
System has been successfully completed with the help of our Principal, HOD and
Guide. I thank them for providing the great tips that I have incorporated in this project.

I would express my sincere thanks to Dr. SRINIVASA H P, Principal, T. John


College for his valuable advice, co-operation and support and also for providing all
the faculties for the construction of the project.

I am thankful to Dr. S. DINAKARAN, Head of Department of Computer


Applications for his valuable advice and co-operation.

I am thankful to Dr. FELCY JUDITH, Project Guide, Department of


Computer Applications for her valuable advice and co-operation.

I also would like to thank our friends and family for their valuable support and
encouragement.
Sl No Title Page No

SYNOPSIS 1

1
INTRODUCTION

1.1 About the project 7

2
SYSTEM STUDY AND ANALYSIS

2.1 Existing Systems 9

2.2 Disadvantages of Existing Systems 10

2.3 Proposed System 12

2.4 Advantages of the Proposed System 14

3
SYSTEM CONFIGURATION

3.1 Hardware Specifications 16

3.2 Software Specifications 18

4
SYSTEM DESIGN AND DEVELOPMENT

4.1 Input Design 26

4.2 Output Design 29

4.3 Database Design 31

4.4 System Design Diagrams 33


4.4.1 Data Flow Diagram 35

4.4.2 Entity Relationship Diagram (ERD) 39

5
SYSTEM TESTING AND IMPLEMENTATION

5.1 System Testing 40

5.2 System Implementation 43

6 50
CONCLUSION

7 52
FUTURE SCOPE

8 55
SOURCE CODE

9 61
BIBILOGRAPHY
SYNOPSIS

Objective

The primary goal of this project is to develop an advanced Internet of Things (IoT) based
environmental monitoring system. This system will continuously collect and analyze key
environmental parameters, including air quality, temperature, and atmospheric pressure. Designed
with precision, the system will immediately notify users through a prominent visual alert—a red
LED indicator—whenever any of the monitored parameters exceed predefined threshold levels.
Additionally, all gathered data will be securely accessible via a local webpage, ensuring that only
authenticated users within the same network can view the information. This robust access control
mechanism is crucial for maintaining data privacy and security, effectively reducing the risks
associated with unauthorized access or potential data breaches.

The main objective of this initiative is to create a sophisticated IoT-driven environmental


monitoring device. This device will continuously track and evaluate essential environmental
metrics such as air quality, temperature, and atmospheric pressure. The system is carefully
engineered to provide immediate visual alerts to users—a red LED light—whenever any
monitored metric surpasses set threshold values. Moreover, the accumulated data will be securely
available through a local webpage, accessible only to authenticated users within the same network.
This stringent access control is essential to ensure data privacy and security, thereby minimizing
the risks of unauthorized access and potential data breaches.

Existing Systems and Their Limitations:

Conventional environmental monitoring solutions often require labor-intensive manual data


logging processes or depend on discrete, non-integrated sensor setups. These traditional
approaches are inherently inefficient as they lack real-time monitoring capabilities and automated
alert mechanisms. The reliance on manual intervention introduces a significant risk of human error,
leading to potential inaccuracies and delays. Furthermore, systems that require remote access can
compromise data security and integrity if not properly safeguarded, posing substantial risks. The

1|P a ge
absence of a centralized, integrated platform for data acquisition, processing, and dissemination
further exacerbates these issues, making comprehensive environmental monitoring and timely
decision-making more difficult.

Traditional environmental monitoring solutions frequently involve laborious manual data logging
or rely on separate, non-integrated sensor configurations. These methods are fundamentally
inefficient, lacking the ability to provide real-time monitoring and automated alert systems.
Manual processes increase the risk of human error, which can lead to inaccuracies and delays in
data collection. Additionally, systems that necessitate remote access may endanger data security
and integrity if adequate safeguards are not in place, creating significant vulnerabilities. The lack
of a centralized, integrated platform for collecting, processing, and disseminating data further
exacerbates these limitations, hindering effective environmental monitoring and delaying critical
decision-making processes

Proposed System and Its Advantages:

Traditional environmental monitoring solutions often require laborious manual data logging or
depend on separate, non-integrated sensor configurations. These methods are fundamentally
inefficient, as they lack the capability to provide real-time monitoring and automated alert systems.
The reliance on manual processes increases the risk of human error, which can lead to inaccuracies
and delays in data collection. Furthermore, systems that necessitate remote access may pose
significant vulnerabilities if adequate safeguards are not implemented, potentially compromising
data security and integrity. The absence of a centralized, integrated platform for collecting,
processing, and disseminating data exacerbates these limitations, hindering effective
environmental monitoring and delaying critical decision-making processes.

Traditional environmental monitoring systems frequently involve cumbersome manual data


logging and rely on disparate, non-integrated sensor configurations. These approaches are
inherently inefficient, as they lack the ability to provide real-time monitoring and automated alert
systems. The dependence on manual processes introduces a high risk of human error, leading to
potential inaccuracies and delays in data collection. Additionally, systems that require remote

2|P a ge
access can significantly compromise data security and integrity if proper safeguards are not in
place, creating vulnerabilities. The lack of a centralized, integrated platform for data acquisition,
processing, and dissemination further exacerbates these issues, hindering comprehensive
environmental monitoring and delaying crucial decision-making processes.

System Modules:

1. Data Acquisition Module: This critical module employs the advanced sensing capabilities
of the SGP30 and BMP280 sensors to continuously gather comprehensive air quality data.
It monitors essential parameters such as carbon dioxide levels, volatile organic compounds,
temperature, and atmospheric pressure. The collected data is transmitted in real-time to the
central processing unit for further analysis and processing, ensuring that the system has up-
to-date information for accurate monitoring.This essential module leverages the advanced
sensing capabilities of the SGP30 and BMP280 sensors to continuously collect detailed air
quality data. It measures key parameters, including carbon dioxide levels, volatile organic
compounds, temperature, and atmospheric pressure. The real-time data acquisition ensures
that all information is immediately sent to the central processing unit for further analysis
and processing, maintaining up-to-date monitoring accuracy.

2. Data Processing Module: The powerful Raspberry Pi single-board computer serves as the
system's cerebral cortex, handling the vast influx of data from the sensors. This module
processes and evaluates the data against rigorously defined threshold values using
sophisticated algorithms and data processing techniques. This ensures accurate and reliable
analysis of environmental conditions, allowing for the prompt detection of any deviations
or anomalies.Acting as the system's brain, the Raspberry Pi single-board computer
processes the large volume of data acquired from the sensors. This module evaluates the
data against rigorously defined threshold values using advanced algorithms and data
processing techniques. The processing ensures precise and reliable analysis of
environmental conditions, enabling the system to promptly identify and respond to any
deviations or anomalies.

3|P a ge
3. Alerting Module: When any environmental parameter exceeds its corresponding
threshold, the alerting module activates a conspicuous red LED indicator. This
unambiguous visual cue notifies users of potential environmental hazards or anomalies.
The instantaneous alert mechanism ensures timely awareness and facilitates proactive
response measures, mitigating potential risks or adverse effects.Upon detecting any
parameter exceeding its threshold, the alerting module triggers a bright red LED indicator.
This clear visual cue alerts users to potential environmental hazards or anomalies. The
immediate alert mechanism ensures users are promptly informed, allowing for swift and
proactive response measures to mitigate potential risks or adverse effects.

4. Web Interface Module: This user-centric module presents both real-time and historical
environmental data through an intuitive and user-friendly local webpage interface. The
webpage offers a comprehensive overview of environmental conditions, enabling users to
effortlessly monitor and analyze data trends. Access to this web interface is restricted solely
to authenticated users within the local network, ensuring that sensitive environmental data
remains secure and inaccessible to unauthorized entities.Designed with the user in mind,
this module provides real-time and historical environmental data through a local webpage
interface that is both intuitive and user-friendly. The webpage offers a comprehensive view
of environmental conditions, making it easy for users to monitor and analyze data trends.
To ensure data security, access to the web interface is restricted to authenticated users
within the local network, preventing unauthorized access to sensitive environmental
information.

Research Methodologies:

The project is guided by a rigorous applied research methodology that begins with a
comprehensive multidisciplinary literature review. This review synthesizes existing knowledge
and best practices across environmental monitoring, IoT, and sensor technology domains. By
leveraging insights from this review, the project establishes a strong theoretical foundation and
identifies key methodologies and technologies to pursue.

4|P a ge
In parallel, an in-depth technical specification analysis is conducted to evaluate the compatibility
and performance capabilities of chosen hardware components. This analysis, which includes
detailed assessments of sensors such as the SGP30 and BMP280, ensures that selected
technologies align effectively with project objectives and environmental monitoring requirements.

The project also employs iterative system design and prototyping processes. Through these
iterative cycles, successive prototypes are developed, tested, and refined based on real-world
performance and reliability metrics. This approach allows for continuous optimization and
adaptation, addressing practical challenges and enhancing overall system functionality.

A critical aspect of the methodology involves extensive validation and testing procedures. These
procedures rigorously assess the accuracy, reliability, and security of the solution at various stages
of development. By subjecting the system to comprehensive testing protocols, the project aims to
deliver a final solution that not only meets stringent quality standards but also effectively addresses
user needs and operational demands.

Conclusion:

The IoT-based environmental monitoring system developed in this project represents a state-of-
the-art solution designed to provide secure, efficient, and reliable real-time environmental
surveillance. By leveraging advanced IoT technologies and integrating high-performance sensors
with robust data processing capabilities, the system introduces a significant advancement in
proactive environmental management practices.

Cutting-Edge IoT Technologies: The system utilizes cutting-edge IoT technologies to enable
seamless communication between sensors, data processing units, and user interfaces. This
interconnected network facilitates continuous monitoring of critical environmental parameters
such as air quality, temperature, and atmospheric pressure. This real-time data acquisition ensures
that environmental changes are promptly detected and analyzed, empowering users with timely
insights for informed decision-making.

Integration of State-of-the-Art Sensors: Integrated with state-of-the-art sensors like the SGP30
and BMP280, the system captures comprehensive environmental data with high precision and
accuracy. These sensors monitor variables including carbon dioxide levels, volatile organic

5|P a ge
compounds, and atmospheric conditions, providing a detailed and nuanced understanding of
environmental conditions in real-time.

Prompt User Alerts and Controlled Data Access: One of the system's key features is its ability
to promptly alert users to any detected anomalies or deviations from predefined thresholds. This
proactive alert mechanism, often indicated by a conspicuous red LED indicator, ensures that
stakeholders are immediately informed of potential environmental risks. Simultaneously, stringent
security measures, including restricted access to data via authenticated local network web
interfaces, safeguard sensitive environmental information from unauthorized access or breaches.

Advancement in Environmental Management: By continuously monitoring critical


environmental parameters and providing real-time alerts, the system supports proactive
environmental management practices. Organizations and communities can utilize this capability
to mitigate risks, implement timely interventions, and promote sustainability. The system's ability
to detect subtle changes in environmental conditions ensures early detection of potential hazards,
contributing to a healthier and safer environment for all stakeholders.

Enhanced Sustainability and Risk Mitigation: Overall, the IoT-based environmental monitoring
system serves as a valuable asset for enhancing sustainability efforts and mitigating environmental
risks. Its comprehensive monitoring capabilities and robust alert systems enable proactive
responses to environmental changes, fostering a more resilient ecosystem and supporting long-
term environmental stewardship.

In conclusion, through its integration of advanced IoT technologies, state-of-the-art sensors, real-
time monitoring capabilities, and stringent security measures, this system represents a significant
advancement in environmental monitoring and management. It stands poised to make a substantial
impact by empowering organizations and communities to safeguard environmental health and
promote sustainable practices effectively.

6|P a ge
1. INTRODUCTION

1. About the project

This multifaceted project aims to develop a secure and efficient Internet of Things (IoT) driven
environmental monitoring system, harnessing the capabilities of advanced sensor technology and
robust data processing. The system centers around a Raspberry Pi single-board computer, which
functions as the central processing unit. This computer is seamlessly integrated with two
sophisticated sensors: the SGP30 air quality sensor and the BMP280 temperature and pressure
sensor. This synergistic combination facilitates the continuous acquisition of comprehensive
environmental data, including parameters such as air quality, temperature, and atmospheric
pressure.

Central Processing with Raspberry Pi: The Raspberry Pi, acting as the cerebral cortex of the
system, processes the vast influx of data from the sensors. It meticulously evaluates this data
against rigorously defined preset thresholds. If any monitored parameter exceeds its respective
threshold, a conspicuous red LED is promptly activated. This serves as an unambiguous visual
alert, notifying users of potential environmental hazards or anomalies. This instantaneous alert
mechanism ensures timely awareness, enabling users to take proactive response measures, thereby
mitigating potential risks or adverse effects.

Advanced Sensor Integration: The integration of the SGP30 air quality sensor and the BMP280
temperature and pressure sensor allows for the continuous and precise monitoring of
environmental conditions. The SGP30 sensor provides detailed measurements of air quality,
including carbon dioxide levels and volatile organic compounds. The BMP280 sensor offers
accurate readings of temperature and atmospheric pressure. Together, these sensors provide a
holistic view of the environmental parameters, enabling comprehensive monitoring and analysis.

User-Friendly Data Visualization: The collected environmental data is visualized through an


intuitive, user-friendly local webpage interface. This interface is designed to provide a
comprehensive overview of both real-time and historical data trends. Users can easily access and
interpret the data, facilitating informed decision-making regarding environmental conditions. The

7|P a ge
local webpage offers clear visualizations and analytics, making it simple for users to monitor and
understand the environmental data at a glance.

Stringent Access Control for Data Security: To ensure the security and privacy of the
environmental data, access to the web interface is restricted solely to authenticated users within
the same network. This stringent access control measure upholds data privacy and integrity,
preventing unauthorized access and mitigating potential risks associated with data breaches. By
limiting access to authorized personnel only, the system ensures that sensitive environmental data
remains secure and protected from external threats.

Proactive Environmental Management: Overall, this IoT-driven environmental monitoring


system represents a significant advancement in proactive environmental management practices.
By leveraging cutting-edge sensor technology and robust data processing capabilities, the system
provides real-time monitoring and instantaneous alerts for environmental hazards. The
comprehensive data visualization and stringent access control measures ensure that users can
effectively manage and respond to environmental conditions, promoting a sustainable and healthy
environment.

8|P a ge
2. SYSTEM STUDY AND ANALYSIS

2. Existing Systems

Current environmental monitoring practices predominantly rely on labor-intensive manual data


logging processes or employ non-integrated sensor networks. These traditional approaches are
characterized by several significant shortcomings, which impede their effectiveness and
efficiency.

Labor-Intensive Manual Data Logging: Many existing environmental monitoring systems


require manual data logging, where personnel must physically record readings from various
sensors. This process is not only time-consuming but also prone to delays, as data collection is
limited to the frequency with which personnel can visit monitoring sites. This can result in
significant gaps between data points, leading to incomplete environmental records and delayed
responses to changing conditions.

Non-Integrated Sensor Networks: The use of non-integrated sensor networks is another major
drawback. In such systems, sensors operate independently without a centralized data aggregation
platform. This lack of integration hinders the ability to analyze data holistically, as it is challenging
to correlate information from different sensors in real time. Consequently, the potential to detect
patterns or anomalies across multiple parameters is greatly diminished.

Delayed Data Processing: Traditional methods often involve delayed data processing, as the
manually collected data must be transferred to a central system for analysis. This delay can result
in outdated information being used for decision-making, reducing the system's effectiveness in
responding to environmental changes promptly. In fast-evolving situations, such as chemical spills
or sudden air quality degradation, these delays can have serious consequences.

Lack of Real-Time Alerts: A critical shortcoming of traditional environmental monitoring


systems is the absence of real-time alert mechanisms. Without the ability to continuously monitor
environmental parameters and trigger immediate alerts when thresholds are breached, these
systems fail to provide timely warnings to stakeholders. This can prevent prompt intervention and

9|P a ge
mitigation of potential hazards, increasing the risk of environmental damage and harm to public
health.

Susceptibility to Human Error: Manual data logging processes are inherently susceptible to
human error. Mistakes in recording, transcription, and data entry can lead to inaccuracies in the
collected data. These errors can propagate through the data analysis process, resulting in incorrect
assessments and decisions based on faulty information. The reliance on human intervention thus
compromises the reliability and accuracy of environmental monitoring.

Poor Integration and Limited Comprehensive Monitoring: Traditional systems often lack the
capability to integrate various environmental parameters into a comprehensive monitoring
framework. This limitation restricts the ability to gain a complete understanding of the
environmental conditions. For example, monitoring air quality without simultaneously assessing
temperature and pressure can provide an incomplete picture of the factors influencing air pollution
levels.

Conclusion: In summary, current environmental monitoring practices are hindered by labor-


intensive manual processes, non-integrated sensor networks, delayed data processing, lack of real-
time alerts, susceptibility to human error, and limited comprehensive monitoring capabilities.
These shortcomings significantly reduce the effectiveness of traditional systems in providing
timely, accurate, and actionable environmental data. To address these challenges, there is a need
for advanced, integrated solutions that leverage real-time data acquisition, automated alert
mechanisms, and robust data processing capabilities to ensure comprehensive and reliable
environmental monitoring.

2.2. Disadvantages of Existing Systems:

Delayed Data Processing: Manual data collection and analysis processes in current environmental
monitoring systems often lead to significant delays. These delays occur because data must be
physically recorded, transferred, and then analyzed, which is a time-consuming process. The result
is that by the time data is available for analysis, it may already be outdated. This lag hinders the
ability to promptly detect and respond to environmental hazards or anomalies, reducing the overall
effectiveness of the monitoring system. In situations where immediate action is required, such as

10 | P a g e
during a sudden increase in air pollution or a chemical spill, these delays can have serious and
detrimental effects on both the environment and public health.

Lack of Real-Time Alerts: Many existing environmental monitoring systems lack automated alert
mechanisms, which are crucial for timely reactions to environmental hazards. Without real-time
alerts, these systems fail to notify users immediately when an environmental parameter exceeds
safe levels. This absence of instant notification can result in delayed responses to hazardous
conditions, allowing potential environmental threats to escalate unchecked. For example, in the
case of a sudden drop in air quality, the delay in alerting relevant authorities or the public can
exacerbate health risks and prevent timely interventions that could mitigate the impact of the
hazard.

Human Error Susceptibility: The reliance on manual data collection and processing in traditional
environmental monitoring systems introduces a significant risk of human error. Mistakes can occur
at various stages, including data recording, transcription, and entry into databases. These errors
can compromise the accuracy and reliability of the environmental data being collected. Inaccurate
data can lead to incorrect assessments and decisions, undermining efforts to monitor and protect
the environment effectively. Furthermore, inconsistencies in data collection practices can result in
incomplete or skewed datasets, further impairing the quality of the monitoring process.

Poor Integration: Many existing systems use standalone sensors or non-integrated networks,
which fail to provide a holistic view of environmental conditions. These isolated sensor setups do
not allow for the comprehensive collection and analysis of data across multiple environmental
parameters. Without integration, it is difficult to correlate data from different sources and identify
broader environmental trends or interactions between various factors. This lack of a unified
approach limits the ability to perform thorough and accurate environmental assessments, which
are essential for effective monitoring and management.

Limited Monitoring Capabilities: A significant limitation of many traditional environmental


monitoring systems is their restricted range of monitoring capabilities. These systems often focus
on a narrow set of environmental parameters, such as only measuring air quality or temperature,
without capturing other critical factors like humidity, atmospheric pressure, or volatile organic
compounds. This limitation prevents a comprehensive understanding of environmental conditions,

11 | P a g e
as it fails to account for the complex interactions between different environmental variables.
Consequently, the effectiveness of these systems in conducting thorough environmental
assessments is significantly reduced, as they do not provide a complete picture of the ecosystem
being monitored.

Conclusion

In conclusion, existing environmental monitoring systems are hindered by several critical


disadvantages, including delayed data processing, lack of real-time alerts, susceptibility to human
error, poor integration, and limited monitoring capabilities. These shortcomings impede the
effectiveness of these systems in providing timely, accurate, and comprehensive environmental
data. Addressing these issues requires the development of advanced, integrated solutions that
leverage real-time data acquisition, automated alert mechanisms, and robust data processing
capabilities to ensure effective and reliable environmental monitoring and management.

2.2. Proposed System


The proposed IoT-based system effectively addresses the multitude of limitations
associated with existing environmental monitoring solutions by seamlessly amalgamating sensor
data collection, processing, and alerting into a single, automated platform. This integration
provides several key advantages, ensuring real-time monitoring and immediate user notifications
upon breaching environmental thresholds. This comprehensive approach minimizes the need for
manual intervention and significantly reduces the potential for human error.

Seamless Integration of Sensor Data Collection: The IoT-based system integrates advanced
sensors, such as the SGP30 for air quality and BMP280 for temperature and pressure, into a unified
network. These sensors continuously collect comprehensive environmental data, including carbon
dioxide levels, volatile organic compounds, temperature, and atmospheric pressure. By leveraging
multiple sensors within a single system, the IoT platform provides a holistic view of environmental
conditions, allowing for more accurate and comprehensive monitoring.

Real-Time Data Processing: At the heart of the system is a powerful processing unit, such as a
Raspberry Pi single-board computer. This unit acts as the central processing hub, receiving data
from the various sensors in real-time. The data is immediately processed using sophisticated

12 | P a g e
algorithms and data processing techniques. This real-time processing capability ensures that any
deviations from preset environmental thresholds are detected instantaneously. The continuous
flow of data from the sensors to the processing unit enables the system to maintain an up-to-date
picture of the environmental conditions, facilitating timely and accurate analysis.

Immediate User Notifications: One of the critical features of the IoT-based system is its ability
to provide immediate notifications to users when environmental parameters breach predefined
thresholds. Upon detecting an anomaly, the system activates a conspicuous red LED indicator as
a visual alert. Additionally, the system can be configured to send notifications through other
channels, such as emails or mobile app alerts. This instantaneous alert mechanism ensures that
users are promptly informed of potential environmental hazards, allowing them to take immediate
corrective actions. The automated alerting system eliminates the delays associated with manual
monitoring and notification processes, thereby enhancing the system's responsiveness.

Minimizing Manual Intervention: By automating the entire data collection, processing, and
alerting workflow, the IoT-based system significantly reduces the need for manual intervention.
Manual data logging, transcription, and analysis processes are replaced by automated mechanisms
that operate continuously and without human oversight. This automation not only streamlines the
monitoring process but also minimizes the potential for human error, which is a common issue in
traditional systems. The reduction in manual intervention ensures that the data collected is more
accurate and reliable, leading to better-informed decision-making.

Mitigating Potential for Human Error: The IoT-based system's reliance on automated processes
addresses the inherent risks of human error present in traditional monitoring systems. Manual data
entry and recording are prone to mistakes, which can compromise the integrity of the
environmental data. In contrast, the automated system consistently applies the same data collection
and processing standards, ensuring uniformity and accuracy. By mitigating the potential for human
error, the IoT-based system enhances the overall reliability and credibility of the environmental
monitoring efforts.

Conclusion: In conclusion, the proposed IoT-based environmental monitoring system offers a


comprehensive solution to the limitations of existing systems. By seamlessly integrating sensor
data collection, real-time data processing, and immediate user notifications into a single,

13 | P a g e
automated platform, the system ensures continuous and accurate monitoring of environmental
conditions. This integration minimizes manual intervention and reduces the potential for human
error, resulting in a more efficient, reliable, and responsive environmental monitoring system.
Organizations and communities can leverage this advanced IoT-based solution to proactively
manage environmental risks and ensure a sustainable and healthy environment.

2.3. Advantages of the Proposed System:


The proposed IoT-based environmental monitoring system incorporates several advanced
features designed to overcome the limitations of traditional methods. These features ensure
continuous, accurate, and secure monitoring of environmental conditions, enhancing the system's
overall effectiveness and reliability.

Real-Time Data Collection:

The system employs continuous, uninterrupted monitoring of critical environmental parameters,


such as air quality, temperature, and atmospheric pressure. By leveraging high-performance
sensors like the SGP30 and BMP280, the system can detect even the slightest changes in
environmental conditions. This real-time data collection capability ensures that any anomalies or
hazards are promptly detected, allowing for immediate analysis and response. The continuous flow
of data provides a comprehensive and up-to-date picture of the environment, enabling more
accurate assessments and timely interventions.

Automated Visual Alerts:

One of the standout features of the system is its automated visual alert mechanism. Upon detecting
any environmental parameter that exceeds its predefined threshold, the system activates an RGB
LED to provide an instantaneous visual alert. This conspicuous indicator ensures that users are
immediately aware of potential hazards or anomalies, facilitating proactive response measures.
The use of an RGB LED allows for a range of alert colors, which can be customized to indicate
different types or severities of environmental issues. This instantaneous alert system significantly
reduces response times, helping to mitigate potential risks and adverse effects.

14 | P a g e
Secure Data Access:

To maintain data privacy and integrity, the system restricts access to environmental data through
a secure local webpage. Only authenticated users within the same network can access this interface,
preventing unauthorized access and protecting sensitive information. This stringent access control
measure ensures that environmental data remains confidential and secure, mitigating risks
associated with data breaches or unauthorized usage. The local webpage is designed to be user-
friendly, providing an intuitive interface for viewing real-time and historical data trends.

Reduced Manual Intervention:

The system is designed to minimize the need for manual intervention by automating data
collection, processing, and alerting processes. This automation reduces the potential for human
error, which is a common issue in traditional manual monitoring systems. By eliminating the need
for manual data logging and processing, the system enhances overall efficiency and accuracy.
Users can rely on the automated system to consistently apply the same standards and procedures,
ensuring reliable and uniform data collection and analysis.

Comprehensive Monitoring:

The integration of multiple sensors allows the system to monitor a broad range of environmental
parameters. This comprehensive monitoring capability provides a holistic view of environmental
conditions, capturing data on air quality, temperature, atmospheric pressure, and other relevant
factors. The ability to monitor multiple parameters simultaneously enables the detection of
complex environmental interactions and trends that may not be apparent when monitoring
individual parameters in isolation. This holistic approach supports more thorough environmental
assessments and more effective decision-making.

15 | P a g e
3. SYSTEM CONFIGURATION

3.1 Hardware Specifications:

The proposed IoT-based environmental monitoring system integrates several key components,
each playing a crucial role in its overall functionality. Here is an in-depth look at each component
and its significance:

Raspberry Pi:

The Raspberry Pi serves as the powerful single-board computer acting as the central processing
unit of the system. It is responsible for executing data processing, analysis, and control logic. With
its robust computational capabilities, the Raspberry Pi can handle the continuous influx of data
from various sensors, process this data in real-time, and make decisions based on predefined
thresholds. Its versatility and flexibility also allow it to interface with multiple sensors and output
devices, making it an ideal choice for an IoT-based environmental monitoring system. The
Raspberry Pi's role as the system's brain ensures accurate and efficient management of data
collection, processing, and alerting.

SGP30 Sensor:

The SGP30 is a state-of-the-art air quality sensor that provides accurate measurements of key air
quality parameters, including carbon dioxide (CO2) levels and volatile organic compounds
(VOCs). This sensor offers comprehensive insights into the air quality of the monitored
environment, allowing the system to detect harmful pollutants and potential health hazards. The
high precision of the SGP30 ensures reliable data, which is critical for timely alerts and informed
decision-making. Its integration into the system enables continuous monitoring of air quality,
contributing to a safer and healthier environment.

BMP280 Sensor:

The BMP280 is an advanced sensor designed to monitor atmospheric pressure and temperature
with high precision. This sensor is crucial for tracking environmental conditions and detecting
changes in weather patterns or indoor climate. The BMP280's accurate readings of temperature

16 | P a g e
and pressure provide valuable data for comprehensive environmental assessments. Its integration
into the system allows for a broader range of monitoring capabilities, ensuring that the system can
capture and analyze multiple environmental parameters simultaneously. This multi-faceted
approach enhances the system's ability to provide a holistic view of the environment.

RGB LED:

The RGB LED is a versatile light-emitting diode capable of emitting different colors, including
red, which is used as a conspicuous visual alert. When any environmental parameter exceeds its
predefined threshold, the RGB LED is activated to emit a red light, serving as an immediate and
clear visual notification to users. This instant alert mechanism ensures timely awareness of
potential hazards, allowing for prompt and proactive response measures. The RGB LED can also
be configured to emit other colors for different types of alerts or statuses, providing a flexible and
effective way to communicate various environmental conditions.

Power Supply:

A reliable power supply is essential for the continuous operation of the Raspberry Pi and connected
sensors. The power supply provides the necessary electrical energy to ensure that all components
function properly and without interruption. This is particularly important for an environmental
monitoring system that relies on continuous data acquisition and real-time processing. A stable
and dependable power source guarantees that the system remains operational at all times,
maintaining the integrity and reliability of the monitoring process.

Connecting Wires:

High-quality connecting wires are used to facilitate secure and efficient interconnections between
the various system components. These wires enable seamless data transfer and communication
between the Raspberry Pi, sensors, and output devices. The use of reliable wiring components
ensures that the electrical connections are stable and that data transmission is not disrupted.
Properly managed and organized wiring also helps to maintain the overall system's performance
and reduces the risk of connection failures or data loss.

17 | P a g e
3.2. Software Specifications:
The proposed IoT-based environmental monitoring system relies on several key software
components to ensure its functionality, efficiency, and ease of use. Each of these components plays
a vital role in creating a seamless and robust system. Here is an in-depth look at the software
components and their significance:

Raspberry Pi OS:

Raspberry Pi OS is a robust and optimized operating system specifically designed for the
Raspberry Pi single-board computer. This OS provides a stable and efficient platform for running
the system's software components. Raspberry Pi OS is based on Debian Linux, offering a familiar
and powerful environment for developers. It is optimized to run on the hardware of the Raspberry
Pi, ensuring that the system performs efficiently even with limited resources. The OS includes a
variety of pre-installed software tools and utilities that facilitate system setup, maintenance, and
development. With its stability and optimization, Raspberry Pi OS serves as the foundational layer

that supports the system’s operations, ensuring reliable performance and ease of use.

Python:

Python is a powerful, versatile, and widely-adopted programming language, chosen for this project
due to its simplicity, readability, and extensive libraries. Python's ease of use and clear syntax
make it ideal for developing the data collection, processing, and control logic modules of the
environmental monitoring system. The language's extensive standard library and the availability
of numerous third-party libraries simplify the implementation of complex functionalities such as

sensor data acquisition, real-time processing, and alerting mechanisms. Python’s flexibility allows

for rapid development and prototyping, which is crucial for iterating on the system design.
Additionally, its strong community support ensures that developers have access to a wealth of
resources and tools, further enhancing development efficiency and effectiveness.

Flask:

18 | P a g e
Flask is a lightweight and flexible web framework for Python, enabling the development of the
user-friendly local webpage interface for data visualization and monitoring. Flask is known for its
simplicity and minimalism, which makes it a perfect choice for creating a web interface that is
both functional and easy to manage. It provides the essential tools and features needed to build
web applications, such as routing, templating, and session management, without the overhead of a

more complex framework. Flask’s flexibility allows developers to customize the web interface

according to specific requirements, ensuring that the environmental data is presented in an intuitive
and accessible manner. By using Flask, the system can generate real-time visualizations of
environmental data, display historical trends, and manage user authentication, all within a secure
and responsive web interface.

Integration of Software Components:

The integration of Raspberry Pi OS, Python, and Flask creates a cohesive and efficient software
environment for the IoT-based environmental monitoring system. Raspberry Pi OS provides the

stable platform necessary for running the system’s applications. Python serves as the primary

programming language, enabling the development of the core functionalities, such as data
collection from sensors, real-time processing, and activation of alerts. Flask, on the other hand,
facilitates the creation of a local web interface that allows users to visualize and monitor
environmental data in real-time.

1. Front-End Technologies:

The proposed IoT-based environmental monitoring system incorporates various technologies to


create a comprehensive and user-friendly web interface. HTML/CSS and JavaScript play crucial
roles in developing and enhancing this interface, ensuring that users can interact with and visualize
environmental data effectively. Here is an in-depth look at these technologies and their
significance:

HTML/CSS:

19 | P a g e
HTML (HyperText Markup Language) and CSS (Cascading Style Sheets) are standard markup
and styling languages used to design the structure, layout, and visual appearance of the local
webpage. These technologies are fundamental in creating an intuitive and user-friendly interface
for the environmental monitoring system.

HTML:

• Structure: HTML is used to define the structure and content of the webpage. It organizes
the various elements such as headings, paragraphs, tables, and forms, creating a logical and
hierarchical structure that is easy to navigate.
• Accessibility: HTML provides semantic elements (like <header>, <footer>,
<article>, and <section>) that enhance the accessibility and searchability of the
webpage. This ensures that the interface is usable by a wider audience, including those
using assistive technologies.
• Integration: HTML serves as the foundation for integrating other technologies like CSS
and JavaScript. It allows for the embedding of scripts and styles, enabling the creation of a
cohesive and interactive web application.
CSS:

• Styling: CSS is used to define the visual appearance of the webpage. It controls the layout,
colors, fonts, and spacing of HTML elements, ensuring a consistent and aesthetically
pleasing design.
• Responsive Design: CSS enables the creation of responsive designs that adapt to different
screen sizes and devices. This ensures that the web interface is accessible and usable on
desktops, tablets, and smartphones.
• Customization: CSS allows for extensive customization of the webpage's look and feel.
By using various selectors, properties, and values, developers can create a unique and
engaging user experience that aligns with the project's branding and design guidelines.

JavaScript:

20 | P a g e
JavaScript is a versatile scripting language employed to enhance the interactivity and dynamic
behavior of the web interface. It enables real-time data updates and interactive visualizations,
making the webpage more engaging and functional.

Real-Time Data Updates:

• Dynamic Content: JavaScript allows for the dynamic updating of webpage content
without requiring a full page reload. This is essential for real-time monitoring, where sensor
data is continuously updated and displayed to users.
• AJAX Requests: JavaScript can make asynchronous HTTP requests (AJAX) to the server
to fetch new data and update the webpage accordingly. This ensures that users always have
access to the latest environmental data without experiencing any interruptions.

Interactive Visualizations:

• Charts and Graphs: JavaScript libraries like D3.js, Chart.js, and Plotly can be used to
create interactive charts and graphs that visualize environmental data. These visualizations
help users understand trends and patterns more easily.
• User Interaction: JavaScript enhances user interaction by enabling features like tooltips,
zooming, panning, and clickable elements. Users can interact with the data visualizations
to gain deeper insights and explore specific details.
• Event Handling: JavaScript allows for the handling of user events (such as clicks, mouse
movements, and key presses) to trigger specific actions. This can be used to implement
features like filtering data, toggling views, and updating visualizations based on user input.

Integration of Technologies:

The integration of HTML/CSS and JavaScript creates a powerful and dynamic web interface for
the IoT-based environmental monitoring system. HTML provides the structure, CSS defines the

21 | P a g e
style, and JavaScript adds interactivity and real-time capabilities. This combination ensures that
users have a seamless and engaging experience when accessing and interacting with environmental
data.

2. Back-End Technologies:

In the proposed IoT-based environmental monitoring system, Python and Flask play critical roles
in ensuring the efficient functioning of the back-end system and the seamless interaction between
the hardware and the web interface. Here is a detailed elaboration on the roles of Python and Flask:

Python:

Python is a versatile programming language that serves multiple functions in the environmental
monitoring system. Beyond its role in data collection and processing, Python acts as the backbone
of the entire back-end system, managing sensor data acquisition, processing algorithms, and
interfacing with the Raspberry Pi hardware.

Sensor Data Acquisition:

• Interfacing with Sensors: Python scripts are used to interface with the SGP30 air quality
sensor and the BMP280 temperature and pressure sensor. Using libraries like smbus for
I2C communication, Python enables the Raspberry Pi to read data from these sensors
efficiently.
• Continuous Monitoring: Python's ability to run loops and schedule tasks allows for
continuous monitoring of environmental parameters. It ensures that data is collected at
regular intervals, providing up-to-date information on air quality, temperature, and
pressure.

Data Processing Algorithms:

22 | P a g e
• Threshold Evaluation: Python processes the raw sensor data and evaluates it against
predefined thresholds. If any parameter exceeds its threshold, the system triggers an alert.
This involves implementing algorithms to compare current readings with safe levels and
detect anomalies.
• Data Aggregation and Analysis: Python can aggregate data over time to analyze trends
and patterns. This helps in understanding long-term changes in environmental conditions
and making informed decisions based on historical data.

Interfacing with Raspberry Pi Hardware:

• Hardware Control: Python scripts control the RGB LED for visual alerts. When a
threshold is breached, Python triggers the LED to turn red, providing an immediate visual
notification to users.
• GPIO Management: Python uses the RPi.GPIO library to manage the General-Purpose
Input/Output (GPIO) pins on the Raspberry Pi. This allows the system to interact with
various hardware components seamlessly.
Flask:

Flask is a lightweight and flexible web framework for Python that is crucial for developing and
managing the web interface of the environmental monitoring system. It handles the server-side
logic, ensuring secure and efficient communication between the Raspberry Pi and the web
interface.

Serving the Local Webpage:

• Web Server: Flask acts as the web server, hosting the local webpage that users access to
view real-time and historical environmental data. It ensures that the webpage is always
available and responsive.
• Template Rendering: Flask uses the Jinja2 templating engine to render HTML templates
dynamically. This allows the webpage to display updated data without requiring a full page
reload, providing a smooth user experience.

23 | P a g e
Handling Web Requests:

• Routing: Flask handles different web requests through URL routing. It maps URLs to
specific Python functions, ensuring that each request is processed correctly. For example,
a request to view real-time data would trigger a function that fetches the latest sensor
readings.
• Data Transmission: Flask facilitates secure and efficient data transmission between the
Raspberry Pi and the web interface. It ensures that data collected from the sensors is
transmitted to the webpage in real-time, enabling users to monitor environmental
conditions continuously.

Secure Data Transmission:

• User Authentication: Flask implements user authentication to restrict access to the local
webpage. Only authenticated users within the same network can access the data, ensuring
data privacy and security.
• Secure Communication: Flask can be configured to use HTTPS, ensuring that data
transmitted between the Raspberry Pi and the web interface is encrypted. This prevents
unauthorized access and protects sensitive environmental data from potential breaches.

Integration of Python and Flask:

The integration of Python and Flask creates a robust and efficient back-end system for the
IoT-based environmental monitoring project. Python handles the core functionalities of data
acquisition, processing, and hardware interfacing, while Flask manages the web server and

24 | P a g e
facilitates secure data transmission. This combination ensures that the system operates smoothly,
providing real-time monitoring, alerts, and an accessible user interface.

Fig A : Concept diagram with wiring and components

25 | P a g e
4.SYSTEM DESIGN AND DEVELOPMENT

4.1. Input Design

The input design phase is a cornerstone of the system's development, ensuring accurate and reliable
data acquisition from the environment. This phase meticulously configures and seamlessly
integrates two advanced sensors, the SGP30 and BMP280, with the Raspberry Pi single-board
computer, which serves as the central processing unit (CPU).

Detailed Configuration and Integration Process

SGP30 Sensor:

• Advanced Air Quality Monitoring: Developed by Sensirion, the SGP30 is a state-of-the-


art air quality sensor utilizing advanced metal-oxide semiconductor technology. It is
designed to measure and monitor a wide range of air quality parameters, including carbon
dioxide (CO2) levels and volatile organic compounds (VOCs). These parameters are
crucial indicators of indoor air quality and potential health hazards.
• Calibration for Accuracy: Before integration with the Raspberry Pi, the SGP30 sensor
undergoes a rigorous calibration process. This process is essential to ensure optimal
accuracy and reliability in its measurements. Calibration accounts for various
environmental factors such as temperature and humidity, which can influence the sensor's
performance. By addressing potential sources of measurement errors or drift, the

calibration process enhances the sensor’s precision.

• Data Acquisition: The SGP30 sensor is integrated with the Raspberry Pi using
communication interfaces like I2C or SPI. This integration establishes reliable data transfer
channels, allowing the sensor to transmit air quality data in real-time to the Raspberry Pi
for subsequent processing and analysis.

BMP280 Sensor:

26 | P a g e
• Atmospheric Pressure and Temperature Monitoring: The BMP280 sensor,
manufactured by Bosch Sensortec, is configured and optimized to monitor atmospheric
pressure and temperature with exceptional precision. Utilizing advanced piezo-resistive
technology, it provides highly accurate barometric pressure readings, essential for precise
tracking of atmospheric conditions.
• Calibration for Precision: The BMP280 features an integrated temperature sensor, which
is carefully calibrated to ensure accurate temperature measurements across a wide range of
environmental conditions. This calibration process is critical to mitigate potential
inaccuracies and ensure reliable data output.
• Data Integration: Similar to the SGP30, the BMP280 sensor is integrated with the
Raspberry Pi via I2C or SPI protocols. This setup ensures efficient data transfer and
seamless communication between the sensor and the central processing unit.

Real-Time Data Acquisition and Processing

• Continuous Data Transfer: The real-time data from the SGP30 and BMP280 sensors is
continuously transmitted to the Raspberry Pi. Optimized communication protocols and
efficient data buffering techniques are employed to ensure that no data is lost or corrupted
during transmission.
• Data Processing Algorithms: The Raspberry Pi acts as the cerebral cortex of the system,
receiving a continuous influx of environmental data. Sophisticated data processing
algorithms and techniques are utilized to analyze and interpret the received data. These
algorithms enable the system to accurately monitor and track environmental conditions in
real-time.

Ensuring Data Integrity and Accuracy

• Configuration and Calibration: Throughout the input design phase, meticulous attention
is paid to the proper configuration, calibration, and integration of the sensors. This attention
ensures that the data collected is accurate and reliable.

27 | P a g e
• Maintenance and Calibration Checks: Regular calibration checks and maintenance
procedures are implemented to mitigate potential sensor drift or performance degradation
over time. These procedures are crucial to maintaining the system's continued reliability
and precision in environmental monitoring.
Integration with Raspberry Pi

• Central Processing Unit: The Raspberry Pi, serving as the CPU, plays a central role in
managing the data acquisition and processing tasks. Its powerful processing capabilities
enable it to handle the vast amounts of data collected from the sensors.
• Communication Interfaces: The integration of the sensors with the Raspberry Pi through
I2C or SPI protocols ensures efficient and reliable communication. This setup facilitates
real-time data transfer, essential for accurate environmental monitoring.

Final Implementation

• System Testing and Validation: Before the final deployment, extensive testing and
validation procedures are conducted to ensure that the system operates as intended. These
procedures involve testing the data acquisition, processing, and alert mechanisms under
various environmental conditions.
• User Interface: The collected environmental data is visualized through an intuitive, user-
friendly local webpage interface. This interface provides a comprehensive overview of
real-time and historical data trends, enabling users to monitor and analyze environmental
conditions effectively.
• Secure Data Access: Access to the web interface is restricted to authenticated users within
the local network, ensuring that sensitive environmental data remains secure and
inaccessible to unauthorized entities. This stringent access control measure upholds data
privacy and integrity.

28 | P a g e
4.2 Output Design: The output design comprises two critical components:

Visual Alerts with RGB LED

The integration of an RGB LED into the IoT-based environmental monitoring system serves as a
crucial visual indicator to alert users of critical environmental conditions. Here's an elaboration on
its functionality and importance:

• Functionality: The RGB LED is programmed to illuminate in a striking red color when
any monitored environmental parameter exceeds its predefined threshold. This immediate
change in color serves as an unambiguous visual cue, ensuring that users are promptly
alerted to potential environmental hazards or anomalies.

• Significance: Visual alerts are essential for ensuring timely awareness and facilitating
proactive response measures. Unlike relying solely on auditory alerts or notifications, the
RGB LED provides a clear and visible signal that can be quickly noticed even in busy
environments or from a distance. This helps users take immediate action to address any
detected issues, thereby minimizing potential risks or adverse effects.

• Integration: The RGB LED is seamlessly integrated into the alerting module of the
system. This module continuously monitors the sensor data processed by the Raspberry Pi.
Upon detecting a parameter breach, it triggers the activation of the LED, ensuring that the
alerting mechanism operates in real-time alongside data acquisition and processing.

Web Interface for Data Visualization

The development of a user-centric, intuitive local webpage interface enhances the usability and

accessibility of environmental data. Here’s an elaboration on its features and benefits:

29 | P a g e
• User-Centric Design: The local webpage interface is designed with the user in mind,
featuring a clean and responsive layout. This design ensures that users can easily navigate
and interact with the interface to access the information they need.

• Real-Time and Historical Data: The interface presents both real-time and historical
environmental data in a comprehensive manner. Users can view current sensor readings as
well as trends over time, enabling them to monitor environmental conditions dynamically.

• Interactive Visualizations: To aid in data analysis, the interface incorporates interactive


visualizations and charts. These visual elements allow users to visualize trends,
correlations, and anomalies in the environmental data more effectively than raw numerical
values alone.

• Data Security: Access to the web interface is restricted to authenticated users within the
local network. This stringent access control measure ensures that sensitive environmental
data remains secure and inaccessible to unauthorized entities. It protects the integrity and
privacy of the data while allowing authorized personnel to monitor environmental
conditions seamlessly.

Importance of the Web Interface

• Decision Support: The comprehensive presentation of environmental data through the


web interface empowers users to make informed decisions. Whether it's identifying trends,
assessing environmental impacts, or responding to alerts, the interface provides the
necessary tools for effective decision-making.

• Monitoring and Analysis: By offering real-time updates and historical data insights, the
interface supports continuous monitoring and analysis of environmental parameters. This
capability is crucial for identifying long-term trends, evaluating the effectiveness of
environmental control measures, and ensuring compliance with regulatory standards.

• User Engagement: An intuitive interface encourages user engagement and participation


in environmental monitoring efforts. It promotes transparency and accountability by

30 | P a g e
enabling stakeholders to access and interpret data directly, fostering a collaborative
approach to environmental management.

4.3 Database Design

Utilization of SQLite Database for Environmental Data Management

In the IoT-based environmental monitoring system, the integration of a local SQLite database on
the Raspberry Pi plays a crucial role in efficiently storing, retrieving, and managing environmental

data. Here’s an elaboration on its implementation and benefits:

Database Schema Design

• Data Entities: The database schema is meticulously designed to accommodate several key
data entities:

◦ Sensor Data: Stores continuous measurements from sensors such as SGP30 (air
quality) and BMP280 (temperature, pressure).

◦ Thresholds: Predefined threshold values for environmental parameters, against


which real-time sensor data is compared to trigger alerts.

◦ Alert Logs: Records incidents where environmental parameters exceed predefined


thresholds, including timestamps and details of the alert.

◦ User Settings: Configuration settings related to data visualization preferences, alert


notifications, and user access controls.
• Normalized Structures: To ensure data integrity and minimize redundancy, normalized
database structures are employed. This involves organizing data into logical tables and
minimizing data duplication through efficient relationships (e.g., primary keys and foreign
keys).

31 | P a g e
Optimized Indexing Techniques

• Indexing for Performance: Optimized indexing techniques are implemented to enhance


database query performance. Indexes are created on frequently queried columns (e.g.,
timestamps, sensor IDs) to facilitate rapid data retrieval. This optimization ensures that
real-time sensor data can be processed and analyzed swiftly, supporting timely alert
notifications and data visualization.

Real-Time Data Processing and Analysis

• High-Performance Operations: The use of SQLite ensures high-performance read and


write operations, crucial for real-time data processing and analysis. This capability is
essential for handling the continuous influx of sensor data and generating immediate
responses, such as activating visual alerts via an RGB LED.

Data Integrity and Consistency

• Transactional Support: SQLite provides robust transactional support, ensuring ACID


(Atomicity, Consistency, Isolation, Durability) properties for database operations. This
guarantees that sensor data updates, threshold comparisons, and alert logging maintain data
integrity and consistency at all times.

• Error Handling: Comprehensive error handling mechanisms are implemented to manage


exceptions and ensure graceful handling of data-related errors. This approach minimizes
potential disruptions to data processing and maintains the reliability of the environmental
monitoring system.

Benefits of Local SQLite Database

• Resource Efficiency: SQLite is lightweight and operates directly on the Raspberry Pi's file
system, consuming minimal system resources. This efficiency is ideal for embedded
systems like the Raspberry Pi, ensuring optimal performance without significant overhead.

32 | P a g e
• Data Security: By storing environmental data locally on the Raspberry Pi, the system
reduces reliance on external servers or cloud services. This enhances data security by
minimizing exposure to potential cyber threats and unauthorized access.

System Design Diagrams:

Developing a comprehensive data flow diagram (DFD) for the IoT-based environmental
monitoring system is essential to visually illustrate how data moves through various stages within

the system. Here’s an elaboration on the components and flow depicted in the DFD:

Components in the Data Flow Diagram

1. Sensors (SGP30 and BMP280):

◦ Data Acquisition: The process begins with the sensors continuously collecting
environmental data, including air quality parameters (CO2, VOCs), temperature,
and atmospheric pressure.

2. Raspberry Pi:

◦ Central Processing Unit: Acts as the core processing unit where all sensor data is
sent for further analysis and processing.
◦ Data Processing: Upon receiving data from sensors, the Raspberry Pi applies
sophisticated algorithms to analyze and interpret the data. This includes comparing
current sensor readings with predefined threshold values stored in the local
database.

3. Local SQLite Database:

◦ Data Storage: The database stores sensor data, predefined thresholds, alert logs,
and user settings.

33 | P a g e
◦ Real-time Processing: Utilizes optimized indexing and transactional support to
ensure high-performance read and write operations. This enables real-time data
processing critical for timely alert notifications and data visualization.

4. Alerting Module (RGB LED):

◦ Visual Alert System: When a sensor detects that an environmental parameter has
exceeded a predefined threshold, the alerting module triggers the RGB LED to
illuminate in red. This provides a visible indication of the detected anomaly or
hazard.

5. Web Interface:

◦ User Interaction: The web interface serves as the primary output module for users
to interact with the system.
◦ Data Visualization: Presents real-time and historical environmental data in an
intuitive and user-friendly manner using HTML, CSS, JavaScript, and Flask.
◦ Data Access Control: Access to the web interface is restricted to authenticated
users within the local network, ensuring data security and privacy.

34 | P a g e
Environmental Data
Temp, Hum, Voc, Co2

SGP30 Sensor BMP280

Raspberry Pi
Processing Unit

Data
Data
Collection Processing

Alert System

Local Database
LED
Indication,
Buzzer

Web Interface
Data Visualization

35 | P a g e
Data Flow Processes

• Continuous Data Collection: Sensors continuously collect environmental data and


transmit it to the Raspberry Pi.
• Real-time Processing: The Raspberry Pi receives and processes incoming sensor data,
applying algorithms to analyze for threshold breaches.
• Alert Triggering: Upon detecting a threshold breach, the alerting module activates the
RGB LED to visually alert users.
• Database Interaction: Sensor data, threshold values, alert logs, and user settings are stored
and managed within the SQLite database, facilitating efficient data retrieval and storage.
• Web Interface Interaction: Users access the web interface to view real-time sensor
readings, historical data trends, and receive alerts. The interface facilitates user interaction
through responsive design and interactive visualizations.

Benefits of the Data Flow Diagram

• Visualization: Provides a clear and structured overview of how data moves through the
system components, aiding in understanding system architecture and data dependencies.
• System Understanding: Facilitates communication among stakeholders by illustrating the
operational flow and interactions between hardware components (sensors, Raspberry Pi)
and software components (database, web interface).
• Troubleshooting and Optimization: Helps in identifying potential bottlenecks or areas
for optimization in data processing and flow, ensuring the system operates efficiently and

Fig 1: Dataflow diagram

effectively.

36 | P a g e
Constructing an Entity Relationship Diagram (ERD) is crucial for visualizing and designing the
relationships between different data entities within the IoT-based environmental monitoring

system. Here’s an elaboration on the components and relationships depicted in the ERD:

Components in the Entity Relationship Diagram

1. Entities:

◦ Sensor Data: Represents continuous measurements collected from sensors such as


SGP30 (air quality) and BMP280 (temperature, pressure).
◦ Thresholds: Predefined values against which sensor data is compared to trigger
alerts.
◦ Alert Logs: Records incidents where environmental parameters exceed predefined
thresholds, including timestamps and details of the alert.

◦ User Settings: Configuration settings related to data visualization preferences, alert


notifications, and user access controls.

2. Relationships:

◦ Sensor Data to Thresholds: A one-to-many relationship where each sensor data


record can be associated with multiple threshold values.
◦ Alert Logs to Sensor Data: A many-to-one relationship indicating that multiple
alert logs can be associated with a single sensor data record.
◦ User Settings to Alerts: A one-to-many relationship indicating that each user
setting can be associated with multiple alert logs.

Design Considerations

37 | P a g e
• Normalization: Ensures that data redundancy is minimized by organizing data into logical
tables and establishing relationships between them. This supports data integrity and
efficient data management.

• Primary Keys and Foreign Keys: Primary keys uniquely identify records within each
table, while foreign keys establish relationships between tables. For instance, the sensor
data table might have a primary key, and the threshold table would have a corresponding
foreign key referencing the sensor data.

ERD Implementation

• Visual Representation: The ERD visually represents the entities (tables), attributes
(columns), and relationships between tables. It provides a clear and structured overview of
how data entities are related and interconnected within the database schema.

• Tool Usage: ERD tools such as Lucidchart, Microsoft Visio, or online database modeling
tools are utilized to construct and refine the diagram. These tools facilitate collaboration
among project stakeholders and allow for iterative design improvements.

Benefits of the ERD

• Database Design: Guides the design and implementation of the database schema, ensuring
that it supports the storage and retrieval of environmental data efficiently.

• Data Integrity: Helps enforce data integrity constraints through normalized structures and
relationship definitions, preventing anomalies such as data duplication or inconsistencies.

• Query Optimization: Provides insights into how data should be structured to optimize
database queries, supporting real-time data processing and analysis.

38 | P a g e
SENSOR DATA

Thresholds
Parameter ID

Value

Time Stamp

ALERTS USER
SETTING
Alert ID
User ID
Parameter ID
User Name
Time Stamp

USER

User ID
User Name
Password

Fig 2: Entity Relationship Diagram

39 | P a g e
5. SYSTEM TESTING AND IMPLEMENTATION

2. System Testing

Implementing a comprehensive testing strategy is essential to ensure the reliability, accuracy, and

security of the IoT-based environmental monitoring system. Here’s an elaboration on each stage

of testing:

Unit Testing

Objective:

• Verify the functionality of each individual module in isolation.


• Validate that each module performs its specific tasks correctly, including handling edge
cases and error conditions.

Key Components Tested:

• Data Collection Module: Ensure sensors (SGP30, BMP280) accurately collect and
transmit data.
• Data Processing Module: Validate algorithms for threshold comparison and anomaly
detection.

40 | P a g e
• Alerting Module: Confirm proper activation of RGB LED upon threshold breaches.
• Web Interface Components: Test functionality for data visualization, real-time updates,
and user interaction.

Methodology:

• Test Cases: Develop test cases to cover all functionalities and potential use cases.
• Mocking: Use mock objects or simulated data to test module interactions.
• Edge Cases: Include scenarios where sensors provide extreme values or unexpected input.

Integration Testing

Objective:

• Validate interoperability and communication between integrated modules.


• Ensure seamless data flow and interaction across the entire system.
Key Integration Points:

• Sensor to Raspberry Pi Integration: Verify data transmission and reception.


• Raspberry Pi to Database: Test data storage and retrieval processes.
• Database to Web Interface: Validate real-time data updates and user access controls.
Methodology:

• Scenario Testing: Execute test scenarios that involve multiple modules working together.
• Interface Testing: Check data consistency and integrity across interfaces.
• Compatibility Testing: Ensure compatibility across different hardware and software
components.

System Testing

Objective:

• Assess the overall performance, accuracy, and reliability of the fully integrated system.

41 | P a g e
• Evaluate system behavior under various conditions and stress testing scenarios.

Key Testing Areas:

• Performance Testing: Measure response times and system throughput under normal and
peak loads.
• Stress Testing: Evaluate system stability and resource handling under high data volume or
concurrent user access.
• Reliability Testing: Ensure continuous operation and data integrity over extended periods.

Methodology:

• Load Testing Tools: Use tools to simulate high-volume data and user interactions.
• Failure Mode Testing: Assess system behavior during hardware or software failures.
• Scalability Testing: Test system scalability to accommodate future growth in data volume
or user base.

Security Testing

Objective:

• Identify and mitigate potential security vulnerabilities in the system.


• Ensure data confidentiality, integrity, and availability against unauthorized access or
attacks.

Key Security Tests:

• Penetration Testing: Conduct simulated attacks to identify weaknesses in network and


application security.
• Access Control Testing: Verify that only authenticated users can access sensitive data and
perform authorized actions.

42 | P a g e
• Encryption Testing: Assess data encryption mechanisms to protect data during
transmission and storage.

Methodology:

• Vulnerability Scanning: Use automated tools to scan for known vulnerabilities in


software and network infrastructure.
• Authentication Testing: Test login mechanisms and session management for
vulnerabilities.
• Compliance Testing: Ensure adherence to security standards and regulations relevant to
environmental data protection.

User Acceptance Testing (UAT)

Objective:

• Validate the system's usability and functionality from an end-user perspective.


• Gather feedback to ensure the system meets user requirements and expectations

Key UAT Activities:

• Scenario Testing: Users perform typical tasks to validate ease of use and system
functionality.
• Feedback Collection: Gather user feedback on interface design, responsiveness, and
overall user experience.
• Requirement Validation: Confirm that the system meets specified user requirements and
operational needs.

Methodology:

• User Involvement: Engage representative end-users or stakeholders in testing activities.

43 | P a g e
• Test Environment: Provide a controlled environment where users can interact with the
system.
• Iterative Improvement: Implement changes based on user feedback to enhance system
usability and effectiveness.

3. System Implementation

Implementing the IoT-based environmental monitoring system involves a series of carefully

planned and executed steps to ensure its reliability, accuracy, and security. Here’s an elaboration

on each key step:

1. Hardware Setup

Objective:

• Assembly: Physically assemble the Raspberry Pi, sensors (SGP30 and BMP280), RGB
LED, and wiring.
• Interconnection: Ensure secure and reliable connections between components to avoid
interference or data loss.
• Shielding: Implement proper grounding and shielding to mitigate environmental noise and
interference.

Importance:

• A well-assembled hardware setup ensures stable and uninterrupted data acquisition and
processing.
• Proper shielding and grounding are crucial to maintaining signal integrity and reducing
potential errors.

2. Software Deployment

Objective:

44 | P a g e
• Operating System: Install and configure Raspberry Pi OS for stable operation.
• Programming Language: Deploy Python and necessary libraries for sensor data
acquisition, processing, and control logic.
• Web Framework: Set up Flask for serving the local webpage interface and handling web
requests.

Importance:

• A correctly deployed software stack forms the foundation for data collection, processing,
and user interaction.
• Rigorous testing ensures compatibility and functionality across all software components.

3. Network Configuration

Objective:

• LAN Setup: Configure a dedicated or existing local area network (LAN) to facilitate
secure communication.
• Access Control: Implement network security measures (e.g., firewalls, access control lists)
to restrict access to authorized users within the network.

Importance:

• Secure network configuration protects sensitive environmental data from unauthorized


access.
• Controlled access ensures only authorized personnel can interact with the monitoring
system.

4. Sensor Calibration and Integration

45 | P a g e
Objective:

• Calibration: Conduct thorough calibration of the SGP30 and BMP280 sensors to ensure
accurate measurement of air quality, temperature, and pressure.
• Integration: Establish reliable communication channels (e.g., I2C, SPI) between sensors
and the Raspberry Pi for data transmission.

Importance:

• Calibrated sensors provide reliable data crucial for accurate environmental monitoring.
• Proper integration ensures seamless data flow and timely detection of environmental
anomalies.

5. Threshold Configuration

Objective:

• Threshold Definition: Set predefined threshold values for each monitored environmental
parameter based on regulatory standards and site-specific requirements.
• Adjustment: Provide a user-friendly interface for authorized personnel to review and
adjust threshold values as necessary.

Importance:

• Thresholds serve as triggers for alerts and response measures, ensuring proactive
environmental management.
• User-friendly configuration enhances operational flexibility and adaptability to changing
environmental conditions.

6. Database Setup and Optimization

Objective:

46 | P a g e
• Database Initialization: Set up an SQLite database with optimized tables and schemas to
store sensor data, alerts, and user settings.
• Performance Optimization: Implement indexing strategies and performance tuning
techniques to ensure efficient data storage and retrieval.

Importance:

• A well-structured database supports real-time data processing and analysis without


compromising system performance.
• Optimization minimizes latency and enhances overall system responsiveness.

7. User Interface Development

Objective:

• Webpage Design: Develop a responsive and user-friendly local webpage interface using
HTML, CSS, and JavaScript.
• Visualizations: Implement interactive charts and graphs to present real-time and historical
environmental data effectively.

Importance:

• An intuitive interface facilitates user interaction, data visualization, and decision-making.


• Interactive visualizations enhance data comprehension and support informed
environmental management practices.

8. Integration and System Testing

Objective:

• Integration Testing: Validate interoperability and communication between hardware and


software components.

47 | P a g e
• System Testing: Conduct comprehensive testing under various scenarios to ensure the
system meets functional and non-functional requirements.

Importance:

• Testing verifies system reliability, accuracy, and adherence to specifications before


deployment.
• Identifying and addressing issues early in the development cycle mitigates risks during
operational deployment.

9. User Training and Documentation

Objective:

• Training Sessions: Provide comprehensive training on system operation, data


interpretation, and troubleshooting procedures for end-users.
• Documentation: Develop user manuals and technical documentation to serve as reference
materials for ongoing support and maintenance.

Importance:

• Effective training enhances user adoption and utilization of the monitoring system.
• Documentation ensures consistent operational practices and facilitates efficient problem-
solving.

10. Pilot Deployment and Performance Monitoring

Objective:

• Pilot Deployment: Test the system in a controlled environment or subset of target sites to
validate performance and gather user feedback.

48 | P a g e
• Monitoring: Continuously monitor system performance, identify issues, and implement
improvements based on user feedback and operational data.

Importance:

• Pilot deployment validates system functionality and reliability under real-world


conditions.
• Performance monitoring ensures continuous optimization and operational efficiency.

11. Full-Scale Deployment and Ongoing Support

Objective:

• Deployment: Roll out the monitoring system across all target sites or environments
following successful pilot testing.
• Support Plan: Establish a robust support and maintenance plan to address user inquiries,
system updates, and enhancements.

Importance:

• Full-scale deployment extends system benefits to broader stakeholders and environmental


management practices.
• Ongoing support ensures long-term reliability, data integrity, and user satisfaction.

49 | P a g e
6. CONCLUSION

The IoT-based environmental monitoring system developed in this project represents a significant
leap forward in proactive environmental management, integrating advanced sensor technology,
robust data processing capabilities, and user-friendly interfaces to offer a secure, efficient, and
reliable solution for real-time environmental surveillance.

Seamless Integration of Technologies

Sensor Technology: The system leverages state-of-the-art sensors like the SGP30 for air quality
monitoring (CO2 and VOCs) and the BMP280 for temperature and pressure. These sensors
provide precise and continuous data on critical environmental parameters, ensuring comprehensive
monitoring essential for detecting anomalies or hazardous conditions promptly.

Data Processing: Acting as the central processing unit, the Raspberry Pi processes the influx of
sensor data with sophisticated algorithms. This enables real-time analysis against predefined
thresholds, ensuring immediate detection of deviations that could indicate environmental risks.

Alerting Mechanism: An RGB LED serves as an instantaneous visual alert, illuminating in red
upon detecting threshold breaches. This alerting system ensures timely notification, empowering
users to take proactive measures to mitigate potential risks or adverse effects promptly.

50 | P a g e
Secure Data Access: The system employs stringent security protocols to control access to
sensitive environmental data. Data is accessible only through a secure, user-friendly local webpage
interface within the network, safeguarding privacy and integrity against unauthorized access or
breaches.

Benefits and Advantages

Timely Awareness and Response: By continuously monitoring environmental parameters and


providing immediate alerts, the system enhances situational awareness. This capability enables
stakeholders to respond swiftly to changing environmental conditions, thereby reducing the
likelihood of adverse impacts.

Scalability and Flexibility: Designed with a modular architecture, the system supports scalability
and flexibility. Additional sensors can be seamlessly integrated to monitor new parameters as
environmental monitoring needs evolve, ensuring the system remains adaptable to future
requirements.

Compliance and Reliability: The system undergoes rigorous testing and validation across
multiple stages—unit testing, integration testing, system testing, security testing, and user
acceptance testing. This ensures its reliability, accuracy, and compliance with industry standards
and regulatory requirements, instilling confidence in its operational effectiveness.

Practical Applications and Impact

Real-world Application: The practical application of cutting-edge IoT technologies in


environmental monitoring addresses real-world challenges effectively. By providing a
comprehensive solution for continuous monitoring and timely alerting, the system supports
sustainable environmental practices and proactive risk mitigation strategies.

Stakeholder Confidence: Stakeholders, including organizations and communities committed to


environmental sustainability, benefit from the system's robust capabilities and secure operation.
The assurance of controlled data access and reliable performance enhances stakeholder confidence
in the system's ability to support informed decision-making and environmental stewardship.

51 | P a g e
7. FUTURE SCOPE

The IoT-based environmental monitoring system, with its robust modular design and scalable
architecture, presents numerous avenues for future enhancements and expansions, each promising
to further elevate its capabilities and impact in environmental management:

Cloud Integration

Integrating with cloud services would extend the system's reach beyond local networks, enabling
remote access to environmental data and alerts from anywhere in the world. Cloud computing
resources could facilitate scalable storage, advanced analytics, and real-time data synchronization
across multiple deployment sites. This enhancement would enhance accessibility, scalability, and
data management capabilities.

Additional Sensor Integration

The system's modular architecture allows for seamless integration of additional sensors to monitor
a wider array of environmental parameters. Sensors for humidity, particulate matter, noise levels,
and other relevant factors could provide a more comprehensive understanding of environmental
conditions. This expansion would enrich the data collected, offering deeper insights for informed
decision-making and proactive management strategies.

Mobile Application Development

52 | P a g e
Developing a dedicated mobile application would enhance user accessibility and convenience.
Users could receive real-time alerts, visualize data trends, and adjust system settings directly from
their mobile devices. This mobile interface would empower users to monitor environmental
conditions on the go, facilitating quicker response times and proactive management actions.

Advanced Analytics and Machine Learning

Implementing advanced analytics and machine learning algorithms could unlock predictive
analysis capabilities based on historical environmental data. These technologies could detect
patterns, forecast trends, and identify anomalies more effectively. Such insights would enable
proactive risk mitigation and optimization of environmental management strategies, enhancing the
system's overall effectiveness.

Artificial Intelligence-Assisted Decision Support

Integrating artificial intelligence (AI) capabilities would enable the system to provide intelligent
decision support based on real-time data analysis. AI algorithms could analyze complex data
relationships, identify correlations, and suggest optimal courses of action. This capability would
empower users with data-driven insights, facilitating more informed and strategic decision-making
processes.

IoT Ecosystem Integration

Aligning the environmental monitoring system with broader IoT ecosystems, such as smart
buildings or smart cities, would foster synergies and enable data exchange across interconnected
systems. This integration could lead to more holistic environmental monitoring and management
approaches, enhancing coordination and efficiency in resource allocation and environmental
protection efforts.

Distributed Sensor Networks

Expanding the system to support distributed sensor networks would enable monitoring of larger
geographical areas or multiple sites simultaneously. Deploying sensor nodes with local processing
capabilities, communicating with a central monitoring station, would enhance scalability and

53 | P a g e
coverage. This approach would support diverse applications, from urban air quality monitoring to
large-scale environmental assessments.

Augmented Reality (AR) and Virtual Reality (VR) Interfaces

Incorporating AR and VR technologies would transform how users interact with environmental
data. AR overlays could provide real-time data visualizations in the physical environment,
enhancing situational awareness. VR environments could offer immersive simulations for training,
scenario planning, and data exploration, fostering deeper understanding and engagement among
stakeholders.

Energy Harvesting and Sustainable Power Solutions

Exploring energy harvesting techniques, such as solar panels or wind turbines, could enhance the
system's sustainability and reduce its environmental footprint. Incorporating renewable energy
sources for power supply would align the system with principles of environmental stewardship,
ensuring its operations are environmentally responsible and sustainable.

Collaboration and Knowledge Sharing

Promoting collaboration and knowledge sharing among stakeholders, researchers, and industry
experts would drive continuous innovation and improvement. Establishing partnerships, hosting
workshops, and participating in forums would facilitate the exchange of best practices, insights,
and emerging technologies. This collaborative approach would ensure the system remains adaptive
and at the forefront of environmental monitoring solutions

54 | P a g e
Source Code

Libraries installed

pip install adafruit-circuitpython-sgp30 adafruit-circuitpython-bmp280 flask

pip install adafruit_sgp30

pip install adafruit_bmp280

SGP30 source code:

import time

import board

import busio

import adafruit_sgp30

# Initialize I2C bus and SGP30

i2c = busio.I2C(board.SCL, board.SDA)

55 | P a g e
sgp30 = adafruit_sgp30.Adafruit_SGP30(i2c)

sgp30.iaq_init()

sgp30.set_iaq_baseline(0x8973, 0x8aae)

print("SGP30 Sensor initialized")

print("Initial eCO2: {} ppm".format(sgp30.eCO2))

print("Initial TVOC: {} ppb".format(sgp30.TVOC))

# Continuously read and print sensor data

while True:

print("eCO2: {} ppm \t TVOC: {} ppb".format(sgp30.eCO2, sgp30.TVOC))

time.sleep(1)

BMP280 Source Code

import time

import board

import busio

import adafruit_bmp280

# Initialize I2C bus and BMP280

i2c = busio.I2C(board.SCL, board.SDA)

56 | P a g e
bmp280 = adafruit_bmp280.Adafruit_BMP280_I2C(i2c)

# Set BMP280 settings if necessary

bmp280.sea_level_pressure = 1013.25

print("BMP280 Sensor initialized")

# Continuously read and print sensor data

while True:

temperature = bmp280.temperature

pressure = bmp280.pressure

altitude = bmp280.altitude

print("Temperature: {:.2f} °C \t Pressure: {:.2f} hPa \t Altitude: {:.2f} meters".format(

temperature, pressure, altitude))

time.sleep(1)

Main code integrated(sgp30 and bmp280 sensors)

import time

from flask import Flask, jsonify, render_template

import board

57 | P a g e
import busio

import adafruit_sgp30

import adafruit_bmp280

# Initialize I2C bus and sensors

i2c = busio.I2C(board.SCL, board.SDA)

sgp30 = adafruit_sgp30.Adafruit_SGP30(i2c)

bmp280 = adafruit_bmp280.Adafruit_BMP280_I2C(i2c)

# Initialize SGP30

sgp30.iaq_init()

sgp30.set_iaq_baseline(0x8973, 0x8aae)

app = Flask(__name__)

# Function to read sensor data

def get_sensor_data():

temperature = bmp280.temperature

pressure = bmp280.pressure

co2eq = sgp30.eCO2

tvoc = sgp30.TVOC

58 | P a g e
return {

"temperature": temperature,

"pressure": pressure,

"co2eq": co2eq,

"tvoc": tvoc

@app.route('/')

def index():

return render_template('index.html')

@app.route('/data')

def data():

sensor_data = get_sensor_data()

return jsonify(sensor_data)

if __name__ == '__main__':

app.run(host='0.0.0.0', port=5000)

59 | P a g e
Local webpage Program

<!DOCTYPE html>

<html>

<head>

<title>Sensor Data</title>

<script>

function fetchData() {

fetch('/data')

.then(response => response.json())

.then(data => {

document.getElementById('temperature').innerText =
data.temperature.toFixed(2) + ' °C';

document.getElementById('pressure').innerText = data.pressure.toFixed(2) +
' hPa';

document.getElementById('co2eq').innerText = data.co2eq + ' ppm';

document.getElementById('tvoc').innerText = data.tvoc + ' ppb';

});

setInterval(fetchData, 1000);

</script>

</head>

<body onload="fetchData()">

60 | P a g e
<h1>Sensor Data</h1>

<p>Temperature: <span id="temperature">Loading...</span></p>

<p>Pressure: <span id="pressure">Loading...</span></p>

<p>CO2eq: <span id="co2eq">Loading...</span></p>

<p>TVOC: <span id="tvoc">Loading...</span></p>

</body>

</html>

8.BIBLOGRAPHY

1. Atzori, L., Iera, A., & Morabito, G. (2010). The Internet of Things: A survey. Computer
Networks, 54(15), 2787-2805.

2. Gubbi, J., Buyya, R., Marusic, S., & Palaniswami, M. (2013). Internet of Things (IoT): A
vision, architectural elements, and future directions. Future Generation Computer
Systems, 29(7), 1645-1660.

3. Marques, G., Pitarma, R., Garcia, N. M., & Pombo, N. (2019). Internet of Things
architctures, technologies, applications, challenges, and future directions for enhanced
living environments and healthcare systems: A review. Electronics, 8(10), 1081.

4. https://flask.palletsprojects.com/.

5. https://www.sensirion.com/en/environmental-sensors/gas-sensors/sgp30/

6. https://www.bosch-sensortec.com/products/environmental-sensors/humidity-sensors-
bmp280/.

7. https://iotbytes.wordpress.com/

61 | P a g e
8. https://www.hackster.io/pro/projects?tag=environmental&build_status=built

9. https://www.instructables.com/howto/environmental+monitoring/

62 | P a g e

You might also like