Anda di halaman 1dari 56

Chapter 1 Introduction

An automatic fire alarm system is designed to detect the unwanted presence of fire by monitoring environmental changes associated with combustion. In general, a fire alarm system is either classified as automatic, manually activated, or both. Automatic fire alarm systems can be used to notify people to evacuate in the event of a fire or other emergency, to summon emergency services, and to prepare the structure and associated systems to control the spread of fire and smoke. Fire alarm systems have become increasingly sophisticated and functionally more capable and reliable in recent years. There are a number of reasons for the substantial increases in the life-safety form of fire protection during recent years, foremost of which are. 1. The proliferation of high-rise construction and the concern for life safety within these buildings. 2. A growing awareness of the life-safety hazard in residential, institutional, and educational occupancies. 3. Increased hazards caused by new building materials and furnishings that create large amounts of toxic combustion products (i.e., plastics, synthetic fabrics, etc.).Vast improvements in smoke detection and 4. A related technology made possible through quantum advances in electronic technology. 5. passing of the Americans with Disabilities Act (ADA), signed into law on July 26, 1990, providing comprehensive civil rights protection for individuals with disabilities. With an effective date of January 26, 1992, these requirements included detailed accessibility standards for both new construction and Renovation toward the goal of equal usability of buildings for everyone.6.It protects life without any loss of life and property The main aim of this project is to control the basic parameters of automatic fire alarm. Different sensors are used in this project to measure various parameters. Temperature sensors (lm35d) are also used to get the temperature and timely irrigation will turn on the motors at specific intervals. LDR is also used LCD will display that in which room fire is occurs. To display in which room temperature occurs the temperature sensor and light sensor both should be sensed and this information will passed to LCD through micro controller

1.1. Objective of project:


The project intends to control the basic parameters of the automatic fire alarm and display the analog parameters on the LCD. The project uses the Embedded Systems to design this application. The main objective of this project is to read the analog parameters like temperature and intensity of light continuously and when any of the parameters exceed the set points perform the required task. The objective of the project is to develop a microcontroller based control and display system. This project consists of temperature and light sensor and LCD as display unit.

1.2. Background of the Project:


The software application and the hardware implementation help the microcontroller read the data from the sensors, compare the values with the set points and if they exceed the

already set points, take the required action. The system is totally designed using embedded systems technology. The Controlling unit has an application program to allow the microcontroller read the data from the sensor, compare them with the fixed values and do the further action and finally display it on the LCD. The performance of the design is maintained by controlling unit

1.3. Organization of the Thesis:


In view of the proposed thesis work explanation of theoretical aspects and algorithms used in this work are presented as per the sequence described below. Chapter 1 describes a brief review of the objectives and goals of the work. Chapter 2 discusses the existing technologies and the study of various technologies in detail. Chapter 3 describes the Block diagram, Circuit diagram of the project and its description. The construction and description of various modules used for the application are described in detail. Chapter 4 explains the Software tools required for the project, the Code developed for the design. Chapter 5 presents the results, overall conclusions of the study and proposes possible improvements and directions of future

Chapter 2 Overview of the technologies used Embedded Systems:


An embedded system can be defined as a computing device that does a specific focused job. Appliances such as the air-conditioner, VCD player, DVD player, printer, fax machine, mobile phone etc. are examples of embedded systems. Each of these appliances will have a processor and special hardware to meet the specific requirement of the application along with the embedded software that is executed by the processor for meeting that specific requirement. The embedded software is also called firm ware. The desktop/laptop computer is a general purpose computer. You can use it for a variety of applications such as playing games, word processing, accounting, software development and so on. In contrast, the software in the embedded systems is always fixed listed below: Embedded systems do a very specific task, they cannot be programmed to do different things. . Embedded systems have very limited resources, particularly the memory. Generally, they do not have secondary storage devices such as the CDROM or the floppy disk. Embedded systems have to work against some deadlines. A specific job has to be completed within a specific time. In some embedded systems, called real-time systems, the deadlines are stringent. Missing a deadline may cause a catastrophe-loss of life or damage to property. Embedded systems are constrained for power. As many embedded systems operate through a battery, the power consumption has to be very low. Some embedded systems have to operate in extreme environmental conditions such as very high temperatures and humidity.

Following are the advantages of Embedded Systems: 1. They are designed to do a specific task and have real time performance constraints which must be met. 2. They allow the system hardware to be simplified so costs are reduced. 3. They are usually in the form of small computerized parts in larger devices which serve a general purpose. 4. The program instructions for embedded systems run with limited computer hardware resources, little memory and small or even non-existent keyboard or screen.

Chapter 3 Hardware Implementation of the Project


This chapter briefly explains about the Hardware Implementation of the project. It discusses the design and working of the design with the help of block diagram and circuit diagram and explanation of circuit diagram in detail. It explains the features, timer programming, serial communication, interrupts of AT89S52 microcontroller. It also explains the various modules used in this project.

3.1 Project Design:


The implementation of the project design can be divided in two parts. Hardware implementation Firmware implementation

Hardware implementation deals in drawing the schematic on the plane paper according to the application, testing the schematic design over the breadboard using the various ICs to find if the design meets the objective, carrying out the PCB layout of the schematic tested on breadboard, finally preparing the board and testing the designed hardware. The firmware part deals in programming the microcontroller so that it can control the operation of the ICs used in the implementation. In the present work, we have used the Orcad design software for PCB circuit design, the Keil v3 software development tool to write and compile the source code, which has been written in the C language. The Proload programmer has been used to write this compile code into the microcontroller. The firmware implementation is explained in the next chapter. The project design and principle are explained in this chapter using the block diagram and circuit diagram. The block diagram discusses about the required components of the design and working condition is explained using circuit diagram and system wiring diagram.

3.1.1 Block Diagram of the Project and its Description:


The block diagram of the design is as shown in Fig 3.1. It consists of microcontroller, keypad, stepper motor and the driver circuit associated with it, buzzer circuit and LCD. The brief description of each unit is explained as follows.

FIGURE: 1

3.2 Power Supply:


The input to the circuit is applied from the regulated power supply. The a.c. input i.e., 230V from the mains supply is step down by the transformer to 12V and is fed to a rectifier. The output obtained from the rectifier is a pulsating d.c voltage. So in order to get a pure d.c voltage, the output voltage from the rectifier is fed to a filter to remove any a.c components present even after rectification. Now, this voltage is given to a voltage regulator to obtain a pure constant dc voltage.

FIGURE: 2

Transformer:
Usually, DC voltages are required to operate various electronic equipment and these voltages are 5V, 9V or 12V. But these voltages cannot be obtained directly. Thus the a.c input available at the mains supply i.e., 230V is to be brought down to the required voltage level. This is done by a transformer. Thus, a step down transformer is employed to decrease the voltage to a required level.

Rectifier:
The output from the transformer is fed to the rectifier. It converts A.C. into pulsating D.C. The rectifier may be a half wave or a full wave rectifier. In this project, a bridge rectifier is used because of its merits like good stability and full wave rectification.

Filter:
Capacitive filter is used in this project. It removes the ripples from the output of rectifier and smoothens the D.C. Output received from this filter is constant until the mains voltage and load is maintained constant. However, if either of the two is varied, D.C. voltage received at this point changes. Therefore a regulator is applied at the output stage.

Voltage regulator:
As the name itself implies, it regulates the input applied to it. A voltage regulator is an electrical regulator designed to automatically maintain a constant voltage level. In this project, power supply of 5V and 12V are required. In order to obtain these voltage levels, 7805 and 7812 voltage regulators are to be used. The first number 78 represents positive supply and the numbers 05, 12 represent the required output voltage levels.

FIGURE: 3

7805 regulator

Three-Terminal Voltage Regulators: Fixed Positive Voltage Regulators:

FIG: 3.1 Figure: circuit diagram of power supply

FIGURE: 4

3.3 Microcontrollers:
Microprocessors and microcontrollers are widely used in embedded systems products. Microcontroller is a programmable device. A microcontroller has a CPU in addition to a fixed amount of RAM, ROM, I/O ports and a timer embedded all on a single chip. The fixed amount of on-chip ROM, RAM and number of I/O ports in microcontrollers makes them ideal for many applications in which cost and space are critical. The Intel 8051 is Harvard architecture, single chip microcontroller (C) which was developed by Intel in 1980 for use in embedded systems. It was popular in the 1980s and early 1990s, but today it has largely been superseded by a vast range of enhanced devices with 8051-compatible processor cores that are manufactured by more than 20 independent manufacturers including Atmel, Infineon Technologies and Maxim Integrated Products. 8051 is an 8-bit processor, meaning that the CPU can work on only 8 bits of data at a time. Data larger than 8 bits has to be broken into 8-bit pieces to be processed by the CPU. 8051 is available in different memory types such as UV-EPROM, Flash and NV-RAM.

Features of AT89S52:
8K Bytes of Re-programmable Flash Memory. RAM is 256 bytes. 4.0V to 5.5V Operating Range. Fully Static Operation: 0 Hz to 33 MHzs Three-level Program Memory Lock. 256 x 8-bit Internal RAM. 32 Programmable I/O Lines. Three 16-bit Timer/Counters. Eight Interrupt Sources. Full Duplex UART Serial Channel. Low-power Idle and Power-down Modes. Interrupt recovery from power down mode. Watchdog timer. Dual data pointer. Power-off flag. Fast programming time. Flexible ISP programming (byte and page mode).

Description:
The AT89s52 is a low-voltage, high-performance CMOS 8-bit microcomputer with 8K bytes of Flash programmable memory. The device is manufactured using Atmels high density nonvolatile memory technology and is compatible with the industry-standard MCS-51 instruction set. The on chip flash allows the program memory to be reprogrammed in system or by a conventional non volatile memory programmer. By combining a versatile 8-bit CPU with Flash on a monolithic chip, the Atmel AT89s52 is a powerful microcomputer, which provides a highly flexible and cost-effective solution to many embedded control applications. .In addition, the AT89s52 is designed with static logic for operation down to zero frequency and supports two software selectable power saving modes. The Idle Mode stops the CP

while allowing the RAM, timer/counters, serial port and interrupt system to continue functioning. The power-down mode saves the RAM contents but freezes the oscillator disabling all other chip functions until the next hardware reset.

Fig5: Pin diagram

Fig6: Block diagram

10

Pin description: Vcc Pin 40 provides supply voltage to the chip. The voltage source is +5V.

GND Pin 20 is the ground. Port 0: Port 0 is an 8-bit open drain bidirectional I/O port. As an output port, each pin can sink eight TTL inputs. When 1s are written to port 0 pins, the pins can be used as high impedance inputs. Port 0 can also be configured to be the multiplexed low-order address/data bus during Accesses to external program and data memory. In this mode, P0 has internal pull-ups. Port 0 also receives the code bytes during Flash programming and outputs the code bytes during Program verification. External pull-ups are required during program verification Port 1: Port 1 is an 8-bit bidirectional I/O port with internal pull-ups. The Port 1 output buffers can sink/source four TTL inputs. When 1s are written to Port 1 pins, they are pulled high by the internal pull-ups and can be used as inputs. As inputs, Port 1 pins that are externally being pulled low will source current (IIL) because of the internal pull-ups. In addition, P1.0 and P1.1 can be configured to be the timer/counter 2 external count input (P1.0/T2) and the timer/counter 2 trigger input (P1.1/T2EX), respectively, as shown in the following table. Port 1 also receives the low-order address bytes during Flash programming and verification.

Table no: 1

11

Port 2: Port 2 is an 8-bit bidirectional I/O port with internal pull-ups. The Port 2 output buffers can sink/source four TTL inputs. When 1s are written to Port 2 pins, they are pulled high by the internal pull-ups and can be used as inputs. As inputs, Port 2 pins that are externally being pulled low will source current (IIL) because of the internal pull-ups. Port 2 emits the high-order address byte during fetches from external program memory and during accesses to external data memory that uses 16-bit addresses (MOVX @ DPTR). In this application, Port 2 uses strong internal pull-ups when emitting 1s. During accesses to external data memory that uses 8-bit addresses (MOVX @ RI), Port 2 emits the contents of the P2 Special Function Register. The port also receives the high-order address bits and some control signals during Flash programming and verification. Port 3: Port 3 is an 8-bit bidirectional I/O port with internal pull-ups. The Port 3 output buffers can sink/source four TTL inputs. When 1s are written to Port 3 pins, they are pulled high by the internal pull-ups and can be used as inputs. As inputs, Port 3 pins that are externally being pulled low will source current (IIL)
Port 3 also serves the functions of various special features of the AT89S52, as shown in the following table.

Table no : 2

12

RST: Reset input A high on this pin for two machine cycles while the oscillator is running resets the device. This pin drives high for 98 oscillator periods after the Watchdog times out. The DISRTO bit in SFR AUXR (address 8EH) can be used to disable this feature. In the default state of bit DISRTO, the RESET HIGH out feature is enabled. ALE/PROG: Address Latch Enable (ALE) is an output pulse for latching the low byte of the address during accesses to external memory. This pin is also the program pulse input (PROG) during Flash programming. In normal operation, ALE is emitted at a constant rate of 1/6 the oscillator frequency and may be used for external timing or clocking purposes. Note, however, that one ALE pulse is skipped during each access to external data memory. In normal operation, ALE is emitted at a constant rate of 1/6 the oscillator frequency and may be used for external timing or clocking purposes. Note, however, that one ALE pulse is skipped during each access to external data memory. If desired, ALE operation can be disabled by setting bit 0 of SFR location 8EH. With the bit set, ALE is active only during a MOVX or MOVC instruction. Otherwise, the pin is weakly pulled high. Setting the ALE-disable bit has no effect if the microcontroller is in external execution mode. Program Store Enable (PSEN): Ps is the read strobe to external program memory. When the AT89S52 is executing code from external program memory, PSEN is activated twice each machine cycle, except that two PSEN activations are skipped during each access to external data

