Fire Fighting Robot

Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 63

Fire Fighting Robot

Chapter- 1

INTRODUCTION

Department of ECE Page 1 CMRCET


Fire Fighting Robot

Chapter- 1

INTRODUCTION

1.1 Introduction
The project is designed to develop a fire fighting robot using RF technology for remote
operation. The robotic vehicle is loaded with water tanker and a pump which is controlled over
wireless communication to throw water. An 8051 series of microcontroller is used for a desired
operation. At transmitting end using push buttons, commands are sent to the receiver to control
the movement of the robot either to move forward, backward, left, right etc. The RF transmitter
acts as a RF remote control that has the advantage of adequate range (up to 200 meters) with
proper antenna, while the receiver decodes before feeding it to another microcontroller to drive
DC motors via motor driver IC for necessary work. A water tank along with water pump is
mounted on robot body and its operation is carried out from the microcontroller output through
appropriate signal from the transmitting end a motor driver IC is interfaced to the
microcontroller through which the controller drives the motor.

1.2 Objective of the project

The objective of this project is to design and develop low cost fire fighting robot which detects
and extinguishes fire. Construction of RF based intelligent fire extinguisher vehicle system.
The flow of water through wireless RF technology. The movement of robot in all directions
automatically or through remote operation using RF technology. If the fire is detected robot
stops and pumps water if fire is not detected then robot move in all directions to detect fire the
pump motor pumps water to extinguish fire which is controlled by microcontroller.

1.3 Technical Approach

Department of ECE Page 2 CMRCET


Fire Fighting Robot

In the proposed system, 8051 series microcontroller, fire sensor, RF(Tx-Rx), battery, motor
pump(DC motors) are used. The controlling of these devices are done by using At89S52
microcontroller.

In this fire fighting robot vehicle system, wireless radio frequency module operation and
interfacing of RF and transceiver module to microcontroller are used efficiently and effectively
the basic hardware components used in the Project are
1. AT89S52 microcontroller
2. RF TX_RX
3. Fire sensor
4. DC motors
5. Motor driver L293D
6. Battery
7. Robot body with water tank
The system software’s are
1. Embedded ‘C’
2. Keil µ Vision
3. Prog ’ISP’
1.4 Organization of the thesis
In this, Implementation of project is discussed in chapter-2.Chapter-2 consists of Block
diagram, system hardware, principle of operation and case studies are discussed. Description of
hardware components and its functionalities are discussed in chapter-3.Results are discussed in
chapter-4, and conclusion & future scope is discussed in Chapter-5.

Department of ECE Page 3 CMRCET


Fire Fighting Robot

Chapter- 2
IMPLEMENTATION

Chapter- 2

2.1 Introduction

Department of ECE Page 4 CMRCET


Fire Fighting Robot

‘Human life and time are priceless’, humans cannot work in all conditions which are hazardous
to their life where temperature is very high ,so to prevent loss of life and destruction of property
and environment we use fire fighting robot to detect and extinguish fire. These fire fighting
robots stop when fire is detected and pump motor pumps water if fire is fire is not detected then
the robot moves in all directions where fire sensor senses the fire.
2.2 Block Diagram
The block diagram of fire fighting robot vehicle system is designed using AT89S52
microcontroller, battery, fire sensor, motor pump(DC motors), RF Tx-Rx, robot body with
water tank , L293D-driver as shown in fig 2.1 and fig 2.2

Fig 2.1: block diagram of transmitter

Department of ECE Page 5 CMRCET


Fire Fighting Robot

Fig 2.2: block diagram of receiver

From the fig 2.1, at transmitting end using push buttons, commands are sent to the receiver to
control the movement of the robot either to move forward, backward, left, right etc. From fig
2.2 at the receiving end three motors are interfaced to the microcontroller where two of them
are used for the movement of the vehicle and the remaining one to position the arm of the
robot. The RF transmitter acts as a RF remote control that has the advantage of adequate range
(up to 200 meters) with proper antenna, while the receiver decodes before feeding it to another
microcontroller to drive DC motors via motor driver IC for necessary work. A water tank along
with water pump is mounted on robot body and its operation is carried out from the
microcontroller output through appropriate signal from the transmitting end a motor driver IC
is interfaced to the microcontroller through which the controller drives the motor.

Department of ECE Page 6 CMRCET


Fire Fighting Robot

2.3. System hardware :


Fig 2.3shows the systems hardware, designed for implementing of AT89S52 microcontroller
based fire detecting system. The operating voltage of AT89S52 microcontroller is 5V. L293D
driver is interfaced to the AT89S52 microcontroller at port 1 to supply enough operating
voltage to load. The output current of microcontroller is very less in the range of µAmps and is
not enough to run the load. Hence L293D driver circuit is used to increase the current gain. The
load here is a DC motor pump.

Fig 2.3. System Hardware

Department of ECE Page 7 CMRCET


Fire Fighting Robot

2.4. Schematic Diagram of RF TX and RF RX:

Department of ECE Page 8 CMRCET


Fire Fighting Robot

2.5. Flow Chart:

Department of ECE Page 9 CMRCET


Fire Fighting Robot

Case studies:

Case 1:If the fire sensor detects fire then the running vehicle stops and starts pumping water
as pump motor will be in the ON state and extinguishes fire.

Case 2:If the fire is not detected then the vehicle does not stop and move according to the
given command from RF transmitter to the RF receiver. If the command is given as 0001 then
the vehicle moves towards RIGHT side where switch d3 will be one. In this case right wheel
will be in OFF state as two conditions are same motor stops and only left wheel will be in ON
state. So the vehicle moves in right direction until fire is detected if fire is detected then in other
condition the vehicle stops.

Case 3:if fire is not detected when moving in right direction the vehicle does not stop and
move in other direction according to the given command from RF transmitter to RF receiver. If
the given command is 0010 then the vehicle moves in BACKWARD direction where the
switch d2 will be one. In this case both the wheels move in backward direction as no two
conditions are same the motor does not stop and move in anticlock wise direction. If fire is
detected then the vehicle stops in other condition.

Case 4: if fire is not detected when moving in previous two directions the vehicle does not
stop and move according to the given commands from RF transmitter to RF receiver .if the
command given is0100 then the vehicle moves in FORWARD direction where the switch d1
will be one. In this case both the wheels move in forward direction as no two conditions are
same the motor does not stop and move in clock wise direction. if the fire is detected in other
condition the vehicle stops.

