Você está na página 1de 49

DESIGN AND DEVELOPMENT OF MICROCONTROLLER BASED IR TRACKING/ HEAT SEEKING ROBOT WITH FIRE ALARM

A Project Report Submitted by

SHRUTI AWASTHI (1311562808) AND SAKSHI (1401562808) in partial fulfillment for the award of the degree of BACHELOR OF TECHNOLOGY
IN ELECTRONICS & COMMUNICATION At

NORTHERN INDIA ENGINEERING COLLEGE, NEW DELHI


(YEAR-2012)

DECLARATION

We hereby declare that the project entitled DESIGN AND DEVELOPMENT OF MICROCONTROLLER BASED IR TRACKING/ HEAT SEEKING ROBOT WITH FIRE ALARM submitted by us in partial fulfillment of the requirement for the award of BACHELOR OF TECHNOLOGY Degree in ELECTRONICS & COMMUNICATION, comprises our original work and due references have been made in text to all other material used. Signature of the Students: Shruti Awasthi(1311562808)

Sakshi(1401562808)

Place: Date:

CERTIFICATE

This is to certify that the project entitled DESIGN AND DEVELOPMENT OF MICROCONTROLLER BASED IR TRACKING/ HEAT SEEKING ROBOT WITH FIRE ALARM is the bonafide work carried out by student of B. Tech, NORTHERN INDIA ENGINEERING COLLEGE, NEW DELHI, during the year 2012, in partial fulfillment of the requirements for the award of the Degree of Bachelor of Technology and that the project has not formed the basis for the award of any degree earlier. Signature of the Guide:

Place: Date:

ACKNOWLEDGEMENT

We feel highly privileged to express our deep sense of gratitude to all those who helped us during our project work. We would like to express our grateful thanks for the help and advice given to us by MS. ANUPRIYA, ECE Dept. for their valuable guidance in our project.

We express our gratitude and reverence to the preceptor and project Guide for his advice, guidance and support which helped us in completing our project.

We are also highly thankful to the management of NORTHERN INDIA ENGINEERING COLLEGE, for providing necessary facilities and infrastructure.

ABSTRACT
This project is titled design and development of microcontroller based ir tracking/ heat seeking robot with fire alarm. This autonomous system tracks IR radiation in the vicinity and then moves in that respective direction together with output on Alarm The system employs 8052 microcontroller as its core and Photodiodes as sensors. The application area of microcontrollers and microprocessors is a wide area in the industry. One branch of the microcontrollers application area is control. In this Project we will design a Microcontroller controlled Robot. This is meant to simulate the real world operation of a Robot performing a fire tracking function. There are five sections, mainly

1. Sensors, 2. Power supply, 3. Transmitter Micro-controller, 4. DC Motor Driver, 5. Sound generator,

The four sensing section detects the infrared radiation from the heat source in four direction (Right, Centre, Left and rear), the output of the sensors is fed to the low power dual operational amplifier used as comparator. A threshold value is set through potentiometer; the input signal from sensor is compared with this threshold value. The controller section process the information from the comparator and provide input to the driver section, which has two DC motor for driving the robot depending on the input sequence obtain the micro controller performs the sequential operations and gives outputs decision which is a sequence of bits to drive a DC motor.

Since the micro controller output is not sufficient to drive the DC motor, a transistor and relay has been used to drive the motors. In the process of reaching the target if an obstacle is encountered the robot changes its path and again start tracking the incoming IR radiation. An alarm will run when robot detects fire in any direction.

TABLE OF CONTENT
CHAPTER TITTLE Project Tittle Introduction Methodology of Design Objective & Scope of the Project Objective Scope Proposed circuit diagram & its description Circuit diagram Description List of Components Hardware design & Development Comparator LM-358 Microcontroller Crystal oscillator Alarm system Reset switch Potentiometer Voltage regulator Power transistor Resistor & Capacitor Relay 12V DC motor Photo diode LED BC548 Diode Software design & development S/W programming using keil C of microcontroller S/W for designing circuit on general purpose PCB Software code Flowcharts of the project Flowchart for the software code Flowchart of subroutine delay Results & Conclusion Future Prospect Bibliography & References PAGE NO. 7 8 9 11 11 11 12 12 13 16 17 17 18 24 24 26 26 26 27 29 29 31 31 32 33 33 35 35 42 43 45 45 46 47 48 49

1 2 3 3.1 3.2 4 4.1 4.2 5 6 6.1 6.2 6.3 6.4 6.5 6.6 6.7 6.8 6.9 6.10 6.11 6.12 6.13 6.14 6.15 7 7.1 7.2 8 9 9.1 9.2

PROJECT ON

DESIGN AND DEVELOPMENT OF MICROCONTROLLER BASED IR TRACKING/ HEAT- SEEKING ROBOT WITH FIRE ALARM

CHAPTER 1 INTRODUCTION
Automatic system like robots carry out specific tasks. These systems are usually employed in environments where conditions keep changing. The robots described here sense the near infrared radiation (.8m-1m) and moves toward that direction. This robot is designed keeping in mind mainly for two applications viz. Heat seeking missile and automatic fire extinguisher. There are four sections, mainly sensor, comparator, Micro-controller, and DC Motor Driver. The sensing section detects the infrared radiation. The controller section process the information from the sensor and provide input to the driver section, which has DC motor for driving the robot, the output of the sensors is fed to the comparator, which serves as the input to the micro controller. Depending on the input sequence obtain the micro controller performs the sequential operations and gives output decisions which is a sequence of bits to drive a DC motor.

As a Heat Seeking Missile:

The heat-seeking missile is a special kind of missile that not only reaches the target emitting heat radiations (Aircraft, Ship or Boat) but also tracks it. As the target moves, it follows the target and finally hits it. The missile is based on the concept of detecting and following the heat-radiating source. The robot designed for two-dimensional motions, performs the task of a heat seeking missile as it tracks heat radiating object.

As a Fire Extinguisher:

The robot can be used as a highly sophisticated fire extinguisher. The fire extinguisher, when it detects fire, will move toward fire, deviating away from any obstacle, and extinguish the fire.

CHAPTER 2 Methodology of Design


Block Diagram

There are five sections, mainly 1. Sensors, 2. Power supply, 3. Transmitter Micro-controller, 4. DC Motor Driver, 5. Sound generator,

The four sensing section detects the infrared radiation from the heat source in four direction (Right, Centre, Left and rear), the output of the sensors is fed to the low power dual operational amplifier used as comparator. A threshold value is set through potentiometer; the input signal from sensor is compared with this threshold value. The controller section process the information from the comparator and provide input to the driver section, which has two DC motor for driving the robot depending on the input sequence obtain the micro controller performs the sequential operations and gives outputs decision which is a sequence of bits to drive a DC motor.

Since the micro controller output is not sufficient to drive the DC motor, a transistor and relay has been used to drive the motors. In the process of reaching the target if an obstacle is encountered the robot changes its path and again start tracking the incoming IR radiation. An alarm will run when robot detects fire in any direction.

10

CHAPTER 3 OBJECTIVE AND SCOPE OF THE PROJECT


3.1. OBJECTIVE: The basic objective behind the development of this project arises due to the fact that with the increasing application of Artificial Intelligence systems in our day to day life thereby making it automated and in order to accord with such systems and environment, the existing system needs to be replaced by other such intelligent systems such as a Robot. So, to tackle with the problems related to Fire detection our project plays a very efficient role as it can be employed in all major remote areas ex. high speed Line Tunnels so as to protect it from fire threats. Another significant role played by this project is in the industrial field such as oil refineries, chemical industries and coal mines, etc. Its other objectives include usage in the remote buildings, areas requiring minimum manhandling, and residential apartments and also in the war field.

3.2. SCOPE:

In the real world scenario, this wired system can be developed into a Wireless fire detection and suppression system so as to overcome the problem of fire in machines. Such a system would require wireless techniques to send and receive signals from various units and to start with the extinguishing system. Our current system only performs the function of fire detection but its application can be increased to fire suppression by addition of an extinguishing system. Another possible scope for the project is in the war field where it can be employed as the Heat Seeking Missile.

11

CHAPTER 4 PROPOSED CIRCUIT DIAGRAM AND ITS DESCRIPTION


4.1. PROPOSED CIRCUIT DIAGRAM:

Fig.4.1 the complete Circuit diagram of the system

12

4.2.

DESCRIPTION OF PROPOSED CIRCUIT:

There are IR sensors located outside the body of the robot namely left side, right side, rear side and at the center. These sensors will detect IR radiations from the fire source (like a candle).This input analog signal is feed to the op-amp in form of digital signal. The sensor can detect fire in any possible direction. If robot detects fire source in its right; the right sensor will detect the infrared rays from the source. It will give signal to the microcontroller through op-amp. Meanwhile the other sensors will not provide any signal. The sensing circuit of ROBOT is as below:

Fig.4.2 sensing circuit diagram

The comparator (LM358) compares the input digital signal with the threshold value set by the potentiometer. It will allow signals higher than threshold level to provide digital input to the microcontroller. The output of the microcontroller is feed to the motor driver circuit. The output of the four respective motor driver circuits is then provided to the motor.

Each motor driver circuit consists of a transistor (TIP122) and a relay. When there is a special bit sequence at the input of the microcontroller, it starts working in its active low condition. In this case the relay switches to normally closed condition which is connected to the +12V supply. In this

13

transistor acts like a switch .In active low condition collector is grounded i.e. providing ground to relay (normally closed). A diode is placed to prevent back EMF due to relay. A relay based D.C motor driver circuit is introduced as as follows:

Fig. 4.3 D.C motor driving circuit The output of microcontroller is fed to the transistor TIP122. For motor one output is taken from pin 0 & pin 1(P1.0, P1.1).For motor two it is from PIN 2 & 3(P1.2&P1.3). The table shown below gives the values of pin 0, pin 1, pin 2, pin 3 for two dimensional motion of DC motor: P1.0 P1.1 RLY O/P1 RLY O/P2 DC MOTOR1 P1.2 P1.3 RLY O/P3 RLY O/P4 DC MOTOR2

0V

0V

STOP

0V

0V

STOP

0V

12V

RUN CW

0V

12V

RUN CW

12V

0V

RUN CCW STOP

12V

0V

RUN CCW STOP

12V

12V

12V

12V

Table 4.1 the output values of microcontroller that fed to the transistor TIP122

14

From the above truth table it is clear that both the motor can run either in clock wise or in counter clock wise direction as per requirement. We are already given a +12V supply at the normally open point of relay and Ground at normally close point of relay. When input of TIP122 i.e. ports 1.0 gets high transistor conduct and a ground goes to the coil of relay makes it energized. It results a +12v supply at common point of relay. There are two similar relay for one DC motor to rotate in both direction. A reverse diode is used across the coil of relay to avoid back EMF of relay. A freewheeling diode is applied here to avoid back EMF of DC motor. So a two dimensional motion can be achieved from robot by using two DC motor.

A table for direction of Robot is as follows: Motor Left Motor Right Direction of Robot

Clock wise

Clock wise

Forward motion

Clock wise

Stop

Turn right

Stop

Clock wise

Turn left

Counter clock wise

Counter clock wise

Reverse motion

Table 4.2 directions of Robot

15

CHAPTER 5 LIST OF COMPONENTS


Sensor Photodiode OP-AMP(LM358) Crystal oscillator (11.0592MHz) Resistances Capacitances Potentiometer Voltage regulator (7805) Power transistor (TIP 122) IC with bases (LM7805, AT89S52, UM3561, LM358) LEDs DIODE Speaker Switches (push to on) Relay Transistors (BC 548) 12v Battery 12V DC Motor General purpose PCB Connecting wires Soldering kit

16

CHAPTER 6 HARDWARE DESIGN AND DEVELOPMENT

The hardware comprises of various components used in making the entire project. These include different ICs, passive components, transistors, etc. A detail of all the components used are given below:

6.1. COMPARATOR LM-358 Pin description of comparator LM-358 is given below:

Fig.6.1.1. pin details of comparator LM-358

Features: Available in 8-Bump micro SMD chip sized package Internally frequency compensated for unity gain Large dc voltage gain: 100 dB Wide bandwidth (unity gain): 1 MHz (temperature compensated) Wide power supply range: Single supply: 3V to 32V or dual supplies: 1.5V to 16V Very low supply current drain (500 A)-essentially independent of supply voltage Low input offset voltage: 2 mV Input common-mode voltage range includes ground Differential input voltage range equal to the power supply voltage Large output voltage swing

17

Description: The LM358 series consists of two independent, high gain, internally frequency compensated operational amplifiers which were designed specifically to operate from a single power supply over a wide range of voltages. Operation from split power supplies is also possible and the low power supply current drain is independent of the magnitude of the power supply voltage. Application areas include transducer amplifiers, dc gain blocks and all the conventional op amp circuits which now can be more easily implemented in single power supply systems. For example, the LM158 series can be directly operated off of the standard +5V power supply voltage which is used in digital systems and will easily provide the required interface electronics without requiring the additional 15V power supplies.

6.2. MICROCONTROLLER AT89S52

Fig.6.2.1. photo of microcontroller AT89S52

Features: Compatible with MCS-51 Products 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 32 Programmable I/O Lines

18

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)

Description: 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 Atmels highdensity nonvolatile 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 nonvolatile 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 costeffective 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 sixvector 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.

19

PIN DIAGRAM OF AT89S52

Fig.6.2.2. pin diagram of AT89S52

Pin Configuration: Pin 1 to pin 8 Pin 9 Pin 10 to pin 17 = Port 1.0 to Port 1.7 = RST = Port 3.0 to Port 3.7

Pin 18 and 19 = XTAL2 and XTAL1 Pin 20 Pin 21 to pin 28 Pin 29, 30 and 31 Pin 32 to pin 39 Pin 40 = GND = Port 2.0 to Port 2.7 = PSEN, ALE / PROG and EA / VPP = Port 0.7 to Port 0.0 = VCC

20

Pin Description: VCC = Supply voltage. GND = Ground. Port 0 = Port 0 is an 8-bit open drain bidirectional I/O port. As an output port, each pin can sink eight TTL inputs. When 1s are written to port 0 pins, the pins 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 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 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 P1.5 P1.6 P1.7 Alternate Functions T2 (external count input to Timer/Counter 2), clockout T2EX (Timer/Counter 2 capture/reload trigger and direction control) MOSI (used for In-System Programming) MISO (used for In-System Programming) SCK (used for In-System Programming) Table 6.2.1 port1 description table

21

Port 2 = 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 is an 8-bit bidirectional 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 receives some control signals for Flash programming and verification. Port 3 also serves the functions of various special features of the AT89S52, as shown in the following table. Port Pin Alternate Functions P3.0 RXD (serial input port) P3.1 TXD (serial output port) P3.2 INT0 (external interrupt 0) P3.3 INT1 (external interrupt 1) P3.4 T0 (timer 0 external input) P3.5 T1 (timer 1 external input) P3.6 WR (external data memory write strobe) P3.7 RD (external data memory read strobe) Table 6.2.2 port3 description table

22

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 98 oscillator periods after the Watchdog times out. The DISRTO bit in SFR AUXR (address 8EH) can be used to disable this feature.