EA/VPP: External Access Enable EA must be strapped to GND in order to enable the device to fetch code from external program memory locations starting at 0000H up to FFFFH. Note, however, that if lock bit 1 is programmed, EA will be internally latched on reset. EA should be strapped to VCC for internal program executions. This pin also receives the 12volt programming enable voltage (VPP) during Flash programming. XTAL1: Input to the inverting oscillator amplifier and input to the internal clock operating circuit. XTAL2: Output from the inverting oscillator amplifier.

13

Oscillator Connections:

fig 7 oscillators connections

C1, C2 = 30 pF 10 pF for Crystals = 40 pF 10 pF for Ceramic Resonators External Clock Drive Configuration:

FIG: 8

XTAL1 and XTAL2 are the input and output, respectively, of an inverting amplifier that can be Configured for use as an on-chip oscillator. Either a quartz crystal or ceramic resonator may be Used. To drive the device from an external clock source, XTAL2 should be left unconnected

14

While XTAL 1 is driven. There are no requirements on the duty cycle of the external clock signal, since the input to the internal clocking circuitry is through a divide-by-two flip-flop, but minimum and maximum voltage high and low time specifications must be observed. Memory Organization: MCS-51 devices have a separate address space for Program and Data Memory. Up to 64K bytes each of external Program and Data Memory can be addressed. Program Memory: If the EA pin is connected to GND, all program fetches are directed to external memory. On the AT89S52, if EA is connected to VCC, program fetches to addresses 0000H through 1FFFH are directed to internal memory and fetches to addresses 2000H through FFFFH are to external memory. Data Memory: The AT89S52 implements 256 bytes of on-chip RAM. The upper 128 bytes occupy a parallel address space to the Special Function Registers. This means that the upper 128 bytes have the same addresses as the SFR space but are physically separate from SFR space. When an instruction accesses an internal location above address 7FH, the address mode used in the instruction specifies whether the CPU accesses the upper 128 bytes of RAM or the SFR space. Instructions which use direct addressing access the SFR space. For example, the following direct addressing instruction accesses the SFR at location 0A0H (which is P2). MOV 0A0H, #data The instructions that use indirect addressing access the upper 128 bytes of RAM. For example, the following indirect addressing instruction, where R0 contains 0A0H, accesses the data byte at address 0A0H, rather than P2 (whose address is 0A0H). MOV @R0, #data It should be noted that stack operations are examples of indirect addressing, so the upper 128 bytes of data RAM are available as stack space. Timer 0: Timer 0 functions as either a timer or event counter in four modes of operation. Timer 0 is controlled by the four lower bits of the TMOD register and bits 0, 1, 4 and 5 of the TCON register. TMOD register selects the method of timer gating (GATE0), timer or counter operation (T/C0#) and mode of operation (M10 and M00). The TCON register provides timer 0 control functions: overflow flag (TF0), run control bit (TR0), interrupt flag (IE0) and interrupt type control bit (IT0). For normal timer operation (GATE0= 0), setting TR0 allows TL0 to be incremented by the selected input. Setting GATE0 and TR0 allows external pin INT0# to control timer operation. Timers 0 overflow (count rolls over from all 1s to all 0s) sets TF0 flag, generating an interrupt request. It is important to stop timer/counter before changing mode.

15