Case 5:if the fire is not detected when moved in previous conditions then the vehicle does not
stop and move according to the given commands from RF transmitter to RF receiver .if the
command given is 1000 then the vehicle move towards LEFT side where switch d0 will be one.
In this case left wheel will be in OFF state as two conditions are same the motor stops and
only right wheel will be in ON state and rotate. Vehicle moves in left direction until fire will be
detected and if fire is detected then in other condition the vehicle stops.

Department of ECE Page 10 CMRCET


Fire Fighting Robot

Chapter-3
RESULTS

Department of ECE Page 11 CMRCET


Fire Fighting Robot

Chapter- 3
3.1. RESULTS
If the fire sensor detects fire then the running vehicle stops and starts pumping water as pump
motor will be in the ON state and extinguishes fire as shown in fig 3.1(a)

Fig 3.1(a): sensor detects fire and pumps water

. If the fire is not detected then the vehicle does not stop and move according to the given
command from RF transmitter to the RF receiver. If the command is given as 0001 then the
vehicle moves towards RIGHT side where switch d3 will be one as shown in fig 3.1(b)

Fig 3.1(b): vehicle moves in right direction

Department of ECE Page 12 CMRCET


Fire Fighting Robot

if fire is not detected when moving in right direction the vehicle does not stop and move in
other direction according to the given command from RF transmitter to RF receiver. If the
given command is 0010 then the vehicle moves in BACKWARD direction as shown in
fig3.1(c)

Fig 3.1(c): vehicle moves in backward direction


if fire is not detected when moving in previous two directions the vehicle does not stop and
move according to the given commands from RF transmitter to RF receiver .if the command
given is0100 then the vehicle moves in FORWARD direction as shown in fig 3.1(d)

Fig 3.1(d): vehicle moves in forward direction

Department of ECE Page 13 CMRCET


Fire Fighting Robot

if the fire is not detected when moved in previous conditions then the vehicle does not stop and
move according to the given commands from RF transmitter to RF receiver .if the command
given is 1000 then the vehicle move towards LEFT side as sown in fig 3.1(e)

Fig 3.1(e): vehicle moves left direction

Department of ECE Page 14 CMRCET


Fire Fighting Robot

Chapter- 4
CONCLUSION & FUTURE SCOPE

Department of ECE Page 15 CMRCET


Fire Fighting Robot

Chapter- 4

4.1. CONCLUSION
This project represents fire fighting robot using RF communication and it is designed and
implemented with atmel89s52 or 8051 microcontroller in embedded system domain
experimental work has been carried out carefully. the result shows that higher efficiency is
indeed achieved using the embedded system. the purposed method is verified to be highly
beneficial for security purpose and industry purpose
at present the robot is capable of throwing water with high flow rate only.in future the robot
will be capable of throwing water with controlled robotic arm and the object detection using
cameras on it.it can be used as further extension of the project to achieve all features

4.2. FUTURE SCOPE

 The project has been motivated by the desire to design a system that can detect fires and
takes appropriate action, without any human intervention

 It can be enhanced by interfacing it with a wireless camera so that the person


controlling it can view the operation of robot remotely on screen

Department of ECE Page 16 CMRCET


Fire Fighting Robot

REFERENCES

 ‘www.atmel.com’

 Zadeh lotfi,”fuzzy sets,”information control,vol. 8, 1965.pp.338-353

 ‘www.alldatasheets.com’

http://www.alldatasheet.com/view.jsp?searchword=8051A

 paul,richard P,”robot manipulator, mathematics programming, and control,”MIT


press,1981

 Shahinpoor, mohasen,”robot engineering textbook,”, harper androw, 1987.

 Korean,yoram,”robotics for engineers,” MC Graw Hill 1985

 ‘Ieeexplore.ieee.org’

Department of ECE Page 17 CMRCET


Fire Fighting Robot

APPENDIX

Department of ECE Page 18 CMRCET


Fire Fighting Robot

APPENDIX
A. Hardware description

A.1. Microcontroller:

Fig: 3.2: Microcontrollers

A.1.a Introduction to Microcontrollers:

AT Circumstances that we find ourselves in today in the field of microcontrollers had


their beginnings in the development of technology of integrated circuits. This development has
made it possible to store hundreds of thousands of transistors into one chip. That was a
prerequisite for production of microprocessors, and the first computers were made by adding
external peripherals such as memory, input-output lines, timers and other. Further increasing of
the volume of the package resulted in creation of integrated circuits. These integrated circuits
contained both processor and peripherals. That is how the first chip containing a
microcomputer, or what would later be known as a microcontroller came about.

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.

Department of ECE Page 19 CMRCET


Fire Fighting Robot

A.1.b.Description of AT 89S52 microcontroller:

The AT89S52 is a low-power, high-performance CMOS 8-bit microcontroller with 8K


bytes of in-system programmable Flash memory. The device is manufactured using Atmel’s
high-density non-volatile memory technology and is compatible with the industry-standard
80C51 instruction set and pin out. 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 in-system programmable Flash on a monolithic chip, the
Atmel AT89S52 is a powerful microcontroller which provides a highly-flexible and cost-
effective solution to many embedded control applications.

The AT89S52 provides the following standard features: 8K bytes of Flash, 256 bytes of
RAM, 32 I/O lines, Watchdog timer, two data pointers, three 16-bit timer/counters, a six-vector
two-level interrupt architecture, a full duplex serial port, on-chip oscillator, and clock circuitry.
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 CPU 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 interrupt or hardware reset.

A.1.c.Features of AT 89S52 architecture:

 8K Bytes of In-System Programmable (ISP) Flash Memory

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

Department of ECE Page 20 CMRCET


Fire Fighting Robot

 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

Now we may be wondering about the non-mentioning of memory space meant for
the program storage, the most important part of any embedded controller. Originally
this AT89S52 architecture was introduced with on-chip, ‘one time programmable’
version of Program Memory of size 4K X 8. Intel delivered all these microcontrollers
(AT 89S52) with user’s program fused inside the device. The memory portion was
mapped at the lower end of the Program Memory area. But, after getting devices,
customers couldn’t change anything in their program code, which was already made
available inside during device fabrication.

A.1.d. Pin Configuration:

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

Gnd: Pin 20 is the ground.

Ports 0, 1, 2 and 3:

As shown in fig 3.3, the four ports P0, P1, P2, and P3 each with 8 pins, make the 8-bit
ports. All the ports upon Reset are configured as input, since P0-P3 have FFH on them.

Department of ECE Page 21 CMRCET


Fire Fighting Robot

Figure 3.3: Pin diagram of AT 89S52 microcontroller

Port 0:

Port 0 occupies a total of 8 pins (pins 32-33). It can be used for input or output. Port0
is also designated as AD0-AD7, allowing it to be used for both address and data. When
connecting an AT 89S52 to an external memory, port 0 provides both address and data. The
AT 89S52 multiplexes address and data through port 0 to save pins. ALE=0, it provides data
D0-D7, but when ALE=1, it has address A0-A7. Therefore, ALE is used for demultiplexing
address and data with the help of a 74LS373 latch. In the AT 89S52-based systems where
there is no external memory connection, the pins of P0 must be connected externally to a 10k –

Department of ECE Page 22 CMRCET


Fire Fighting Robot

ohm pull-up resistor. With external pull-up resistors connected to P0, it can be used as a simple
I/O port, just like P1 and P2. In contrast to Port 0, ports p1, p2, and p3 do not need any pull-up
resistors since they already have pull-up resistors internally. Upon reset, ports p1, p2, and p3
are configured as input ports.

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 pullups 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 pullups. 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 3.1: Port1 pins of microcontroller

Department of ECE Page 23 CMRCET


Fire Fighting Robot

Port 2:

Port 2 occupies a total 8 pins (pins 21-28). It can be used as input or output. However, in 8031-
based systems, port2 is also designated as A8-A15, indicating its dual function. Since an AT
89S52/31 is capable of accessing 64K bytes of external memory, it needs a path for the 16 bits
of the address. While P0 provides the lower 8 bits via A0-A7, it is the job of p2 is used for the
upper 8 bits of the 16-bit address, and it cannot be used for I/O. Just like P1, port 2 does not
need any pull-up resistors since it already has pull-up resistors internally. Upon reset, port2 is
configured as an input port.

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.
Port 2 also receives the high-order address bits and some control signals during Flash
programming and verification.

Port 3:

Port 3 occupies a total of 8 pins (pins 10-17). It can be used as input or output. P3 does
not need any pull-up resistors, just as P1 and P2 did not. Although Port 3 is configured as an
input port upon reset, this is not the way it is most commonly used. Port 3 has the additional
function of providing some extremely important signals such as interrupts. The below table
provides these alternate functions of P3. This is information applies to both AT 89S52 and
8031 chips.

Department of ECE Page 24 CMRCET


Fire Fighting Robot

Table 3.2: Port3 pins of microcontroller

Alternate Functions of Port 3:

Port 3 also receives some control signals for Flash programming and verification.

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

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 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. If desired, ALE operation
can be disabled by setting bit 0 of SFR location 8EH. With the bit set, ALE is active only

Department of ECE Page 25 CMRCET


Fire Fighting Robot

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 is the read strobe to external Program Memory. When the device
is executing out of external Program Memory, this port is activated twice each machine cycle
(except that two PSEN activations are skipped during accesses to external Data Memory).
PSEN is not activated when the device is executing out of internal Program Memory.

When EA is held high the CPU executes out of internal Program Memory (unless the
Program Counter exceeds 0FFFH in the AT 89S52). Holding EA low forces the CPU to
execute out of external memory regardless of the Program Counter value. In the 80C31, EA
must be externally wired low. In the EPROM devices, this pin also receives the programming
supply voltage (VPP) during EPROM programming.

XTAL1:

Input to the inverting oscillator amplifier and input to the internal clock operating circuit.

XTAL2:

Output from the inverting oscillator amplifier.The AT 89S52’s I/O port structure is
extremely versatile and flexible. The device has 32 I/O pins configured as four eight bit
parallel ports (P0, P1, P2 and P3). Each pin can be used as an input or as an output
under the software control. external memory cycle, low order 8 bits of the address
bus are output on P0. The same pins transfer data byte at the later stage of the
instruction execution.

Also, any instruction that accesses external Program Memory will output the
higher order byte on P2 during read cycle. Remaining ports, P1 and P3 are available
for standard I/O functions. But all the 8 lines of P3 support special functions: Two

Department of ECE Page 26 CMRCET


Fire Fighting Robot

external interrupt lines, two counter inputs, serial port’s two data lines and two timing
control strobe lines are designed to use P3 port lines. When you don’t use these
special functions, you can use corresponding port lines as a standard I/O. Even within
a single port, I/O operations may be combined in many ways. Different pins can be
configured as input or outputs independent of each other or the same pin can be used as
an input or as output at different times. You can comfortably combine I/O operations
and special operations for Port 3 lines.

A.1.e. Central processing unit:

The CPU is the brain of the microcontrollers reading user’s programs and
executing the expected task as per instructions stored there in. Its primary elements are
an 8 bit Arithmetic Logic Unit (ALU ) , Accumulator (Acc ) , few more 8 bit
registers , B register, Stack Pointer (SP ) , Program Status Word (PSW) and 16 bit
registers, Program Counter (PC) and Data Pointer Register (DPTR).

The ALU (Acc) performs arithmetic and logic functions on 8 bit input variables.
Arithmetic operations include basic addition, subtraction, and multiplication and division.
Logical operations are AND, OR, Exclusive OR as well as rotate, clear, complement and
etc. Apart from all the above, ALU is responsible in conditional branching decisions,
and provides a temporary place in data transfer operations within the device.

B-register is mainly used in multiply and divides operations. During execution,


B register either keeps one of the two inputs or then retains a portion of the result. For
other instructions, it can be used as another general purpose register.

Program Status Word (PSW) keeps the current status of the ALU in different
bits. Stack Pointer (SP) is an 8 bit register. This pointer keeps track of memory space
where the important register information is stored when the program flow gets into
executing a subroutine. The stack portion may be placed in any where in the on-chip
RAM. But normally SP is initialized to 07H after a device reset and grows up from
the location 08H. The Stack Pointer is automatically incremented or decremented for

Department of ECE Page 27 CMRCET


Fire Fighting Robot

all PUSH or POP instructions and for all subroutine calls and returns.

Program Counter (PC) is the 16 bit register giving address of next instruction
to be executed during program execution and it always points to the Program Memory
space. Data Pointer (DPTR) is another 16 bit addressing register that can be used to
fetch any 8 bit data from the data memory space. When it is not being used for this
purpose, it can be used as two eight bit registers.

A.1.f. Timers/counters:

Watchdog Timer(One-time Enabled with Reset-out):

The WDT is intended as a recovery method in situations where the CPU may be
subjected to software upsets. The WDT consists of a 13-bit counter and the Watchdog Timer
Reset (WDTRST) SFR. The WDT is defaulted to disable from exiting reset. To enable the
WDT, a user must write 01EH and 0E1H in sequence to the WDTRST register (SFR location
0A6H). When the WDT is enabled, it will increment every machine cycle while the oscillator is
running. The WDT timeout period is dependent on the external clock frequency. There is no
way to disable the WDT except through reset (either hardware reset or WDT overflow reset).
When WDT overflows, it will drive an output RESET HIGH pulse at the RST pin.

Using the WDT:

To enable the WDT, a user must write 01EH and 0E1H in sequence to the WDTRST
register (SFR location 0A6H). When the WDT is enabled, the user needs to service it by
writing 01EH and 0E1H to WDTRST to avoid a WDT overflow. The 13-bit counter overflows
when it reaches 8191 (1FFFH), and this will reset the device. When the WDT is enabled, it will
increment every machine cycle while the oscillator is running. This means the user must reset
the WDT at least every 8191 machine cycles. To reset the WDT the user must write 01EH and
0E1H to WDTRST. WDTRST is a write-only register. The WDT counter cannot be read or
written. When WDT overflows, it will generate an output RESET pulse at the RST pin. The
RESET pulse duration is 96xTOSC, where TOSC=1/FOSC. To make the best use of the WDT,

Department of ECE Page 28 CMRCET


Fire Fighting Robot

it should be serviced in those sections of code that will periodically be executed within the time
required to prevent a WDT reset.

Timer 0 and 1:
Timer 0 and Timer 1 in the AT89S52 operate the same way as Timer 0 and Timer 1 in
the AT89C51 and AT89C52.

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.

A.1.g.Serial ports:

Each AT 89S52 microcomputer contains a high speed full duplex (means you
can simultaneously use the same port for both transmitting and receiving purposes)
serial port which is software configurable in 4 basic modes: 8 bit UART; 9 bit UART;
inter processor Communications link or as shift register I/O expander.

For the standard serial communication facility, AT 89S52 can be programmed for
UART operations and can be connected with regular personal computers, teletype
writers, modem at data rates between 122 bauds and 31 kilo bauds. Getting this
facility is made very simple using simple routines with option to elect even or odd
parity. You can also establish a kind of Inter processor communication facility among
many microcomputers in a distributed environment with automatic recognition of
address/data. Apart from all above, you can also get super fast I/O lines using low cost
simple TTL or CMOS shift registers.

A.1.h.Interrupts:

Department of ECE Page 29 CMRCET


Fire Fighting Robot

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. 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. Note that Table 5 shows that bit position IE.6 is unimplemented.In the AT89S52, bit
position IE.5 is also unimplemented. User software should not write 1s to these bit positions,
since they 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.

Table 3.3: Interrupt enable(IE) register

Table 3.4: Interrupt Enable(IE) register Functions.

Department of ECE Page 30 CMRCET


Fire Fighting Robot

A.1.i. Oscillator Characteristics:

XTAL1 and XTAL2 are the input and output, respectively, of an inverting amplifier
that can be configured for use as an on-chip oscillator, as shown in Figure 11. Either a quartz
crystal or ceramic resonator may be used. To drive the device from an external clock source,
XTAL2 should be left unconnected while XTAL1 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.

Figure3.4 (a): Oscillator connections. Figure 3.4(b): External clock drive


configuration.

A.1.j. Idle Mode:

In idle mode, the CPU puts itself to sleep while all the on chip peripherals remain
active. The mode is invoked by software. The content of the on-chip RAM and all the special
functions registers remain unchanged during this mode. The idle mode can be terminated by
any enabled interrupt or by a hardware reset. Note that when idle mode is terminated by a
hardware reset, the device normally resumes program execution from where it left off, up to
two machine cycles before the internal reset algorithm takes control. On-chip hardware inhibits
access to internal RAM in this event, but access to the port pins is not inhibited. To eliminate
the possibility of an unexpected write to a port pin when idle mode is terminated by a reset, the
instruction following the one that invokes idle mode should not write to a port pin or to external
memory.

Department of ECE Page 31 CMRCET


Fire Fighting Robot

A.1.k. Power-down Mode:

In the Power-down mode, the oscillator is stopped, and the instruction that invokes
Power-down is the last instruction executed. The on-chip RAM and Special Function Registers
retain their values until the Power-down mode is terminated. Reset redefines the SFRs but does
not change the on-chip RAM. The reset should not be activated before VCC is restored to its
normal operating level and must be held active long enough to allow the oscillator to restart and
stabilize.

Table 3.5 Status of external pins in idle and power down mode

A.1.m. Criteria in choosing a microcontroller:

1. The first and foremost criterion in choosing a microcontroller is that it must meet task at
hands efficiently and cost effectively. In analyzing the needs of a microcontroller based
project we must first see whether it is an 8-bit, 16-bit or 32-bit microcontroller and how
best it can handle the computing needs of the task most effectively. The other
considerations in this category are:

(a) Speed: The highest speed that the microcontroller supports

(b) Packaging: Is it 40-pin DIP or QPF or some other packaging format? This is
important in terms of space, assembling and prototyping the End product.

(c) Power Consumption: This is especially critical for battery-powered Products.

(d) The amount of RAM and ROM on chip

Department of ECE Page 32 CMRCET


Fire Fighting Robot

(e) The number of I/O pins and timers on the chip.

(f) Cost per unit: This is important in terms of final product in which a
microcontroller is used.

