Вы находитесь на странице: 1из 64

A Mini Project Report on

LINE FOLLOWER ROBOT WITH FIRE EXTINGUISHER


Submitted in partial fulfillment of the requirement for the award of degree of BACHELOR OF TECHNOLOGY in ELECTRONICS AND COMMUNICATION ENGINEERING Submitted by G.YASASWINI M.S.N.MALLIKA A.VIHARI YADAV V.ASWANI
Under the Esteemed Guidance of

08FE1A0489 09FE5A0417 08FE1A0487 09FE5A0413

Mr.RATNA BABU

M.Tech.,

Associate Professor

DEPARTMENT OF ELECTRONICS AND COMMUNICATION ENGINEERING

VIGNANS LARA INSTITUTE OF TECHNOLOGY & SCIENCE


(An ISO 9001:2008 Certified, Approved by AICTE, Affiliated to JNTU, KAKINADA) VADLAMUDI-522213, GUNTUR Dist., ANDHRA PRADESH.

April, 2011

DEPARTMENT OF ELECTRONICS AND COMMUNICATION ENGINEERING

VIGNANS LARA INSTITUTE OF TECHNOLOGY & SCIENCE


(An ISO 9001:2008 Certified, Approved by AICTE, Affiliated to JNTU, KAKINADA) VADLAMUDI-522213, GUNTUR Dist., ANDHRA PRADESH.

CERTIFICATE
This is to certify that the project work entitled LINE FOLLOWER ROBOT WITH FIRE EXTINGUISHER (08FE1A0489), is a bonafide work done by G.YASASWINI M.S.N.MALLIKA (09FE5A0417),

A.VIHARI YADAV(08FE1A0487), V.ASWANI(09FE5A0413) under my guidance and submitted in partial fulfillment of the requirements for the award of the degree of Bachelor of Technology in Electronics and Communication Engineering by Jawaharlal Nehru Technological University, Kakinada.

Project Guide
(Mr.RATNA BABU)

Head of the Department


(Mrs.M.S.S.Rukmini)

External Examiner

ACKNOWLEDGEMENT
Firstly , we would like to express our deep and sincere gratitude to our institution Vignans Lara Institute of Technology and Science for providing us with all the required equipment for the fulfillment of the Bachelor of Technology in Electronics and Communication Engineering. We are grateful to our principal Dr.Madhusudhan Rao and head of the department of Electronics and Communication Engineering Mrs.M.S.S.Rukmini for having provided us an excellent academic atmosphere in the institution. Marvellous success can be achieved only through the guidance of well-experienced and qualified persons. So, we are greatly indebted to our guide Mr.Ratna Babu , for his illustrious guidance, encouragement and support right from the commencement of our project and other staff members for their help to complete this project. Finally, we are thankful to each and every faculty member both technical and non technical, friends and all the persons who helped us directly or indirectly in making our project a successful one.

ABSTRACT
The main objective of this project is to detect any fire accident and to extinguish the fire by sprinkling water on a predefined path. Here there is a path that has already been set for the robot to move on, hence the robot senses the fire accident if it occurs only in this path. The movement of the robot in this path can be autonomous because of the usage of IR transmitter and receiver. While moving in the path that has already been predefined if the Thermistor detects a very high temperature than the normal it indicates to the microcontroller that there is a fire accident occurred, now when the fire has been detected the water sprinkler sprinkles the water on the accident zone that has been detected.

CHAPTER 1

INTRODUCTION
5

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

3. They are usually in the form of small computerized parts in larger devices which serve a general purpose. 4. The program instructions for embedded systems run with limited computer hardware resources, little memory and small or even non-existent keyboard or screen. Robotics in real world Robots are very useful things. For example, if a building collapses, with people trapped in it, robots small enough can go in there and search for human survivors. When these little robots find a survivor they let the rescue team know so they can dig out the survivor. This will reduce the time that rescue teams look for humans still alive in the debris saving more lives. Also, these small robots designed to go into building debris can bring oxygen supplies to the survivor to keep him or her alive while the rescue people dig the him or her out. Robots are very use to doing our dirty work in industry. They perform tedious, unpleasant and very dangerous jobs that would be too dangerous for humans to do and robots can do jobs for us that we wouldn't survive. As well as rescuing people from disasters, they are in use with military forces performing surveillance and de-mining work. Soon they will be able to navigate through hazardous terrain. Robots are not affected by harmful chemicals, high radiation areas and high temperatures and they don't need oxygen to survive which makes them great for performing this dirty and dangerous work such as working in environments which would harm humans and sometimes kill people. Robots can inspect nuclear reactors. There is already one working in the Chernobyl nuclear plant in the Ukraine. In 1986, it was one of the world's worst nuclear accidents ever. There are fears that the concrete and steel tomb built around the damaged reactor may be crumbling so this led to a robot moving around in this environment scanning walls, floors and ceilings for damage.

Robots are also very useful in our homes doing chores for us, helping us and making our lives easier. They can also help to do jobs which elderly or disabled people would find very difficult or impossible to do. Coming out are vacuum cleaner robots. These robots can do the vacuum cleaning for you so you don't have to and you can save your time doing something else! The robot contains a radar round it so it can detect walls and obstacles. However, it does eat battery power and takes a whopping 12 hours to re-charge for only about 2 hours of cleaning!

Robots are also very useful for space travel. NASA and ESA use them a lot to explore worlds humans can't visit. From deep down in the Earth's oceans to the freezing world of Mars, robot explorers go and find out more which scientists discover. Robots can go into potentially dangerous environments and safely explore around. The 1997 Mars Pathfinder mission used a robot explorer which analyzed Martian rock and soil.

A robotic arm in space can also help construction of space stations so astronauts don't have to.

Many Mars rovers are planned for the future. They are controlled from Earth. The robot on the planet's surface beams back the data to the orbiter which sends the results back to Earth for scientists to analyse.

1.1 AIM OF THE PROJECT