Timer 1: Timer 1 is identical to timer 0, except for mode 3, which is a hold-count mode. The following comments help to understand the differences: Timer 1 functions as either a timer or event counter in three modes of operation. Timer 1s mode 3 is a hold-count mode. Timer 1 is controlled by the four high-order bits of the TMOD register and bits 2, 3, 6 and 7 of the TCON register. The TMOD register selects the method of timer gating (GATE1), timer or counter operation (C/T1#) and mode of operation (M11 and M01). The TCON register provides timer 1 control functions: overflow flag (TF1), run control bit (TR1), interrupt flag (IE1) and interrupt type control bit (IT1). Timer 1 can serve as the baud rate generator for the serial port. Mode 2 is best suited for this purpose. For normal timer operation (GATE1 = 0), setting TR1 allows TL1 to be incremented by the selected input. Setting GATE1 and TR1 allows external pin INT1# to control timer operation. Timer 1 overflow (count rolls over from all 1s to all 0s) sets the TF1 flag generating an interrupt request. When timer 0 is in mode 3, it uses timer 1s overflow flag (TF1) and run control bit (TR1). For this situation, use timer 1 only for applications that do not require an interrupt (such as a baud rate generator for the serial port) and switch timer 1 in and out of mode 3 to turn it off and on. It is important to stop timer/counter before changing modes. Timer 2: Timer 2 is a 16-bit Timer/Counter that can operate as either a timer or an event counter. The type of operation is selected by bit C/T2 in the SFR T2CON. Timer 2 has three operating modes: capture, auto-reload (up or down counting), and baud rate generator. The modes are selected by bits in T2CON. Timer 2 consists of two 8-bit registers, TH2 and TL2. In the Timer function, the TL2 register is incremented every machine cycle. Since a machine cycle consists of 12 oscillator periods, the count rate is 1/12 of the oscillator frequency.

Table no 03

16

In the Counter function, the register is incremented in response to a 1-to-0 transition at its corresponding external input pin, T2. In this function, the external input is sampled during S5P2 of every machine cycle. When the samples show a high in one cycle and a low in the next cycle, the count is incremented. The new count value appears in the register during S3P1 of the cycle following the one in which the transition was detected. Since two machine cycles (24 oscillator periods) are required to recognize a 1-to-0 transition, the maximum count rate is 1/24 of the oscillator frequency. To ensure that a given level is sampled at least once before it changes, the level should be held for at least one full machine cycle. Interrupts: The AT89S52 has a total of six interrupt vectors: two external interrupts (INT0 and INT1), three timer interrupts (Timers 0, 1, and 2), and the serial port interrupt. These interrupts are all shown in the below figure. Each of these interrupt sources can be individually enabled or disabled by setting or clearing a bit in Special Function Register IE. IE also contains a global disable bit, EA, which disables all interrupts at once. The below table shows that bit position IE.6 is unimplemented. User software should not write a 1 to this bit position, since it may be used in future AT89 products. Timer 2 interrupt is generated by the logical OR of bits TF2 and EXF2 in register T2CON. Neither of these flags is cleared by hardware when the service routine is vectored to. In fact, the service routine may have to determine whether it was TF2 or EXF2 that generated the interrupt, and that bit will have to be cleared in software. The Timer 0 and Timer 1 flags, TF0 and TF1, are set at S5P2 of the cycle in which the timers overflow. The values are then polled by the circuitry in the next cycle. However, the Timer 2 flag, TF2, is set at S2P2 and is polled in the same cycle in which the timer overflows. Programming Algorithm: Before programming the AT89S52, the address, data, and control signals should be set up according to the Flash Programming Modes. To program the AT89S52, take the following steps:1. Input the desired memory location on the address lines. 1. Input the desired memory location on the address lines. 2. Input the appropriate data byte on the data lines. 3. Activate the correct combination of control signals. 4. Raise EA/VPP to 12V. 5. Pulse ALE/PROG once to program a byte in the Flash array or the lock bits. The byte write cycle is self-timed and typically takes no more than 50 s. Repeat steps 1 through 5, changing the address and data for the entire array or until the end of the object file is reached.

17

Chip Erase: In the parallel programming mode, a chip erase operation is initiated by using the proper combination of control signals and by pulsing ALE/PROG low for a duration of 200 ns - 500 ns. In the serial programming mode, a chip erase operation is initiated by issuing the Chip Erase instruction. In this mode, chip erase is self-timed and takes about 500 ms. During chip erase, a serial read from any address location will return 00H at the data output.

3.4 Sensors:
3.4.1 LM35D Temperature Sensor:
LM35 converts temperature value into electrical signals. LM35 series sensors are precision integratedcircuit temperature sensors whose output voltage is linearly proportional to the Celsius temperature. The LM35 requires no external calibration since it is internally calibrated. . The LM35 does not require any external calibration or trimming to provide typical accuracies of 14C at room temperature and 34C over a full 55 to +150C temperature range.

The LM35s low output impedance, linear output, and precise inherent calibration make interfacing to readout or control circuitry especially easy. It can be used with single power supplies, or with plus and minus supplies. As it draws only 60 A from its supply, it has very low self-heating, less than 0.1C in still air.

Features:
Calibrated directly in Celsius (Centigrade) Linear + 10.0 mV/C scale factor 0.5C accuracy guaranteed (at +25C) Rated for full 55 to +150C range Suitable for remote applications Low cost due to wafer-level trimming Operates from 4 to 30 volts Less than 60 A current drain Low self-heating, 0.08C in still air Nonlinearity only 14C typical Low impedance output, 0.1 W for 1 mA load

FIG: The this For each degree of centigrade temperature it outputs 10milli volts.

9 characteristic of LM35 sensor is:

18

3.4.2 LDR (LIGHT DEPENDENT RESISTOR):


LDRs or Light Dependent Resistors are very useful especially in light/dark sensor circuits. Normally the resistance of an LDR is very high, sometimes as high as 1,000,000 ohms, but when they are illuminated with light, the resistance drops dramatically. Thus in this project, LDR plays an important role in switching on the based on the intensity of light i.e., if the intensity of light is more the motors will be in on condition. And if the intensity of light is less then motors will be switched off.

FIG: 10 This is an example of a light sensor circuit: When the light level is low the resistance of the LDR is high. This prevents current from flowing to the base of the transistors. Consequently the LED does not light. However, when light shines onto the LDR its resistance falls and current flows into the base of the first transistor and then the second transistor. The LED glows. The preset resistor can be turned up or down to increase or decrease resistance, in this way it can make the circuit more or less sensitive.

3.5 .LM339 QUAD COMPARATOR:


Features:
Single or dual supply operation Wide ranges of supply voltages Low supply current drain 800A Type Open collector outputs for wired and connectors Low input bias current 25mA Type Low input offset current 2.3mA Type Low input offset voltage 1.4mV Type Input Common Mode Voltage Range Includes Ground

19

Low output saturation voltage Output compatible with TTL,DTL, and MOS Logic system

Description:
The LM339 consists of four independent voltage comparators designed to operate from single power supply over a wide voltage range.

FIG: 11

FIG: 12

20

Advantages:
1) High precision comparators 2) Reduced VOS drift over temperature 3) Eliminates need for dual supplies 4) Allows sensing near GND 5) Compatible with all forms of logic 6) Power drain suitable for battery operation

3.6. RELAYS:
A relay is an electrically operated switch. Many relays use an electromagnet to operate a switching mechanism mechanically, but other operating principles are also used. Relays are used where it is necessary to control a circuit by a low-power signal (with complete electrical isolation between control and controlled circuits), or where several circuits must be controlled by one signal. The first relays were used in long distance telegraph circuits, repeating the signal coming in from one circuit and re-transmitting it to another. Relays were used extensively in telephone exchanges and early computers to perform logical operations. A type of relay that can handle the high power required to directly control an electric motor is called a contactor. Solid-state relays control power circuits with no moving parts, instead using a semiconductor device to perform switching. Relays with calibrated operating characteristics and sometimes multiple operating coils are used to protect electrical circuits from overload or faults; in modern electric power systems these functions are performed by digital instruments still called "protective relays"

21

FIG: 13

Applications:
Relays are used to and for: Control a high-voltage circuit with a low-voltage signal, as in some types of modems or audio amplifiers, Control a high-current circuit with a low-current signal, as in the starter solenoid of an automobile, Detect and isolate faults on transmission and distribution lines by opening and closing circuit breakers (protection relays), Isolate the controlling circuit from the controlled circuit when the two are at different potentials, for example when controlling a mains-powered device from a low-voltage switch. The latter is often applied to control office lighting as the low voltage wires are easily installed in partitions, which may be often moved as needs change. They may also be controlled by room occupancy detectors in an effort to conserve energy, Logic functions. For example, the boolean AND function is realised by connecting normally open relay contacts in series, the OR function by connecting normally open contacts in parallel. The change-over or Form C contacts perform the XOR (exclusive or) function.

22

Similar functions for NAND and NOR are accomplished using normally closed contacts. The Ladder programming language is often used for designing relay logic networks. Early computing. Before vacuum tubes and transistors, relays were used as logical elements in digital computers. See ARRA (computer), Harvard Mark II, Zuse Z2, and Zuse Z3. Safety-critical logic. Because relays are much more resistant than semiconductors to nuclear radiation, they are widely used in safety-critical logic, such as the control panels of radioactive waste-handling machinery. Time delay functions. Relays can be modified to delay opening or delay closing a set of contacts. A very short (a fraction of a second) delay would use a copper disk between the armature and moving blade assembly. Current flowing in the disk maintains magnetic field for a short time, lengthening release time. For a slightly longer (up to a minute) delay, a dashpot is used. A dashpot is a piston filled with fluid that is allowed to escape slowly. The time period can be varied by increasing or decreasing the flow rate. For longer time periods, a mechanical clockwork timer is installed.

3.7. DIODE:
1N4007 DIODE

FIG: 14

Features:
Diffused Junction High Current Capability and Low Forward Voltage Drop Surge Overload Rating to 30A Peak Low Reverse Leakage Current Lead Free Finish, RoHS Compliant In electronics, a diode is a two-terminal electronic component that conducts electric current in only one direction. The term usually refers to asemiconductor diode, the most common type today. This is a crystalline piece of semiconductor material connected to two electrical terminals.[1] A vacuum tube diode (now little used except in some high-power technologies) is a vacuum tube with two electrodes: a plate and acathode. The most common function of a diode is to allow an electric current to pass in one direction (called the diode's forward direction), while blocking current in the opposite direction

23

(the reverse direction). Thus, the diode can be thought of as an electronic version of a check valve. This unidirectional behavior is called rectification, and is used to convert alternating current to direct current, and to extract modulation from radio signals in radio receivers. However, diodes can have more complicated behavior than this simple on-off action. This is due to their complex non-linear electrical characteristics, which can be tailored by varying the construction of their P-N junction. These are exploited in special purpose diodes that perform many different functions. For example, specialized diodes are used to regulate voltage (Zener diodes), to electronically tune radio and TV receivers (varactor diodes), to generate radio frequency oscillations (tunnel diodes), and to produce light (light emitting diodes). Tunnel diodes exhibitnegative resistance, which makes them useful in some types of circuits. Diodes were the first semiconductor electronic devices. The discovery of crystals' rectifying abilities was made by German physicist Ferdinand Braun in 1874. The first semiconductor diodes, called cat's whisker diodes, developed around 1906, were made of mineral crystals such asgalena. Today most diodes are made of silicon, but other semiconductors such as germanium are sometimes used

3.8. TRANSISTOR:
2N2222 transistor

FIG: 15 2N2222A with Emitter, Base and Collector identified as "e" "b" "c" respectively. The 2N2222 is a common NPN bipolar junction transistor used for general purpose lowpower amplifying or switching applications. It is designed for low to medium current, low power, medium voltage, and can operate at moderately high speeds. It is made in the TO18 metal can as shown in the picture. Replacements are commonly available now in the cheaper TO-92 packaging, where it is known as the PN2222 or P2N2222. The 2N2222 is considered a very common transistor,[1][2][3] and is used as an exemplar of an NPN transistor. It is frequently used as a small-signal transistor,[4][5] It is a small general purpose transistor[6] of enduring popularity.[7][8][9] The 2N2222 was part of a family of devices described by Motorola at a 1962 IRE convention [10]. Since then it has been made by many semiconductor companies; a Texas Instruments data sheet published in March 1973 listed this part number with an A suffix, indicating an improved version with slightly higher voltage ratings. [11]

24

The JEDEC registration of a device number ensures particular rated values will be met by all parts offered under that number. JEDEC registered parameters include outline dimensions, small-signal current gain, transition frequency, maximum values for voltage withstand, current rating, power dissipation and temperature rating, and others, measured under standard test conditions. Other part numbers will have different parameters. The exact specs depend on the manufacture case type and variation. Therefore it is important to reference the datasheet for the exact part number and manufacturer.

3.9 Buzzer and Bleeper:


These devices are output transducers converting electrical energy to sound. They contain an internal oscillator to produce the sound which is set at about 400Hz for buzzers and about 3kHz for bleepers. Buzzers have a voltage rating but it is only approximate, for example 6V and 12V buzzers can be used with a 9V supply. Their typical current is about 25mA. Bleepers have wide voltage ranges, such as 3-30V, and they pass a low current of about 10mA. Buzzers and bleepers must be connected the right way round, their red lead is positive (+).

FIG: 16

3.10 DC Motors:
Principles of operation: In any electric motor, operation is based on simple electromagnetism. A current-carrying conductor generates a magnetic field; when this is then placed in an external magnetic field, it will experience a force proportional to the current in the conductor, and to the strength of the external magnetic field. As you are well aware of from playing with magnets as a kid, opposite (North and South) polarities attract, while like polarities (North and North, South and South) repel. The internal configuration of a DC motor is designed to harness the magnetic interaction between a current-carrying conductor and an external magnetic field to generate rotational motion.

25

FIG: 17

3.11. LIQUID CRYSTAL DISPLAY:


LCD stands for Liquid Crystal Display. LCD is finding wide spread use replacing LEDs (seven segment LEDs or other multi segment LEDs) because of the following reasons: The declining prices of LCDs. The ability to display numbers, characters and graphics. This is in contrast to LEDs, which are limited to numbers and a few characters. Incorporation of a refreshing controller into the LCD, thereby relieving the CPU of the task of refreshing the LCD. In contrast, the LED must be refreshed by the CPU to keep displaying the data. Ease of programming for characters and graphics. These components are specialized for being used with the microcontrollers, which means that they cannot be activated by standard IC circuits. They are used for writing different messages on a miniature LCD.

A model described here is for its low price and great possibilities most frequently used in

practice. It is based on the HD44780 microcontroller (Hitachi) and can display messages in two lines with 16 characters each. It displays all the alphabets, Greek letters, punctuation marks, mathematical symbols etc. In addition, it is possible to display symbols that user makes up on its own. Automatic shifting message on display (shift left and right), appearance of the pointer, backlight etc. are considered as useful characteristics. Pins Functions: There are pins along one side of the small printed board used for connection to the microcontroller. There are total of 14 pins marked with numbers (16 in case the background light is built in). Their function is described in the table below:

26

Function Ground Power supply Contrast

Pin Number 1 2 3 4

Name Vss Vdd Vee RS

Logic State 0 1

Description 0V +5V 0 Vdd D0 D7 are interpreted as commands D0 D7 are interpreted as data Write data (from controller to LCD) Read data (from LCD to controller)

Control operating

of 5

R/W

0 1

0 Access to LCD disabled 1 Normal operating From 1 to Data/commands are transferred to 0 LCD 0/1 0/1 0/1 0/1 0/1 0/1 0/1 0/1 Bit 0 LSB Bit 1 Bit 2 Bit 3 Bit 4 Bit 5 Bit 6 Bit 7 MSB

7 8 9 10 Data / commands 11 12 13 14

D0 D1 D2 D3 D4 D5 D6 D7

Specifications:

Number of Characters: 16 characters x 2 Lines Character Table: English-European (RS in Datasheet) Module dimension: 80.0mm x 36.0mm x 13.2mm(MAX) View area: 66.0 x 16.0 mm Active area: 56.2 x 11.5 mm Dot size: 0.56 x 0.66 mm Dot pitch: 0.60 x 0.70 mm Character size: 2.96 x 5.46 mm Character pitch: 3.55 x 5.94 mm

27

LCD type: STN, Positive, Transflective, Yellow/Green Duty: 1/16 View direction: Wide viewing angle Backlight Type: yellow/green LED RoHS Compliant: lead free Operating Temperature: -20C to + 70

LCD screen: LCD screen consists of two lines with 16 characters each. Each character consists of 5x7 dot matrix. Contrast on display depends on the power supply voltage and whether messages are displayed in one or two lines. For that reason, variable voltage 0-Vdd is applied on pin marked as Vee. Trimmer potentiometer is usually used for that purpose. Some versions of displays have built in backlight (blue or green diodes). When used during operating, a resistor for current limitation should be used (like with any LE diode).

FIG: 18 LCD Basic Commands: All data transferred to LCD through outputs D0-D7 will be interpreted as commands or as data, which depends on logic state on pin RS: RS = 1 - Bits D0 - D7 are addresses of characters that should be displayed. Built in processor addresses built in map of characters and displays corresponding symbols. Displaying position is determined by DDRAM address. This address is either previously defined or the address of previously transferred character is automatically incremented.

28

RS = 0 - Bits D0 - D7 are commands which determine display mode. List of commands which LCD recognizes are given in the table below: Command Clear display Cursor home Entry mode set Display on/off control Cursor/Display Shift Function set Set CGRAM address Set DDRAM address Read BUSY flag (BF) Write to DDRAM Read from DDRAM CGRAM CGRAM or or RS RW D7 D6 D5 D4 D3 D2 D1 D0 0 0 0 0 0 0 0 0 0 1 1 0 0 0 0 0 0 0 0 1 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 1 0 0 1 D 0 1 Execution Time

1 1.64mS x 1.64mS

I/D S 40uS U B 40uS x 40uS x 40uS 40uS 40uS -

D/C R/L x F x

0 0 1 DL N

0 1 CGRAM address 1 DDRAM address BF DDRAM address

D7 D6 D5 D4 D3 D2 D1 D0 40uS D7 D6 D5 D4 D3 D2 D1 D0 40uS R/L 1 = Shift right 0 = Shift left DL 1 = 8-bit interface 0 = 4-bit interface N 1 = Display in two lines 0 = Display in one line F 1 = Character format 5x10 dots 0 = Character format 5x7 dots D/C 1 = Display shift 0 = Cursor shift

I/D 1 = Increment (by 1) 0 = Decrement (by 1) S 1 = Display shift on 0 = Display shift off D 1 = Display on 0 = Display off U 1 = Cursor on 0 = Cursor off B 1 = Cursor blink on 0 = Cursor blink off

Potentiometer:

29

Variable resistors used as potentiometers have all three terminals connected. This arrangement is normally used to vary voltage, for example to set the switching point of a circuit with a sensor, or control the volume (loudness) in an amplifier circuit. If the terminals at the ends of the track are connected across the power supply, then the wiper terminal will provide a voltage which can be varied from zero up to the maximum of the supply.

Potentiometer Symbol

Presets:

FIG:19

These are miniature versions of the standard variable resistor. They are designed to be mounted directly onto the circuit board and adjusted only when the circuit is built. For example, to set the frequency of an alarm tone or the sensitivity of a light-sensitive circuit, a small screwdriver or similar tool is required to adjust presets. Presets are much cheaper than standard variable resistors so they are sometimes used in projects where a standard variable resistor would normally be used. Multiturn presets are used where very precise adjustments must be made. The screw must be turned many times (10+) to move the slider from one end of the track to the other, giving very fine control.

LCD Interfacing with 8051:

30

FIG: 20

CHAPTER: 4 Software Implementation of the project design


This chapter briefly explains about the software implementation of the project. The required software tools are discussed in section 4.1 software tools required, 4.2 I/O Port programming in 8051 using assembly language.

4.1 Software Tools Required:


Keil v3, Proload are the two software tools used to program microcontroller. The working of each software tool is explained below in detail.

4.1.1 Programming Microcontroller:


A compiler for a high level language helps to reduce production time. To program the AT89S52 microcontroller the Keil v3 is used. The programming is done strictly in the embedded C language. Keil v3 is a suite of executable, open source software development tools for the microcontrollers hosted on the Windows platform. The compilation of the C program converts it into machine language file (.hex). This is the only language the microcontroller will understand, because it contains the original program code converted into a hexadecimal format. During this step there are some warnings about eventual errors in the program. This is shown in Fig 4.1. If there are no errors and warnings then run the program, the system performs all the required tasks and behaves as expected the software developed. If not, the whole procedure will have to be repeated again. Fig 4.2 shows expected outputs for given inputs when run compiled program. One of the difficulties of programming microcontrollers is the limited amount of resources the programmer has to deal with. In personal computers resources such as RAM and processing speed are basically limitless when compared to microcontrollers. In contrast, the code on microcontrollers should be as low on resources as possible.

31

Keil Compiler:
Keil compiler is software used where the machine language code is written and compiled. After compilation, the machine source code is converted into hex code which is to be dumped into the microcontroller for further processing. Keil compiler also supports C language code

4.2. I/O Port Programming in 8051 (using Assembly Language):


So far we have discussed the basic setup required for initializing the microcontroller and now comes the interesting part i.e. how to program 8051 using assembly language i.e. carry out input/output operations. All the ports of 8051 can be used for Input or Output. Lets get started. Some illustrations are listed below showing how to access the different pins and ports. In the following code, we have programmed the microcontroller to toggle the output pins of port 1and hence it will continuously toggle. ORG 0H MOV BACK: A, #55H MOV P1, A ; A= 55 hex ; P1= A ;Wait say for 256 counter ; complement A ; keep doing it ;delay subroutine for 256 counts ;load FF hex in R1 counter ; a delay loop

ACALL DELAY CPL SJMP A BACK

DELAY: MOV R1,#0FFH AGAIN: RET END DJNZ R1, AGAIN

;return to caller

32

FIG: 21

33

4.3 CODE OF THE PROJECT:


;*********************************************************************** ;This assembly program is for AUTOMATIC FIRE CONTROL AND ALARM SYSTEM USING AT89S52 ;Project Details ; ; ; ; ; ; Microcontroller Crystal Comparator Latch LCD Power Supply : : : : : : AT89S52 11.059 M hz LM339 74HCT373 2 X 16 Character +5v @ 1A AC-DC Adapter

;************************************************************* $mod52 ; standard library

;************************************************************* ;*************** Initialization Variables ********************* ;**************************************************************

nhsec equ temp1 equ temp2 equ light1 equ light2 equ

0031h 0032h 0033h 0034h 0035h

; ; ; ; ;

for delay variable Temperature - 1 flag Temperature - 2 flag Light - 1 flag Light - 2 flag

;************************************************************** ;********** Defining LCD Controls ************************** ;p2.0 is used as select either instruction or data RS ;p2.1 is used as read/write select RW ;p2.2 is used as lcd enable EN ;**************************************************************

34

lcd_rs bit lcd_rw bit lcd_en bit

p2.0 p2.1 p2.2

; ; ;

lcd RS lcd RW lcd EN

;************************************************************** led_test temph1 temph2 ldr1 ldr2 relay1 relay2 buzzer bit bit bit bit bit bit bit bit p1.1 p1.4 p1.2 p1.5 p2.3 p2.5 p1.3 p1.0 ; ; ; ; ; Flash LED

Temperature - 1 I/P Temperature - 2 I/P Light - 1 I/P Light - 2 I/P

;************************************************************** ;************************************************************** ;*********** MAIN Program ***********

;************************************************************** ;************************************************************** org sjmp 0000h start ; ; main program origin main program begin label

;************************************************************** ;****************** Application Start ************************* ;************************************************************** start: mov sp,#70h ; Move 70h in stack pointer

cpl setb clr

led_test buzzer ; relay1

Flash LED off

buzzer on/off ; Disable Latch - 1

35

clr clr clr clr clr mov mov mov mov mov lcall lcall cpl clr lcall cpl lcall cpl lcall cpl lcall

relay2 temph1 temph2 ldr1 ldr2 temp1,#00h temp2,#00h light1,#00h light1,#00h p1,#0ffh display_test delay led_test buzzer ; delay led_test delay led_test delay led_test display_line1

Disable Latch - 2

Flash LED off

buzzer on/off

Flash LED off

Flash LED off

Flash LED off

;************************************************************** ;************** looping is here only************************ ;************************************************************** repeat: cpl lcall lcall lcall led_test ; Flash LED on / off

process_input1 process_input2 process_input3

36

lcall lcall lcall sjmp

process_input4 pump_set delay repeat

;************************************************************** ;************************************************************** ; END OF PROGRAMME

;************************************************************** ;************************************************************** ;************************************************************** ;************************************************************** ; OUTPUT Function

;************************************************************** pump_set: ;************ pump - 1 *************** clr mov anl jnz lcall clr clr lcall lcall jmp nxt11: clr mov a a,#0ffh a a,#0ffh a,temp1 nxt11 disp_pump1_off relay1 buzzer delay delay nxt22

37

anl jnz clr clr lcall lcall lcall jmp pump1_on: lcall setb setb

a,light1 pump1_on relay1 buzzer disp_pump1_off delay delay nxt22

disp_pump1_on relay1 buzzer

;************ pump - 2 *************** nxt22: clr mov anl jnz lcall clr clr lcall jmp nxt12: clr mov anl jnz clr a a,#0ffh a,light2 pump2_on relay2 a a,#0ffh a,temp2 nxt12 disp_pump2_off relay2 buzzer delay exit

38

clr lcall lcall jmp pump2_on: lcall setb setb ret

buzzer disp_pump2_off delay exit

disp_pump2_on relay2 buzzer

;************************************************************* exit: ret ;************************************************************** ; INPUT - 1 Decoding

;************************************************************** process_input1: jnb mov ret next1: mov ret ;************************************************************** ; INPUT - 2 Decoding light1,#00h ; Disable Light - 1 flag ldr1,next1 light1,#01h ; Enable Light - 1 flag

;************************************************************** process_input2: jnb mov ret temph1,next2 temp1,#01h

39

next2: mov ret ;************************************************************** ; INPUT - 3 Decoding temp1,#00h

;************************************************************** process_input3: jnb mov ret next3: mov ret ;************************************************************** ; INPUT - 4 Decoding light2,#00h ; Disable Light - 2 flag ldr2,next3 light2,#01h ; Enable Light - 2 flag

;************************************************************** process_input4: jnb mov ret next4: mov ret temp2,#00h temph2,next4 temp2,#01h

;************************************************************** ;************* LCD LINE - 1 DISPLAY FUNCTION **************** ;************************************************************** display_line1:

40

mov acall mov acall mov acall mov acall mov acall mov acall mov acall mov acall mov acall mov acall mov acall mov acall mov acall mov acall mov

a,#80h ; command a,#'F' display a,#'I' display a,#'R' display a,#'E' display a,#' ' display a,#'A' display a,#'L' display a,#'R' display a,#'M' display a,#' ' display a,#'&' display a,#' ' display a,#'C' display a,#'T'

address of second line - 1

41

acall mov acall mov acall ret

display a,#'R' display a,#'L' display

;************************************************************** ;******************** PUMP - 1 ON FUNCTION ****************** ;************************************************************** disp_pump1_on: mov acall mov acall mov acall mov acall mov acall mov acall mov acall mov acall mov acall display a,#'U' display a,#'M' display a,#'P' display a,#' ' display a,#0C0h command a,#'*' display a,#'*' display a,#' ' display a,#'P' ; address of second line - 2

42

mov acall mov acall mov acall mov acall mov acall mov acall mov acall mov acall ret

a,#'-' display a,#' ' display a,#'1' display a,#' ' display a,#'O' display a,#'N' display a,#' ' display a,#'*' display

;************************************************************** ;******************* PUMP - 1 OFF FUNCTION ******************* ;************************************************************** disp_pump1_off: mov acall mov acall mov acall mov a,#0C0h command a,#'*' display a,#' ' display a,#'P' ; address of second line - 2

43

acall mov acall mov acall mov acall mov acall mov acall mov acall mov acall mov acall mov acall mov acall mov acall mov acall mov acall ret

display a,#'U' display a,#'M' display a,#'P' display a,#' ' display a,#'-' display a,#' ' display a,#'1' display a,#' ' display a,#'O' display a,#'F' display a,#'F' display a,#' ' display a,#'*' display

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

44

;******************** PUMP - 2 ON FUNCTION ******************* ;************************************************************** disp_pump2_on: mov acall mov acall mov acall mov acall mov acall mov acall mov acall mov acall mov acall mov acall mov acall mov acall mov acall display a,#'U' display a,#'M' display a,#'P' display a,#' ' display a,#'-' display a,#' ' display a,#'2' display a,#' ' display a,#0C0h command a,#'*' display a,#'*' display a,#' ' display a,#'P' ; address of second line - 2

45

mov acall mov acall mov acall mov acall ret

a,#'O' display a,#'N' display a,#' ' display a,#'*' display

;************************************************************** ;******************* PUMP - 2 OFF FUNCTION ****************** ;************************************************************** disp_pump2_off: mov acall mov acall mov acall mov acall mov acall mov acall mov acall mov display a,#'U' display a,#'M' display a,#'P' display a,#' ' a,#0C0h command a,#'*' display a,#' ' display a,#'P' ; address of second line - 2

46

acall mov acall mov acall mov acall mov acall mov acall mov acall mov acall mov acall mov acall ret

display a,#'-' display a,#' ' display a,#'2' display a,#' ' display a,#'O' display a,#'F' display a,#'F' display a,#' ' display a,#'*' display

;************************************************************** ;**************** LCD DISPLAY FUNCTION ********************* ;************************************************************** display_test: lcall mov acall mov display_init a,#' ' display a,#'A'

47

acall mov acall mov acall mov acall mov acall mov acall mov acall mov acall mov acall mov acall mov acall mov acall mov acall mov acall mov acall

display a,#'U' display a,#'T' display a,#'O' display a,#'M' display a,#'A' display a,#'T' display a,#'I' display a,#'C' display a,#' ' display a,#'F' display a,#'I' display a,#'R' display a,#'E' display a,#' ' display

48

mov acall mov acall mov acall mov acall mov acall mov acall mov acall mov acall mov acall mov acall mov acall mov acall mov acall mov acall mov

a,#0c0h command a,#'A' display a,#'L' display a,#'A' display a,#'R' display a,#'M' display a,#' ' display a,#'&' display a,#' ' display a,#'C' display a,#'T' display a,#'R' display a,#'L' display a,#' ' display a,#'S'

address of second line

49

acall mov lcall mov acall ret

display a,#'Y' display a,#'S' display

;************************************************************** ;***************** command sub-routine ************************ ;************************************************************** ; ; ; ; ; p0 is used as data port for LCD p2.2 is used as lcd enable EN p2.0 is used as select either instruction or data RS p2.1 is used as read/write select RW p0.7 is used as busy flag

;************************************************************** command:

acall clr clr mov clr setb clr ret

ready lcd_en lcd_rs p0,a lcd_rw ; lcd_en ; lcd_en ; ; ; ; Disable display Command register chosen move data

LCD write enabled Enable display Disble display

;************************************************************** ;********* display sub-routine sending data to port p0 ***************** ;**************************************************************

50

ready: wait: clr clr setb mov setb jb clr clr ret ;************************************************************** ;******************* lcd clear sub-routine********************* ;************************************************************** display_clr: clr a clr acall mov acall ret lcd_rs ; command a,#01h ; clear memory and home cursor RS lcd_en ;Disble display lcd_rs ;RS lcd_rw ;RW p0,#0ffh lcd_en ;Enable display p0.7,wait lcd_en ;Disble display lcd_rw ;RW

command

;************************************************************ ;******************* lcd initialisation *************************** ;************************************************************ display_init: clr a mov acall a,#3ch ; command 8 bits/char, 2 rows,5*10 dots/char

51

mov acall mov acall mov acall mov acall ret

a,#0ch ; command a,#06h ; command a,#01h ;

screen and cursor on,no blink

shift cursor right

clear memory and home cursor

command a,#80h ; command move cursor to start of first line

;************************************************************** ;******** display sub-routine sending data to port p2 ****************** ;************************************************************** display: acall setb mov setb clr ret ;************************************************************** ;************************************************************** ;********************* delay at 11.059Mhz ********************* ;************************************************************** delay: push push mov relo: dec nhsec acc psw nhsec,#09h ; @12Mhz ready lcd_rs ; p0,a lcd_en ; lcd_en ; ; set Rs ; mov accumulator content to p0 calling ready sub routine

Enable display Disble display

52

mov again5: dec mov again6: dec jnz mov jnz mov jz ljmp clint1: pop pop ret a again6 a,b again5 a,nhsec clint1 relo b a,#0ffh

b,#61h

psw acc

;************************************************************** end ; end of the program

53

Chapter 5 Results and Discussions 5.1 Results:


Assemble the circuit on the PCB as shown in Fig 5.1. After assembling the circuit on the PCB, check it for proper connections before switching on the power supply. FUTURE SCOPE: This system is a rapidly growing field and there are new and improved strategies popping up all the time. For the most part these systems are all built around the same basic structure, a central box that monitors several detectors and perimeter guards and sounds an alarm when any of them are triggered. This system is best for guiding the perimeter of a house or a business center the points where an intruder would enter the building. In this system LDR sensor is used to detect the fire. Similarly the temperature sensors recognize disturbances and accidental fires respectively. This project provides an efficient and economical security system. This system finds applications in industries, banks and homes. Incorporating the features discussed below can further enhance the system This system automatically detects the occurrence of fire and enables the alarm. The system displays for every five seconds about the condition of pump1 and pump2 of respective rooms. If the fire is at room1 then pump1 will be enabled and if the fire is at room2 then pump2 will be enabled using relays. The addition of the above discussed advancements certainly builds this project into a much flexible and reliable system.

54

SCHEMATIC DIAGRAM:

FIG: 22

5.2. WORKING PROCEDURE:


THE AUTOMATIC FIRE CONTROL AND ALARM SYSTEM is an efficient project that automatically controls the occurrence of fire without human intervention continuously and also enables the buzzer to give the information about the occurrence of fire. The microcontroller continuously reads the analog parameters like temperature, light and compares these values with the set points for the corresponding parameters. Whenever the read temperature and light exceeds the set points, the microcontroller switches on the corresponding relay and with the help of power supply the respective pump gets on. Since the microcontroller cannot provide the required current to the load another power supply is used. The microcontroller updates the information on the LCD i.e., whether the respective pump is on or off.

55

ADVANTAGES:
1). It gives the information about occurrence of fire through alarm. 2). It detects and suppresses the fire without any loss of life and property. 3). It controls the fire without human intervention.

DISADVANTAGES:
The fire will not be detected if the sensors get damaged.

APPLICATIONS:
It is mainly used to suppress the fire automatically. This method is being implemented in many industries in foreign countries and also in India.

5.3. CONCLUSION:
Embedded systems are emerging as a technology with high potential. In the past decades microprocessor based embedded system ruled the market. The last decade witnessed the revolution of microcontroller based embedded systems. This project basically deals with the safety measures that must be taken during a fire break and alarms the people of a fire break with the help of microcontroller. With regard to the requirements gathered the safety of the people can be ensured with the help of electronic devices.

REFERENCES:
1. Muhammad Ali Mazidi,, The 8051 Microcontroller and Embedded systems, 2nd
Edition.

2. Micro processors and interfacing Technical publications

56

Anda mungkin juga menyukai