2. The second criteria in choosing a microcontroller are how easy it is to develop products
around it. Key considerations include the availability of an assembler, debugger, a code
efficient ‘C’ language compiler, emulator, technical support and both in house and outside
expertise.

3. The third criteria in choosing a microcontroller is it readily available in needed quantities


both now and in future. For some designers this is even more important than first two
criteria’s. Currently, of leading 8–bit microcontrollers, the AT 89S52 family has the largest
number of diversified (multiple source) suppliers. By suppliers meant a producer besides
the originator of microcontroller in the case of the AT 89S52, which was originated by
Intel, several companies are also currently producing the AT 89S52. Viz: INTEL, These
companies include PHILIPS, SIEMENS, and DALLAS-SEMICONDUCTOR.

A.2.Fire Sensor

This fire sensor circuit exploits the temperature sensing property of an ordinary signal
diode IN 34 to detect heat from fire. At the moment it senses heat, a loud alarm simulating that
of Fire brigade will be produced. The circuit is too sensitive and can detect a rise in temperature
of 10 degree or more in its vicinity. Ordinary signal diodes like IN 34 and OA 71 exhibits this
property and the internal resistance of these devices will decrease when temperature rises.

Figure 3.5.fire sensor

Department of ECE Page 33 CMRCET


Fire Fighting Robot

There are several types of flame detector. The optical flame detector is a detector that uses
optical sensors to detect flames. There are also ionization flame detectors, which use current
flow in the flame to detect flame presence, and thermocouple flame detectors.

A.2.aTypes

Ultraviolet
Ultraviolet (UV) detectors work with wavelengths shorter than 300 nm. These detectors detect
fires and explosions within 3–4 milliseconds due to the UV radiation emitted at the instant of
their ignition. False alarms can be triggered by UV sources such as lightning, arc welding,
radiation, and sunlight. In order to reduce false alarm a time delay of 2-3 seconds is often
included in the UV flame detector design.
Near IR Array
Near infrared (IR) array flame detectors, also known as visual flame detectors, employ flame
recognition technology to confirm fire by analyzing near IR radiation via the pixel array of a
charge-coupled device (CCD).
Infrared
Infrared (IR) flame detectors work within the infrared spectral band. Hot gases emit a specific
spectral pattern in the infrared region, which can be sensed with a thermal imaging camera
(TIC) a type of thermo graphic camera. False alarms can be caused by other hot surfaces and
background thermal radiation in the area as well as blinding from water and solar energy. A
typical frequency where single frequency IR flame detector is sensitive is in the 4.4 micrometer
range. Typical response time is 3-5 seconds.
UV/IR
UV and IR flame detectors compare the threshold signal in two ranges in "AND" configuration
and their ratio to each other to confirm the fire signal and minimize false alarms.
IR/IR flame detection
Dual IR (IR/IR) flame detectors compare the threshold signal in two infrared ranges. In this
case one sensor looks at the 4.4 micrometer range the other sensor at a reference frequency.

Department of ECE Page 34 CMRCET


Fire Fighting Robot

IR3 flame detection


Triple IR flame detectors compare three specific wavelength bands within the IR spectral
region and their ratio to each other. In this case one sensor looks at the 4.4 micrometre range
and the other sensors at reference bands above and below. This allows the detector to
distinguish between non flame IR sources, and flames that emit hot CO2 in the combustion
process (which have a spectral characteristic peak at 4.4 micrometre). As a result, both
detection range and immunity to false alarms can be significantly increased. IR3 detectors can
detect a 0.1m2 (1ft2) gasoline pan fire at up to 65m (215ft) in less than 5 seconds.

Most IR detectors are designed to ignore constant background IR radiation, which is present in
all environments. Instead they measure the modulated part of the radiation. When exposed to
modulated non flame IR radiation, IR and UV/IR detectors become more prone to false alarms,
while IR3 detectors become somewhat less sensitive, and more immune to false alarms. Triple
IR, like other IR detector types, is susceptible to blinding by a layer of water on the detector's
window.
Visible sensors
In some detectors a sensor for visible radiation is added to the design in order to be able to
discriminate against false alarms better or improve the detection range. Example: UV/IR/vis,
IR/IR/vis, IR/IR/IR/vis flame detectors.
Video
Closed-circuit television or a web camera can be used for video detection (wavelength between
0.4 and 0.7 µm). Like humans, the camera can be blinded by smoke or fog.[1]
Other types
Ionization current flame detection
The intense ionization within the body of a flame can be measured by means of the current
which will flow when a voltage is applied. This current can be used to verify flame presence
and quality. They are normally used in large industrial process gas heaters and are connected to

Department of ECE Page 35 CMRCET


Fire Fighting Robot

the flame control system and act as both the flame quality monitor and the "flame failure
device".
Thermocouple flame detection
Thermocouples are used extensively for monitoring flame presence in combustion heating
systems and gas cookers. They are commonly used as the "flame failure device" to cut off the
supply of fuel if the flame fails. This prevents the danger of a large explosive mixture building
up, or the hazard of asphyxiation in a confined space due to exclusion of oxygen.

A.3.DC Motor:
Here DC Motor is used to rotate the panel in the required direction. Let us study in
detail about the DC Motor.
A.3.a. 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. Let's start by looking at a simple 2-pole DC electric motor (here red
represents a magnet or winding with a "North" polarization, while green represents a magnet or
winding with a "South" polarization).

Figure 3.6 Internal structure DC motor

Department of ECE Page 36 CMRCET


Fire Fighting Robot