The main aim of the project is to build a robot that simply follows a path that has been predefined and detects the fire at every instant using a thermistor. When the fire has been detected using a thermistor it can be extinguished using a water sprinkler.

1.2 TECHNICAL APPROACH This project has been designed as a real time application to be used in thermal power stations, in coal mines and in tunnels. This project can be effectively used in the areas where there is no scope for the humans to extinguish the fire.

1.3 ORGANIZATION OF THE PROJECT The project is organized in such a way that in Chapter 2 gives the overview of the project, which includes the basic block diagram, schematic advantages and applications. Chapter 3 lists out description of different hardware components. It gives complete idea about each module and its interfacing descriptions.

Chapter 4 is devoted to the software implementation which gives a brief idea about the software used. In this project, the source code is compiled with the help of KEIL compiler. The tools and the implementation of KEIL compiler is discussed in this chapter. The feature of the FLASH MAGIC is also discussed. Chapter 5 elaborates the complete code implemented in this project.
10

Chapter 6 shows the results of the project. A conclusion is presented in Chapter 7 and provides a summary of the project deliveries and discusses future scope for improvements in the performance and development. References used in the dissertation are then listed out in the Annexure section, followed by APPENDIX.

CHAPTER 2

11

OVERVIEW OF THE PROJECT

2.1

THE BASIC BLOCK DIAGRAM

12

Fig 2.1: Basic block diagram

2.2 SCHEMATIC DIAGRAM

2.3 WORKING OF THE PROJECT The objective of this project is to build a robot, which will extinguish a fire in the quickest time possible. The temperature level of the surrounding testing area will be determined until the day of the competition. For this reason, a Thermistor can be used to detect the fire. However the Knowledge of the surrounding temperature must be taken into consideration in order to make an appropriate fire sensor. Here there is a path that has already been set for the robot to move on, hence the robot senses the fire accident if it
13

occurs only in this path. The movement of the robot in this path can be autonomous because of the usage of IR transmitter and receiver. While moving in the path that has already been predefined if the Thermistor detects a very high temperature than the normal it indicates to the microcontroller that there is a fire accident occurred , now when the fire has been detected the buzzer buzzes and the water sprinkler sprinkles the water on the accident zone that has been detected.

2.4 APPLICATIONS
1. Used in Thermal Power Stations 2. Used in coal mines 3. Used in tunnels

CHAPTER 3

14

HARDWARE IMPLEMENTATION

3.1 AT89S52
3.1.1 A BREIF HISTORY OF MICROCONTROLLER
Microprocessors brought the concept of programmable devices and made many applications of intelligent equipment. Most applications, which do not need large amount of data and program memory, tended to be costly. The microprocessor system had to satisfy the data and program requirements so, sufficient RAM and ROM are used to satisfy most applications. The peripheral control equipment also had to be satisfied. Therefore, almost all-peripheral chips were used in the design. Because of these additional peripherals cost will be comparatively high. So peripheral devices like Timer/Counter, Parallel programmable port, Serial Communication Port, Interrupt controller and so on, which were most often used were integrated with the Microprocessor to present the Micro controller .RAM and ROM also were integrated in the same chip. The ROM size was anything from 256 bytes to 32Kb or more. RAM was optimized to minimum of 64 bytes to 256 bytes or more. 15

3.1.2 INTRODUCTION TO AT89S52


Coming to the question of why to use 89S52 of all the 8-bit Microcontroller available in the market the main answer would be because it has 8kB Flash and 256 bytes of data RAM32 I/O lines, three 16-bit timer/counters, a Eight-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 hardware reset. The Flash program memory supports both parallel programming and in Serial In-System Programming (ISP). The 89S52 is also In-Application Programmable (IAP), allowing the Flash program memory to be reconfigured even while the application is running.

3.1.3 ARCHITECTURAL DESCRIPTION


FUNCTIONAL BLOCK DIAGRAM

16

Fig 3.1: Functional block diagram of micro controller

a) THE AT89s52 OSCILLATOR AND CLOCK

17

The heart of the 89S52 circuitry that generates the clock pulses by which all the internal all internal operations are synchronized. Pins XTAL1 and XTAL2 is provided for connecting a resonant network to form an oscillator. Typically a quartz crystal and capacitors are employed. The crystal frequency is the basic internal clock frequency of the microcontroller. The manufacturers make designs that run at specific minimum and maximum frequencies typically 1 to 16 MHz.

b) MEMORIES
The 8052 have three general types of memory. They are on-chip memory, external Code memory and external Ram. On-Chip memory refers to physically existing memory on the micro controller itself. External code memory is the code memory that resides off chip. This is often in the form of an external EPROM. External RAM is the Ram that resides off chip. This often is in the form of standard static RAM or flash RAM.

CODE MEMORY Code memory is the memory that holds the actual 8052 programs that is to be run.

This memory is limited to 64K. Code memory may be found on-chip or off-chip. It is possible to have 8K of code memory on-chip and 60K off chip memory simultaneously. If only off-chip memory is available then there can be 64K of off chip ROM. This is controlled by pin provided as EA

INTERNAL RAM The 8052 have a bank of 256 bytes of internal RAM. The internal RAM is found

on-chip. So it is the fastest Ram available.. Internal Ram is volatile, so when 8051 is reset, this memory is cleared. 256 bytes of internal memory are subdivided. The first 32 bytes are divided into 4 register banks. Each bank contains 8 registers. Internal RAM also contains 256 bits, which are addressed from 20h to 2Fh. These bits are bit addressed i.e. each individual bit of a byte can be addressed by the user. They are numbered 00h to FFh. The user may make use of these variables with commands such as SETB and CLR.

c) Special Function registered memory 18

Special function registers are the areas of memory that control specific functionality of the 8052 micro controller.

