100% found this document useful (2 votes)
13K views22 pages

MEC 523 (Fire Alarm System) Mini Project Report

This document describes a fire alarm system project created using an Arduino microcontroller. The system uses flame and gas sensors to detect fires and activates LEDs, a buzzer, and an LCD display to alert users. The system is designed to apply concepts from an Applied Electronics and Microprocessors course by programming an Arduino board with C++ code. When either sensor detects its threshold condition, the code triggers the output devices to warn people in the area. The project aims to demonstrate safety applications of emerging technologies like Arduino systems.

Uploaded by

Shahmi Salim
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
100% found this document useful (2 votes)
13K views22 pages

MEC 523 (Fire Alarm System) Mini Project Report

This document describes a fire alarm system project created using an Arduino microcontroller. The system uses flame and gas sensors to detect fires and activates LEDs, a buzzer, and an LCD display to alert users. The system is designed to apply concepts from an Applied Electronics and Microprocessors course by programming an Arduino board with C++ code. When either sensor detects its threshold condition, the code triggers the output devices to warn people in the area. The project aims to demonstrate safety applications of emerging technologies like Arduino systems.

Uploaded by

Shahmi Salim
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/ 22

MEC 523

APPLIED ELECTRONICS AND MICROPROCESSOR

FIRE ALARM SYSTEM

NO NAME STUDENT ID
1 MUHAMMAD AFIQ BIN MD KAMAL 2018248682
2 MUHAMMAD SHAFIQ BIN SHAHARUM 2018410368
3 MUHAMMAD SHAHMI BIN SALIM 2018410768

GROUP:

EMD6M3A2

PREPARED FOR:

DR MOHD FAUZI ISMAIL

SUBMISSION DATE:
23RD JULY 2021

1
ABSTRACT

The purpose of this project is to allow students to apply the understanding concept of C++
programming that has been taught throughout the whole semester by using Arduino codes. The
main objective is to create an entire system that applies the Arduino code consisting minimum of
two inputs and two outputs. To achieve this, the Fire Alarm System has been conducted in order
to fulfil this project’s requirements. By making use of current revolutionary and advancing
technology, Fire Alarm System be able to help the public to notice them about the presence of
fire. This system uses Arduino as the micro-controller and other electronic components such as
sensors that behaves as a smart switching system. The purpose of this invention is to exemplify
for a larger initiative to maintain the safety of the user. This system can be very helpful for many
users especially large building, such as shopping mall, house unit, and factory.

2
TABLE OF CONTENT

ABSTRACT……………………………………………..2
LIST OF FIGURES……………………………………...4
1.0 INTRODUCTION………………………………….5
2.0 PROBLEM STATEMENT…………………………6
3.0 OBJECTIVE………………………………………...6
4.0 PRODUCT DESCRIPTION………………………..7
5.0 PROGRAMMING…………………...…………….11
5.1 FLOWCHART………………………………….11
5.2 CIRCUIT DIAGRAM…………………..……...13
5.3 ASSEMBLY METHOD…………..……………14
5.4 CODING………………………………………..16

6.0 RESULT AND DISCUSION………………………21


7.0 CONCLUSION…………………………………….22

3
LIST OF FIGURES

FIGURE 1.1 (Emergency Fire Alarm Bell) ………………………………………5


FIGURE 4.1 (Fire Alarm System) ……………………………………………..…7
FIGURE 4.2 (Arduino Uno R3 ATMEGA328P) ………………………………….7
FIGURE 4.3 (Flame Sensor) ……………………………………………………...8
FIGURE 4.4 (Gas Sensor) ……………………………………………………… 8
FIGURE 4.5 (LED) ………………………………………………………………9
FIGURE 4.6 (Piezo Buzzer) ……………………………………………………...9
FIGURE 4.7 (LCD Panel) …………………………………………...…………..10
FIGURE 5.1.1 (Programming Flowchart) ............................................................11
FIGURE 5.2.1 (Circuit Diagram) ………………………………………………..13
FIGURE 5.4.1 (Arduino Coding) ………………………………………………..16
FIGURE 5.4.2 (Arduino Coding) …………………………….………………….16
FIGURE 5.4.3 (Arduino Coding) ……………………………………….……….17
FIGURE 5.4.4 (Arduino Coding) ……………………………………………….17

