Sunday, February 8, 2009

Fire Fighting Robot

Fire Fighting Robot


Introduction

Every year IEEE Region 3 holds
the SoutheastCon Conference in which
teams from different universities can
compete in the Hardware Competition
[1]. The Hardware Competition of the
2003 IEEE SoutheastCon requires
designing and building a robot that will
go through a model of a house and detect
and extinguish a small fire. It will
then go through the house structure that
is made of black painted wood. The
walls are 23 cm high and 2 cm thick
with doorways 23 cm wide. All
measurements are guaranteed to be
accurate to 4%. The floor plan is shown
in Figure 1 [1]. There is a 1.9 cm line
made with white Tartan General Purpose
tape across each doorway and running
down the center of each hallway. This
design allows for the robot to use line
following in order to maneuver.

Floor Plan

The small fire is represented by a
cylindrical red object with six red light
emitting diodes (LED). The candle can
be found in any of the four rooms. Once
the candle is found it will be
extinguished by the robot by covering
the candle with a cup. If the candle is
knocked over it is considered as
spreading the fire and the team will be
disqualified. After extinguishing the fire
the robot should return to the home area
without entering any other room along
the way. The goal of this project is to
create a robot to complete this task in the
shortest amount of time.

Frame

Firebot’s frame, shown in Figure 2, is
constructed of 1/8 inch thick balsa wood.
There are three layers, each separated by
metal standoffs. The dimensions of the
frame were designed so that it is able to
fit within the 21 cm x 21 cm x 20 cm
home area and maneuver through the
maze.

Power supply

The power supply consists
of eight 1.5 Volt AA nickel-cadmium
rechargeable batteries which are
mounted on the bottom layer. The
supply voltage passes through five volt
regulators which powers the board and
dc motors.
The robot has dc servos that are
fully hacked for use as motors.
Originally, two voltage regulators were
added to keep a constant voltage on each
motor allowing the robot to go straight
given the same values. This did not give
the expected results but prevented the
motors from varying in speed depending
on the current battery charge.

Board

An AVR based microcontroller
was chosen for the robot computer
system. In this case an Atmel ATMega
128processor was chosen. This
processor provided 128 kilobytes of
onboard flash for programs through a
JTAG interface. The processor also has
a 10 bit analog to digital converter
(ADC), two UARTs, and multiple timers
including both output compares and
input capture devices. A board
developed by optiCompo Electronics,
using the ATMega 128, allowed the
RS232 protocol to be used on UART0
thereby allowing the processor to
communicate to a PC. This is extremely
useful while debugging the system.
Because the optiCompo board brought
out the processor pins in a series of male
headers and because several external
sensors and motors are needed, a
breakout board was designed .

Behaviors

An intelligent robot which automatically
detect the location of fire and uses a
blower to put out fire.In this 40 KHz
ultrasonic sensor are used for obstacle
sensor,two number of IR sensor used to
guide the robot in correct direction. Fire
sensor is used to sense fire it will stop and start a high speed fan to extinguish the fire.

Room Finding

Room finding is
accomplished using two infrared sensors
centered on both sides of the robot. The
IR sensors detect when an opening in the
wall is present. This signals to the robot
that the door is to the side and it is time
to turn. In order for the robot to not be
confused immediately after a turn, a
front IR sensor is used to gauge the
distance from the wall ahead.
Testing determined that the
sensors did not have a high enough
resolution to determine the farther
distances that were needed in the front.
The front IR was then replaced by a
Devantech SRF004 ultrasonic range
finder.

Candle Detection

The robot uses a LDR to
detect the fire.

Conclusion

The challenge of creating a fire
extinguishing robot to operate in lighting
conditions that are not fixed is a difficult
one. Completing each of the different
components was not easy. However,
Firebot’s hardest task was integrating all
of its components. The experience and
the difficulties faced taught us valuable
lessons that we can use on future
projects.

Source Code