1) Accumulator (0E0h) As its name suggests, it is used to accumulate the results of large no of instructions. It can hold 8 bit values. 2) B registers (0F0h) The B register is very similar to accumulator. It may hold 8-bit value. The b register is only used by MUL AB and DIV AB instructions. In MUL AB the higher byte of the product gets stored in B register. In div AB the quotient gets stored in B with the remainder in A. 3) Stack pointer (81h) The stack pointer holds 8-bit value. This is used to indicate where the next value to be removed from the stack should be taken from. When a value is to be pushed on to the stack, the controller first stores the value of SP and then stores the value at the resulting memory location. When a value is to be popped from the stack, then returns the value from the memory location indicated by SP and then decrements the value of SP. 4) Data pointer The SFRs DPL and DPH work together work together to represent a 16-bit value called the data pointer. The data pointer is used in operations regarding external RAM and some instructions code memory. It is a 16-bit SFR and also an addressable SFR. 5) Program counter The program counter is a 16 bit register, which contains the 2 byte address, which tells the 8052 where the next instruction to execute to be found in memory. When the 8052 is initialized PC starts at 0000h. And is incremented each time an instruction is executes. It is not addressable SFR.

6) PCON (power control, 87h)

19

The power control SFR is used to control the 8051s power control modes. Certain operation modes of the 8051 allow the 8051 to go into a type of sleep mode which consumes much lee power.

7) TCON (timer control, 88h) The timer control SFR is used to configure and modify the way in which the 8051s two timers operate. This SFR controls whether each of the two timers is running or stopped and contains a flag to indicate that each timer has overflowed. Additionally, some non-timer related bits are located in TCON SFR. These bits are used to configure the way in which the external interrupt flags are activated, which are set when an external interrupt occurs.

8) TMOD (Timer Mode, 89h) The timer mode SFR is used to configure the mode of operation of each of the two timers. Using this SFR your program may configure each timer to be a 16-bit timer, or 13 bit timer, 8-bit auto reload timer, or two separate timers. Additionally you may configure the timers to only count when an external pin is activated or to count events that are indicated on an external pin.

9) TO (Timer 0 low/high, address 8A/8C h)

20

These two SFRs taken together represent timer 0. Their exact behavior depends on how the timer is configured in the TMOD SFR; however, these timers always count up. What is configurable is how and when they increment in value. 10) T1 (Timer 1 Low/High, address 8B/ 8D h) These two SFRs, taken together, represent timer 1. Their exact behavior depends on how the timer is configured in the TMOD SFR; however, these timers always count up. 11) P0 (Port 0, address 90h, bit addressable) This is port 0 latch. Each bit of this SFR corresponds to one of the pins on a micro controller. Any data to be outputted to port 0 is first written on P0 register. For e.g., bit 0 of port 0 is pin P0.0, bit 7 is pin p0.7. Writing a value of 1 to a bit of this SFR will send a high level on the corresponding I/O pin whereas a value of 0 will bring it to low level. 12) P1 (port 1, address 90h, bit addressable) This is port latch1. Each bit of this SFR corresponds to one of the pins on a micro controller. Any data to be outputted to port 0 is first written on P0 register. For e.g., bit 0 of port 0 is pin P1.0, bit 7 is pin P1.7. Writing a value of 1 to a bit of this SFR will send a high level on the corresponding I/O pin whereas a value of 0 will bring it to low level 13) P2 (port 2, address 0A0h, bit addressable) This is a port latch2. Each bit of this SFR corresponds to one of the pins on a micro controller. Any data to be outputted to port 0 is first written on P0 register. For e.g., bit 0 of port 0 is pin P2.0, bit 7 is pin P2.7. Writing a value of 1 to a bit of this SFR will send a high level on the corresponding I/O pin whereas a value of 0 will bring it to low level. 14) P3 (port 3, address B0h, bit addressable) Each bit of this SFR corresponds to one of the pins on a micro controller. Any data to be outputted to port 0 is first written on P0 register. For e.g., bit 0 of port 0 is pin P3.0, bit 7 is pin P3.7. Writing a value of 1 to a bit of this SFR will send a high level on the corresponding I/O pin whereas a value of 0 will bring it to low level. 15) IE (interrupt enable, 0A8h) 21

The Interrupt Enable SFR is used to enable and disable specific interrupts. The low 7 bits of the SFR are used to enable/disable the specific interrupts, where the MSB bit is used to enable or disable all the interrupts. Thus, if the high bit of IE is 0 all interrupts are disabled regardless of whether an individual interrupt is enabled by setting a lower bit.

16) IP (Interrupt Priority, 0B8h) The interrupt priority SFR is used to specify the relative priority of each interrupt. On 8051, an interrupt may be either low or high priority. An interrupt may interrupt interrupts. For e.g., if we configure all interrupts as low priority other than serial interrupt. The serial interrupt always interrupts the system, even if another interrupt is currently executing. However, if a serial interrupt is executing no other interrupt will be able to interrupt the serial interrupt routine since the serial interrupt routine has the highest priority.

17) PSW (Program Status Word, 0D0h) The program Status Word is used to store a number of important bits that are set and cleared by 8052 instructions. The PSW SFR contains the carry flag, the auxiliary carry flag, the parity flag and the overflow flag. Additionally, it also contains the register bank select flags, which are used to select, which of the R register banks currently in use.

18) SBUF (Serial Buffer, 99h) 22

SBUF is used to hold data in serial communication. It is physically two registers. One is writing only and is used to hold data to be transmitted out of 8052 via TXD. The other is read only and holds received data from external sources via RXD. Both mutually exclusive registers use address 99h.

d) I/O PORTS:
One major feature of a microcontroller is the versatility built into the input/output (I/O) circuits that connect the 8052 to the outside world. The main constraint that limits numerous functions is the number of pins available in the 8051 circuit. The DIP had 40 pins and the success of the design depends on the flexibility incorporated into use of these pins. For this reason, 24 of the pins may each used for one of the two entirely different functions which depend, first, on what is physically connected to it and, then, on what software programs are used to program the pins.

PORT 0 Port 0 pins may serve as inputs, outputs, or, when used together, as a bi directional low-order address and data bus for external memory. To configure a pin as input, 1 must be written into the corresponding port 0 latch by the program. When used for interfacing with the external memory, the lower byte of address is first sent via PORT0, latched using Address latch enable (ALE) pulse and then the bus is turned around to become the data bus for external memory.

PORT 1 Port 1 is exclusively used for input/output operations. PORTS 1 pin have no dual function. When a pin is to be configured as input, 1 is to be written into the corresponding Port 1 latch.

PORT 2 23

Port 2 may be used as an input/output port. It may also be used to supply a high order address byte in conjunction with Port 0 low-order byte to address external memory. Port 2 pins are momentarily changed by the address control signals when supplying the high byte a 16-bit address. Port 2 latches remain stable when external memory is addressed, as they do not have to be turned around (set to 1) for data input as in the case for Port 0.

PORT 3 Port 3 may be used to input /output port. The input and output functions can be programmed under the control of the P3 latches or under the control of various special function registers. Unlike Port 0 and Port 2, which can have external addressing functions and change all eight-port b se, each pin of port 3 maybe individually programmed to be used as I/O or as one of the alternate functions. The Port 3 alternate uses are:

Pin (SFR) P3.0-RXD (SBUF) P3.1-TXD (SBUF) P3.2-INTO 0 (TCON.1) P3.3 - INTO 1 (TCON.3) P3.4 - T0 (TMOD) P3.5 T1 (TMOD) P3.6 - WR P3.7 - RD

Alternate Use Serial data input Serial data output External interrupt 0 External interrupt 1 External Timer 0 input External timer 1 input External memory write pulse External memory read pulse

24

Table 3.1: Functions of port3

e) INTERRUPTS:
The AT89S52 has a total of six interrupt vectors: two external interrupts (INT0 and INT1), three timers interrupts (Timers0, 1, and 2), and the serial port interrupt. These interrupts are all shown in Figure 10. 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. 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. 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.

25

3.1.4 Pin Description

Fig 3.2: PIN description of AT89s52 26

VCC: Supply voltage. GND: Ground.

PORT0
Port 0 is an 8-bit open drain bi-directional I/O port, each pin can sink eight TTL inputs. When 1s are written to port 0 these can be used as high- impedance inputs. Port 0 can also be configured to be the multiplexed low- order address/data bus during accesses to external pro-gram and data memory.

PORT1
Port 1 is an 8-bit bi-directional I/O port with internal pull-ups. The Port 1 output buffers can sink/source four TTL inputs. When 1s are written to Port 1 pins, they are pulled high by the internal pull-ups and can be used as inputs. As inputs, Port 1 pins that are externally being pulled low will source current (IIL) because of the internal pull-ups. In addition, P1.0 and P1.1 can be configured to be the timer/counter 2 external count input (P1.0/T2) and the timer/counter 2 trigger input (P1.1/T2EX), respectively, as shown in the following table. Port 1 also receives the low-order address bytes during flash programming and verification.

Port Pin P1.0 P1.1

Alternate Functions T2 (external count input to Timer/Counter 2), clock-out T2EX (Timer/Counter 2 capture/reload trigger and direction control)

Table 3.2: Alternate functions of Port1

PORT2
Port 2 is an 8-bit bi-directional 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 27

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 highorder address bits and some control signals during Flash programming and verification.

PORT3
Port 3 is an 8-bit bi-directional I/O port with internal pull-ups. The Port 3 output buffers can sink/source four TTL inputs. When 1s are written to Port 3 pins, they are pulled high by the internal pull-ups and can be used as inputs. As inputs, Port 3 pins that are externally being pulled low will source current (IIL) because of the pull-ups. Port 3 also serves the functions of various special features of the AT89C51, as shown in the following table. Port 3 also receives some control signals for Flash programming and verification. Port Pin P3.0 P3.1 P3.2 P3.3 P3.4 P3.5 P3.6 P3.7 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) Table 3.3: Alternate functions of Port 3 RST Reset input. A high on this pin for two machine cycles while the oscillator is running resets the device. 28

ALE/PROG Address Latch Enable is an output pulse for latching the low byte of the address during accesses to external memory. This pin is also the program pulse input (PROG) during Flash programming. In normal operation, ALE is emitted at a constant rate of 1/6 the oscillator frequency and may be used for external timing or clocking Note, however, that one ALE pulse is skipped during each access to external data memory.

3.1.5 FEATURES

Compatible with MCS 8K Bytes of In-System Programmable (ISP) Flash Memory Endurance: 10,000 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)

29

3.2 POWER SUPPLY


3.2.1 Introduction
Power supply is a reference to a source of electrical power. A device or system that supplies electrical or other types of energy to an output load or group of loads is called a power supply unit or PSU. The term is most commonly applied to electrical energy supplies, less often to mechanical ones, and rarely to others This power supply section is required to convert AC signal to DC signal and also to reduce the amplitude of the signal. The available voltage signal from the mains is 230V/50Hz which is an AC voltage, but the required is DC voltage (no frequency) with the amplitude of +5V and +12V for various applications. In this section we have Transformer, Bridge rectifier, are connected serially and voltage regulators for +5V and +12V (7805 and 7812) via a capacitor (1000F) in parallel are connected parallel as shown in the circuit diagram below. Each voltage regulator output is again is connected to the capacitors of values (100F, 10F, 1 F, 0.1 F) are connected parallel through which the corresponding output (+5V or +12V) are taken into consideration.

30

Fig 3.3: Power Supply Circuit diagram

3.2.2 Transformer:
A transformer is a device that transfers electrical energy from one circuit to another through inductively coupled electrical conductors. A changing current in the first circuit (the primary) creates a changing magnetic field; in turn, this magnetic field induces a changing voltage in the second circuit (the secondary). By adding a load to the secondary circuit, one can make current flow in the transformer, thus transferring energy from one circuit to the other. The secondary induced voltage VS, of an ideal transformer, is scaled from the primary VP by a factor equal to the ratio of the number of turns of wire in their respective windings: The changing magnetic field across the windings induces an electromotive force (EMF) across each winding. Since the ideal windings have no impedance, they have no associated voltage drop, and so the voltages VP and VS measured at the terminals of the transformer, are equal to the corresponding EMFs. The primary EMF, acting as it does in opposition to the primary voltage, is sometimes termed the "back EMF". This is due to 31