ALE/PROG = 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 (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 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 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.

PSEN = Program Store Enable (PSEN) is the read strobe to external program memory. When the AT89S52 is executing code from external program memory, PSEN is activated twice each machine cycle, except that two PSEN activations are skipped during each access to external data memory.

EA / VPP = External Access Enable. EA must be strapped to GND in order to enable the device to fetch code from external program memory locations starting at 0000H up to FFFFH. Note, however, that if lock bit 1 is programmed, EA will be internally latched on reset. EA should be strapped to VCC for internal program executions. This pin also receives the 12-volt programming enable voltage (VPP) during Flash programming.

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

23

XTAL2 = Output from the inverting oscillator amplifier.

6.3. CRYSTAL OSCILLATOR

Fig.6.3.1. photo of crystal oscillator A crystal oscillator is an electronic oscillator circuit that uses the mechanical resonance of a vibrating crystal of piezoelectric material to create an electrical signal with a very precise frequency. This frequency is commonly used to keep track of time (as in quartz wristwatches), to provide a stable clock signal for digital integrated circuits, and to stabilize frequencies for radio transmitters and receivers. The most common type of piezoelectric resonator used is the quartz crystal, so oscillator circuits designed around them became known as "crystal oscillators. We have used crystal oscillator of 11.0592 MHz in our project.

6.4 ALARM CIRCUIT

UM3561:

It is an excellent ROM IC that can generate Multi siren tones simulating Police siren, Ambulance siren, Fire brigade siren and Machine gun sound. This 8 pin low power IC can work down to 2.4 volts. The UM 3561 is a low cost siren generator designed for use in toy applications. The IC has an inbuilt oscillator and tone selection pins. It is easy to make a siren generator with only a few external components. Only one external resistor and a speaker driver transistor are sufficient to make a simple siren generator.

24

Fig.6.4.1 pin description of UM3561

Circuit diagram for alarm circuit:

Fig.6.4.2. circuit diagram for various alarm system

25

6.5. RESET SWITCH Push to ON: In electronics and technology, a reset button is a button that can reset a device. The reset button clears the memory and reboots the machine forcibly. Reset buttons are found on circuit breakers to reset the circuit. This button can cause data corruption so this button often doesn't exist on many machines. Usually, in computers, it is present as a small button, possibly recessed into the case, to prevent accidentally pressing it. The RESET button was used at the microcontroller input in order to set all the levels to null in the process. This was used simultaneously with an LED.

6.6. POTENTIOMETER A potentiometer (colloquially known as a "POT") is a three-terminal resistor with a sliding contact that forms an adjustable voltage divider. If only two terminals are used (one side and the wiper), it acts as a variable resistor or rheostat. Potentiometers are commonly used to control electrical devices such as volume controls on audio equipment. Potentiometers operated by a mechanism can be used as position transducers, for example, in a joystick. Potentiometers are rarely used to directly control significant power (more than a watt). Instead they are used to adjust the level of analog signals (e.g. volume controls on audio equipment), and as control inputs for electronic circuits. POT is used to set a threshold level on the Comparator such that it gives a reference voltage for the input signal on which the output of the microcontroller can be decided. The reference voltage was set as 4 V in the project. POT is also used in our project to vary the brightness of the LCD.

6.7. VOLTAGE REGULATOR A voltage regulator is an electrical regulator designed to automatically maintain a

constant voltage level. It may use an electromechanical mechanism, or passive or active electronic components. Depending on the design, it may be used to regulate one or more AC or DC voltages.

26

The 78XX / 79XX voltage regulator is a 3 pin regulator used in the circuit. The following are the ways to determine the type of regulator: The first 2 digits 78 / 79 specify it as a positive / negative voltage regulator respectively. The XX specifies the amount of voltage after regulation is applied, e.g., 7805 specifies a positive regulator with 5 volts at output end. The first pin of the regulator is input pin, the second is ground pin and the third is the output pin. The head of the regulator is made of metal because it helps in dissipating of neglected voltage in form of heat energy. Hence, in the project, positive regulator 7805 is used. 6.8. POWER TRANSISTOR

TIP 122:

Fig.6.8.1. photo of transistor TIP122

A transistor is a semiconductor device used to switch and amplify signals. It is made of a solid piece of semiconductor material, with at least three terminals for connection to an external circuit. A voltage or current applied to one pair of the transistor's terminals changes the current flowing through another pair of terminals. Because the controlled (output) power can be much more than the controlling (input) power, the transistor provides amplification of a signal. Today, some transistors are packaged individually, but many more are found embedded in integrated circuits.

27

Transistor packages are made of glass, metal, ceramic, or plastic. The package often dictates the power rating and frequency characteristics. Power transistors have larger packages that can be clamped to heat sinks for enhanced cooling. Additionally, most power transistors have the collector or drain physically connected to the metal can/metal plate. Specifications: Collector Emitter voltage Collector Base voltage Emitter Base voltage Base Current = = = = 100 V 100 V 5V 120 mA

Darlington 5 Ampere Complementary Silicon Power Transistors:

Fig.6.8.2. darlington 5amp complementary silicon power transistor 6080100 VOLTS 65 WATTS designed for generalpurpose amplifier and lowspeed switching applications. High DC Current Gain hFE = 2500 4.0 Adc CollectorEmitter Sustaining Voltage @ 100 mAdc VCEO(sus) = 60 Vdc (Min) TIP120, TIP125 80 Vdc (Min) TIP121, TIP126 100 Vdc (Min) TIP122, TIP127 Low CollectorEmitter Saturation Voltage-VCE(sat) = 2.0 Vdc (Max) @ IC = 3.0 Adc 4.0 Vdc (Max) @ IC = 5.0 Adc Monolithic Construction with BuiltIn BaseEmitter Shunt Resistors TO220AB Compact Package

28

6.9. RESISTORS AND CAPACITORS A resistor is a two-terminal electronic component that produces a voltage across its terminals that is proportional to the electric current passing through it in accordance with Ohm's law: V = IR Resistors are elements of electrical networks and electronic circuits and are ubiquitous in most electronic equipment. Practical resistors can be made of various compounds and films, as well as resistance wire (wire made of a high-resistivity alloy, such as nickel/chrome). The primary characteristics of a resistor are the resistance, the tolerance, maximum working voltage and the power rating. Other characteristics include temperature coefficient, noise, and inductance. Less well-known is critical resistance, the value below which power dissipation limits the maximum permitted current flow, and above which the limit is applied voltage. Critical resistance is determined by the design, materials and dimensions of the resistor.

A capacitor is a passive electronic component consisting of a pair of conductors separated by a dielectric (insulator). When there is a potential difference (voltage) across the conductors a static electric field develops in the dielectric that stores energy and produces a mechanical force between the conductors. An ideal capacitor is characterized by a single constant value, capacitance, measured in farads. This is the ratio of the electric charge on each conductor to the potential difference between them. Capacitors are widely used in electronic circuits for blocking direct current while allowing alternating current to pass, in filter networks, for smoothing the output of power supplies, in the resonant circuits that tune radios to particular frequencies and for many other purposes. Different values of resistors and capacitors were used in the project in accordance with the circuit discussed later.

6.10. RELAY A relay is an electrically operated switch. Many relays use an electromagnet to operate a switching mechanism mechanically, but other operating principles are also used. Relays are used where it is necessary to control a circuit by a low-power signal (with complete electrical isolation between control and controlled circuits), or where several circuits must be controlled by one signal.

29

Fig.6.10.1. photo of relay Features:


A contactor is a relay that is used for switching power. They usually handle very heavy loads like an electric motor, lighting and heating equipments and so on.

Though their output is used for switching very high loads, they are controlled by a circuit with very less power.

According to the loads they handle, they vary in sizes from a small device to as huge as a yard.

Though they are used for switching purposes, they do not interrupt a short-circuit current like a circuit breaker.

They have ratings ranging from a breaking current of a few amperes and 24 DC volts to thousands of amperes with many kilo volts.

Fig.6.10.2. single pole double throw realy This is a Single Pole Double Throw relay. Current will flow between the movable contact and one fixed contact when the coil is DE-energized and between the movable contact and the alternate fixed contact when the relay coil is energized. The most commonly used relay in car audio, the Bosch relay, is a SPDT relay.

30

6.11. 12V DC MOTOR 200 RPM 12V DC geared motor for robotics application .Very easy to use and available in standard size. Nut and thread on shaft to easily connect and thread shaft for easily connection to the wheel.

Features: 3 ORPM 12V DC Motor with gearbox 66mm shaft diameter with internal hole 125gm weight Small size motor 2kgcm torque No load current = 60(mA),Load current = 300(mA)

6.12. PHOTODIODE: A photodiode is a type of photo detector capable of converting light into either current or voltage, depending upon the mode of operation. The common, traditional solar cell used to generate electric solar power is a large area photodiode. Photodiodes are similar to regular semiconductor diodes except that they may be either exposed (to detect vacuum UV or X-rays) or packaged with a window or optical fiber connection to allow light to reach the sensitive part of the device. Many diodes designed for use specifically as a photodiode use a PIN junction rather than a p-n junction, to increase the speed of response. A photodiode is designed to operate in reverse bias. 6.12.1. Principle of operation A photodiode is a p-n junction or PIN structure. When a photon of sufficient energy strikes the diode, it excites an electron, thereby creating a free electron (and a positively charged electron hole). This mechanism is also known as the inner photoelectric effect. If the absorption occurs in the junction's depletion region, or one diffusion length away from it, these carriers are swept from the junction by the built-in field of the depletion region. Thus holes move toward the anode, and electrons toward the cathode, and a photocurrent is produced. This photocurrent is the sum of both the dark current (without light) and the light current, so the dark current must be minimized to enhance the sensitivity of the device.

31

6.13. LIGHT EMITTING DIODE (LED): A light-emitting diode (LED) is a semiconductor light source. LEDs are used as indicator lamps in many devices and are increasingly used for other lighting. Introduced as a practical electronic component in 1962, early LEDs emitted low-intensity red light, but modern versions are available across the visible, ultraviolet, and infrared wavelengths, with very high brightness. When a light-emitting diode is forward-biased (switched on), electrons are able to recombine with electron holes within the device, releasing energy in the form of photons. This effect is called electroluminescence and the color of the light (corresponding to the energy of the photon) is determined by the energy gap of the semiconductor. LEDs are often small in area (less than 1 mm2), and integrated optical components may be used to shape its radiation pattern. LEDs present many advantages over incandescent light sources including lower energy consumption, longer lifetime, improved robustness, smaller size, and faster switching. LEDs powerful enough for room lighting are relatively expensive and require more precise current and heat management than compact fluorescent lamp sources of comparable output.

Fig.6.13.1. symbol of LED

Fig.6.13.2. Schematic diagram of working of an LED

32

6.14. BC548: The BC548 is a general purpose epitaxial silicon NPN transistor. The part number is assigned by Pro Electron, which allows many manufacturers to offer electrically and physically interchangeable parts under ones identification. It is used in our alarm circuit. If the plastic TO-92 package is held in front of one's face with the flat side facing toward you and the leads downward, the order of the leads, from left to right is collector, base, emitter.

Fig.6.14.1. photo of BC548

6.15. DIODE: A diode is a two-terminal electronic component that conducts electric current in only one direction. A semiconductor diode is a crystalline piece of semiconductor material connected to two electrical terminals. A vacuum tube diode is a vacuum tube with two electrodes: a plate and a cathode. The most common function of a diode is to allow an electric current to pass in one direction while blocking current in the opposite direction. Thus, the diode can be thought of as an electronic version of a check valve. This unidirectional behavior is called rectification, and is used to convert alternating current to direct current and to extract modulation from radio signals in radio receivers. When p-type and n-type materials are placed in contact with each other, the junction is depleted of charge carriers and behaves very differently than either type of material. The electrons in n-type material diffuse across the junction and combine with holes in p-type material. The region of the p-type material near the junction takes on a net negative charge because of the electrons attracted. Since electrons departed the N-type region, it takes on a localized positive charge. The thin layer of the crystal lattice between these charges has been

33

depleted of majority carriers, thus, is known as the depletion region. It becomes nonconductive intrinsic semiconductor material. This separation of charges at the p-n junction constitutes a potential barrier, which must be overcome by an external voltage source to make the junction conduct. The electric field created by the space charge region opposes the diffusion process for both electrons and holes. There are two concurrent phenomena: the diffusion process that tends to generate more space charge and the electric field generated by the space charge that tends to counteract the diffusion.

6.15.1. P-N junction in thermal equilibrium with zero bias voltage applied

6.15.2. Forward and reverse bias characteristics of a diode and its circuit symbol

34

CHAPTER 7 SOFTWARE DESIGN AND DEVELOPMENT


KEILC IDE SPIPGM Converts code from C to Hex. Code (Assembly Language) For programming Burning

This project requires some prerequisites which one must possess so as to work on this project and achieve the given output within a given amount of time.

7.1. SOFTWARE PROGRAMMING USING KEIL C OF MICROCONTROLLER

The software for Fire Alarm system using Microcontroller has been written in the C language and it is converted to assembly language using cross complier Keil UV Vision. Keil was founded in 1986 to market add-on products for the development tools provided by many of the silicon vendors. Keil implemented the first C compiler designed from the ground-up specifically for the 8051 microcontroller.

Keil C51 Cross Compiler: The 8051 Family is one of the fastest growing Microcontroller Architectures. More than 500 device variants available. Keil provides several development tools for these 8051 variants. C51 Compiler A51 Macro Assembler BL51 Linker/Locater

Software Development Cycle in Keil: Create a project, select the target chip from the device database, and configure the tool settings. Create source files in C. Build your application with the project manager.

35

Correct errors in source files. Test the linked application

Create a Project File: To create a new project file select from the Vision menu Project New Project. This opens a standard Windows dialog that asks you for the new project file name. We suggest that you use a separate folder for each project.

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

Create New Source Files:

36

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

37

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

Set Tool Options for Target: Vision lets you set options for your target hardware. The dialog Options for Target opens via the toolbar icon or via the Project - Options for Target menu item. In the Target tab

38

you specify all relevant parameters of your target hardware and the on-chip components of the device you have selected.

Build Project and Create a HEX File

You may translate all source files and line the application with a click on the Build Target toolbar icon. When you build an application with syntax errors, Vision will display errors and warning messages in the Output Window Build page.

A double click on a message line opens the source file on the correct location in a Vision editor window

39

Build Project and Create a HEX File:

Once you have successfully generated your application you can start debugging using the Vision Debugger. After you have tested your application, it might be required to create an Intel HEX file and to download the application software into the physical device using a Flash programming utility.

Vision creates HEX files with each build process when Create HEX file under Options for Target Output is enabled.

Output Files

The Cx51 Compiler generates a number of output files during compilation. By default, each output file shares the same filename as the source file, each has a different file extension.

40

.LST

Files with this extension are listing files that contain the formatted source text along with any errors detected by the compiler. Listing files may optionally contain the symbols used and the assembly code generated.

.OBJ

Files with this extension are object modules that contain relocatable object code. Object modules may be linked to an absolute object module by the Lx51 Linker/Locator.

.I

Files with this extension contain the source text as expanded by the preprocessor. All macros are expanded and all comments are deleted in this listing.

.SRC

Files with this extension are assembly source files generated from your C source code. These files can be assembled with the A51 Assembler.

.Hex

Image of the machine code generated, to be burnt onto the target device.

41

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

7.2. SOFTWARE FOR DESIGNING CIRCUIT ON GENERAL PURPOSE PCB EXPRESS PCB:

There are two parts to Express PCB, the CAD software and the board manufacturing service. The CAD software includes Express SCH for drawing schematics and Express PCB for designing circuit boards. After completing the PC board design, it provides a low cost, high quality and fast source for having our boards made. Here is how it works:

1. Draw a schematic using Express SCH. Drawing a schematic is not required, but it

will save us time when designing our board and reduce the possibility of wiring errors.
2.

Next, use the Express PCB program to lay out the PC board.

If we link our

schematic to the Express PCB program, the program will guide us through the wiring process by highlighting how the components should be connected

42

CHAPTER 8 SOFTWARE CODE


#include <reg51.h> sbit right = P2^1; sbit centre=P2^3; sbit left=P2^0; sbit alarm=P3^0; sbit mr1=P1^2; sbit mr2=P1^3; sbit ml1=P1^0; sbit ml2=P1^1; //sensor connection

//alarm is connected //right motor //left motor

//definition of the delay function void delay() { unsigned int i=30000; while(i--); } //definition of main function void main() { right=1; left=1; centre=1; ml1=1; ml2=1; mr1=1; mr2=1; alarm=0; while(1) { if(left) { alarm=1; mr1=1; mr2=0; ml1=1; ml2=1; delay(); } //ON the alarm

//configure as input pin

//stop all the motors //OFF the alarm

//forward the right motor

43

ifelse(right) { alarm=1; mr1=1; mr2=1; ml1=1; ml2=0; delay(); } ifelse(centre) { alarm=1; mr1=1; mr2=0; ml1=1; ml2=0; delay(); delay(); } //ON the alarm //ON the alarm

//forward the left motor

//forward the both the motors

if(!(left||right||centre)) { alarm=0; } } }