MOV A,#0FFH
MOV P1,A
MAIN: MOV A,P1
SUBB A,#00H
JZ L1
AJMP L2
L1: LCALL FRWD1
L2: MOV A,P1
SUBB A,#01H
JZ L3
AJMP L4
L3: LCALL BACK3
L4: MOV A,P1
SUBB A,#02H
JZ L5
AJMP L6
L5: LCALL FRWD1
L6: MOV A,P1
SUBB A,#03H
JZ L7
AJMP L8
L7: LCALL BACK3
L8: MOV A,P1
SUBB A,#04H
JZ L9
AJMP L10
L9: LCALL FRWD3
LCALL CHKLDR7
L10: MOV A,P1
SUBB A,#05H
JZ L11
AJMP L12
L11: LCALL CHKLDR8
L12: MOV A,P1
SUBB A,#06H
JZ L13
AJMP L14
L13: LCALL FRWD1
L14: MOV A,P1
SUBB A,#07H
JZ L15
AJMP L16
L15: LCALL STPNEXT
L16: MOV A,P1
SUBB A,#08H
JZ L17
AJMP L18
L17: LCALL RGHT1
L18: MOV A,P1
UBB A,#09H
JZ L19
AJMP L20
L19: LCALL RGHT2
L20: MOV A,P1
SUBB A,#0AH
JZ L21
AJMP L22
L21: LCALL RGHT1
L22: MOV A,P1
SUBB A,#0BH
JZ L23
AJMP L24
L23: LCALL RGHT2
L24: MOV A,P1
SUBB A,#0CH
JZ L25
AJMP L26
L25: LCALL FRWD3
LCALL CHKLDR5
L26: MOV A,P1
SUBB A,#0DH
JZ L27
AJMP L28
L27: LCALL FRWD2
LCALL CHKLDR6
L28: MOV A,P1
SUBB A,#0EH
JZ L29
AJMP L30
L29: LCALL FRWD1
L30: MOV A,P1
SUBB A,#0FH
JZ L31
AJMP L32
L31: LCALL STPNEXT
L32: MOV A,P1
SUBB A,#10H
JZ L33
AJMP L34
L33: LCALL LFT1
L34: MOV A,P1
SUBB A,#11H
JZ L35
AJMP L36
L35: LCALL LFT2
L36: MOV A,P1
SUBB A,#12H
JZ L37
AJMP L38
L37: LCALL LFT1
L38: MOV A,P1
SUBB A,#13H
JZ L39
AJMP L40
L39: LCALL LFT2
L40: MOV A,P1
SUBB A,#14H
JZ L41
AJMP L42
L41: LCALL FRWD3
LCALL CHKLDR3
L42: MOV A,P1
SUBB A,#15H
JZ L43
AJMP L44
L43: LCALL FRWD2
LCALL CHKLDR4
L44: MOV A,P1
SUBB A,#16H
JZ L45
AJMP L46
L45: LCALL FRWD1
L46: MOV A,P1
SUBB A,#17H
JZ L47
AJMP L48
L47: LCALL STPNEXT
L48: MOV A,P1
SUBB A,#18H
JZ L49
AJMP L50
L49: LCALL ROTATE
L50: MOV A,P1
SUBB A,#19H
JZ L51
AJMP L52
L51: LCALL BACK3
LCALL ROTATE
L52: MOV A,P1
SUBB A,#1AH
JZ L53
AJMP L54
L53: LCALL ROTATE
L54: MOV A,P1
SUBB A,#1BH
JZ L55
AJMP L56
L55: LCALL BACK3
LCALL ROTATE
L56: MOV A,P1
SUBB A,#1CH
JZ L57
AJMP L58
L57: LCALL FRWD3
LCALL CHKLDR1
L58: MOV A,P1
SUBB A,#1DH
JZ L59
AJMP L60
L59: LCALL FRWD2
LCALL CHKLDR2
L60: MOV A,P1
SUBB A,#1EH
JZ L61
AJMP L62
L61: LCALL FRWD1
L62: MOV A,P1
SUBB A,#1FH
JZ L63
AJMP L64
L63: LCALL STPNEXT
L64: AJMP MAIN
DELAY: MOV R3,#0AH
D3: MOV R4,#64H
D2: MOV R5,#0FAH
D1: DJNZ R5,D1
DJNZ R4,D2
DJNZ R3,D3
RET
ROTATE: ACALL DELAY
MOV A,#18H
MOV P2,A
RET
BACK1: MOV A,#0D4H
MOV P2,A
RET
BACK2: MOV R3,#0AH
B23: MOV R4,#64H
B22: MOV R5,#53H
B21: MOV A,#0D4H
MOV P2,A
DJNZ R5,B31
DJNZ R4,B32
DJNZ R3,B33
RET
BACK3: MOV R3,#0AH
B33: MOV R4,#64H
B32: MOV R5,#0FAH
B31: MOV A,#0D4H
MOV P2,A
DJNZ R5,B31
DJNZ R4,B32
DJNZ R3,B33
RET
FRWD1: MOV A,#0E8H
MOV P2,A
RET
FRWD2: MOV R3,#0AH
F23: MOV R4,#64H
F22: MOV R5,#53H
F21: MOV A,0E8H
MOV P2,A
DJNZ R5,F21
DJNZ R4,F22
DJNZ R3,F23
RET
FRWD3: MOV R3,#0AH
F33: MOV R4,#64H
F32: MOV R5,#0FAH
F31: MOV A,0E8H
MOV P2,A
DJNZ R5,F31
DJNZ R4,F32
DJNZ R3,F33
RET
LFT1: MOV A,#0E4H
MOV P2,A
RET
LFT2: MOV R3,#0AH
LF23: MOV R4,#64H
LF22: MOV R5,#0FAH
LF21: MOV A,0E4H
MOV P2,A
DJNZ R5,LF21
DJNZ R4,LF22
DJNZ R3,LF23
RET
RGHT1: MOV A,#0D8H
MOV P2,A
RET
RGHT2: MOV R3,#0AH
R23: MOV R4,#64H
R22: MOV R5,#0FAH
R21: MOV A,#0D8H
MOV P2,A
DJNZ R5,R21
DJNZ R4,R22
DJNZ R3,R23
RET
CHKLDR1: JB P1.3 CH1
AJMP CH2
CH1: ACALL FRWD1
AJMP CH3
CH2: ACALL ROTATE
CH3: RET
CHKLDR2: JB P1.3 CH4
AJMP CH5
CH4: ACALL STPNEXT
AJMP CH6
CH5: ACALL BACK3
ACALL ROTATE
CH6: RET
CHKLDR3: JB P1.3 CH7
AJMP CH8
CH7: ACALL FRWD1
AJMP CH9
CH8: ACALL LFT1
CH9: RET
CHKLDR4: JB P1.3 CH10
AJMP CH11
CH10: ACALL STPNEXT
AJMP CH12
CH11: ACALL LFT1
CH12: RET
CHKLDR5: JB P1.3 CH13
AJMP CH14
CH13: ACALL FRWD1
AJMP CH15
CH14: ACALL RGHT1
CH15: RET
CHKLDR6: JB P1.3 CH16
AJMP CH17
CH16: ACALL STPNEXT
AJMP CH18
CH17: ACALL RGHT1
CH18: RET
CHKLDR7: JB P1.3 CH19
AJMP CH20
CH19: ACALL FRWD1
AJMP CH21
CH20: ACALL BACK3
ACALL ROTATE
CH21: RET
CHKLDR8: JB P1.3 CH22
AJMP CH23
CH22: ACALL STPNEXT
AJMP CH24
CH23: ACALL BACK1
CH24: RET
STPNEXT: MOV A,#02H
MOV P2,A
RET