Lenz's law which states that the induction of EMF would always be such that it will oppose development of any such change in magnetic field.

3.2.3. Rectifier
Here we use a bridge rectifier. A diode bridge or bridge rectifier is an arrangement of four diodes in a bridge configuration that provides the same polarity of output voltage for any polarity of input voltage. A bridge rectifier provides full-wave rectification from a two-wire AC input, resulting in lower cost and weight as compared to a center-tapped transformer design, but has two diode drops rather than one, thus exhibiting reduced efficiency over a center-tapped design for the same output voltage.

A) Basic Operation:
When the input connected at the left corner of the diamond is positive with respect to the one connected at the right hand corner, current flows to the right along the upper colored path to the output, and returns to the input supply via the lower one. When the right hand corner is positive relative to the left hand corner, current flows along the upper colored path and returns to the supply via the lower colored path. In each case, the upper right output remains positive with respect to the lower right one. Since this is true whether the input is AC or DC, this circuit not only produces DC power when supplied with AC power: it also can provide what is sometimes called "reverse polarity protection". That is, it permits normal functioning when batteries are installed backwards or DC input-power supply wiring "has its wires crossed" (and protects the circuitry it powers against damage that might occur without this circuit in place).

b) Output smoothing (Using Capacitor):


32

For many applications, especially with single phase AC where the full-wave bridge serves to convert an AC input into a DC output, the addition of a capacitor may be important because the bridge alone supplies an output voltage of fixed polarity but pulsating magnitude (see diagram above).

Fig 3.4: Bridge rectifier with shunt capacitor The function of this capacitor, known as a reservoir capacitor (aka smoothing capacitor) is to lessen the variation in (or 'smooth') the rectified AC output voltage waveform from the bridge. One explanation of 'smoothing' is that the capacitor provides a low impedance path to the AC component of the output, reducing the AC voltage across, and AC current through, the resistive load. In less technical terms, any drop in the output voltage and current of the bridge tends to be cancelled by loss of charge in the capacitor. Output can also be smoothed using a choke and second capacitor. The choke tends to keep the current (rather than the voltage) more constant. Due to the relatively high cost of an effective choke compared to a resistor and capacitor this is not employed in modern equipment.

3.2.4. Regulator
A voltage regulator is an electrical regulator designed to automatically maintain a constant voltage level. The 78xx (also sometimes known as LM78xx) series of devices is a family of self-contained fixed linear voltage regulator integrated circuits. The 78xx family is a very popular choice for many electronic circuits which require a regulated 33

power supply, due to their ease of use and relative cheapness. When specifying individual ICs within this family, the xx is replaced with a two-digit number, which indicates the output voltage the particular device is designed to provide (for example, the 7805 has a 5 volt output, while the 7812 produces 12 volts). The 78xx line is positive voltage regulators, meaning that they are designed to produce a voltage that is positive relative to a common ground. There is a related line of 79xx devices which are complementary negative voltage regulators. 78xx and 79xx ICs can be used in combination to provide both positive and negative supply voltages in the same circuit, if necessary. These 78xx ICs devices typically support an input voltage which can be anywhere from a couple of volts over the intended output voltage, up to a maximum of 35 or 40 volts, and can typically provide up to around 1 or 1.5 amps of current (though smaller or larger packages may have a lower or higher current rating). IR TX:

3.4 IR Sensor:

TSAL6200 is a high efficiency infrared emitting diode in GaAlAs on GaAs technology, molded in clear, bluegrey tinted plastic packages. In comparison with the standard GaAs on GaAs technology these emitters achieve more than 100 % radiant power improvement at a similar wavelength. The forward voltages at low current and at high pulse current roughly correspond to the low values of the standard technology. Therefore these emitters are ideally suitable as high performance replacements of standard emitters. Features Extra high radiant power and radiant intensity High reliability Low forward voltage 34

Suitable for high pulse current operation Standard T-1 ( 5 mm) package Angle of half intensity = 17 Peak wavelength p = 940 nm Good spectral matching to Si photodetectors

Applications Infrared remote control units with high power requirements Free air transmission systems Infrared source for optical counters and card readers IR source for smoke detectors. Most photo-detecting modules for industrial use are using modulated light to avoid interference by the ambient light. The detected signal is filtered with a band pass filter and disused signals are filtered out. Therefore, only the modulated signal from the light emitter can be detected. Of course, the detector must not be saturated by ambient light because it is effective when the detector is working in its linear region. In this project, pulsed light is used to cancel ambient light. This is suitable for arrayed sensors that are scanned in sequence to avoid interference from the next sensor. The microcontroller starts to scan the sensor status, sample the output voltage, turns on the LED and samples again the output voltage. The difference between the two samples is the optical current created by the LED, as the output voltage produced by the ambient light is canceled. The other sensors are also scanned the same way in sequence.

35

The IR TX and RX are placed adjacent to each other. The TX transmits the IR radiation continuously and these will pass away when there is no object interrupting the signal. The IR receiver does not receive the IR radiation in this case. When there is an obstacle or when some one interrupts the IR signal, the rays transmitted by the IR transmitter will get reflected back and these reflected rays will be received by the IR receiver. Thus, the IR receiver receives the signal now in this case. The microcontroller detects this change and does the necessary action.

1.5 WATER SPRINKLER:

The primary function is not only to detect the fire but also to extinguish the fire by means of a water sprinkler. Here the robot detects the fire by the thermistor and moves towards it. After reaching a certain distance from the fire, it sprays water at the fire, thereby extinguishing it.

3.6 L293D- Current Driver


36