Every DC motor has six basic parts. They are axle, rotor (a.k.a., armature), stator, commutator,
field magnet(s), and brushes. In most common DC motors (and all that BEAMERS will see),
the external magnetic field is produced by high-strength permanent magnets1. The stator is the
stationary part of the motor -- this includes the motor casing, as well as two or more permanent
magnet pole pieces. The rotor (together with the axle and attached commutator) rotates with
respect to the stator.
The rotor consists of windings (generally on a core), the windings being electrically
connected to the commutator. The above diagram shows a common motor layout with the rotor
inside the stator (field) magnets.
The geometry of the brushes, commutator contacts, and rotor windings are such that
when power is applied, the polarities of the energized winding and the stator magnet(s) are
misaligned, and the rotor will rotate until it is almost aligned with the stator's field magnets. As
the rotor reaches alignment, the brushes move to the next commutator contacts, and energize
the next winding. Given our example two-pole motor, the rotation reverses the direction of
current through the rotor winding, leading to a "flip" of the rotor's magnetic field, driving it to
continue rotating. In real life, though, DC motors will always have more than two poles (three
is a very common number). In particular, this avoids "dead spots" in the commutator. You can
imagine how with our example two-pole motor, if the rotor is exactly at the middle of its
rotation (perfectly aligned with the field magnets), it will get "stuck" there. Meanwhile, with a
two-pole motor, there is a moment where the commutator shorts out the power supply (i.e.,
both brushes touch both commutator contacts simultaneously). This would be bad for the power
supply, waste energy, and damage motor components as well. Yet another disadvantage of such
a simple motor is that it would exhibit a high amount of torque "ripple" (the amount of torque it
could produce is cyclic with the position of the rotor). You'll notice a few things from this --
namely, one pole is fully energized at a time (but two others are "partially" energized). As each
brush transitions from one commutator contact to the next, one coil's field will rapidly collapse,
as the next coil's field will rapidly charge up (this occurs within a few microsecond). We'll see
more about the effects of this later, but in the meantime you can see that this is a direct result of
the coil windings' series wiring:

Department of ECE Page 37 CMRCET


Fire Fighting Robot

Figure 3.7 DC Motor

The use of an iron core armature (as in the Mabuchi, above) is quite common, and has a
number of advantages2. First off, the iron core provides a strong, rigid support for the windings
-- a particularly important consideration for high-torque motors. The core also conducts heat
away from the rotor windings, allowing the motor to be driven harder than might otherwise be
the case. Iron core construction is also relatively inexpensive compared with other construction
types. But iron core construction also has several disadvantages. The iron armature has a
relatively high inertia which limits motor acceleration. This construction also results in high
winding inductances which limits brush and commutates life. In small motors, an alternative
design is often used which features a 'coreless' armature winding. This design depends upon the
coil wire itself for structural integrity. As a result, the armature is hollow, and the permanent
magnet can be mounted inside the rotor coil. Coreless DC motors have much lower armature
inductance than iron-core motors of comparable size, extending brush and commutator life. The
coreless design also allows manufacturers to build smaller motors; meanwhile, due to the lack
of iron in their rotors, coreless motors are somewhat prone to overheating. As a result, this
design is generally used just in small, low-power motors. BEAMERS will most often see
coreless DC motors in the form of pager motors. Consider the g a DC motor. A DC motor will
have two terminals. Let the terminals are D1 and D2. If we give positive voltage to D1 and
negative voltage to D2 (simply voltage at D1 should be more positive than the voltage at D2)
the rotor will rotate in forward direction. Alternatively if the voltage at D1 is negative and D2 is
positive (or in other words voltage at D1 is more negative than D2) then the motor will rotate in
reverse direction.

Department of ECE Page 38 CMRCET


Fire Fighting Robot

A.3.b.Basics of Dc Motor
The speed of a DC motor is directly proportional to the supply voltage, so if we reduce
the supply voltage from 12 Volts to 6 Volts, the motor will run at half the speed. The speed
controller works by varying the average voltage sent to the motor. It could do this by simply
adjusting the voltage sent to the motor, but this is quite inefficient to do. A better way is to
switch the motor's supply on and off very quickly. If the switching is fast enough, the motor
doesn't notice it, it only notices the average effect. Now imagine a light bulb with a switch.
When we close the switch, the bulb goes on and is at full brightness, say 100 Watts. When we
open the switch it goes off (0 Watts). Now if you close the switch for a fraction of a second,
then open it for the same amount of time, the filament won't have time to cool down and heat
up, and you will just get an average glow of 50 Watts. This is how lamp dimmers work, and the
same principle is used by speed controllers to drive a motor.
3.6 H-Bridge
An H-bridge is an electronic circuit which enables DC electric motors to be run
forwards or backwards. These circuits are often used in robotics. H-bridges are available as
integrated circuits, or can be built from discrete components.

Figure 3.8 H-Bridge Circuit

The term "H-bridge" is derived from the typical graphical representation of such a circuit. An
H-bridge is built with four switches (solid-state or mechanical). When the switches S1 and S4
(according to the first figure) are closed (and S2 and S3 are open) a positive voltage will be

Department of ECE Page 39 CMRCET


Fire Fighting Robot

applied across the motor. By opening S1 and S4 switches and closing S2 and S3 switches, this
voltage is reversed, allowing reverse operation of the motor. Using the nomenclature above, the
switches S1 and S2 should never be closed at the same time, as this would cause a short circuit
on the input voltage source. The same applies to the switches S3 and S4. This condition is
known as shoot-through.
A.3.c.Operation
The H-Bridge arrangement is generally used to reverse the polarity of the motor, but
can also be used to 'brake' the motor, where the motor comes to a sudden stop, as the motors
terminals are shorted, or to let the motor 'free run' to a stop, as the motor is effectively
disconnected from the circuit. The following table summarizes operation.
Table 3.6 H-Bridge operation

S1 S2 S3 S4 Result

1 0 0 1 Motor moves right

0 1 1 0 Motor moves left

0 0 0 0 Motor free runs

0 1 0 1 Motor brakes

A.3.d.H-Bridge Driver
The switching property of this H-Bridge can be replaced by a Transistor or a Relay or a
MOSFET or even by an IC. Here we are replacing this with an IC named L293D as the driver
whose description is as given below.
Features:

 600mA output current capability

Department of ECE Page 40 CMRCET


Fire Fighting Robot

 Per channel
 1.2a peak output current (non repetitive)
 Per channel
 Enable facility
 Over temperature protection
 Logical "0" input voltage up to 1.5 v
 (high noise immunity)
 Internal clamp diodes
A.3.e.Description
The Device is a monolithic integrated high voltage, high current four channel driver
designed to accept standard DTL or TTL logic levels and drive inductive loads (such as relays
solenoids, DC and stepping motors) and switching power transistors. To simplify use as two
bridges each pair of channels is equipped with an enable input. A separate supply input is
provided for the logic, allowing operation at a lower voltage and internal clamp diodes are
included fig 3.9 shows block diagram of H-bridge.

