|

8051/AT89S52 based SMOKE DETECTOR and FIRE ALARM SYSTEM

Download Project Report

       
       
8051 BASED FIRE ALARM SYSTEM
ownership

We, Mr. Hasban Mehmood, S/LT Arslan, S/LT Tauseef and S/LT Sikandar, bearing ROLL/P No. El-614, 7400, 7407, 7410 respectively of national university of science and technology, take an oath and state that the project FIRE ALARM SYSTEM is entirely and devotedly made by us. Previously stated project is owned by us and bears no belonging to anybody else. All the work and efforts in this project has been done only and only by the above mentioned group members. All the work from selection of project to the completion has been done by ourselves, although we have referred to some seniors and instructors of electronics department whenever we faced some problems which happened very often. 


Importance
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. 

Objectives: 
Our objective is to design a Fire Alarm System that would fulfill 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
  • The system should never be in any ambiguous state. Under normal conditions the system should indicate the state of the room as ‘NORMAL’ in order to avoid any confusion.

REASONS FOR CHOOSING DIGITAL SOLUTION:
Conventional fire alarm systems having hard wire layout and normally opened warning devices like heat detector and smoke detector in general specifications, have a good view in low price, but have a bad view in

1. Low efficiency to warn and to communicate to human
2. Difficulty of maintenance
3. Hard expansion and transformation of working
4. No record and no database to develop in the future

Our proposed fire alarm system is designed and built to solve these problems. The connections between warning devices are dealt with microcontroller.

GENERAL WORKING OF THE PROPOSED SYSTEM:
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 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.

HOW I WILL GO ABOUT IMPLEMENTING MY SOLUTION:
To make our lives easier and to make maximum use of time available to us, we plan to use the modular design concept to implement our system. The entire system is to be divided into different modules, which not only makes troubleshooting easier but is also an effective approach for system modification.

Our system will consist of the following modules:
HEAT DETECTION CIRCUIT
• SMOKE DETECTION CIRCUIT
• MICROCONTROLLER PROGRAMMING
• INTERFACING OF BUZZER
• LCD INTERFACING

We first plan to implement each of our modules on breadboard. Once the circuit starts to function properly on the breadboard it will be implemented on the weiroboard. In the next step all these modules will be linked together via microcontroller. The software will then be embedded onto the hardware to perform the desired control operations.


HEAT DETECTION CIRCUIT:
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 fulfill 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 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.

MICROCONTROLLER PROGRAMMING AND INTERFACING:
We have used 89S52 microcontroller. It has 40 pins .pin no 40 is connected to Vcc while pin no 20 with ground. 

LCD INTERFACING:
The LCD we used was having 16 pins out of which 8 pins are directly going to microcontroller pin number 1 to 8. Two pins are connected with Vcc one with ground and one with the potentiometer to set the resolution of LCD. Three control pins of LCD are also connected to microcontroller pin no 2.5, 2.6, and 2.7 .They are used for enabling LCD, performing read or write operations and to select command or data register .

BUZZER:
It has two pins; one is connected with the supply and the other one with the microcontroller pin no 2.4. When microcontroller will provide low signal, the circuit will be completed and the buzzer will start alarming.

SOFTWARE DESIGN
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 h
    is operating above normal conditions), the program takes this situation as ambiguous and  displays “NORMAL” on the LCD.

  • 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.
  • The programming approach to display output on the LCD includes character by character transfer of the entire string with an appropriate delay. The LCD is initialized only once and only the top line of the LCD is being used for display purpose.
SOURCE CODE:

;********************************************************************

 LCD_RS    BIT     P2.7
 LCD_RW    BIT     P2.6
 LCD_EN    BIT     P2.5

 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'
                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

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

        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:
                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

Feel free to contact us at elprojects@ymail.com.

Posted by Muhammad Ahmed on 20:49. Filed under , . You can follow any responses to this entry through the RSS 2.0. Feel free to leave a response

Labels

Recently Commented

Recently Added