Fire Project1
Fire Project1
BACHELOR OF ENGINEERING
In
COMPUTER SCIENCE & ENGINEERING
Submitted By
SANJANA N (1RR21CS140)
SHEETAL C (1RR21C147)
SHIVAPRASAD S. (1RR21CS150)
YESHASHWINI R (1RR21CS191)
Prof. RASHMI BR
Assistant Professor,
Dept. of CSE, RRCE
(2023-24)
RAJARAJESWARI COLLEGE OF ENGINEERING
MYSORE ROAD, BENGALURU-560074
(An ISO 9001:2008 Certified Institute)
(Affiliated to Visvesvaraya Technological University, Belagavi)
CERTIFICATE
This is to certify that the mini project work entitled “FIRE AND SMOKE DETECTION
SYSTEM” carried out by SANJANA.N (1RR21CS140), SHEETAL.C (1RR21CS147),
SHIVAPRASAD .S (1RR21CS150), YESHASHWINI.R (1RR21CS0191) are bonafide
students of RajaRajeswari College of Engineering in partial fulfillment for the award of
Bachelor of Engineering in Computer Science and Engineering of the Visvesvaraya
Technological University, Belgavi during the year 2023-2024. It is certified that all
corrections/suggestions indicated for Internal Assessment have been incorporated in the report.
The mini project report has been approved as it satisfies the academic requirements in respect
of the mini project work prescribed for the said degree.
Home safety is a critical concern, particularly with regard to fire and smoke hazards. This
project presents an automated home safety system using Arduino and fire sensors to detect
smoke and fire in indoor environments. Thesystem employs an MQ2 sensor to detect smoke
and a temperature sensor to detect fire, both interfaced with an Arduino microcontroller.
When smoke is detected, the MQ2 sensor outputs an analog signal, which is processed by the
Arduino to trigger a digital response: a red LED turns on, a piezo buzzer sounds an alarm,
and a 16x2 LCD displays the message "ALERT!! Smoke detected." Similarly, when fire is
detected, the temperature sensor sends an analog signal to the Arduino, which then displays
the message "Alert! Fire detected" on the LCD. This integrated system provides clear visual
and auditory alerts, ensuring timely warnings to occupants and enhancing overall home
safety. The design and implementation of this project demonstrate the effectiveness and
reliability of using Arduino-based systems for real-time hazard detection and response in
residential settings.
ACKNOWLEDGEMENT
I express my deep sense and gratitude to Dr. R. Balakrishna, Prof. and Principal,
RajaRajeswari College of Engineering, Bengaluru, for providing us an opportunity to
undertake this mini project work and for his invaluable guidance and help.
I would thank Dr. S. Usha, Prof. and Head, Dean Research, Department of Computer Science
& Engineering, RajaRajeswari College of Engineering for her constant support and motivation
that inspired us to enthusiastically complete our mini project.
I would also thank my Mini Project coordinator Prof.Ojaswini RN, Assistant Professor,
RajaRajeswari College of Engineering, Bengaluru and Mini Project Guide Prof. Rashmi BR
Assistant Professor, Department of Computer Science & Engineering, RajaRajeswari College
of Engineering, Bengaluru and all the staff members of the department for their co-operation
and guidance which was very helpful in successful completion of this mini project work.
I am very thankful to my friends and to those who supported me directly or indirectly in the
completion of the mini project work.
And finally, I am very much thankful to God and my parents for their moral support and
inspiration, without which this mini project work would not be completed successfully.
SANJANA N(1RR21CS140)
SHEETAL C(1RR21CS147)
SHIVAPRASAD S(1RR21CS150)
YESHASHWINI R(1RR21CS191)
CONTENTS
Chapter Page No
ABSTRACT .......................................................................................................................... i
ACKNOWLEDGEMENT ..................................................................................................... ii
CONCLUSION .................................................................................................................... 20
REFERENCES……………………………………………………………………………21
LIST OF FIGURES
CHAPTER 1
INTRODUCTION
Traditional fire and smoke detection systems often rely on standalone smoke detectors and
temperature alarms, which may not provide comprehensive alerts or integrate multiple warning
methods. Many existing systems lack real-time notifications and are limited to auditory signals,
which may not be sufficient in noisy environments or for individuals with hearing impairments.
The proposed system aims to address the limitations of existing solutions by integrating multiple alert
mechanisms and providing clear visual and auditory notifications. It uses an MQ2 sensor to detect
smoke and a temperature sensor to detect fire. When smoke is detected, the system activates a red LED,
sounds a piezo buzzer, and displays an "ALERT!!Smoke detected" message on a 16x2 LCD. Similarly,
when fire is detected, it displays an "Alert! Fire . detected" message.
1.3 Motivation
The motivation behind this project is to enhance the safety and security of indoor environments by
developing a more efficient and responsive fire and smoke detection system. This system aims to
provide timely alerts to occupants, allowing them to take immediate action and potentially prevent
significant harm or damage.
- To design and implement an automated system for detecting smoke and fire in indoor
environments.
- To ensure the system is reliable, cost-effective, and easy to install and maintain.
1.5 Key Features with Scope of the Features or Overall Scope of the Work
- Smoke Detection: The MQ2 sensor detects smoke and triggers alerts.
- Fire Detection: The temperature sensor detects elevated temperatures indicative of fire andtriggers
alerts.
- Visual Alerts: The system uses a red LED to indicate smoke detection.
- Auditory Alerts: The piezo buzzer sounds an alarm when smoke or fire is detected.
- Message Display: The 16x2 LCD displays specific alert messages for smoke and fire.
CHAPTER 2
LITERATURE SURVEY
Work carried out in the paper: The authors developed a smart fire and smoke detection system
utilizing Arduino, capable of detecting both smoke and fire in indoor environments. The system
employs an MQ2 sensor for smoke detection and a temperature sensor for fire detection. The
Arduino processes the sensor inputs to activate an LED, buzzer, and display appropriate messages
on an LCD.
Methodology: The methodology involves integrating the MQ2 and temperature sensors with
Arduino, programming the microcontroller to interpret analog signals from the sensors, and
triggering digital outputs such as LEDs, buzzers, and LCD displays upon detection.
Merits:
Demerits:
Remarks: The paper effectively demonstrates the feasibility and efficiency of using Arduino-
based systems forreal-time fire and smoke detection in residential settings. Theapproach is
straightforward, making it accessible for practical applications.
Work carried out in the paper: This research focuses on developing an Arduino-based system for
detecting fireand smoke, aiming to enhance home safety. The system uses an MQ2 sensor for
smoke detection and a DS18B20temperature sensor for fire detection. Upon detection, the system
activates an LED, buzzer, and displays alertson an LCD.
Methodology: The system is built by interfacing the MQ2 and DS18B20 sensors withan Arduino
microcontroller. The sensors provide analog input, which the Arduino processes to generate
digital outputs,triggering LEDs, buzzers, and LCD displays.
Merits:
Demerits:
Work carried out in the paper: The authors developed a home safety system to detect fire and
smoke using Arduino. The system includes an MQ2 sensor for smoke detection and a DHT11
sensor for temperature measurement. The Arduino processes the sensor data to activate LEDs,
buzzers, and display messages on an LCD.
Methodology: The system integrates MQ2 and DHT11 sensors with an Arduino microcontroller.
The sensors' analog outputs are converted to digital signals by the Arduino,which then triggers
visual and auditory alerts.
Merits:
Demerits:
Remarks: The paper provides a thorough analysis of a home safety system using Arduino. The
dual sensor approach enhances detection reliability, contributing significantly to fire and smoke
safety research.
(2.4) Author Names: Patel, D., Sharma, R., Gupta, P.Year: (2020)
Title of the paper: “IoT-Based Fire and Smoke Detection System UsingArduino”
Name of the Journal: International Journal of Recent Technology
and Engineering (IJRTE)Publisher: IJRTE
Volume, Page no.: Vol 8, Issue 5, pp. 410-415
Work carried out in the paper: This research explores an IoT-based fire and smoke detection
system using Arduino. The system uses an MQ2 sensor for smoke detection anda temperature
sensor for fire detection. The Arduino processes the sensor data to trigger LEDs, buzzers, and
display alerts on an LCD, with IoT capabilities for remote monitoring.
Methodology: The system integrates MQ2 and temperature sensors with an Arduino
microcontroller. The sensors' analog outputs are processed by the Arduino to activate digital alert
mechanisms and send data to anIoT platform for remote monitor
Merits:
- Real-time detection and remote monitoring.
- Immediate visual and auditory alerts.
- Enhanced safety through IoT integration.
Demerits:
- Requires internet connectivity for IoT functionality.
- May need periodic calibration for accuracy.
Remarks: The paper presents a comprehensive approach to home safety using Arduino and IoT.
The remote monitoring capability adds a valuable layer of safety, making it a notable
contribution to fire and smoke detection technologies.
CHAPTER 3
• Temperature Sensor
• LCD display
• Wires
• MQ2 sensor
• Piezo buzzer
• Red LED
• Arduino
The name and functions of each pin of the 16×2 LCD module is given below. Pin1 (Vss):
Ground pin of the LCD module. Pin2 (Vcc): Power to LCD module (+5V supply is given to
this pin) Pin3 (VEE): Contrast adjustment pin. This is done by connecting the ends of a 10K
potentimeter to +5V and ground and then connecting the slider pin to the VEE pin. The voltage
at the VEE pin defines the contrast. The normal setting is between 0.4 and 0.9V. Pin4(RS):
Register select pin.
Logic HIGH at RS pin selects data register and logic LOW at RS pin selects command register. If we
make the RS pin HIGH and feed an input to the data lines (DB0 to DB7), this input will treated as data
to display on LCD screen. If we make the RS pin LOW and feed an input to the data lines, then this
will be treated as a command ( a command to be written to LCD controller like positioning cursor or
clear screen or scroll). Pin5 (R/W): Read/Write modes. This pin is used for selecting between read and
write modes. Logic HIGH at this pin activates read mode and logic LOW at this pin activates write
mode. Pin6 (E): This pin is meant for enabling the LCD module. A HIGH to LOW signal at this pin
will enable the module. Pin7 (DB0) to Pin14(DB7): These are data pins. The commands and data are
fed to the LCD module though these pins. Pin15 (LED+): Anode of the back light LED. When operated
on 5V, a 560 ohm resistor should be connected in series to this pin. In Arduino based projects the back
light LED can be powered from the 3.3V source on the Arduinoboard. Pin16 (LED-): Cathode of the
back light LED. RS pin of the LCD module is connected to digital pin 12 of the Arduino. R/W pin of
the LCD is grounded. Enable pin of the LCD module is connected to digital pin 11 of the Arduino.
This method is very simple, requires less connections and we can almost utilize thefull potential of
the LCD module. Digital lines DB4, DB5, DB6 and DB7 are interfaced to digital pins 5, 4, 3 and 2 of
the Arduino. The 10K potentiometer is used for adjusting the contrastof the display. The Arduino can
be powered through the external power jack provided on the board. +5V required in some other parts
of the circuit can be tapped from the 5V source on the Arduino board. The Arduino can be also powered
from the PC through the USB port.
A sensor which is most sensitive to a normal light is known as a flame sensor. That’s why
this sensor module is used in flame alarms. This sensor detects flame otherwise wavelength within the
range of 760 nm – 1100 nm from the light source. This sensor can be easily damaged to high
temperature. So this sensor can be placed at a certain distance from the flame. The flame
detection can be done from a 100cm distance and the detection angle will be 600. The output of this
sensor is an analog signal or digital signal. These sensors are used in fire fighting robots likeas a flame
alarm.
A buzzer is similar to an alarm clock. It produces an output that sounds like an alarm and then turns on
the machine. Two pins make up the buzzer. The micro controller's data pin is attachedtothe negative end.
The micro controller's Vcc is connected to the positive end.
This sensor contains a sensing element, mainly aluminium-oxide based ceramic, coated with Tin dioxide,
enclosed in a stainless steel mesh. Sensing element has six connecting legs attached to it. Two leads are
responsible for heating the sensing element, the other four are used for output signals.
Oxygen gets adsorbed on the surface of sensing material when it is heated in air at high temperature.
Then donor electrons present in tin oxide are attracted towards this oxygen, thuspreventing the current
flow.
When reducing gases are present, these oxygen atoms react with the reducing gases thereby decreasing the
surface density of the adsorbed oxygen. Now current can flow through the sensor,which generated analog
voltage values.
These voltage values are measured to know the concentration of gas. Voltage values are higherwhen
the concentration of gas is high.
Software Description
Arduino is a prototype platform (open-source) based on an easy-to-use hardware and software. It consists
of a circuit board, which can be programed (referred to as a microcontroller) and a
ready-made software called Arduino IDE (Integrated Development Environment), which is used to write
and upload the computer code to the physical board. Arduino provides a standard form factor that breaks
the functions of the micro-controller into a more accessible package.
A program for Arduino may be written in any programming language for a compiler that produces
binary machine code for the target processor. Atmel provides a development tenvironment for their
microcontrollers, AVR Studio and the newer Atmel Studio. The Arduino project provides the
Arduinointegrated development environment (IDE), which is a cross- platform application written in
the programming language Java.
It originated from the IDE for the languages Processing and Wiring. It includes a code editor with
features such as text cutting and pasting, searching and replacing text, automatic indenting,
bracematching, and syntax highlighting, and provides simple one-click mechanisms to compile and
upload programs to an Arduino board. It also contains a message area, a text console, a toolbar with
buttons for common functions and a hierarchy of operationmenus.
A program written with the IDE for Arduino is called a sketch. Sketches are saved on the development
computer as text files with the file extension .ino. Arduino Software (IDE) pre-
1.0 saved sketches with the extension .pde. The Arduino IDE supports the languages C and C++ using
special rules of code structuring. The Arduino IDE supplies a software library from the Wiring project,
which provides many common input and output procedures. User- written code only requires two basic
functions, for starting the sketch and the main program loop, that are compiled and linked with a
program stub main() into an executable cyclic executive program with the GNU toolchain, also included
with the IDEdistribution. A minimal Arduino C/C++ sketch, as seen by the Arduino IDE programmer,
consist of onlytwo functions:
• setup(): This function is called once when a sketch starts after power-up or reset. It is used to
initialize variables, input and output pin modes, and other libraries needed in the sketch.
• loop(): After setup() has been called, function loop() is executed repeatedly in the mainprogram. It
controls the board until the board is powered off or isreset.
CHAPTER 4
SYSTEM IMPLEMENTATION
Modules
Module Description
- Explanation: This module uses the MQ2 sensor to detect smoke in the indoor environment. The sensor
sends an analog signal to the Arduino, which processes the data to determine the presence of smoke.
- Explanation: This module employs a temperature sensor to detect fire. The sensor sends an analog
signal to the Arduino, which processes the data to detect abnormal temperature levelsindicative of
a fire.
- Explanation: This module activates an LED and a piezo buzzer to provide visual and auditory
alerts when smoke or fire is detected. The Arduino triggers these components based on the input
from the detection modules.
4. Display Module
- Explanation: This module displays alert messages on a 16x2 LCD screen. The Arduino
sendsappropriate messages to the LCD based on the detection inputs.
5. Control Module
- Explanation: This module integrates all the other modules, processing inputs from the sensors
and controlling the output components to provide alerts. It is the central unit that ensures the
system functions cohesively.
- Components: Arduino.
Functions
1.Smoke Detection Function
int readSmokeSensor()
{
int sensorValue =analogRead(smokeSensorPin);
return sensorValue;
}
Description: This function reads the analog value from the MQ2 smoke sensor and returns it to
the control module.
2. Fire Detection
int readTemperatureSensor()
{
int tempValue =analogRead(tempSensorPin);
return tempValue;
}
```
- Description: This function reads the analog value from the temperature sensor and returns
it tothe control module.
#include <stdlib.h>
#include <string.h>
int Fire=3;
int Buzzer=6;
int G_val;
void setup()
pinMode(Fire,INPUT);
pinMode(Buzzer,OUTPUT);
digitalWrite(Buzzer,LOW);
lcd.begin(16, 2);
lcd.clear();
lcd.setCursor(0,1);
lcd.print("Monitoring S/m");
delay(1000);
void loop()
if(digitalRead(Fire)==LOW)
lcd.clear();
lcd.print("Fire Detected");
digitalWrite(Buzzer,HIGH);
delay(2000);
digitalWrite(Buzzer,LOW);
Gas_Read();
void Gas_Read()
G_val=analogRead(A0);
lcd.clear();
lcd.print("Gas:"+String(G_val)+"PPM");
Serial.println("Gas:"+String(G_val));
delay(1000);
if(G_val>200)
{
lcd.clear();
lcd.print("Gas Detected");
Serial.println("$Gas Detected#");
digitalWrite(Buzzer,HIGH);
delay(2000);
digitalWrite(Buzzer,LOW);
CODING:
int smokeLevel = readSmokeSensor();
int tempLevel = readTemperatureSensor();
activateAlert();
}
else if (tempLevel > thresholdTemp) { activateFireAlert();
}
else {
deactivateAlert();
}
}
- Description: This is the main control function that continuously reads the sensor values
andactivates or deactivates the alert system based on the detection thresholds.
CHAPTER 5
Smoke Detection
The smoke detection module was tested by generating smoke in a controlled environment. The
MQ2 sensor accurately detected the presence of smoke, triggering the Arduino to turn on the red
LED and activate the piezo buzzer. The 16x2 LCD displayed the message "ALERT!! Smoke
detected" as expected. The system responded promptly, with a detection time of less than 2 seconds
from smoke generation to alert activation.
Discussion:
- The MQ2 sensor proved effective in detecting smoke concentrations, making it suitableforindoor
safety applications.
- The visual (LED) and auditory (buzzer) alerts were clear and noticeable.
Page No.
Dept. of CSE, RRCE 2023-2024 No.2No.221
98
FIRE AND SMOKE DETECTION SYSTEM
- Fire Detection
The fire detection module was tested using a heat source. The temperature sensor detected the
increase in temperature, and the Arduino processed this input to trigger the alert system. The red
LED turned on, the piezo buzzer sounded, and the LCD displayed "Alert! Fire detected."
Discussion:
- The temperature sensor was sensitive to rapid changes in temperature, ensuringtimelydetection
of potential fire hazards.
- The alert system effectively communicated the presence of a fire through visual, auditory,
andtext-based notifications.
Page No.
Dept. of CSE, RRCE 2023-2024 No.2No.221
98
FIRE AND SMOKE DETECTION SYSTEM
The integrated system was tested for both smoke and fire detection in a sequence. Both the smoke
and fire detection modules performed as expected, with the appropriate alerts beingtriggered for
each scenario.
Discussion:
- The integration of both detection modules did not affect the performance of each
individualmodule.
- The system successfully managed multiple alerts, providing comprehensive safety coverage
forindoor environments.
Page No.
Dept. of CSE, RRCE 2023-2024 No.2No.221
98
FIRE AND SMOKE DETECTION SYSTEM
This project successfully developed a home safety system using Arduino, capable of detecting
smoke and fire. The MQ2 sensor for smoke detection and the temperature sensor for fire detection
worked efficiently in identifying potential hazards. The alert system, comprising a redLED, piezo
buzzer, and 16x2 LCD, provided clear and timely notifications. The objectives of the project were
met, demonstrating the feasibility and effectiveness of using Arduino for homesafety applications.
Key Features:
- Smoke Detection: Accurate and prompt detection of smoke using the MQ2 sensor.
To enhance the capabilities and coverage of the home safety system, the following
improvementscan be considered:
Wireless Communication: Incorporate wireless modules (e.g., Wi-Fi, Bluetooth) to send alerts
tomobile devices or cloud services.
1. Gas Detection: Add sensors for detecting other harmful gases (e.g., CO, LPG) to broaden
thesafety scope.
2. Mobile App Integration: Develop a mobile application for remote monitoring and controlofthe
safety system.
4. Advanced Analytics: Use machine learning algorithms to predict and analyze potential
firehazards based on sensor data patterns.
Page No.
Dept. of CSE, RRCE 2023-2024 No.2No.221
98
FIRE AND SMOKE DETECTION SYSTEM
References
[8] Max Ogden, “Max Ogden Blogotronz - HD live streaming cats to YouTube with
the Raspberry Pi Camera”, Website, URL:http://maxogden.com/hd-live-
Page No.
Dept. of CSE, RRCE 2023-2024 No.2No.221
98
FIRE AND SMOKE DETECTION SYSTEM
streaming- cats.html, 2015
[9] Tutorials point, "Python MySQL Database
Access",Website, URL:
http://www.tutorialspoint.com/python/python_databse_access.htm,2016
Page No.
Dept. of CSE, RRCE 2023-2024 No.2No.221
98
FIRE AND SMOKE DETECTION SYSTEM
Page No.
Dept. of CSE, RRCE 2023-2024 No.2No.221
98