// OFF the alarm

44

CHAPTER 9 FLOWCHARTS OF THE PROJECT


9.1. FLOWCHART FOR THE SOFTWARE CODE:

45

9.2. FLOWCHART OF SUBROUTINE DELAY:

46

RESULT AND CONCLUSION


The Robot has been tested successfully. The designed robot is capable to move in left, right, rear and forward direction when it got a fire signal or IR radiation from their respective sides. This robot has proved the tracking of fire and IR radiation. Robot is also capable of energizing fire alarm and a visual LED lighting indication on getting IR radiation. A step-by-step approach in designing the simplex fire tracking robot has been followed. The results obtained from the calculations have shown that the system performance is quite reliable and accurate.

47

FUTURE PROSPECTS
This robot can be modified for its better performance and more technological advancement. Presently, the robot can detect the fire and track it by following the fire, but it is only a one time fire extinguishing system where we are having the fire suppression system and if the fire continues, the robot will go in fireplace but would not stop a particular distance before the fireplace and start the fire suppression action. This feature can be added in the future and also send the corresponding signals to the receiver about the direction, name of the location/place, proceeding of the fire suppression, time taken to suppress the fire, transmission can be done in both the direction, and the base station can also control the robot, monitor its actions and define the zones for a number of such zone wise distributed and allocated robots, send the signals to the particular robot according to the zone on fire. Such a system would be completely autonomous. We can also interface the current robot with a PC by using RS232 protocol, MAX232 IC, DB9 cable connector which will connect our robot with an PC. By this feature we can track the exact movement of the robot from a far off location. This feature can be used for security purposes. We can also interface a GSM module with our current system which will inform the user in case the robot detects the fire by sending an SMS to the users mobile phone. This feature will enable quick response from the user.

48

BIBLIOGRAPHY & REFERENCES


BOOKS: 1. Operational Amplifiers Linear Integrated Circuits, Ramakant Gayakwad, Prentice of India, 3rd Edition. Hall

2. Electronic Devices and Circuits, J.B.Gupta, Katsons Books. 3. The 8051 microcontroller and embedded systems, Muhammad Ali Mazidi and Janice Gillispie Mazidi, Prentice hall of India Pvt. Limited. 4. Electronic Devices Robert Boylstead, Prentice Hall.

INTERNET SITES: www.datasheetarchive.com www.datasheetcatalog.com www.ieee.org http://robokits.co.in www.alldatasheet.com http://www.expresspcb.com/ http://www.fairchildsemi.com/ www.atmel.com

49

Você também pode gostar