Fig 3.9:Block diagram of H-Bridge

A.4.L293D
This device is suitable for use in switching applications at frequencies up to 5 kHz. The
L293D is assembled in a 16 lead plastic package which has 4 center pins connected together
and used for heat sinking The L293DD is assembled in a 20 lead surface mount which has 8
center pins connected together and used for heat sinking as shown in fig below.

Department of ECE Page 41 CMRCET


Fire Fighting Robot

Figure 3.10 Pin diagram of L293D

Table 3.7 Pin Function of L293D


Pin No Function Name
1 Enable pin for Motor 1;active high Enable 1,2
2 Input 1 for Motor 1 Input 1
3 Output 1 for Motor 1 Output 1
4 Ground(0V) Ground
5 Ground(0V) Ground
6 Output 2 for Motor 1 Output 2
7 Input 2 for Motor 1 Input 2
8 Supply voltage for Motors;9-12V(upto 36V) Vcc2
9 Enable pin for Motor 2; active high Enable 3,4
10 Input 1 for Motor 1 Input 3
11 Output 1 for Motor 1 Otput 3
12 Ground (0V) Ground
13 Ground(0V) Ground
14 Output 2 for Motor 1 Output 4
15 Input 2 for Motor 1 Input 4
16 Supply voltage; 5V(upto 36V) Vcc1

Department of ECE Page 42 CMRCET


Fire Fighting Robot

A.4.1 Working of L293D


The 4 input pins for this l293d, pin 2,7 on the left and pin 15 ,10 on the right as shown
on the pin diagram. Left input pins will regulate the rotation of motor connected across left side
and right input for motor on the right hand side. The motors are rotated on the basis of the
inputs provided across the input pins as LOGIC 0 or LOGIC 1. In simple you need to provide
Logic 0 or 1 across the input pins for rotating the motor.
A.4.2 L239D DC Motor Driver & Pin Configuration
Although I’ve only used 1 motor, it is possible to use 2 motors on a single L293D chip
of course you then have to compensate on the current accordingly to ensure enough juice for
both motors under peak load. Remember that if you use 2 motors, the power source will be the
same voltage but the current needed will be doubled – a good start is by altering how your
batteries are connected in series or parallel. “The L293D is a monolithic integrated, high
voltage, high current, 4-channel driver.” Basically this means using this chip you can use DC
motors and power supplies of up to 36 Volts, thats some pretty big motors and the chip can
supply a maximum current of 600mA per channel, the L293D chip is also what’s known as a
type of H-Bridge. The H-Bridge is typically an electrical circuit that enables a voltage to be
applied across a load in either direction to an output, e.g. motor. This means you can essentially
reverse the direction of current and thus reverse the direction of the motor. It works by having 4
elements in the circuit commonly known as corners: high side left, high side right, low side
right, and low side left. By using combinations of these you are able to start, stop and reverse
the current. You could make this circuit out of relays but its easier to use an IC – The L293D
chip is pretty much 2 H-Bridge circuits, 1 per side of the chip or 1 per motor. The bit we really
care about in all of this is the 2 input pins per motor that do this logic and these, more
importantly for our needs, can be controlled from the Arduino board. You also don’t have to
worry about voltage regulation so much because it allows for 2 power sources – 1 direct source
upto 36V for the motors and the other, 5V, to control the IC which can be supplied from the
Arduino power supply or since my motor power supply is only 6V I’m going to use this (if the
motor supply was higher I would consider using a transistor or voltage regulator). The only
thing to remember is that the grounding connection must be shared/ common for both supplies.
Below you can see the pin layout for the chip and the truth table showing the output logic. • Pin

Department of ECE Page 43 CMRCET


Fire Fighting Robot

2 = Logic 1 and Pin 7 = Logic 0 | Clockwise Direction


