You are on page 1of 6

Fire Fighting Robot (AT89S52)

The need for a device that can detect and extinguish a fire on its own is long past due. Many house fires originate when someone is either sleeping or not home. With the invention of such a device, people and property can be saved at a much higher rate with relatively minimal damage caused by the fire. Our task as electrical engineers was to design and build a prototype system that could autonomously detect and extinguish a fire. Also aims at minimizing air pollution.In this Project we design a Fuzzy based Microcontroller controlled Robot. It is the Robot that can move through a model structure, find a lit candle and then extinguish it with help of a Blower. This is meant to simulate the real world operation of a Robot performing a fire extinguishing function in an oilfield. Fuzzy logic provided an appropriate solution to the otherwise complex task of mathematically deriving an exact model for the non-linear control system upon which conventional control techniques could then be applied. The fuzzy inference system was designed to act as a PID-like controller. We are using the Popular 8 bit Microcontroller the 8051 family Microcontroller. Program code to control the fire fighting robot is written in assembly language.

Code:
INCLUDE REG_52.PDF RB0 EQU 000H ; Select Register Bank 0 ;%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %%%%%%%%%%%%%%%%%% ; PORT DECLERATION ;%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %%%%%%%%%%%%%%%%%% CLK EQU P0.4 START EQU P0.0 EOC EQU P0.1 DATA1 DATA2 DATA3 DATA4 DATA5 DATA6 DATA7 DATA8 ALE EQU EQU EQU EQU EQU EQU EQU EQU EQU P2.4 P2.5 P2.6 P2.7 P0.2 P0.6 P0.5 P0.7 P2.3 P2.0 P2.1 P2.2 EQU EQU EQU EQU EQU EQU EQU EQU EQU EQU EQU EQU EQU EQU P0.3 P3.3 P3.5 P3.4 P3.0 P1 P1.0 P1.1 P1.2 P1.3 P1.4 P1.5 P1.6 P1.7

ADD_A EQU ADD_B EQU ADD_C EQU OUT_EN FRONT LEFT RIGHT BLOWER MOTOR COIL1 COIL2 COIL3 COIL4 COIL5 COIL6 COIL7 COIL8

DSEG ; This is internal data memory ORG 20H ; Bit adressable memory VALUE: DS 1 STACK: DS 1 CSEG ; Code begins here ;---------==========----------==========---------=========--------; Main routine. Program execution starts here. ;---------==========----------==========---------=========--------ORG 00H ; Reset AJMP MAIN ORG 000BH CPL CLK RETI ;---------==========----------==========---------=========--------MAIN: MOV PSW,#RB0 ; Select register bank 0 MOV SP,#60H MOV TMOD,#02H MOV TH0,#0A4H MOV IE,#82H SETB TR0 CLR BLOWER CALL READ_ADC

;&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& ; INITIALIZE ADC CHIP ;&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& READ_ADC: CLR START CLR ALE CLR OUT_EN SETB ADD_A SETB ADD_B CLR ADD_C SETB ALE

NOP NOP NOP NOP CLR ALE SETB START NOP NOP NOP NOP CLR START CALL DELAY SETB EOC JNB EOC,$ SETB OUT_EN NOP NOP NOP NOP CLR OUT_EN CALL READ_TEMP RET ;&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& ; READ TEMPERATURE ;&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& READ_TEMP: SETB DATA1 SETB DATA2 SETB DATA3 SETB DATA4 SETB DATA5 SETB DATA6 SETB DATA7 SETB DATA8 MOV VALUE,#00H JNB DATA1,DF1 SETB VALUE.7 DF1: JNB DATA2,DF2 SETB VALUE.6 DF2: JNB DATA3,DF3 SETB VALUE.5 DF3: JNB DATA4,DF4 SETB VALUE.4 DF4: JNB DATA5,DF5 SETB VALUE.3 DF5: JNB DATA6,DF6 SETB VALUE.2 DF6: JNB DATA7,DF7

SETB VALUE.1 JNB DATA8,DF8 SETB VALUE.0 DF8: RET ;&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& DELAY: MOV R0,#35H RP2: MOV R1,#0FFH RP1: NOP DJNZ R1,RP1 DJNZ R0,RP2 RET DF7: DELAYS1: RP2X: RP1X: MOV R0,#0FFH MOV R1,#0FFH NOP DJNZ R1,RP1X DJNZ R0,RP2X RET

DELAYF: RRP2: RRP1: MOV R0,#0FFH MOV R1,#0FFH NOP DJNZ R1,RRP1 DJNZ R0,RRP2 RET

; ********************************************************** END

You might also like