4
1.0 INTRODUCTION

A fire alarm system is a system that is designed to warn people when there is fire, smokes, or any
other harmful gas appear on the premise. The alarms are activated automatically or manually
turned on with manual fire alarm activation devices such as manual call points or pull stations. The
manual activation exist is to help people warn of a fire or harmful gas leak quickly as it may take
some time for the sensors to kick in. The alarms can either be motorized bells or wall mounted
sounder or horns. They can also be a speaker strobe which sound an alarm, followed by a voice
urging evacuation message which alarming people on the situation and warning them not to use
elevators if there is any. The fire alarms sounders can be set to different frequencies and tones
depending on the country and the manufacturer. Some place needs a higher frequency and tone
such as shopping malls and high-leveled building.

Figure 1.1 Emergency Fire Alarm Bell

5
2.0 PROBLEM STATEMENTS

Fire alarm system is crucial in every building as it can prevent any mishaps and can save lives.
The system can sense heat and gas thus alarming people via buzzer, automated announcements,
or alarming lights. It is faster than having to scream to alarm people of a fire or a gas leak.
Basically, heat sensor will sense any temperature above the normal room temperature. The
Arduino will be used as micro-controller to control the whole system. Once the temperature rise
is detected, the signal will be sent to the buzzer or LED to alarm people. Thus, the people will be
alarmed, and everyone will be able to evacuate safely.

3.0 OBJECTIVE

In this project, we have objectives to achieve at the end of our project. This objective will
implement the application of MEC523 (Applied Electronics and Microprocessor) course. The
objective we want to achieve are:

• To study how a fire alarm system works.

• To design the fire alarm system using Arduino system.

6
4.0 PRODUCT DESCRIPTION

1) The fire alarm system is a safety system that warn people when the flame and flammable
gas are detected. This system will automatically activate when the flame sensor and gas
sensor detected the flame and gas. Then, the piezo buzzer will trigger and the LED will
turn on to warn the people surrounding. In addition, the LCD also will display the status
of this fire alarm system.

Figure 4.1 Fire Alarm System

2) In this fire alarm system, the Arduino uno R3 ATMEGA328P has been used. The
Arduino environment has two platform which are a development board and the software
environment. A development board has 8-bit microcontroller, programming hardware,
USB programming interface and input/output pin. For software development which is
Integrated Development Environment (IDE) has cross-compiler, debugger, simulator and
programmer. To make the programming code of the system, the code is upload from
Arduino IDE to microcontroller (ATMEGA328P) at Arduino uno.

Figure 4.2 Arduino Uno R3 ATMEGA328P

7
3) The flame sensor is to detect the presence flame at the surrounding. This component has
four pins which are pin A0, ground, VCC and D0. The pin A0 is connect to the analog
pin A2 at Arduino Uno while the ground and VCC are connect to ground pin and power 5
Volt respectively. In this fire alarm system, the threshold is set 200. When the flame
sensor value at pin A0 is less than 200, the LED will turn on and the buzzer will activate.

Figure 4.3 Flame Sensor

4) Next, the type of gas sensor in this fire alarm system that used is MQ-2. This type of gas
sensor can detect methane, butane, LPG and smoke. This gas sensor has 4 pins which are
A0, D0, ground and VCC. The pin A0 is connected to pin A0 in Arduino uno. In this fire
alarm system, when the value at gas sensor is crossed the safety level which is 500, the
LED will turn on and the buzzer will trigger.

Figure 4.4 Gas Sensor

8
5) For light-emitting diode (LED) which semiconductor diode will glow when the sensors
have detected the flame and flammable gas. The LED has two pins which are anode and
cathode. The anode is connected to pin 13 while the cathode is connected to ground pin.

Figure 4.5 LED

6) For piezo buzzer has two pins which are positive and negative. The positive is connected
to pin 8 while the negative connected to ground pin. In this system, we used active buzzer
as an output. The piezo buzzer will make sound when the sensors have detected the fire
and flammable gas or smoke. This will warn the people that the fire alarm system has
activated.

Figure 4.6 Piezo Buzzer

9
7) The Liquid-Crystal Display which is call LCD is a flat-panel display that uses the light-
modulating properties of liquid crystal combined with polarizers. LCD is available to
display arbitrary image or fixed image with low information content which can be
displayed or hidden. In this fire alarm system, this LCD will display “NO FLAME/NO
GAS” when the gas and flame are not detected by sensors while it will display “FLAME
DETECTED/GAS DETECTED” when the sensors have detected the fire and flammable
gas. In this system, we have use 5V Arduino I1C I2C 1602 LCD. This LCD is combined
with I2C. When wired the LCD, it used only four pins compared to normal LCD which
must use more pins. So, the circuit will look tidy compared to normal LCD. It has four
pins which are ground, power, SDA and SCL. The pins SDA and SCL are connected to
pin A4 and A5 respectively.

Figure 4.7 LCD Panel

10
5.0 PROGRAMMING

5.1) FLOWCHART

Figure 5.1.1 Programming Flowchart

11
1. For flame sensor and gas sensor, the program will execute in microcontroller
ATMEGA328P which pin A2 and A0 as input, respectively.

2. For buzzer, LED and LCD as output. LCD is connected to analog pin A4 and A5 while
buzzer and LED is connected to digital pin 8 and pin 13 respectively.

3. Threshold is set at value 500.

4. If the flame sensor detects the flame (flame value<500), buzzer and LED will activate,
and LCD will display “FLAME: FLAME IS DETECTED”. While if the flame sensor
does not detect the flame (flame value>500), buzzer and LED will not activate, and the
LCD will display “FLAME: NO FLAME”.

5. If gas sensor detects the flammable gas or smoke (>500), buzzer and LED will activate
and LED will display “GAS: GAS IS DETECTED”. While if the gas sensor does not
detect the flammable gas or smoke (<500), buzzer and LED will not activate, and LCD
will display “GAS: NO GAS”.

6. This program will repeat and loop.

12
5.2) CIRCUIT DIAGRAM

Figure 5.2.1 Circuit Diagram

13
5.3) ASSEMBLY METHOD

1. Prepared all components that used to make fire alarm system.


2. Put the piezo buzzer and gas sensor at breadboard.
3. For piezo buzzer, connect the positive pin to digital pin 8 while negative to ground pin
using jumping wire.
4. For gas sensor, connect the pin A0 to pin analog A0 at Arduino UNO
5. Connect to analog pin A2 for flame sensor.
6. The LED is connected to pin 13
7. The LCD is connected to analog pin A4 and A5
8. Power up the Arduino with connect to laptop/PC.
9. Open software Arduino IDE and upload the sketch or program code to Arduino uno
10. Then, light on the flame at flame sensor to see the result output happen
11. Then, turn on the flammable gas at gas sensor to see the output.

Piezo buzzer
Positive pin (+) = pin 8
Negative pin (-) = ground

LED
Anode = pin 13
Cathode = ground

Flame sensor
A0 = pin A2
GND = ground
VCC = power 5 V

14
Gas sensor
A0 = pin A0
GND = ground
VCC = power 5 V

Liquid crystal (LCD)


GND = ground
VCC = power 5 V
SDA = pin A4
SCL = pin A5

15
5.4 CODING

Figure 5.4.1 Arduino Coding

Figure 5.4.2 Arduino Coding

16
Figure 5.4.3 Arduino Coding

Figure 5.4.4 Arduino Coding

17
CODING
#include <Wire.h>
#include <LiquidCrystal_I2C.h>
LiquidCrystal_I2C lcd(0x27,20,4);

int LED = 13;


int gasSensor;
int piezo = 8;
int threshold=500;
int flamesensvalue=0;

void setup() {
pinMode(A0,INPUT);
pinMode(A2,INPUT);
pinMode(LED,OUTPUT);
pinMode(piezo,OUTPUT);
Serial.begin(9600);
lcd.begin();
}

18
void loop() {
flamesensvalue=analogRead(A2);
gasSensor = analogRead(A0);

if (flamesensvalue<=threshold) {
digitalWrite(LED,HIGH);
digitalWrite(piezo,HIGH);
lcd.clear();
lcd.setCursor(0, 0);
lcd.print(" FLAME : ");
lcd.print("FLAME");
lcd.setCursor(0, 1);
lcd.print(" IS DETECTED");
delay(5000);
}
else {
digitalWrite(LED,LOW);
digitalWrite(piezo,LOW);
lcd.clear();
lcd.setCursor(0, 0);
lcd.print("FLAME : ");
lcd.print("NO FLAME");
delay(1000);
}

if (gasSensor>=500) {
digitalWrite(LED,HIGH);
digitalWrite(piezo,HIGH);

19
lcd.clear();
lcd.setCursor(0, 0);
lcd.print(" GAS : ");
lcd.print("GAS");
lcd.setCursor(0, 1);
lcd.print(" IS DETECTED");
delay(5000);
}
else {
digitalWrite(LED,LOW);
digitalWrite(piezo,LOW);
lcd.clear();
lcd.setCursor(0, 0);
lcd.print("GAS : ");
lcd.print("NO GAS");
delay(1000);
}
Serial.print("flamesensorValue = ");
Serial.print(" ");
Serial.print(flamesensvalue);
Serial.print("\t");
Serial.print("GasSensor = ");
Serial.print(" ");
Serial.print(gasSensor);
Serial.println();
delay(1000);
}

20
6.0 RESULT AND DISCUSSION

After several tests have been done towards our project, The Fire Alarm System has been able to
be conducted according to the desired system. The system consists of two inputs, which are
flame sensor and gas sensor. Starting off with the flame sensor, it detects the presence of the fire
and it will send a signal to its output. In this case, the outputs are LED, Piezo Buzzer and the
LCD Panel. The LED will lights up and the buzzer will produce the sound after obtain the signal
to aware the users about the presence of fire. The LCD Panel will display the information about
the presence of fire.

The second input, which is the gas sensor is a component that measures presences of the gas,
which is smoke in this case. The type of gas sensor we use for this project is MQ-2. This type of
gas sensor able to detects butane, methane, LPG and smoke. This gas sensor is placed at this fire
alarm system to enhance to safety when there are fires. When the situation occurs, it will send a
signal to its output, which is the buzzer. This buzzer acts as an alarm that reminds the users to be
aware of the situation.

Certain tests, improvements and changes were done to achieve the results mentioned above. The
sensors have been tested and it work well as intended. This project certainly can be a huge
helping to the society to prevent the unwanted situation. This alarm system can implement the
OSHA Fire Alarm requirement to maintain the safety and eliminate hazard.

21
7.0 CONCLUSION

From this project, the expected results are obtained successfully. The fire alarm functions well as
designed to be. The flame sensor and gas sensor has performed well in sensing the present of the
fire and smoke using the Arduino Uno R3 ATMEGA328P and the output which is LED and
Piezo Buzzer. The LED will lights up and the Piezo Buzzer’s sound will warn the public about
the fire. This system will be useful for building especially for large area building. As we don’t
aware if there are fire, the Piezo Buzzer act to alert us to work on necessary action. So the Fire
Alarm System will gain the interest of plenty party to ensure the safety and precaution on fire. As
conclusion, our project will help on implement the OSHA fire alarm requirement.

22

You might also like