Submitted by


Under the Guidance of

Hemant Kumar Scientist ‘C’

ISO 9001: 2008

Centre for Fire, Explosive and Environment Safety (CFEES), Defence Research and Development Organization (DRDO), Timarpur, Delhi - 110054
July, 2010


This is to certify that the Project entitled ―Design and Development of Micro-controller Based IR Tracking /Heat – seeking Robot with fire alarm” is being submitted by KAUSHAL JHA in partial fulfillment of summer training in CFEES, Timarpur, Delhi. It is the original work carried out by him under my guidance and supervision.

Sh. Hemant Shukla
Date: Place:



I take this opportunity to acknowledge all those who have assisted me in this thesis. First of all I express my earnest gratitude towards Sh. B.J MISHRA sir, CFEES, Timarpur, Delhi for his constant support and guidance during my thesis work. His motivations and suggestions were invaluable in successful completion of this thesis. I am also grateful to the team of FASG who has been given valuable suggestions for completion of this work. It is a pleasure to thank my training head SH. HEMANT SHUKLA & group head Sh. A.K CHAWLA for their encouragement and interest in this work. I would like to thank Sh. Banwari Lal sir, Sh. Ashok sir and Sh. Paras sir for their direct and indirect help for completion of this project work. Finally I am grateful to GOD almighty and my parents for giving me the strength and wisdom to carry out this work successful.

( Kaushal Jha )
Date: Place:


1. About DRDO 2. About CFEES 3. Project Assigned 4. Introduction 5. Methodology of Design 6. Description of Proposed Circuit 7. Micro Controller 8. Crystal Oscillator 9. TIP 122 & 127 10. Software Section a. Flow Chart b. Program 11. Keil C51 Cross Compiler 12. Photograph of Designed Robot 13. Conclusion and Results. 14. Implementations and Future Work 15. References. 16. List of Abbreviation Used. 25 27 29 38 39 40 41 42 5 6 8 9 10 13 15 22 24


materials.  5 . armaments. India. responsible for the development of technology for use by the military. technical and supporting personnel. life sciences.000 other scientific.000 scientists and about 25. like aeronautics.ABOUT: DEFENCE RESEARCH AND DEVELOPMENT ORGANISATION The Defence Research and Development Organisation (DRDO) (Hindi: रक्षा अनुसंधान एवं ववकास संगठन. DRDO has a network of 52 laboratories which are deeply engaged in developing defence technologies covering various fields. The organization includes more than 5. Rakṣā Anusandhān evaṃ Vikās Sangaṭhan) is an agency of the Republic of India. It was formed in 1958 by the merger of Technical Development Establishment and the Directorate of Technical Development and Production with the Defence Science Organisation. electronic and computer sciences. human resource development. headquartered in New Delhi. missiles. combat vehicles development and naval research and development.

The present director of CFEES is J. 6 . which prevents the pollution in mountainous areas where the Indian Army operates.CFEES develops treatment and disposal techniques for hazardous Heavy Metal Wastes. its main function is the development of technologies and products in the area of explosive. Simulation and risk modeling is also carried out. and the Fire Adviser’s Office. in order to aid in Disaster Management.CFEES helps in the Siting of explosive processing and storage dumps and the design. EXPLOSIVE AND ENVIRONMENT SAFETY The Centre for Fire. testing and evaluation of safe explosive storage houses. and enforces safety standards in the use of hazardous materials. CFEES also designs and develops sensors to detect these threats. and enforces compliance of safety rules. Delhi. as well as Photodegradable Polyethylene for use as packaging material at high altitudes. AREAS OF WORK CFEES works in the area of Explosive safety. In addition to developing technologies to protect against these threats. Environment Safety . Fire protection and environmental safety. explosive and flammable. DRDO Computer Centre. fire and environmental safety. CFEES is organized under the Armaments Directorate of DRDO. DRDO HQ. Kapoor.ABOUT : CENTRE FOR FIRE. such as Kargil and Siachen. ―Defence Institute of Fire Research (DIFR)‖ was merged with CEES. In order to emphasize the importance of fire science. The Directorate of Explosives Safety. Explosive Safety . it also trains personnel in these areas. Located in Timarpur.toxic. DRDO HQ. Explosive and Environment Safety (CFEES) is an Indian defense laboratory of the Defence Research and Development Organization (DRDO). it trains armed forces personnel and DRDO scientists in the safe use of explosives and ordinance. the Government renamed CEES as CFEES in 2003.C. Delhi. In 2000 another DRDO lab. The Centre for Explosive and Environment Safety (CEES) was established in 1992 by merging three DRDO establishments. Additionally.