• Pin 2 = Logic 0 and Pin 7 = Logic 1 | Anticlockwise Direction
• Pin 2 = Logic 0 and Pin 7 = Logic 0 | Idle [No rotation] [Hi-Impedance state]
• Pin 2 = Logic 1 and Pin 7 = Logic 1 | Idle [No rotation

Circuit Diagram For l293d motor driver IC controller.

Fig3.11: ckt diagram of L293D


Voltage Specification

VCC is the voltage that it needs for its own internal operation 5v; L293D will not use this
voltage for driving the motor. For driving the motors it has a separate provision to provide
motor supply VSS (V supply). L293d will use this to drive the motor. It means if you want to
operate a motor at 9V then you need to provide a Supply of 9V across VSS Motor supply.

The maximum voltage for VSS motor supply is 36V. It can supply a max current of 600mA per
channel. Since it can drive motors Up to 36v hence you can drive pretty big motors with this
l293d.VCC pin 16 is the voltage for its own internal Operation. The maximum voltage ranges
from 5v and up to 36v.

TIP: Don’t Exceed the Vmax Voltage of 36 volts or it will cause damage.

Department of ECE Page 44 CMRCET


Fire Fighting Robot

A.5. RF Tx & Rx

The RF module, as the name suggests, operates at Radio Frequency. The corresponding
frequency range varies between 30 kHz & 300 GHz. In this RF system, the digital data is
represented as variations in the amplitude of carrier wave. This kind of modulation is known as
Amplitude Shift Keying (ASK).

Transmission through RF is better than IR (infrared) because of many reasons. Firstly, signals
through RF can travel through larger distances making it suitable for long range applications.
Also, while IR mostly operates in line-of-sight mode, RF signals can travel even when there is
an obstruction between transmitter & receiver. Next, RF transmission is more strong and
reliable than IR transmission. RF communication uses a specific frequency unlike IR signals
which are affected by other IR emitting sources.

Pin Diagram:

This RF module comprises of an RF Transmitter and an RF Receiver. The


transmitter/receiver (Tx/Rx) pair operates at a frequency of 434 MHz. An RF transmitter
receives serial data and transmits it wirelessly through RF through its antenna connected at
pin4. The transmission occurs at the rate of 1Kbps - 10Kbps.The transmitted data is received by
an RF receiver operating at the same frequency as that of the transmitter.

Fig.3.12: pin diagram of RF Tx-Rx

Department of ECE Page 45 CMRCET


Fire Fighting Robot

Pin Description:

Table 3.8:RF Transmitter

Pin No Function Name

1 Ground (0V) Ground

2 Serial data input pin Data

3 Supply voltage; 5V Vcc

4 Antenna output pin ANT

Table 3.9: RF Receiver

Pin No Function Name

1 Ground (0V) Ground

2 Serial data output pin Data

3 Linear output pin; not connected NC

4 Supply voltage; 5V Vcc

5 Supply voltage; 5V Vcc

6 Ground (0V) Ground

7 Ground (0V) Ground

8 Antenna input pin ANT

Department of ECE Page 46 CMRCET


Fire Fighting Robot

B.SOFTWARE DESCRIPTION

B.1 ABOUT KEIL SOFTWARE:

It is possible to create the source files in a text editor such as Notepad, run the Compiler on
each C source file, specifying a list of controls, run the Assembler on each Assembler source
file, specifying another list of controls, run either the Library Manager or Linker (again
specifying a list of controls) and finally running the Object-HEX Converter to convert the
Linker output file to an Intel Hex File. Once that has been completed the Hex File can be
downloaded to the target hardware and debugged. Alternatively KEIL can be used to create
source files; automatically compile, link and covert using options set with an easy to use user
interface and finally simulate or perform debugging on the hardware with access to C variables
and memory. Unless you have to use the tolls on the command line, the choice is clear. KEIL
Greatly simplifies the process of creating and testing an embedded application.

About Keil ARM:

Click on the Keil u Vision3 Icon on Desktop

1.The following fig will appear.

Department of ECE Page 47 CMRCET


Fire Fighting Robot

3.Click on the Project menu from the title bar


4.Then Click on New Project

5.Save the Project by typing suitable project name with no extension in u r own folder sited
in either C:\ or D:\

Department of ECE Page 48 CMRCET


Fire Fighting Robot

6.Then Click on Save button above.


7.Select the component for u r project. i.e.ATMEL……
8.Click on the + Symbol beside of ATMEL

Department of ECE Page 49 CMRCET


Fire Fighting Robot

9. Select AT89S52 as shown below

10. Then Click on “OK”


11. The Following fig will appear

Department of ECE Page 50 CMRCET


Fire Fighting Robot

12.Then Click YES


13.Now your project is ready to USE
14.Now double click on the Target1, you would get another option “Source group 1” as shown
in next page.

Department of ECE Page 51 CMRCET


Fire Fighting Robot

15.Click on the file option from menu bar and select “new”

16.The next screen will be as shown in next page, and just maximize it by double clicking on
its blue boarder.

17.Now start writing program in either in “C” or “ASM”

18.For a program written in Assembly, then save it with extension “. asm” and for “C” based
program save it with extension “ .C”

Department of ECE Page 52 CMRCET


Fire Fighting Robot

19.Now right click on Source group 1 and click on “Add files to Group Source”

Department of ECE Page 53 CMRCET


Fire Fighting Robot

20.Now you will get another window, on which by default “C” files will appear

21.Now select as per your file extension given while saving the file
22.Click only one time on option “ADD”
23.Now Press function key F7 to compile. Any error will appear if so happen.

Department of ECE Page 54 CMRCET


Fire Fighting Robot

Department of ECE Page 55 CMRCET


Fire Fighting Robot

24. If the file contains no error, then press Control+F5 simultaneously.


25. The new window is as follows

26. Then Click “OK”


27. Now Click on the Peripherals from menu bar, and check your required port as shown in
fig below

Department of ECE Page 56 CMRCET


Fire Fighting Robot

29. Drag the ports a side and click in the program file

29.Now keep Pressing function key “F11” slowly and observe.


30.You are running your program successfully.
CREATING A HEX FILE:
1.right click on the target file
2.select OPTIONS IN TARGET FILE as below

Department of ECE Page 57 CMRCET


Fire Fighting Robot

3.change the frequency accordingly and enable the create hex file option
4.click OK and rebuild the file
5.name.hex file gets created in the project folder

PROGISP:
1.Select the progisp application
2.Then the following window will appear

Department of ECE Page 58 CMRCET


Fire Fighting Robot

3.select the LOAD FLASH option and select the HEX file
4. then select the AUTO to dump the program to the hardware

Department of ECE Page 59 CMRCET


Fire Fighting Robot

C. Source Code:

#include<reg51.h>

sbit fire=P3^2;

sbit f=P2^1;

sbit b=P2^2;

sbit l=P2^3;

sbit r=P2^4;

sbit MR1=P1^0;

sbit MR2=P1^1;

sbit ML1=P1^2;

sbit ML2=P1^3;

sbit W_Pump1=P3^6;

sbit W_Pump2=P3^7;

Void delay(unsigned int x)

unsigned int i,j;

for(i=0;i<x;i++)

for(j=0;j<1275;j++);

Void main()

P2=0x1f;

Department of ECE Page 60 CMRCET


Fire Fighting Robot

P1=0x00;

P3=0x3f;

While(1)

if(f==0&&b==0&&r==0&&l==0)

MR1=0;

MR2=0;

ML1=0;

ML2=0;

W_Pump1=0;

W_Pump2=0;

if(f==1&&b==0&&r==0&&l==0)

MR1=0;

MR2=1;

ML1=0;

ML2=1;

W_Pump1=0;

W_Pump2=0;

Department of ECE Page 61 CMRCET


Fire Fighting Robot

If(f==0&&b==1&&r==0&&l==0)

MR1=1;

MR2=0;

ML1=1;

ML2=0;

W_Pump1=0;

W_Pump2=0;

If(f==0&&b==0&&r==1&&l==0)

MR1=0;

MR2=0;

ML1=0;

ML2=1;

W_Pump1=0;

W_Pump2=0;

If(f==0&&b==0&&r==0&&l==1)

MR1=0;

MR2=1;

Department of ECE Page 62 CMRCET


Fire Fighting Robot

ML1=0;

ML2=0;

W_Pump1=0;

W_Pump2=0;

If(fire==0)

MR1=0;

MR2=0;

ML1=0;

ML2=0;

MR1=0;

MR2=0;

ML1=0;

ML2=0;

W_Pump1=1;

W_Pump2=0;

delay(500);

Department of ECE Page 63 CMRCET

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy