Professional Documents
Culture Documents
In any modern structure or building of the world, safety has the highest priority and therefore fire
detection system is one of the basic components of the structure. Timely information of fire not
only helps save lives but also makes it easier to put out fire.
Figure:11.1
11.1. Objectives
Our objective is to design a Fire Alarm System that would full fill the following objectives:
Indicate the room in which fire erupted. Sound the alarm if fire occurs.
False Alarm occurrence should be kept minimum.
The system should be flexible enough to be easily modified in case if new rooms are added to the
building.
The system should also provide the flexibility to adjust the temperature and smoke sensitivity
levels as per the operating environment.
11.2. Working
This paper proposes the design and construction of fire alarm system which is controlled
by 89S52 microcontroller. LCD is used to indicate situations of the system composed of 2 modes
of working state, regular working mode and fire mode. Graphic output states are displayed on
LCD by using software „Keil uVision2‟, interfacing with microcontroller. Input signal coming
from the normally opened warning devices such as heat detector and smoke detector is sent into
a detectable instrument to separate the mode of working state. After that, output signal
19
is dispatched to 89S52 microcontroller for analysis. This microcontroller can transfer data
and display the situation of detector in 4 zones. Thus, the environment of the zones is exposed
on LCD. In case of fire mode, the data will be sent to LCD and to Buzzer simultaneously.
11.3. Requirements
This is the first module of our project in which we have used LM 35 sensor and a
comparator. LM 35 has three pins a, b and c. Pin a is connected to Vcc pin b is connected with
ground while the output is from pin c .The output of this sensor is going to a comparator .As per
our requirement we need to send a high signal to the microcontroller when the temperature is
50 degree centigrade As the output of sensor gives 10mv change with a change of 1
degree centigrade in temperature. So at 50 degree centigrade it will give 0.5 volts as output has
a linear relationship with temperature .so to meet our requirement we have set 0.49 volts on
the negative input of comparator so that when the output of sensor will give 0.5 volts
the comparator will pass high signal to microcontroller. So when the temperature of
external environment will be 50 degree centigrade, a high signal will be passed on to the
microcontroller through comparator.
Smoke Detection Circuit
The second module of our project is to detect smoke from the environment which is
inevitable outcome of fire. So to full fill this requirement we have used smoke sensor TGS 308
and a comparator. The sensor output is almost zero when there is no smoke in environment .On
the contrary when there is a smoke the sensor will give a output voltage according to
the intensity of smoke .As soon as the smoke vanishes its output again comes to zero .The
internal circuitry of TGS-308 contains a heater .as the smoke particles will pass through , the
heater will ionize the smoke particles and they will act as a charge carriers so a voltage will be
built at output .TGS-308 has four pins Pin A, B, C and D. out of these A and B are connected to
Vcc, pin D is connected with ground and pin C is the output pin. The output pin is connected
20
with the positive input of comparator while at its negative input there is constant 3 volts .so as
the smoke will produce, there will be voltage at output of sensor. As the smoke intensity
increase and the sensor output will reach 3.1 volts the comparator will pass a high signal
to microcontroller. As this sensor is quite sensitive to smoke so we have kept 3 volts as a
standard at comparator input so that it should detect real fire and do not activate on fake signals
just like if someone is smoking.
Conditions
In case if both the bits of a particular room are high (i.e. the smoke and heat levels are above
normal conditions), the program sets the pin connected to the buzzer, turning it
ON. Simultaneously the LCD displays the room number of the room where fire has erupted.
In case if one of the bits of a particular room is set (i.e. either the smoke sensor or his operating
above normal conditions), the program takes this situation as ambiguous and displays
“NORMAL” on the LCD.
21
If both the bits are at low logic levels (i.e. both the heat and smoke sensors are operating
under normal conditions), the program simply displays “NORMAL” on the LCD and the buzzer
also remains OFF.
Code:
LCD EQU P1
ORG 000H
CALL INIT_LCD
again:
CALL GET_SENSOR_DATA
MOV A,#81H
CALL WR_LCD_COMMAND
CALL DELAY
JNC HERE
MOV A,#' '
CALL WR_LCD_CHR
MOV A,#'F'
22
CALL WR_LCD_CHR
MOV A,#'I'
CALL WR_LCD_CHR
MOV A,#'R'
CALL WR_LCD_CHR
MOV A,#'E'
CALL WR_LCD_CHR
MOV A,#' '
CALL WR_LCD_CHR
MOV A,#'A'
CALL WR_LCD_CHR
MOV A,#'L'
CALL WR_LCD_CHR
MOV A,#'A'
CALL WR_LCD_CHR
MOV A,#'R'
CALL WR_LCD_CHR
MOV A,#'M'
CALL WR_LCD_CHR
MOV A,#' '
CALL WR_LCD_CHR
MOV A,#'#'
CALL WR_LCD_CHR
MOV A,#' '
CALL WR_LCD_CHR
CLR P2.4
MOV A,#31H
CALL WR_LCD_CHR
JMP AGAIN
23
HERE: MOV A,#' '
CALL WR_LCD_CHR
MOV A,#' '
CALL WR_LCD_CHR
MOV A,#' '
CALL WR_LCD_CHR
MOV A,#' '
CALL WR_LCD_CHR
MOV A,#'N'
CALL WR_LCD_CHR
MOV A,#'O'
CALL WR_LCD_CHR
MOV A,#'R'
CALL WR_LCD_CHR
MOV A,#'M'
CALL WR_LCD_CHR
MOV A,#'A'
CALL WR_LCD_CHR
MOV A,#'L'
CALL WR_LCD_CHR
MOV A,#' '
CALL WR_LCD_CHR
MOV A,#' '
CALL WR_LCD_CHR
MOV A,#' '
CALL WR_LCD_CHR
MOV A,#' '
CALL WR_LCD_CHR
MOV A,#' '
CALL WR_LCD_CHR
24
SETB P2.4
JMP AGAIN
INIT_LCD:
MOV A,#38H ;2 line 5x7
CALL WR_LCD_COMMAND
MOV A,#0CH ;LCD on cursor on
CALL WR_LCD_COMMAND
MOV A,#01H ;clear LCD
CALL WR_LCD_COMMAND
MOV A,#06H ;shift cursor right
CALL WR_LCD_COMMAND
DISP: MOV A, #81H ; Curser at LINE # 1, Position # 3
CALL WR_LCD_COMMAND
RET
WR_LCD_COMMAND:
CALL DELAY
MOV LCD,A
CLR LCD_RS
CLR LCD_RW
SETB LCD_EN
CLR LCD_EN
RET
WR_LCD_CHR:
25
CALL DELAY
MOV LCD,A
SETB LCD_RS
CLR LCD_RW
SETB LCD_EN
CLR LCD_EN
RET
DELAY:
mov r5, #0ffh ; delay loop instead of checking bit-7
djnz r5, $
RET
GET_SENSOR_DATA:
MOV C, P2.0
ANL C, P2.2
RET
END
26
12. CONCLUSION
An embedded system is a computer system with a dedicated function within a larger mechanical
or electrical system, often with real-time computing constraints. It is embedded as part of a
complete device often including hardware and mechanical parts. By contrast, a general-purpose
computer, such as a personal computer (PC), is designed to be flexible and to meet a wide range
of end-user needs. Embedded systems control many devices in common use today.
Embedded systems contain processing cores that are either microcontrollers, or digital signal
processors (DSP).
A processor is an important unit in the embedded system hardware. It is the heart of the
embedded system. The key characteristic, however, is being dedicated to handle a particular task.
Since the embedded system is dedicated to specific tasks, design engineers can optimize it to
reduce the size and cost of the product and increase the reliability and performance. Some
embedded systems are mass-produced, benefiting from economies of scale.
Physically, embedded systems range from portable devices such as digital watches and MP3
players, to large stationary installations like traffic lights, factory controllers, and largely
complex systems like hybrid vehicles, MRI, and avionics. Complexity varies from low, with a
single microcontroller chip, to very high with multiple units, peripherals and networks mounted
inside a large chassis or enclosure.
27
13. REFERENCES
28