CFEES is involved in the development of automatic fire and explosion detection and suppression systems for armoured vehicles.[4] In this regard. Halons are one of the six categories of chemicals that are covered under the phase-out programme of the Montreal Protocol. halons and other man-made ozone-depleting chemicals. is implemented by CFEES.CFEES also plays an active role in formulating the phase-out strategy for halon and other ozone layer threatening gases. 7 . Fire Safety . the lab is researching into alternative chemicals for fire suppression and other uses. India. supported by Ozone Cell. The Montreal Protocol. and water mist based fire protection Systems for various applications. A smoke test tunnel for creating fire signatures under various conditions has been installed. to which India is a signatory. It also develops lightweight fire protection clothing. has called upon the parties to phase out the CFCs. funded under bilateral programme. The National Halon Management Programme.

PROJECT ASSIGNED 27/07/2010 Design and Development of Micro-controller Based IR TRACKING /HEAT – SEEKING ROBOT WITH FIRE ALARM 8 .

INTRODUCTION Automatic system like robots carry out specific tasks. Depending on the input sequence obtain the micro controller performs the sequential operations and gives output decisions which is a sequence of bits to drive a DC motor. which has DC motor for driving the robot. mainly sensor. The sensing section detects the infrared radiation. The fire extinguisher. The controller section process the information from the sensor and provide input to the driver section. As a heat seeking missile: The heat-seeking missile is a special kind of missile that not only reaches the target emitting heat radiations (Aircraft. and extinguish the fire. will move toward fire. deviating away from any obstacle. These systems are usually employed in environments where conditions keep changing. and DC Motor Driver. Ship or Boat) but also tracks it. Heat seeking missile and automatic fire extinguisher. The robots described here sense the near infrared radiation (. This robot is designed keeping in mind mainly for two applications viz. 9 . As the target moves. There are four sections. Micro-controller. it follows the target and finally hits it. the output of the sensors is fed to the comparator. comparator. which serves as the input to the micro controller. The missile is based on the concept of detecting and following the heat-radiating source. As a Fire Extinguisher: The robot can be used as a highly sophisticated fire extinguisher. performs the task of a heat – seeking missile as it tracks heat radiating object. The robot designed for two-dimensional motions.8µm-1µm) and moves toward that direction. when it detects fire.

Methodology of Design Block Diagram Audio & visual indication IR Sensor Left IR Sensor Centre IR Sensor C O M P C O M P C O M P Micro Controller AT 89S52 T R A N S I S T O R D R I V E R R E L A Y C K T D C M O T O R D C M O T O R Right Wire less Communication Module (Optional) 10 .

11 . The driver circuit energies the relay and finally DC Motor gets power from relay.In this method sensing of IR signal is been carried out by three IR sensor. A comparator make this pulse to positive going and feed to micro controller 89S52. The sensing circuit of ROBOT is as below. When sensor start tracking the IR radiation a audio indication from alarm circuit will also come. The Wireless message can also be send through RF by putting TX and Rx module. The micro controller as per its software gives output to the respective transistorized driver circuit. It gives a negative going signal when an IR radiation coming if front of the sensor.

The complete Circuit diagram of this method is as follows 12 .

These IR sensors after getting IR radiations from there respective sides gives a negative going pulse to the comparator.3)respectively. The output from left is connected to the PIN NO 21(P 2.P 2.22 (P2.1.For motor two it is from PIN3 &4(P1.P1.C motor driver circuit is introduced as as follows: 13 .0. The output of microcontroller is fed to the Darlington pair transistor TIP127.0) of Microcontroller. output from centre and right are connected to pin no 24.1). A relay based D.DESCRIPTION OF PROPOSED CIRCUIT There are three IR sensors located outside the body of the robot namely left side. For motor one output is taken from pin 1 pin 2(P1.2&P1.3). right side and at the center. For three sensors there are three respective comparators.

0 gets high transistor conduct and a ground goes to the coil of relay makes it energized.1 0 0 1 1 0 1 0 1 RLY O/P1 0V 0V 12V 12V RLY O/P2 0V 12V 0V 12V DC MOTOR 1 STOP RUN CW RUN CCW STOP P 1. port 1.e. we are already given a +12V supply at the normally open point of relay and Ground at normally close point of relay. A reverse diode is used across the coil of relay to avoid back emf of relay.3 0 1 0 1 RLY O/P3 0V 0V 12V 12V RLY O/P4 0V 12V 0V 12V DC MOTOR 2 STOP RUN CW RUN CCW STOP A table for direction of Robot is as follows. When input of TIP127 i. P1.From the above truth table it is clear that both the motor can run either in clock wise or in counter clock wise direction as per requirement. There are two similar relay for one DC motor to rotate in both direction. So a two dimensional motion can be achieved from robot by using two DC motor. Motor Left Clock wise Clock wise Stop Counter clock wise Motor Right Clock wise Stop Clock wise Counter clock wise Direction of Robot Forward motion Turn right Turn left Reverse motion 14 . It results a +12v supply at common point of relay.2 0 0 1 1 P 1.

AT89S52 Micro-Controller Features                  Compatible with MCS-51® Products 8K Bytes of In-System Programmable (ISP) Flash Memory o Endurance: 1000 Write/Erase Cycles 4.0V to 5.5V Operating Range Fully Static Operation: 0 Hz to 33 MHz 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) 15 .

By combining a versatile 8-bit CPU with in-system programmable Flash on a monolithic chip. Watchdog timer. and clock circuitry. high-performance CMOS 8-bit microcontroller with 8K bytes of in-system programmable Flash memory. 16 . The device is manufactured using Atmel’s high-density nonvolatile memory technology and is compatible with the industry-standard 80C51 instruction set and pin out. The Power-down mode saves the RAM contents but freezes the oscillator. timer/counters. The AT89S52 provides the following standard features: 8K bytes of Flash. 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 CPU while allowing the RAM. The on-chip Flash allows the program memory to be reprogrammed in-system or by a conventional nonvolatile memory programmer. a full duplex serial port. disabling all other chip functions until the next interrupt or hardware reset. the Atmel AT89S52 is a powerful microcontroller which provides a highly-flexible and cost-effective solution to many embedded control applications. serial port.Description The AT89S52 is a low-power. two data pointers. In addition. a six-vector two-level interrupt architecture. 32 I/O lines. on-chip oscillator. and interrupt system to continue functioning. 256 bytes of RAM. three 16-bit timer/counters.

Pin Configuration Pin 1 to pin 8 Pin 9 Pin 10 to pin 17 Pin 18 &19 Pin 20 Pin 21 to pin 28 PIN 29.7 Reset Port 3.0 to Port1.7 XTAL2 AND XTAL1 GROUND Port 2.0 to Port 3.7 PSEN.0 to Port 2. ALE/PROG & EA /VPP Port O.0 VCC 17 .7 to Port 0. 30 & 31 Pin 32 to pin 39 PIN 40 Port1.

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

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

5 P3.6 P3.1 P3. The Port 3 output buffers can sink/source four TTL inputs.3 P3.0 P3.Port 3 Port 3 is an 8-bit bidirectional I/O port with internal pull-ups.2 P3. the RESET HIGH out feature is enabled. Port 3 receives some control signals for Flash programming and verification.7 RST Alternate Functions RXD (serial input port) TXD (serial output port) INT0 (external interrupt 0) INT1 (external interrupt 1) T0 (timer 0 external input) T1 (timer 1 external input) WR (external data memory write strobe) RD (external data memory read strobe) Reset input. When 1s are written to Port 3 pins. they are pulled high by the internal pull-ups and can be used as inputs. A high on this pin for two machine cycles while the oscillator is running resets the device.nally being pulled low will source current (IIL) because of the pull-ups. Port 3 also serves the functions of various special features of the AT89S52. In the default state of bit DISRTO. This pin drives high for 98 oscillator periods after the Watchdog times out.4 P3. 20 . Port Pin P3. The DISRTO bit in SFR AUXR (address 8EH) can be used to disable this feature. As inputs. as shown in the following table. Port 3 pins that are exter.

however. ALE operation can be disabled by setting bit 0 of SFR location 8EH. In normal operation. Otherwise. This pin also receives the 12-volt programming enable voltage (V PP ) during Flash programming. PSEN is activated twice each machine cycle. 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. the pin is weakly pulled high. Note. 21 . XTAL2 Output from the inverting oscillator amplifier. If desired. This pin is also the program pulse input (PROG) during Flash programming. EA/VPP External Access Enable. however. XTAL1 Input to the inverting oscillator amplifier and input to the internal clock operating circuit. ALE is active only during a MOVX or MOVC instruction. When the AT89S52 is executing code from external program memory. With the bit set. except that two PSEN activations are skipped during each access to external data memory. ALE is emitted at a constant rate of 1/6 the oscillator frequency and may be used for external timing or clocking purposes. that one ALE pulse is skipped during each access to external data memory. Setting the ALE-disable bit has no effect if the microcontroller is in external execution mode. PSEN Program Store Enable (PSEN) is the read strobe to external program memory.ALE/PROG Address Latch Enable (ALE) is an output pulse for latching the low byte of the address during accesses to external memory. EA should be strapped to VCC for internal program executions. that if lock bit 1 is programmed. Note. EA will be internally latched on reset.

A crystal can oscillate in series resonance. Cs 22 . HC-50 7 –10 30  30PPM 17 1 30 20 2* 50 10 70 Not Important Depends on Holder Type Application Dependent Application Dependent Affects Frequency Tolerance Calc. and the resonance frequency is then simply 0. meaning that Ls is resonating with Cs.31818 Fundamental HC-49. The same crystal can be made to oscillate in series resonance mode or parallel resonance mode.5 25 Min Typical 14. The oscillator has been designed to function reliably with crystals that conform to the following specifications Table 1 • Crystal Specifications Crystal Specifications Nominal Frequency (MHz) Oscillation Mode Holder Type Pin to Pin Capacitance (Co in pF) Operating Temperature (C) Frequency Tolerance Load Capacitance (Ceq in 12.Crystal Oscillator Crystal Specifications The reference frequencies for Chrontel's products are derived from an on-chip Pierce oscillator with an external crystal. The frequency of oscillation of a crystal is usually specified by the manufacturer as either the series resonance frequency or the parallel resonance frequency.5 pF) Drive Level (P in W) Motion Resistance (Rs in ) Series and Parallel Resonance There is no such thing as a ―series cut‖ crystal as opposed to a ―parallel cut‖ crystal. Value by (4) Affects Drive Level Max Comment f series = 1/2  Ls.

where ceq = C0+C1(C2/(C1+C2)) At parallel resonance. most crystals oscillators in today's ICs are of the parallel resonance type.318 MHz crystal that has been specified for operation in either series or parallel resonance modes 23 . Since fparallel is a function of the load capacitance Ceq. the crystal behaves inductively and resonates with capacitance shunting the crystal terminals. For PC CPU clock and VGA clock applications. it should also be specified along with fparallel. however. In fact. The actual oscillation frequency of a parallel mode oscillator is dependent on the equivalent capacitance seen by the crystal. are more sensitive to temperature and component variations. These series mode oscillators. The oscillation frequency of a parallel mode oscillator is always higher than fseries. the frequency accuracy required is usually not very stringent and can easily be satisfied with a 14. Depending on the application. a crystal manufacturer may specify parallel resonance frequency instead of series resonance frequency.Some oscillator circuits are designed for series resonance and the oscillation frequency shall equal the specified series resonance value. especially in microprocessors where Pierce oscillators are used predominantly.

.0 Adc = 4.0 Vdc (Max) @ IC = 5. designed for general–purpose amplifier and low–speed switching applications. TIP127 Low Collector–Emitter Saturation Voltage — VCE(sat) = 2.0 Vdc (Max) @ IC = 3.0 Adc Monolithic Construction with Built–In Base–Emitter Shunt Resistors TO–220AB Compact Package     24 .TRANSISTOR TIP 122 & TIP 127 Plastic Medium-Power Complementary Silicon Transistors DARLINGTON 5 AMPERE COMPLEMENTARY SILICON POWER TRANSISTORS 60–80–100 VOLTS 65 WATTS .   High DC Current Gain — hFE = 2500 (Typ) @ IC = 4. TIP126 = 100 Vdc (Min) — TIP122. TIP125 = 80 Vdc (Min) — TIP121.0 Adc Collector–Emitter Sustaining Voltage — @ 100 mAdc VCEO(sus) = 60 Vdc (Min) — TIP120. .



//left motor //alarm is connected //right motor //sensor connection //definition of the main function void delay() { unsigned int i=30000.h> sbit right = P2^1. sbit mr1=P1^2. sbit left=P2^0. sbit ml1=P1^0. } //definition of main function void main() { right=1.ml2=1. sbit ml2=P1^1. //stop all the motors //OFF the alarm 27 .centre=1. sbit alarm=P3^0.mr2=1. sbit centre=P2^3. sbit mr2=P1^3.PROGRAM #include <reg51. //configure as input pin ml1=1. alarm=0. while(i--).left=1. while(1) { if(left) { alarm=1.mr1=1.

} else mr2=1. //stop the left motor if(centre) { alarm=1. delay(). //forward mr2=0. //stop both the motors } if(!(left||right||centre)) { alarm=0. } else ml2=1. //forward the right motor delay(). //forward delay(). //forward left motor delay(). ml2=0. } else { ml2=1. ml2=0. //stop the right motor if(right) { alarm=1. } } } 28 .mr2=0. mr2=1.

 C51 Compiler  A51 Macro Assembler  BL51 Linker/Locater Software Development Cycle in Keil 1. Test the linked application Create a Project File   To create a new project file select from the µ Vision menu Project – New Project…. and configure the tool settings. Create source files in C. 3. Create a project. We suggest that you use a separate folder for each project 29 . Correct errors in source files.  More than 500 device variants available. select the target chip from the device database. 2. Build your application with the project manager. 5. Keil provides several development tools for these 8051 variants. This opens a standard Windows dialog that asks you for the new project file name.Keil C51 CROSS COMPILER :   The 8051 Family is one of the fastest growing Microcontroller Architectures. 4.

Select a Device When you create a new project µ Vision asks you to select a CPU for your project. The Select Device dialog box shows the µVision device database. Just select the microcontroller you use 30 .

This opens an empty editor window where you can enter your source code. µVision enables the C color syntax highlighting when you save your file with the dialog File – Save As… under a filename with the extension *. 31 .Create New Source Files You may create a new source file with the menu option File – New.C.

Add Source File to the Project   Once you have created your source file you can add this file to your project. you can select the file group in the Project Workspace – Files page and click with the right mouse key to open a local menu.C you have just created 32 . Select the file MAIN. For example. The option Add Files opens the standard files dialog.

Set Tool Options for Target µVision lets you set options for your target hardware. In the Target tab you specify all relevant parameters of your target hardware and the on-chip components of the device you have selected 33 . The dialog Options for Target opens via the toolbar icon or via the Project .Options for Target menu item.

µVision will display errors and warning messages in the Output Window – Build page. • A double click on a message line opens the source file on the correct location in a µVision editor window 34 .Build Project and Create a HEX File • You may translate all source files and line the application with a click on the Build Target toolbar icon. When you build an application with syntax errors.

After you have tested your application. µVision creates HEX files with each build process when Create HEX file under Options for Target – Output is enabled • • 35 . it might be required to create an Intel HEX file and to download the application software into the physical device using a Flash programming utility.Build Project and Create a HEX File • Once you have successfully generated your application you can start debugging using the µVision Debugger.

–each has a different file extension. .OBJ Files with this extension are object modules that contain relocatable object code. to be burnt onto the target device. By default. 36 . Object modules may be linked to an absolute object module by the Lx51 Linker/Locator.I Files with this extension contain the source text as expanded by the preprocessor. Listing files may optionally contain the symbols used and the assembly code generated. All macros are expanded and all comments are deleted in this listing.LST Files with this extension are listing files that contain the formatted source text along with any errors detected by the compiler. .Hex Image of the machine code generated. . each output file shares the same filename as the source file.SRC Files with this extension are assembly source files generated from your C source code. .Output Files • • The Cx51 Compiler generates a number of output files during compilation. These files can be assembled with the A51 Assembler. .

Language Extensions  The Cx51 Compiler provides several extensions to ANSI Standard C to support the following elements of the 8051 architecture. o o o o o o o o Memory Areas Memory Types Memory Models Data Types Bit Variables and Bit-Addressable Data Special Function Registers Pointers Function Attributes 37 .

Photograph of Designed Robot 38 .

Robot is also capable of energizing fire alarm on getting IR radiation. right and center direction when it gets a fire signal or IR radiation from their respective side. It can also interface with RF Transmitter and Receiver module and are able to directly interface with computer for software up gradation and data logging purpose.Conclusion and Result The Robot has been tested and evaluated successfully. The designed robot is capable to move in left . 39 . This robot has proved the tracking of fire and IR radiation. Some better features can be added to tackle more complex situation.

Future Plan This robot can be modified for its better performance and more technological advancement. Three Different Audio Visual Alarm Opto coupler Micro controller And DC Motor Driver Pyro detector Amplifier A D C DC MOTOR LEFT Photo Diode ADC DC MOTOR RIGHT RF and GSM Interfacing Circuit 40 . A block diagram on the future plan in shown below.

Data Sheet of ATMEL AT89S52 Data Sheet of IC UM 3561 Data Sheet of TIP 122 & 127 41 .By MA Mazidi. The 8051 microcontroller and embedded system . 3. JC Mazidi and RD Mckinlay. 2.References and DataSheet 1. 4.

LIST OF ABBRIVIATION USED CW CCW IC IR Comp Clock wise Counter clock wise Integrated circuit infrared Comparator 42 .

Sign up to vote on this title
UsefulNot useful