Features Wide Supply-Voltage Range: 4.5 V to 36 V Separate Input-Logic Supply Internal ESD Protection Thermal Shutdown High-Noise-Immunity Inputs Functionally Similar to SGS L293 and SGS L293D Output Current 1 A Per Channel (600 mA for L293D) Peak Output Current 2 A Per Channel (1.2 A for L293D) Output Clamp Diodes for Inductive Transient Suppression (L293D)

Description The L293 and L293D are quadruple high-current half-H drivers. The L293 is designed to provide bidirectional drive currents of up to 1 A at voltages from 4.5 V to 36 V. The L293D is designed to provide bidirectional drive currents of up to 600-mA at voltages from 4.5 V to 36 V. Both devices are designed to drive inductive loads such as relays, solenoids, dc and bipolar stepping motors, as well as other high-current/high-voltage loads in positive-supply applications. All inputs are TTL compatible. Each output is a complete totem-pole drive circuit, with a Darlington transistor sink and a pseudo- Darlington source. Drivers are enabled in pairs, with drivers 1 and 2 enabled by 1,2EN and drivers 3 and 4 enabled by 3,4EN. When an 37

enable input is high, the associated drivers are enabled and their outputs are active and in phase with their inputs. When the enable input is low, those drivers are disabled and their outputs are off and in the high-impedance state. With the proper data inputs, each pair of drivers forms a full-H (or bridge) reversible drive suitable for solenoid or motor applications. On the L293, external high-speed output clamp diodes should be used for inductive transient suppression. A VCC1 terminal, separate from VCC2, is provided for the logic inputs to minimize device power dissipation. The L293 and L293D are characterized for operation from 0 to 70 degree Celsius.

38

This chip contains 4 enable pins. Each enable pin corresponds to 2 inputs. Based on the input values given, the device connected to this IC works accordingly. L293D Interfacing with 8051:

39

3.7 Electric Motors:


Electric motors are used to efficiently convert electrical energy into mechanical energy. Magnetism is the basis of their principles of operation. They use permanent magnets, electromagnets, and exploit the magnetic properties of materials in order to create these amazing machines. There are several types of electric motors available today. The following outline gives an overview of several popular ones. There are two main classes of motors: AC and DC. AC motors require an alternating current or voltage source (like the power coming out of the wall outlets in your house) to make them work. DC motors require a direct current or voltage source (like the voltage coming out of batteries) to make them work. Universal motors can work on either type of power. Not only is the construction of the motors different, but the means used to control the speed and torque created by each of these motors also varies, although the principles of power conversion are common to both. Motors are used just about everywhere. In our house, there is a motor in the furnace for the blower, for the intake air, in the sump well, dehumidifier, in the kitchen in the exhaust hood above the stove, microwave fan, refrigerator compressor and cooling fan, can

40

opener, garbage disposer, dish washer pump, clocks, computer fans, ceiling fans, and many more items. In industry, motors are used to move, lift, rotate, accelerate, brake, lower and spin material in order to coat, paint, punch, plate, make or form steel, film, paper, tissue, aluminum, plastic and other raw materials. They range in power ratings from less than 1/100 hp to over 100,000 hp. The rotate as slowly as 0.001 rpm to over 100,000 rpm. They range in physical size from as small as the head of a pin to the size of a locomotive engine. What happens when a wire carrying current is within a magnetic field?

This is the Left Hand Rule for motors. The first finger points in the direction of the magnetic field (first - field), which goes from the North pole to the South pole. The second finger points in the direction of the current in the wire (second - current). The thumb then points in the direction the wire is thrust or pushed while in the magnetic field (thumb - torque or thrust). So, when a wire carrying current is perpendicular to a magnetic field, a force is created on the wire causing it to move perpendicular to the field and direction of current. The greater the current in the wire, or the greater the magnetic field, the faster the wire moves because of the greater force created. If the current in the wire is parallel to the magnetic field, there will be no force on the wire. DC Motors

41

DC motors are fairly simple to understand. They are also simple to make and only require a battery or dc supply to make them run. A simple motor has six parts, as shown in the diagram below:

Armature or rotor Commutator Brushes Axle Field magnet DC power supply of some sort

An electric motor is all about magnets and magnetism: A motor uses magnets to create motion. If you have ever played with magnets you know about the fundamental law of all magnets: Opposites attract and likes repel. So if you have two bar magnets with their ends marked "north" and "south," then the north end of one magnet will attract the south end of the other. On the other hand, the north end of one magnet will repel the north end of the other (and similarly, south will repel south). Inside an electric motor, these attracting and repelling forces create rotational motion.

42

The armature (or rotor) is an electromagnet, while the field magnet is a permanent magnet (the field magnet could be an electromagnet as well, but in most small motors it is not in order to save power). When you put all of these parts together, here is a complete electric motor:

In the above figure, the armature winding has been left out so that it is easier to see the commutator in action. The key thing to notice is that as the armature passes through the horizontal position, the poles of the electromagnet flip. Because of the flip, the north pole

43

of the electromagnet is always above the axle so it can repel the field magnet's north pole and attract the field magnet's south pole. Even a small electric motor contains the same pieces described above: two small permanent magnets, a commutator, two brushes, and an electromagnet made by winding wire around a piece of metal. Almost always, however, the rotor will have three poles rather than the two poles as shown in this article. There are two good reasons for a motor to have three poles:

It causes the motor to have better dynamics. In a two-pole motor, if the electromagnet is at the balance point, perfectly horizontal between the two poles of the field magnet when the motor starts, one can imagine the armature getting "stuck" there. This never happens in a three-pole motor.

Each time the commutator hits the point where it flips the field in a two-pole motor, the commutator shorts out the battery (directly connects the positive and negative terminals) for a moment. This shorting wastes energy and drains the battery needlessly. A three-pole motor solves this problem as well.

