0% found this document useful (0 votes)
3 views

Sensor Report

The document presents a project on a smoke and temperature detection system utilizing the MQ-2 gas sensor and DHT11 temperature sensor, which triggers an LED alert for early fire hazard warnings. It includes details on the theory, block diagram, flowchart, code implementation, and applications in various environments such as homes, offices, and factories. The conclusion emphasizes the system's effectiveness in real-time monitoring and safety enhancement using affordable hardware.

Uploaded by

yashjaiswal-inft
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)
3 views

Sensor Report

The document presents a project on a smoke and temperature detection system utilizing the MQ-2 gas sensor and DHT11 temperature sensor, which triggers an LED alert for early fire hazard warnings. It includes details on the theory, block diagram, flowchart, code implementation, and applications in various environments such as homes, offices, and factories. The conclusion emphasizes the system's effectiveness in real-time monitoring and safety enhancement using affordable hardware.

Uploaded by

yashjaiswal-inft
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/ 7

“Smoke and Temperature Detection System using MQ-2

and DHT11 with Simulation Mode”

By

Omkar Temkar TEIT 2 Roll Number 46


Nikhil Mudumadigela TEIT 1 Roll Number 67
Yash Jaiswal TEIT-1 Roll Number 46

Guide:
Prof. Snehal Gholap
Assistant Professor

Department of Information Technology


Atharva College of Engineering
Malad West, Mumbai
University of Mumbai
2024-2025
1
Table of Contents

Sr.No. Topic Page No.

1 Introduction 3

2 Theory 3

3 Block Diagram 4

4 Flowchart 5

5 Code 6

6 Application 7

7 Conclusion 8
Introduction

This project focuses on detecting smoke and temperature in real-time using the MQ-2 gas
sensor and the DHT11 temperature sensor. When critical levels of smoke or temperature
are detected, it triggers an LED alert, providing an early warning to prevent potential fire
hazards, making it a crucial part of safety systems.

Theory
The MQ-2 sensor is highly sensitive to smoke and gases like LPG, methane, and carbon monoxide, while
the DHT11 sensor measures ambient temperature and humidity. By monitoring both parameters
simultaneously, the system ensures that any irregularities, such as excessive smoke or heat, are flagged
instantly, allowing for rapid intervention. The LED serves as a visual alarm for the user

Block Diagram
Algorithm
Code

#include <DHT.h>

// Define pins
#define MQ2_PIN A0 // Analog pin for
MQ-2
#define DHTPIN 2 // Digital pin for
DHT11
#define LED_PIN 8 // Digital pin for
LED
#define DHTTYPE DHT11 // DHT 11 sensor

DHT dht(DHTPIN, DHTTYPE);

// Thresholds
const int smokeThreshold = 300; // MQ-
2 threshold (tune if needed)
const float tempThreshold = 45.0; //
Temperature threshold
unsigned long previousMillis = 0; //
Timer for simulation blinking
bool simulateBlinkState = false;

void setup() {
pinMode(MQ2_PIN, INPUT);
pinMode(LED_PIN, OUTPUT);
Serial.begin(9600);
dht.begin();
}

void loop() {
bool simulateMode = false;
int smokeValue = analogRead(MQ2_PIN);
float temperature = dht.readTemperature();

// Check for sensor errors


if (isnan(temperature) || smokeValue < 0 ||
smokeValue > 1024) {
simulateMode = true;
Serial.println("Sensor error! Simulating
LED behavior...");
}
// Print sensor values
Serial.print("Smoke: ");
Serial.print(smokeValue);
Serial.print(" | Temp: ");
Serial.println(temperature);

if (!simulateMode) {
// Real detection
if (smokeValue > smokeThreshold ||
temperature > tempThreshold) {
digitalWrite(LED_PIN, HIGH);
Serial.println("Warning! Smoke or High
Temp Detected!");
} else {
digitalWrite(LED_PIN, LOW);
}
} else {
// Simulation: Blink every 30 sec, stay on
for 5 sec
unsigned long currentMillis = millis();
if (currentMillis - previousMillis >=
30000 || simulateBlinkState) {
if (!simulateBlinkState) {
digitalWrite(LED_PIN, HIGH);
simulateBlinkState = true;
previousMillis = currentMillis;
Serial.println("Simulated LED ON");
} else if (currentMillis -
previousMillis >= 5000) {
digitalWrite(LED_PIN, LOW);
simulateBlinkState = false;
Serial.println("Simulated LED OFF");
previousMillis = currentMillis;
}
}
}

delay(1000); // Loop delay


}

Application

Home Safety: Detects smoke or gas leaks in kitchens and living areas, preventing fire
hazards.
Offices & Server Rooms: Helps monitor temperature surges to avoid overheating and damage to electronic
equipment.

Warehouses & Factories: Early smoke detection can prevent large-scale industrial fires.

Educational Projects: Great for learning IoT, sensors, and automation basics in engineering and science
fields.

Smart IoT Integration: Can be combined with smart home systems for real-time alerts and automatic
responses.

Conclusion

The smart detection system provides real-time monitoring of environmental conditions with a focus on
early detection of smoke and temperature variations. By triggering timely alerts via a simple LED, it
empowers users to take immediate action, significantly improving safety in various settings while
utilizing cost-effective, reliable hardware.
10

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy