0% found this document useful (0 votes)
26 views5 pages

Smart Air Quality Monitoring System

The document outlines a smart air quality monitoring system using an Arduino Uno and various sensors to track environmental parameters such as temperature, humidity, and hazardous gas levels. The system employs a DHT11 sensor for temperature and humidity, an MQ-7 sensor for carbon monoxide detection, and an MQ-2 sensor for smoke and combustible gas detection, providing real-time data. Future enhancements include calibration of sensor readings, data logging capabilities, alert mechanisms, and the development of a user interface for remote monitoring.

Uploaded by

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

Smart Air Quality Monitoring System

The document outlines a smart air quality monitoring system using an Arduino Uno and various sensors to track environmental parameters such as temperature, humidity, and hazardous gas levels. The system employs a DHT11 sensor for temperature and humidity, an MQ-7 sensor for carbon monoxide detection, and an MQ-2 sensor for smoke and combustible gas detection, providing real-time data. Future enhancements include calibration of sensor readings, data logging capabilities, alert mechanisms, and the development of a user interface for remote monitoring.

Uploaded by

Mrudula wani
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 5

Smart Air Quality Monitoring

System
Group Members:
1. Jayesh Pathak – 22104B0012
2. Aditya Bhagwat – 22104B0009
3. Dhruv Jain – 22104B0028
4. Akansha Tandale – 22104B0017

1. Introduction
Air quality has become an increasingly important factor in ensuring
healthy living environments. Monitoring indoor and outdoor air quality can
help in early detection of hazardous pollutants such as carbon monoxide,
smoke, and other harmful gases. This project describes a smart air quality
monitoring system that integrates multiple sensors to monitor
environmental parameters including temperature, humidity, and gas
concentrations. The system is built around an Arduino Uno microcontroller
and utilizes a DHT11 sensor for temperature and humidity readings, an
MQ-7 sensor for carbon monoxide detection, and an MQ-2 sensor for
smoke and combustible gas detection.

2. Objectives
 Monitor environmental conditions: Capture temperature and
humidity using the DHT11 sensor.
 Detect hazardous gases: Use the MQ-7 sensor to monitor carbon
monoxide levels and the MQ-2 sensor to detect the presence of
smoke and other flammable gases.
 Provide real-time data: Transmit sensor readings to a serial
monitor for real-time monitoring.
 Potential integration: Lay the groundwork for future integration
with alert systems (e.g., alarms, SMS notifications, or IoT platforms).

3. System Components
3.1 Arduino Uno

The Arduino Uno is an 8-bit microcontroller board based on the


ATmega328P. It offers:

 Digital I/O Pins: 14 (of which 6 can be used as PWM outputs)


 Analog Input Pins: 6 (A0 to A5)
 Clock Speed: 16 MHz
 Flash Memory: 32 KB (ATmega328P)
 Operating Voltage: 5V
 USB Interface: For programming and serial communication

The Arduino Uno is chosen for its simplicity, community support, and ease
of interfacing with multiple sensors.

3.2 Sensors

3.2.1 DHT11 Temperature & Humidity Sensor

 Function: Measures ambient temperature and relative humidity.


 Operating Voltage: 3.3V to 5V
 Accuracy: ±2 °C for temperature and ±5% for humidity.
 Interface: Single digital data pin.

3.2.2 MQ-7 Carbon Monoxide Sensor

 Function: Detects carbon monoxide (CO) concentrations.


 Operating Principle: Metal oxide semiconductor that changes
resistance based on CO concentration.
 Interface: Analog voltage output corresponding to CO levels.
 Calibration: Requires periodic calibration and proper heating cycle
for accurate readings.

3.2.3 MQ-2 Gas/Smoke Sensor

 Function: Detects flammable gases and smoke, including LPG,


methane, and smoke.
 Operating Principle: Changes resistance when exposed to target
gases.
 Interface: Analog voltage output.
 Usage: Often used in fire or gas leak detection systems.

4. Hardware Configuration and Pin


Connections
4.1 Pin Configuration Table

Senso Arduino Uno


Function
r Pin
DHT1 Temperature & Humidity
Digital Pin D2
1 Data
Carbon Monoxide Analog
MQ-7 Analog Pin A0
Output
MQ-2 Gas/Smoke Analog Output Analog Pin A1

4.2 Wiring Overview


 DHT11 Sensor:
o VCC to Arduino 5V
o GND to Arduino GND
o Data to Digital Pin D2
 MQ-7 Sensor:
o VCC to Arduino 5V
o GND to Arduino GND
o Analog Output to Analog Pin A0
 MQ-2 Sensor:
o VCC to Arduino 5V
o GND to Arduino GND
o Analog Output to Analog Pin A1

5. Software Implementation
#include <DHT.h>

// DHT11 Sensor Configuration


#define DHTPIN 2 // DHT11 Data pin is connected to Digital Pin 2
#define DHTTYPE DHT11 // Define sensor type DHT11
DHT dht(DHTPIN, DHTTYPE);

// MQ Sensor Pin Definitions


#define MQ7_PIN A0 // MQ-7 sensor connected to Analog Pin A0
#define MQ2_PIN A1 // MQ-2 sensor connected to Analog Pin A1

void setup() {
// Initialize Serial Communication
Serial.begin(9600);
// Initialize DHT11 sensor
dht.begin();
Serial.println("Smart Air Quality Monitoring System Initialized");
}

void loop() {
// Reading temperature and humidity from DHT11
float temperature = dht.readTemperature(); // in Celsius
float humidity = dht.readHumidity();

// Check if any reads failed and exit early (to try again).
if (isnan(temperature) || isnan(humidity)) {
Serial.println("Failed to read from DHT sensor!");
delay(2000);
return;
}
// Read gas sensor values from MQ-7 and MQ-2
int mq7_value = analogRead(MQ7_PIN); // Raw analog value for CO concentration
int mq2_value = analogRead(MQ2_PIN); // Raw analog value for Gas/Smoke
concentration

// Output the sensor readings to the Serial Monitor


Serial.println("---- Sensor Readings ----");
Serial.print("Temperature: "); Serial.print(temperature); Serial.println(" °C");
Serial.print("Humidity: "); Serial.print(humidity); Serial.println(" %");
Serial.print("MQ-7 (CO level): "); Serial.println(mq7_value);
Serial.print("MQ-2 (Gas/Smoke level): "); Serial.println(mq2_value);
Serial.println("-------------------------\n");

// Delay between sensor readings


delay(2000);
}

5.1 Code Explanation

 Library Inclusion and Definitions:


The sketch includes the DHT library for sensor readings and sets up
the required pins for the DHT11, MQ-7, and MQ-2 sensors.
 Setup Function:
Initializes the serial communication and the DHT sensor.
 Loop Function:
o Reads temperature and humidity values.
o Reads the analog outputs of the MQ-7 and MQ-2 sensors.
o Outputs all readings to the serial monitor every 2 seconds.

6. Results and Discussion


When the system is powered on and the code is uploaded to the Arduino
Uno, the following observations can be made:

 Temperature & Humidity:


The DHT11 sensor provides periodic readings of ambient
temperature (in °C) and relative humidity (%). These readings are
visible on the serial monitor.
 Gas Sensor Readings:
o MQ-7: The analog reading from the MQ-7 sensor indicates the
level of carbon monoxide in the environment. In a normal
setting with low CO levels, the raw value should be relatively
low.
o MQ-2: Similarly, the MQ-2 sensor outputs a raw analog value
that correlates with the concentration of smoke or
combustible gases. Higher readings may indicate the
presence of smoke or hazardous gases.
 Observations:
The system allows for real-time monitoring of key environmental
parameters. Although the raw analog values for the MQ sensors
require calibration and conversion to standard units (like ppm), the
data can be further processed to set thresholds for alerting. For
instance, if the MQ-7 value exceeds a predefined limit, it could
trigger an alarm or notification.

7. Conclusion
This project demonstrates a basic yet effective approach to building a
smart air quality monitoring system using an Arduino Uno and multiple
sensors. By combining the DHT11, MQ-7, and MQ-2 sensors, the system
can monitor temperature, humidity, carbon monoxide, and smoke/gas
levels in real-time. With further calibration and integration of
communication modules, the system can be extended to notify users of
poor air quality or potential hazards, thereby contributing to safer living
environments.

8. Future Enhancements
 Calibration and Conversion: Develop and implement calibration
routines for the MQ sensors to convert raw analog readings into
meaningful concentration units (e.g., ppm).
 Data Logging: Integrate an SD card module or IoT connectivity
(e.g., WiFi or GSM) to log data for long-term analysis.
 Alert Mechanism: Incorporate buzzer alarms, LEDs, or wireless
notifications to alert users when pollutant levels exceed safe
thresholds.
 User Interface: Develop a web or mobile application for remote
monitoring of the sensor data.

You might also like