It is possible to have any number of poles, depending on the size of the motor and the specific application it is being used in. Types of Motors Split Phase The split phase motor is mostly used for "medium starting" applications. It has start and run windings, both are energized when the motor is started. When the motor reaches about 75% of its rated full load speed, the starting winding is disconnected by an automatic switch. Uses: This motor is used where stops and starts are somewhat frequent. Common applications of split phase motors include: fans, blowers, office machines and tools such as small saws or drill presses where the load is applied after the motor has obtained its operating speed. Capacitor Start This motor has a capacitor in series with a starting winding and provides more than double the starting torque with one third less starting current than the split phase motor. 44

Because of this improved starting ability, the capacitor start motor is used for loads which are hard to start. It has good efficiency and requires starting currents of approximately five times full load current. The capacitor and starting windings are disconnected from the circuit by an automatic switch when the motor reaches about 75% of its rated full load speed. Uses: Common uses include: compressors, pumps, machine tools, air conditioners, conveyors, blowers, fans and other hard to start applications. Horsepower & RPM Horsepower Electric motors are rated by horsepower, the home shop will probably utilize motors from 1/4 HP for small tools and up to 5 HP on air compressors. Not all motors are rated the same, some are rated under load, others as peak horsepower and hence we have 5 HP compressors with huge motors and 5 Hp shopvacs with tiny little motors. Unfortunately all 5 HP compressor motors are not equal in actual power either, to judge the true horsepower the easiest way is to look at the amperage of the motor. Electric motors are not efficient, most have a rating of about 50% due to factors such as heat and friction and some may be as high as 70%. This chart will give a basic idea of the true horse power rating compared to the ampere rating. Motors with a higher efficiency rating will draw fewer amps, for example a 5 HP motor with a 50% efficiency rating will draw about 32 amps at 230 VAC compared to about 23 amps for a motor with a 70% rating.

45

A quick general calculation when looking at a motor is 1 HP = 10 amps on 110 volts and 1 HP = 5 amps on 220 volts. RPM The shaft on a typical shop motor will rotate at either 1725 or 3450 RPM (revolutions per minute). The speed of the driven machine will be determined by the size of pulleys used, for example a 3450 RPM motor can be replaced by a 1750 RPM motor if the diameter of the pulley on the motor is doubled. The opposite is true as well but if the pulley on the 1750 RPM motor is small it is not always possible to replace it with one half the size. It may be possible to double the pulley size on the driven machine if it uses a standard type of pulley, (not easily done on air compressors for example). Electronic speed reducers such as the ones sold for routers will not work on induction type motors. Phase, Voltage & Rotation Whether or not you can use a motor will likely depend on these factors.

46

Single Phase Ordinary household wiring is single phase, alternating current. Each cycle peaks and dips as shown. To run a three phase motor a phase converter must be used, usually this is not practical, it is often less expensive to change the motor on a machine to a single phase style.

Three Phase This is used in industrial shops, rather than peaks and valleys the current supply is more even because of the other two cycles each offset by 120 degrees.

Voltage Many motors are dual voltage i.e., by simply changing the wiring configuration, they can be run on 110 volts or 220 volts. Motors usually run better on 220 volts, especially if there is any line loss because of having to use a long wire to reach the power supply. Motors are available for both AC and DC current, our typical home wiring will be AC. There are DC converters available which are used in applications where the speed of the motor is controlled. Rotation The direction the shaft rotates can be changed on most motors by switching the right wires. The direction of rotation is usually determined by viewing the motor from the shaft end and is designated as CW (clockwise) or CCW (counter-clockwise). Inside the Wipers The wipers combine two mechanical technologies to perform their task
1.

A combination electric motor and worm gear reduction provides power to the wipers.

47

2.

A neat linkage converts the rotational output of the motor into the back-and-forth motion of the wipers. On any gear, the ratio is determined by the distances from the center of the gear to

the point of contact. For instance, in a device with two gears, if one gear is twice the diameter of the other, the ratio would be 2:1. One of the most primitive types of gears we could look at would be a wheel with wooden pegs sticking out of it. The problem with this type of gear is that the distance from the center of each gear to the point of contact changes as the gears rotate. This means that the gear ratio changes as the gear turns, meaning that the output speed also changes. If you used a gear like this in your car, it would be impossible to maintain a constant speed you would be accelerating and decelerating constantly. Worm gears These are used when large gear reductions are needed. It is common for worm gears to have reductions of 20:1, and even up to 300:1 or greater. Many worm gears have an interesting property that no other gear set has: the worm can easily turn the gear, but the gear cannot turn the worm. This is because the angle on the worm is so shallow that when the gear tries to spin it, the friction between the gear and the worm holds the worm in place. The worm gear is shown in the below figure.

48

Motor and Gear Reduction It takes a lot of force to accelerate the wiper blades back and forth across the windshield so quickly. In order to generate this type of force, a worm gear is used on the output of a small electric motor. The worm gear reduction can multiply the torque of the motor by about 50 times, while slowing the output speed of the electric motor by 50 times as well. The output of the gear reduction operates a linkage that moves the wipers back and forth. Inside the motor/gear assembly is an electronic circuit that senses when the wipers are in their down position. The circuit maintains power to the wipers until they are parked at the bottom of the windshield, and then cuts the power to the motor. This circuit also parks the wipers between wipes when they are on their intermittent setting. Linkage

49

A short cam is attached to the output shaft of the gear reduction. This cam spins around as the wiper motor turns. The cam is connected to a long rod; as the cam spins, it moves the rod back and forth. The long rod is connected to a short rod that actuates the wiper blade on the driver's side. Another long rod transmits the force from the driver-side to the passenger-side wiper blade. Operational Specifications of Motors are shown in below Table.

Description of the wiper motors selected The motor is two pole design having high energy permanent magnets, together with a gear box housing, having two stages of gear reduction .power from the motor is a transferred by a three start worm on a extension of the armature shaft through a two stage gear system. A ball bearing system is provided on the commutator end of the armature to minimize the friction losses and thereby increase torque of the wiper motor. Power from the final gear arm spindles .A special inbuilt limit switch ensures in applying regenerative braking to the OFF position. Thermal protector is connected in series with armature to avoid burning of armature under locked position. Consistent parking of the wiper arms and blades in the correct position is there by ensured. The side on which the arms come to rest is preset to requirements.

50

Electrical connections are made to the motor via a non-reversible in line plug and socket assembly .This type of connections ensures that the correct motor polarity is maintained when the motor is connected to the vehicle wiring. The wiper motor incorporates radio interference capacitor.

3.8 Driver circuit:


Digital systems and microcontroller pins lack sufficient current to drive the circuits like relays, water sprinklers, buzzer circuits, DC fans etc. While these circuits require around 10milli amps to be operated, the microcontrollers pin can provide a maximum of 12milli amps current. For this reason, a driver such as a power transistor is placed in between the microcontroller and the device.

The operation of this circuit is as follows: The input to the base of the transistor is applied from the microcontroller port pin P1.2. The transistor will be switched on when the base to emitter voltage is greater than 0.7V

51

(cut-in voltage). Thus when the voltage applied to the pin P1.2 is high i.e., P1.2=1 (>0.7V), the transistor will be switched on and thus the water sprinkler will be ON. When the voltage at the pin P1.2 is low i.e., P1.2=0 (<0.7V) the transistor will be in off state and the water sprinkler will be OFF. Thus the transistor acts like a current driver to operate the water sprinkler accordingly. Water sprinkler interfacing with the Microcontroller:

52

CHAPTER-4

SOFTWARE DEVELOPMENT
53

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

Keil Compiler:
Keil compiler is software used where the machine language code is written and compiled. After compilation, the machine source code is converted into hex code which 54

is to be dumped into the microcontroller for further processing. Keil compiler also supports C language code.

55

Proload:
Proload is software which accepts only hex files. Once the machine code is converted into hex code, that hex code has to be dumped into the microcontroller and this is done by the Proload. Proload is a programmer which itself contains a microcontroller in it other than the one which is to be programmed. This microcontroller has a program in it written in such a way that it accepts the hex file from the Keil compiler and dumps this hex file into the microcontroller which is to be programmed. As the Proload programmer kit requires power supply to be operated, this power supply is given from the power supply circuit designed above. It should be noted that this programmer kit contains a power supply section in the board itself but in order to switch on that power supply, a source is required. Thus this is accomplished from the power supply board with an output of 12volts.

56

(i)

Features

Supports major Atmel 89 series devices Auto Identify connected hardware and devices Error checking and verification in-built Lock of programs in chip supported to prevent program copying 20 and 40 pin ZIF socket on-board Auto Erase before writing and Auto Verify after writing Informative status bar and access to latest programmed file Simple and Easy to use Works on 57600 speed

Description It is simple to use and low cost, yet powerful flash microcontroller programmer for the Atmel 89 series. It will Program, Read and Verify Code Data, Write Lock Bits, Erase and Blank Check. All fuse and lock bits are programmable. This programmer has intelligent onboard firmware and connects to the serial port. It can be used with any type of computer and requires no special hardware. All that is needed is a serial communication ports which all computers have. All devices have signature bytes that the programmer reads to automatically identify the chip. No need to select the device type, just plug it in and go! All devices also have a number of lock bits to provide various levels of software and programming protection. These lock bits are fully programmable using this programmer. Lock bits are useful to protect the program to be read back from microcontroller only allowing erase to 57

reprogram the microcontroller. The programmer connects to a host computer using a standard RS232 serial port. All the programming 'intelligence' is built into the programmer so you do not need any special hardware to run it. Programmer comes with window based software for easy programming of the devices.

Programming Software Computer side software called 'Proload V4.1' is executed that accepts the Intel HEX format file generated from compiler to be sent to target microcontroller. It auto detects the hardware connected to the serial port. It also auto detects the chip inserted and bytes used. Software is developed in Delphi 7 and requires no overhead of any external DLL.

58

CHAPTER 5

59

CODE IMPLEMENTATION

CODE :
void void void void void sbit sbit sbit sbit sbit sbit sbit sbit sbit sbit

#include<reg52.h>

delay(unsigned int value); forward(void); left(void); right(void); stop(void); en1=P2^0; en2=P2^1; in1=P2^2; in2=P2^3; in3=P2^4; in4=P2^5; ir1=P1^5; ir2=P1^7; the=P1^0; mot=P1^2;

void main() { while(1) { if(the==1) { mot=1; }

60

if(ir1==0&&ir2==0) { forward(); } if(ir1==0&&ir2==1) { left(); } if(ir1==1&&ir2==0) { right(); } if(ir1==1&&ir2==1) { stop(); } } } void forward() { en1=1; en2=1; in1=1; in2=0; in3=1; in4=0; } void left() { en1=0; en2=1; in1=1; in2=0; in3=1; in4=0; } void right() { en1=1; en2=0; in1=1; in2=0; in3=1; in4=0; } void stop()

61

{ en1=0; en2=0; }

CHAPTER-6

62

CONCLUSIONS 6.1 CONCLUSION


In this project, we have studied and implemented a complete working model using a Microcontroller. The programming and interfacing of microcontroller has been mastered during the implementation. This work includes the study of LINE FOLLOWER AND FIRE EXTINGUISHER in detail. The biggest advantage of using this project is, to use where the humans cannot have a chance to extinguish the fire especially where the fire occurs frequently.

6.2 FUTURE ENHANCEMENT


As in the future robots will place a very significant role, this project can be used effectively and efficiently where the humans cannot do anything.

BIBILIOGRAPHY
63

TEXTBOOKS
Muhammad Ali Mazidi& Janice Gillispie Mazidi, The 8051 Microcontroller and Embedded Systems, 2nd Edition Kenneth Ayala, 8051 Micro controller Architecture, Programming and Applications Alkaklra & Sanjeev kumar kalkra, Architecture and Programming of 8051 Microcontroller.

REFERENCES

64

Вам также может понравиться