Gas Leakage Detection B-11

72
STOP AND GO DRIVING SYSTEM A Mini project report submitted in partial fulfillment of the requirements for the award of the degree of BACHELOR OF TECHNOLOGY IN ELECTRONICS AND COMMUNICATION ENGINEERING Submitted by T.ABHISHEK NELSON (08C91A04B6) SANDEEP (07C91A0490) CH.SRINATH REDDY (08C91A04B5) Under the noble guidance of Mr. Buchiraju Asst. professor

Transcript of Gas Leakage Detection B-11

Page 1: Gas Leakage Detection B-11

STOP AND GO DRIVING SYSTEM

A Mini project report submitted in partial fulfillment of the requirements for the award of the degree of

BACHELOR OF TECHNOLOGY

IN

ELECTRONICS AND COMMUNICATION ENGINEERING

Submitted by

T.ABHISHEK NELSON (08C91A04B6)

SANDEEP (07C91A0490)

CH.SRINATH REDDY (08C91A04B5)

Under the noble guidance of

Mr. Buchiraju

Asst. professor

How did they come to know

DEPARTMENT OF ELECTRONICS AND COMMUNICATION ENGINEERING

HOLY MARY INSTITUTE OF TECHNOLOGY & SCIENCEBogaram (V), Keesara (M), R.R.Dist-501301

(Affiliated to JNTU, Hyderabad)

Page 2: Gas Leakage Detection B-11

2008-2012

HOLY MARY INSTITUTE OF TECHNOLOGY & SCIENCE(COLLEGE OF ENGINEERING)

BOGARAM (V), KESSARA (M), R.RDIST-501301(Affiliated to JNTU, Hyderabad)

2010-2011DEPARTMENT OF ELECTRONICS AND COMMUNICATION ENGINEERING

CERTIFICATE

This is to certify that the Mini Project entitled “STO AND GO DRIVING SYSTEM” is being submitted

byT.ABHISHEK NELSON (O8C91A04B6), SANDEEP (07C91A0490) and CH,SRINATH REDDY

(08C91A04B5)in the partial fulfillment for the award of Degree of Bachelor of Technology “ELECTRONICS

AND COMMUNICATION ENGINEERING” to JAWAHARLAL NEHRU TECHNOLOGY

UNIVERSITY is a record of bonafide work carried out by him/her. The results embodied in this project have

not been submitted to any other university or institute for the award of any degree or diploma.

Internal Guide Head of the department

Mr. Buchiraju K. V. Murali Mohan

Asst. professor professor

Page 3: Gas Leakage Detection B-11

ACKNOWLEDGMENT

We take this opportunity to thank all those persons who rendered their full support to our work the

pleasure, the achievement, the glory, the satisfaction, the reward, the appreciation and the construction of this

regular schedule spared their valuable time for us. This acknowledgement is not just a position of works but

also an account of indictment that have been a guiding and source of inspiration towards the completion of this

project.

We express my gratitude to Dr. Subash Chandra, principal of HOLY MARY INSTITUTE OF TECHNOLOGY & SCIENCES, for giving us opportunity to do this project work. We are thankful to Prof. R.V. AMARNATH , head of department of Electrical and Electronics department, who with his continuous efforts, constant support and providing us the right infrastructure helped us in completing this project.

We also like to express our sincere gratitude and special thanks to our internal guide Mr. Y.NARESH KUMAR, Asst. professor, Department of Electrical Engineering, HOLY MARY INSTITUTE OF TECHNOLOGY & SCIENCES, for his invaluable suggestions, constant encouragement and support towards the completion of this project.

Finally we would like to thank our parents and all our friends for their valuable suggestions and support

which directly or indirectly helped us in moulding this project into a comprehensive one.

BY:

P.Uday Kumar (08C91A0225)

CH. Sai Pratap (08C91A0208

N. Srikanth (08C91A0223

CONTENTS

Page 4: Gas Leakage Detection B-11

ABSTRACT Page no.

LIST OF FIGURES

LIST OF TABLES

CHAPTER

1. INTRODUCTION 1-2

1.0 General Introduction 1

1.1 Need for stop and go griving system 1

1.2 Project overview 2

2. EMBEDDED SYSTEMS 3-6

2.1 Applications of embedded systems 4

2.2 Military and aerospace software applications 4

2.3 Communication applications 5

2.4 Electronic applications and consumer devices 5

2.5 Industrial automation and process control software 5

2.6 Microcontroller Vs Microprocessor 6

2.7 Microcontroller for embedded systems 6

3. 8051 ARCHETECTURE 7-19

3.1 Features of 8051 architecture 7

3.2 Block diagram of 8051 8

3.3 Microcontroller Pin Diagram 9

3.3.1 ALE/PROG 9

3.3.2 PSEN 9

3.3.3 EA/VPP 9

3.3.4 XTAL1 10

3.3.5 XTAL2 10

3.4 Memory organization 10

3.5 Description 11

3.6 Block Diagram of Microcontroller 13

3.7 Pin configuration 14

3.8 Pin description 16-21

4. INFRA RED SENSORS 22-27

Page 5: Gas Leakage Detection B-11

4.1 Applications 23-24

4.1 Modulation 24

4.3 The transmitter 24-26

4.4 The receiver 26-27

5. GAS SENSOR AND BUZZER 28-29

5.1 Description 28-29

5.2 Buzzer 29

BLOCK DIAGRAM 30

CIRCUIT DIAGRAM 31

6. KEAL SOFTWARE 32-41

9. CONCLUSION 42

ABBRIVATIONS 43

REFERANCES 44

ABSTRACT

Page 6: Gas Leakage Detection B-11

The purpose of the Stop-and-Go Driving system is to develop a cruise control system that would

maintain a safe driving distance from the vehicle ahead while in heavy traffic. We were interested in pursuing

this project because it was something that we would like to see put in to production on all passenger

automobiles. After the frustration of a summer of driving in Chicago, one can see the benefits of the system

almost immediately.

The system will be implemented using RC cars in which one will have infrared sensors mounted to the

front to measure its distance from the car in front. A digital speed gauge also mounted to the rear car will send

signals to a microcontroller to determine the proper distance and speed to maintain from the car in front. The

microcontroller will have a wireless interface which will communicate with the radio for the car for speed

control. The reason for using RC cars is that the main differences between our system and one for a passenger

vehicle are mechanical and beyond the scope of the course.

This would allow the driver to do something else while in stop-and-go traffic resulting in a more

enjoyable and less stressful drive.Could prevent accidents resulting from distractions, drowsiness/fatigue, or

impaired vision to the driver.Implementation of system could improve traffic flow and reduce congestion

Page 7: Gas Leakage Detection B-11

LIST OF FIGURES

Figure No. and Name Page No.

Figure 1: Block Diagram of 8051 10

Figure 2: Microcontroller Pin Diagram 11

Figure 3: Block Diagram of Microcontroller 15

Figure 4: Pin Configuration of 8051 16

Figure 5: Infrared Transmitter and Receiver 24

Figure 6: Infrared Transmitter 25

Figure 7: Infrared Transmitter 26

Figure 8: Infrared Receiver 26

Figure 9: Block Diagram of Project 30

Figure 10: Circuit Diagram of Project 31

Page 8: Gas Leakage Detection B-11

LIST OF TABLES

Table No. and Name: Page No.

Table 1: Port Description 17

Table 2: Port Description 18

Table 3: Operating Modes 21

Page 9: Gas Leakage Detection B-11

CHAPTER 1INTRODUCTION

1. GENERAL INTRODUCTION

The purpose of the Stop-and-Go Driving system is to develop a cruise control system that would

maintain a safe driving distance from the vehicle ahead while in heavy traffic. We were interested in pursuing

this project because it was something that we would like to see put in to production on all passenger

automobiles. After the frustration of a summer of driving in Chicago, one can see the benefits of the system

almost immediately.

The system will be implemented using RC cars in which one will have infrared sensors mounted to the

front to measure its distance from the car in front. A digital speed gauge also mounted to the rear car will send

signals to a microcontroller to determine the proper distance and speed to maintain from the car in front. The

microcontroller will have a wireless interface which will communicate with the radio for the car for speed

control. The reason for using RC cars is that the main differences between our system and one for a passenger

vehicle are mechanical and beyond the scope of the course.

1.1NEED FOR STOP AND GO DRIVING SYSTEM

This would allow the driver to do something else while in stop-and-go traffic resulting in a more

enjoyable and less stressful drive.Could prevent accidents resulting from distractions, drowsiness/fatigue, or

impaired vision to the driver.Implementation of system could improve traffic flow and reduce congestion

The Stop-and-Go Driving system would maintain a safe driving distance from the vehicle ahead while in heavy

traffic. We were interested in pursuing this project because it was something that we would like to see put in to

production on all passenger automobiles. After the frustration of a summer of driving in Chicago, one can see

the benefits of the system almost immediately.

Page 10: Gas Leakage Detection B-11

1.2PROJECT OVERVIEW

OBJECTIVES

The system will be implemented using RC cars in which one will have infrared sensors mounted to the

front to measure its distance from the car in front. A digital speed gauge also mounted to the rear car will send

signals to a microcontroller to determine the proper distance and speed to maintain from the car in front. The

microcontroller will have a wireless interface which will communicate with the radio for the car for speed

control. The reason for using RC cars is that the main differences between our system and one for a passenger

vehicle are mechanical and beyond the scope of the course.

BENEFITS

This would allow the driver to do something else while in stop-and-go traffic resulting in a more

enjoyable and less stressful drive.

Could prevent accidents resulting from distractions, drowsiness/fatigue, or impaired vision to the

driver.

Implementation of system could improve traffic flow and reduce congestion

FEATURES

Infrared sensors can detect distance from approximately 6 inches to 5 feet from the car in front.

Speed gauge will sense the exact speed of the car.

PIC will automatically adjust the speed of the car to maintain a safe driving distance from the car

in front.

Page 11: Gas Leakage Detection B-11

CHAPTER 2

EMBEDDED SYSTEM

An embedded system is a special-purpose computer system designed to perform one or a few dedicated

functions, sometimes with real-time computing constraints. It is usually embedded as part of a complete device

including hardware and mechanical parts. In contrast, a general-purpose computer, such as a personal computer,

can do many different tasks depending on programming. Embedded systems have become very important today

as they control many of the common devices we use.

Since the embedded system is dedicated to specific tasks, design engineers can optimize it, reducing the

size and cost of the product, or increasing the reliability and performance. Some embedded systems are mass-

produced, benefiting from economies of scale.

Physically, embedded systems range from portable devices such as digital watches and MP3 players, to

large stationary installations like traffic lights, factory controllers, or the systems controlling nuclear power

plants. Complexity varies from low, with a single microcontroller chip, to very high with multiple units,

peripherals and networks mounted inside a large chassis or enclosure.

In general, "embedded system" is not an exactly defined term, as many systems have some element of

programmability. For example, Handheld computers share some elements with embedded systems — such as

the operating systems and microprocessors which power them — but are not truly embedded systems, because

they allow different applications to be loaded and peripherals to be connected.

An embedded system is some combination of computer hardware and software, either fixed in capability

or programmable, that is specifically designed for a particular kind of application device. Industrial machines,

automobiles, medical equipment, cameras, household appliances, airplanes, vending machines, and toys (as well

as the more obvious cellular phone and PDA) are among the myriad possible hosts of an embedded system.

Embedded systems that are programmable are provided with a programming interface, and embedded systems

programming is a specialized occupation.

Page 12: Gas Leakage Detection B-11

Certain operating systems or language platforms are tailored for the embedded market, such as

Embedded Java and Windows XP Embedded. However, some low-end consumer products use very inexpensive

microprocessors and limited storage, with the application and operating system both part of a single program.

The program is written permanently into the system's memory in this case, rather than being loaded into RAM

(random access memory), as programs on a personal computer are.

2.1 Applications of embedded system

We are living in the Embedded World. You are surrounded with many embedded products and your

daily life largely depends on the proper functioning of these gadgets. Television, Radio, CD player of your

living room, Washing Machine or Microwave Oven in your kitchen, Card readers, Access Controllers, Palm

devices of your work space enable you to do many of your tasks very effectively. Apart from all these, many

controllers embedded in your car take care of car operations between the bumpers and most of the times you

tend to ignore all these controllers.

In recent days, you are showered with variety of information about these embedded controllers in many

places. All kinds of magazines and journals regularly dish out details about latest technologies, new devices;

fast applications which make you believe that your basic survival is controlled by these embedded products.

Now you can agree to the fact that these embedded products have successfully invaded into our world. You

must be wondering about these embedded controllers or systems.

The computer you use to compose your mails, or create a document or analyze the database is known as

the standard desktop computer. These desktop computers are manufactured to serve many purposes and

applications.

You need to install the relevant software to get the required processing facility. So, these desktop

computers can do many things. In contrast, embedded controllers carryout a specific work for which they are

designed. Most of the time, engineers design these embedded controllers with a specific goal in mind. So these

controllers cannot be used in any other place.

Theoretically, an embedded controller is a combination of a piece of microprocessor based hardware and

the suitable software to undertake a specific task.

These days designers have many choices in microprocessors/microcontrollers. Especially, in 8 bit and

32 bit, the available variety really may overwhelm even an experienced designer. Selecting a right

Page 13: Gas Leakage Detection B-11

microprocessor may turn out as a most difficult first step and it is getting complicated as new devices continue

to pop-up very often.

In the 8 bit segment, the most popular and used architecture is Intel's 8031. Market acceptance of this

particular family has driven many semiconductor manufacturers to develop something new based on this

particular architecture. Even after 25 years of existence, semiconductor manufacturers still come out with some

kind of device using this 8031 core.

2.2 Military and aerospace software applications

From in-orbit embedded systems to jumbo jets to vital battlefield networks, designers of mission-

critical aerospace and defense systems requiring real-time performance, scalability, and high-availability

facilities consistently turn to the LynxOS® RTOS and the LynxOS-178 RTOS for software certification to DO-

178B. Rich in system resources and networking services, LynxOS provides an off-the-shelf software platform

with hard real-time response backed by powerful distributed computing (CORBA), high reliability, software

certification, and long-term support options.

The LynxOS-178 RTOS for software certification, based on the RTCA DO-178B standard, assists

developers in gaining certification for their mission- and safety-critical systems. Real-time systems

programmers get a boost with LynuxWorks' DO-178B RTOS training courses.

LynxOS-178 is the first DO-178B and EUROCAE/ED-12B certifiable, POSIX®-compatible RTOS

solution.

2.3 Communications applications

"Five-nines" availability, CompactPCI hot swap support, and hard real-time response—LynxOS delivers on

these key requirements and more for today's carrier-class systems. Scalable kernel configurations, distributed

computing capabilities, integrated communications stacks, and fault-management facilities make LynxOS the

ideal choice for companies looking for a single operating system for all embedded telecommunications

applications—from complex central controllers to simple line/trunk cards. LynuxWorks Jumpstart for

Communications package enables OEMs to rapidly develop mission-critical communications equipment, with

pre-integrated, state-of-the-art, data networking and porting software components—including source code for

easy customization. The Lynx Certifiable Stack (LCS) is a secure TCP/IP protocol stack designed especially for

applications where standards certification is required.

2.4 Electronics applications and consumer devices

As the number of powerful embedded processors in consumer devices continues to rise, the BlueCat®

Linux® operating system provides a highly reliable and royalty-free option for systems designers.

And as the wireless appliance revolution rolls on, web-enabled navigation systems, radios, personal

communication devices, phones and PDAs all benefit from the cost-effective dependability, proven stability and

Page 14: Gas Leakage Detection B-11

full product life-cycle support opportunities associated with BlueCat embedded Linux. BlueCat has teamed up

with industry leaders to make it easier to build Linux mobile phones with Java integration.

For makers of low-cost consumer electronic devices who wish to integrate the LynxOS real-time operating

system into their products, we offer special MSRP-based pricing to reduce royalty fees to a negligible portion of

the device's MSRP.

2.5 Industrial automation and process control software

Designers of industrial and process control systems know from experience that LynuxWorks operating

systems provide the security and reliability that their industrial applications require. From ISO 9001

certification to fault-tolerance, POSIX conformance, secure partitioning and high availability, we've got it all.

Take advantage of our 20 years of experience.

2.6 Microcontroller Vs Microprocessor

On What is the difference between a Microprocessor and Microcontroller? By microprocessor is meant

the general purpose Microprocessors such as Intel's X86 family (8086, 80286, 80386, 80486, and the Pentium)

or Motorola's 680X0 family (68000, 68010, 68020, 68030, 68040, etc). These microprocessors contain no

RAM, no ROM, and no I/O portst he chip itself. For this reason, they are commonly referred to as general-

purpose Microprocessors.

A system designer using a general-purpose microprocessor such as the Pentium or the 68040 must add

RAM, ROM, I/O ports, and timers externally to make them functional. Although the addition of external RAM,

ROM, and I/O ports makes these systems bulkier and much more expensive, they have the advantage of

versatility such that the designer can decide on the amount of RAM, ROM and I/O ports needed to fit the task at

hand. This is not the case with Microcontrollers.

A Microcontroller has a CPU (a microprocessor) in addition to a fixed amount of RAM, ROM, I/O

ports, and a timer all on a single chip. In other words, the processor, the RAM, ROM, I/O ports and the timer

are all embedded together on one chip; therefore, the designer cannot add any external memory, I/O ports, or

timer to it. The fixed amount of on-chip ROM, RAM, and number of I/O ports in Microcontrollers makes them

ideal for many applications in which cost and space are critical.

In many applications, for example a TV remote control, there is no need for the computing power of a

486 or even an 8086 microprocessor. These applications most often require some I/O operations to read signals

and turn on and off certain bits.

2.7 Microcontroller for embedded systems

Page 15: Gas Leakage Detection B-11

In the Literature discussing microprocessors, we often see the term Embedded System. Microprocessors

and Microcontrollers are widely used in embedded system products. An embedded system product uses a

microprocessor (or Microcontroller) to do one task only. A printer is an example of embedded system since the

processor inside it performs one task only; namely getting the data and printing it. Contrast this with a Pentium

based PC. A PC can be used for any number of applications such as word processor, print-server, bank teller

terminal, Video game, network server, or Internet terminal. Software for a variety of applications can be loaded

and run. Of course the reason a pc can perform myriad tasks is that it has RAM memory and an operating

system that loads the application software into RAM memory and lets the CPU run it.

In an Embedded system, there is only one application software that is typically burned into ROM. An

x86 PC contains or is connected to various embedded products such as keyboard, printer, modem, disk

controller, sound card, CD-ROM drives, mouse, and so on. Each one of these peripherals has a Microcontroller

inside it that performs only one task. For example, inside every mouse there is a Microcontroller to perform the

task of finding the mouse position and sending it to the PC. Table 1-1 lists some embedded products.

CHAPTER 3

8051 ARCHITECTURE

The generic 8051 architecture supports a Harvard architecture, which contains two separate

buses for both program and data. So, it has two distinctive memory spaces of 64K X 8 size for both

programmed and data. It is based on an 8 bit central processing unit with an 8 bit Accumulator and

another 8 bit B register as main processing blocks. Other portions of the architecture include few 8

bit and 16 bit registers and 8 bit memory locations.

Each 8051 device has some amount of data RAM built in the device for internal processing.

This area is used for stack operations and temporary storage of data.

This bus architecture is supported with on-chip peripheral functions like I/O ports, timers/counters,

versatile serial communication port. So it is clear that this 8051 architecture was designed to cater

many real time embedded needs.

3.1 FEATURES OF 8051 ARCHITECTURE

Optimized 8 bit CPU for control applications and extensive Boolean processing capabilities.

Page 16: Gas Leakage Detection B-11

64K Program Memory address space.

64K Data Memory address space.

128 bytes of on chip Data Memory.

32 Bi-directional and individually addressable I/O lines.

Two 16 bit timer/counters.

Full Duplex UART.

6-source / 5-vector interrupt structure with priority levels.

On chip clock oscillator.

Now we may be wondering about the non-mentioning of memory space meant for the program

storage, the most important part of any embedded controller. Originally this 8051 architecture was

introduced with on-chip, ‘one time programmable’ version of Program Memory of size 4K X 8.

Intel delivered all these microcontrollers (8051) with user’s program fused inside the device. The

memory portion was mapped at the lower end of the Program Memory area. But, after getting devices,

customers couldn’t change anything in their program code, which was already made available

inside during device fabrication.

3.2 Block Diagram Of 8051

Page 17: Gas Leakage Detection B-11

Figure 4.1 - Block Diagram of the 8051 Core

So, very soon Intel introduced the 8051 devices with re-programmable type of Program Memory

using built-in EPROM of size 4K X 8. Like a regular EPROM, this memory can be re-programmed many

times. Later on Intel started manufacturing these 8031 devices without any on chip Program Memory.

3.3 Microcontroller Pin Diagram

Page 18: Gas Leakage Detection B-11

Fig 4.2 - Microcontroller Pin Diagram

3.3.1 ALE/PROG:

Address Latch Enable output pulse for latching the low byte of the address during accesses to external

memory. ALE is emitted at a constant rate of 1/6 of the oscillator frequency, for external timing or clocking

purposes, even when there are no accesses to external memory. (However, one ALE pulse is skipped during

each access to external Data Memory.) This pin is also the program pulse input (PROG) during EPROM

programming.

3.3.2 PSEN:

Program Store Enable is the read strobe to external Program Memory. When the device is executing out

of external Program Memory, PSEN is activated twice each machine cycle (except that two PSEN activations

are skipped during accesses to external Data Memory). PSEN is not activated when the device is executing out

of internal Program Memory.

3.3.3 EA/VPP:

When EA is held high the CPU executes out of internal Program Memory (unless the Program Counter

exceeds 0FFFH in the 80C51). Holding EA low forces the CPU to execute out of external memory regardless of

Page 19: Gas Leakage Detection B-11

the Program Counter value. In the 80C31, EA must be externally wired low. In the EPROM devices, this pin

also receives the programming supply voltage (VPP) during EPROM programming.

3.3.4 XTAL1:

Input to the inverting oscillator amplifier.

3.3.5 XTAL2:

Output from the inverting oscillator amplifier.

The 8051’s I/O port structure is extremely versatile and flexible. The device has 32 I/O pins configured

as four eight bit parallel ports (P0, P1, P2 and P3). Each pin can be used as an input or as an output

under the software control. These I/O pins can be accessed directly by memory instructions during

program execution to get required flexibility. These port lines can be operated in different modes and

all the pins can be made to do many different tasks apart from their regular I/O function executions.

Instructions, which access external memory, use port P0 as a multiplexed address/data bus. At the

beginning of an external memory cycle, low order 8 bits of the address bus are output on P0. The

same pins transfer data byte at the later stage of the instruction execution.

Also, any instruction that accesses external Program Memory will output the higher order byte

on P2 during read cycle. Remaining ports, P1 and P3 are available for standard I/O functions. But all

the 8 lines of P3 support special functions: Two external interrupt lines, two counter inputs, serial

port’s two data lines and two timing control strobe lines are designed to use P3 port lines. When you

don’t use these special functions, you can use corresponding port lines as a standard I/O. Even within

a single port, I/O operations may be combined in many ways. Different pins can be configured as input or

outputs independent of each other or the same pin can be used as an input or as output at different

times. You can comfortably combine I/O operations and special operations for Port 3 lines.

All the Port 3 pins are multifunctional. They are not only port pins, but also serve the functions of

various special features as listed below:

Port Pin Alternate Function

P3.0 RxD (serial input port)

P3.1 TxD (serial output port)

3.4 Memory Organization

The alternate functions can only be activated if the corresponding bit latch in the port SFR contains a 1.

Otherwise the port pin remains at 0.All 80C51 devices have separate address spaces for program and data

memory, as shown in Figures 1 and 2. The logical separation of program and data memory allows the data

memory to be accessed by 8-bit addresses, which can be quickly stored and manipulated by an 8-bit (Central

Page 20: Gas Leakage Detection B-11

Processing Unit) CPU. Nevertheless, 16-bit data memory addresses can also be generated through the DPTR

register.

Program memory (ROM, EPROM) can only be read, not written to. There can be up to 64k bytes of

program memory. In the 80C51, the lowest 4k bytes of program are on-chip. In the ROM less versions, all

program memory is external. The read strobe for external program memory is the PSEN (program store enable).

Data Memory (RAM) occupies a separate address space from Program Memory. In the 80C51, the lowest 128

bytes of data memory are on-chip. Up to 64k bytes of external RAM can be addressed in the external Data

Memory space. In the ROM less version, the lowest 128 bytes are on-chip. The CPU generates read and write

signals, RD and WR, as needed during external Data Memory accesses.

External Program Memory and external Data Memory may be combined if desired by applying the RD

and PSEN signals to the inputs of an AND gate and using the output of the gate as the read strobe to the

external Program/Data memory.

AT89S52 Features:

• Compatible with MCS®-51 Products

• 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)

• Green (Pb/Halide-free) Packaging Option

3.5 Description

Page 21: Gas Leakage Detection B-11

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

system programmable Flash memory. The device is manufactured using Atmel’s high-density nonvolatile

memory technology and is compatible with the indus-try-standard 80C51 instruction set and pinout. The on-

chip Flash allows the program memory to be reprogrammed in-system or by a conventional nonvolatile memory

pro-grammer. By combining a versatile 8-bit CPU with in-system programmable Flash on a monolithic chip,

the Atmel AT89S52 is a powerful microcontroller which provides a highly-flexible and cost-effective solution

to many embedded control applications. The standard features are 8K bytes of Flash, 256 bytes of RAM, 32 I/O

lines, Watchdog timer, two data pointers, three 16-bit timer/counters, a six-vector two-level interrupt

architecture, a full duplex serial port, on-chip oscillator, and clock circuitry. In addition, the AT89S52 is

designed with static logic for operation down to zero frequency and supports two software selectable power

saving modes. The Idle Mode stops the CPU while allowing the RAM, timer/counters, serial port, and interrupt

system to continue functioning. The Power-down mode saves the RAM con-tents but freezes the oscillator,

disabling all other chip functions until the next interrupt or hardware reset.

Page 22: Gas Leakage Detection B-11

Fig. 4.4 – Block Diagram Of Microcontroller

Page 23: Gas Leakage Detection B-11

3.6 Pin Configuration

Fig. 4.6 – Pin Configuration of 8051

3.7 Pin Description

VCC :

Supply voltage. Should not exceed 5v.

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

Page 24: Gas Leakage Detection B-11

memory. In this mode, P0 has internal pull-ups. Port 0 also receives the code bytes during Flash programming

and outputs the code bytes dur-ing 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 inter-nal 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 follow-ing table. Port

1 also receives the low-order address bytes during Flash programming and verification.

Table 1: Port Description

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 inter-nal 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 dur-ing accesses to external data memory that use 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 use 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 program-ming and verification.

Port Pin Alternate Functions

Page 25: Gas Leakage Detection B-11

P1.0 T2 (external count input to Timer/Counter 2), clock-out P1.1 T2EX (Timer/Counter 2 capture/reload

trigger and direction control) P1.5 MOSI (used for In-System Programming) P1.6 MISO (used for In-System

Programming) P1.7 SCK (used for In-System Programming)5 1919D–MICRO–6/

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 inter-nal 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 fol-lowing table.

Table 2 : Port Description

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. In the default state of bit DISRTO, the RESET HIGH out

feature is enabled.

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 dur-ing 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

Page 26: Gas Leakage Detection B-11

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 exter-nal 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.

XTAL2: Output from the inverting oscillator amplifier.

Special Function Registers:

A map of the on-chip memory area called the Special Function Register (SFR) space is shown in Table

5-1. Note that not all of the addresses are occupied, and unoccupied addresses may not be imple-mented on the

chip. Read accesses to these addresses will in general return random data, and write accesses will have an

indeterminate effect. User software should not write 1s to these unlisted locations, since they may be used in

future products to invoke new features. In that case, the reset or inactive values of the new bits will always be 0.

Timer 2 Registers:

Control and status bits are contained in registers T2CON (shown in Table 5- 2) and T2MOD (shown in

Table 10-2) for Timer 2. The register pair (RCAP2H, RCAP2L) are the Capture/Reload registers for Timer 2 in

16-bit capture mode or 16-bit auto-reload mode.

Interrupt Registers:

The individual interrupt enable bits are in the IE register. Two priorities can be set for each of the six

interrupt sources in the IP register.Memory Organization MCS-51 devices have a separate address space for

Program and Data Memory. Up to 64K bytes each of external Program and Data Memory can be addressed.

Program Memory:

Page 27: Gas Leakage Detection B-11

If the EA pin is connected to GND, all program fetches are directed to external memory. On the

AT89S52, if EA is connected to VCC, program fetches to addresses 0000H through 1FFFH are directed to

internal memory and fetches to addresses 2000H through FFFFH are to external memory.

Data Memory:

The AT89S52 implements 256 bytes of on-chip RAM. The upper 128 bytes occupy a parallel address

space to the Special Function Registers. This means that the upper 128 bytes have the same addresses as the

SFR space but are physically separate from SFR space. When an instruction accesses an internal location above

address 7FH, the address mode used in the instruction specifies whether the CPU accesses the upper 128 bytes

of RAM or the SFR space. Instructions which use direct addressing access the SFR space. For example, the

following direct addressing instruction accesses the SFR at location 0A0H (which is P2). MOV 0A0H, #data

Instructions that use indirect addressing access the upper 128 bytes of RAM. For example, the following

indirect addressing instruction, where R0 contains 0A0H, accesses the data byte at address 0A0H, rather than

P2 (whose address is 0A0H). MOV @R0, #data Note that stack operations are examples of indirect addressing,

so the upper 128 bytes of data RAM are available as stack space.

Watch dog Timer (One-time Enabled with Reset-out) :

The WDT is intended as a recovery method in situations where the CPU may be subjected to software

upsets. The WDT consists of a 14-bit counter and the Watchdog Timer Reset (WDTRST) SFR. The WDT is

defaulted to disable from exiting reset. To enable the WDT, a user must write 01EH and 0E1H in sequence to

the WDTRST register (SFR location 0A6H). When the WDT is enabled, it will increment every machine cycle

while the oscillator is running. The WDT timeout period is dependent on the external clock frequency. There is

no way to disable the WDT except through reset (either hardware reset or WDT overflow reset). When WDT

over-flows, it will drive an output RESET HIGH pulse at the RST pin

WDT During Power-down and Idle :

In Power-down mode the oscillator stops, which means the WDT also stops. While in Power-down mode, the

user does not need to service the WDT. There are two methods of exiting Power-down mode: by a hardware

reset or via a level-activated external interrupt which is enabled prior to entering Power-down mode. When

Power-down is exited with hardware reset, servicing the WDT should occur as it normally does whenever the

AT89S52 is reset. Exiting Power-down with an interrupt is significantly different. The interrupt is held low long

enough for the oscillator to stabilize. When the interrupt is brought high, the interrupt is serviced. To prevent

the WDT from resetting the device while the interrupt pin is held low, the WDT is not started until the interrupt

is pulled high. It is suggested that the WDT be reset during the interrupt service for the interrupt used to exit

Page 28: Gas Leakage Detection B-11

Power-down mode. To ensure that the WDT does not overflow within a few states of exiting Power-down, it is

best to reset the WDT just before entering Power-down mode. Before going into the IDLE mode, the WDIDLE

bit in SFR AUXR is used to determine whether the WDT continues to count if enabled. The WDT keeps

counting during IDLE (WDIDLE bit = 0) as the default state. To prevent the WDT from resetting the AT89S52

while in IDLE mode, the user should always set up a timer that will periodically exit IDLE, service the WDT,

and reenter IDLE mode. With WDIDLE bit enabled, the WDT will stop to count in IDLE mode and resumes

the count upon exit from IDLE.

UART :

The UART in the AT89S52 operates the same way as the UART in the AT89S52 and AT89C52.

Timer 0 and 1:

Timer 0 and Timer 1 in the AT89S52 operate the same way as Timer 0 and Timer 1 in the AT89S52 and

AT89C52.

Timer 2 :

Timer 2 is a 16-bit Timer/Counter that can operate as either a timer or an event counter. The type of

operation is selected by bit C/T2 in the SFR T2CON (shown in Table 5-2). Timer 2 has three operating modes:

capture, auto-reload (up or down counting), and baud rate generator. The modes are selected by bits in T2CON,

as shown in Table 10-1. Timer 2 consists of two 8-bit registers, TH2 and TL2. In the Timer function, the TL2

register is incremented every machine cycle. Since a machine cycle consists of 12 oscillator periods, the count

rate is 1/12 of the oscil-lator frequency.

Timer 2 Operating Mode:

Table 3: Operating Modes

In the Counter function, the register is incremented in response to a 1-to-0 transition at its

corresponding external input pin, T2. In this function, the external input is sampled during S5P2 of every

machine cycle. When the samples show a high in one cycle and a low in the next cycle, the count is

Page 29: Gas Leakage Detection B-11

incremented. The new count value appears in the register during S3P1 of the cycle following the one in which

the transition was detected. Since two machine cycles (24 oscillator periods) are required to recognize a 1-to-0

transition, the maximum count rate is 1/24 of the oscillator frequency. To ensure that a given level is sampled at

least once before it changes, the level should be held for at least one full machine cycle.

CHAPTER 4

IR (Infra Red) SENSORS

IR is a specification for a suite of high level communication protocols using small, low-power digital

radios based on the IEEE 802.15.4-2003 standard for wireless personal area networks (WPANs), such as

wireless headphones connecting with cell phones via short-range radio. The technology defined by the IR

specification is intended to be simpler and less expensive than other WPANs, such as Bluetooth. IR is targeted

at radio-frequency (RF) applications that require a low data rate, long battery life, and secure networking.

Overview

IR is a low-cost, low-power, wireless mesh networking proprietary standard. The low cost allows the

technology to be widely deployed in wireless control and monitoring applications, the low power-usage allows

longer life with smaller batteries, and the mesh networking provides high reliability and larger range.

The IR Alliance, the standards body that defines IR, also publishes application profiles that allow multiple OEM

vendors to create interoperable products. The current list of application profiles either published or in the works

are:

Page 30: Gas Leakage Detection B-11

* Home Automation

* IR Smart Energy

* Commercial Building Automation

* Telecommunication Applications

* Personal, Home, and Hospital Care

* Toys

The relationship between IEEE 802.15.4 and IR is similar to that between IEEE 802.11 and the Wi-Fi

Alliance. The IR 1.0 specification was ratified on 14 December 2004 and is available to members of the IR

Alliance. Most recently, the IR 2007 specification was posted on 30 October 2007. The first IR Application

Profile, Home Automation, was announced 2 November 2007.

IR operates in the industrial, scientific and medical (ISM) radio bands; 868 MHz in Europe, 915 MHz

in the USA and Australia, and 2.4 GHz in most jurisdictions worldwide. The technology is intended to be

simpler and less expensive than other WPANs such as Bluetooth. IR chip vendors typically sell integrated

radios and microcontrollers with between 60K and 128K flash memory, such as the Jennic JN5148, the Free

scale MC13213, the Ember EM250, the Texas Instruments CC2430, the Samsung Electro-Mechanics ZBS240

and the Atmel ATmega128RFA1. Radios are also available stand-alone to be used with any processor or

microcontroller. Generally, the chip vendors also offer the IR software stack, although independent ones are

also available.

Because, IR can activate (go from sleep to active mode) in 15 msec or less, the latency can be very low

and devices can be very responsive — particularly compared to Bluetooth wake-up delays, which are typically

around three seconds. Because IRs can sleep most of the time, average power consumption can be very low,

resulting in long battery life.

The first stack release is now called IR 2004. The second stack release is called IR 2006, and mainly

replaces the MSG/KVP structure used in 2004 with a "cluster library". The 2004 stack is now more or less

obsolete.

IR 2007, now the current stack release, contains two stack profiles, stack profile 1 (simply called IR), for

home and light commercial use, and stack profile 2 (called IR Pro). IR Pro offers more features, such as multi-

casting, many-to-one routing and high security with Symmetric-Key Key Exchange (SKKE), while IR (stack

profile 1) offers a smaller footprint in RAM and flash. Both offer full mesh networking and work with all IR

application profiles.

IR 2007 is fully backward compatible with IR 2006 devices: A IR 2007 device may join and operate on

a IR 2006 network and vice versa. Due to differences in routing options, IR Pro devices must become non-

routing IR End-Devices (ZEDs) on a IR 2006 or IR 2007 network, the same as IR 2006 or IR 2007 devices must

Page 31: Gas Leakage Detection B-11

become ZEDs on a IR Pro network. The applications running on those devices work the same, regardless of the

stack profile beneath them.

4.1 Applications

IR protocols are intended for use in embedded applications requiring low data rates and low power

consumption. IR's current focus is to define a general-purpose, inexpensive, self-organizing mesh network that

can be used for industrial control, embedded sensing, medical data collection, smoke and intruder warning,

building automation, home automation, etc. The resulting network will use very small amounts of power —

individual devices must have a battery life of at least two years to pass IR certification.

Typical application areas include:

* Home Entertainment and Control — Smart lighting, advanced temperature control, safety and security,

movies and music

* Home Awareness — Water sensors, power sensors, energy monitoring, smoke and fire detectors, smart

appliances and access sensors.

* Mobile Services — m-payment, m-monitoring and control, m-security and access control, m-healthcare and

tele-assist

* Commercial Building — Energy monitoring, HVAC, lighting, access control

* Industrial Plant — Process control, asset management, environmental management, energy management,

industrial device control

Infra-Red actually is normal light with a particular colour. We humans can't see this colour because its

wave length of 950nm is below the visible spectrum. That's one of the reasons why IR is chosen for remote

control purposes, we want to use it but we're not interested in seeing it. Another reason is because IR LEDs are

quite easy to make, and therefore can be very cheap.

Although we humans can't see the Infra-Red light emitted from a remote control doesn't mean we can't

make it visible. A video camera or digital photo camera can "see" the Infra-Red light as you can see in this

picture. If you own a web cam you're in luck, point your remote to it, press any button and you'll see the LED

flicker.

Unfortunately for us there are many more sources of Infra-Red light. The sun is the brightest source of

all, but there are many others, like: light bulbs, candles, central heating system, and even our body radiates

Infra-Red light. In fact everything that radiates heat, also radiates Infra-Red light.

Therefore we have to take some precautions to guarantee that our IR message gets across to the receiver

without errors.

4.2 Modulation:

Page 32: Gas Leakage Detection B-11

Modulation is the answer to make our signal stand out above the noise. With modulation we make the

IR light source blink in a particular frequency. The IR receiver will be tuned to that frequency, so it can ignore

everything else. You can think of this blinking as attracting the receiver's attention. We humans also notice the

blinking of yellow lights at construction sites instantly, even in bright daylight.

Fig: 4.0 Infra Red Transmitter and Receiver

In the picture above you can see a modulated signal driving the IR LED of the transmitter on the left

side. The detected signal is coming out of the receiver at the other side.

In serial communication we usually speak of 'marks' and 'spaces'. The 'space' is the default signal, which

is the off state in the transmitter case. No light is emitted during the 'space' state. During the 'mark' state of the

signal the IR light is pulsed on and off at a particular frequency. Frequencies between 30kHz and 60kHz are

commonly used in consumer electronics. At the receiver side a 'space' is represented by a high level of the

receiver's output. A 'mark' is then automatically represented by a low level.

Please note that the 'marks' and 'spaces' are not the 1-s and 0-s we want to transmit. The real relationship

between the 'marks' and 'spaces' and the 1-s and 0-s depends on the protocol that's being used. More information

about that can be found on the pages that describe the protocols.

4.3 The Transmitter

The transmitter usually is a battery powered handset. It should consume as little power as possible, and

the IR signal should also be as strong as possible to achieve an acceptable control distance. Preferably it should

be shock proof as well.

Many chips are designed to be used as IR transmitters. The older chips were dedicated to only one of the

many protocols that were invented. Nowadays very low power microcontrollers are used in IR transmitters for

the simple reason that they are more flexible in their use. When no button is pressed they are in a very low

power sleep mode, in which hardly any current is consumed. The processor wakes up to transmit the

appropriate IR command only when a key is pressed.

Page 33: Gas Leakage Detection B-11

Quartz crystals are seldom used in such handsets. They are very fragile and tend to break easily when

the handset is dropped. Ceramic resonators are much more suitable here, because they can withstand larger

physical shocks. The fact that they are a little less accurate is not important.

The current through the LED (or LEDs) can vary from 100mA to well over 1A! In order to get an

acceptable control distance the LED currents have to be as high as possible. A trade-off should be made

between LED parameters, battery lifetime and maximum control distance. LED currents can be that high

because the pulses driving the LEDs are very short. Average power dissipation of the LED should not exceed

the maximum value though. You should also see to it that the maximum peek current for the LED is not

exceeded.

Fig. 4.2 Infra Red Transmitter

A simple transistor circuit can be used to drive the LED. A transistor with a suitable HFE and switching

speed should be selected for this purpose.

The resistor values can simply be calculated using Ohm's law. Remember that the nominal voltage drop over an

IR LED is approximately 1.1V.

The normal driver, described above, has one disadvantage. As the battery voltage drops, the current

through the LED will decrease as well. This will result in a shorter control distance that can be covered.

An emitter follower circuit can avoid this.

Page 34: Gas Leakage Detection B-11

Fig: 4.3 Infra Red Transmitter

The 2 diodes in series will limit the pulses on the base of the transistor to 1.2V. The base-emitter voltage of the

transistor subtracts 0.6V from that, resulting in a constant amplitude of 0.6V at the emitter. This constant

amplitude across a constant resistor results in current pulses of a constant magnitude. Calculating the current

through the LED is simply applying Ohm's law again.

4.4 The receiver:

Many different receiver circuits exist on the market. The most important selection criteria are the

modulation frequency used and the availability in you region.

Fig: Block Diagram of Infra Red Receiver

In the picture above you can see a typical block diagram of such an IR receiver. Don't be alarmed if you don't

understand this part of the description, for everything is built into one single electronic component.

The received IR signal is picked up by the IR detection diode on the left side of the diagram. This signal is

amplified and limited by the first 2 stages. The limiter acts as an AGC circuit to get a constant pulse level,

regardless of the distance to the handset.

As you can see only the AC signal is sent to the Band Pass Filter. The Band Pass Filter is tuned to the

modulation frequency of the handset unit. Common frequencies range from 30kHz to 60kHz in consumer

electronics. The next stages are a detector, integrator and comparator. The purpose of these three blocks is to

detect the presence of the modulation frequency. If this modulation frequency is present the output of the

comparator will be pulled low.

Page 35: Gas Leakage Detection B-11

All these blocks are integrated into a single electronic component. There are many different

manufacturers of these components on the market. And most devices are available in several versions each of

which are tuned to a particular modulation frequency.

Please note that the amplifier is set to a very high gain. Therefore the system tends to start oscillating

very easily. Placing a large capacitor of at least 22µF close to the receiver's power connections is mandatory to

decouple the power lines. Some data sheets recommend a resistor of 330 Ohms in series with the power supply

to further decouple the power supply from the rest of the circuit.

There are several manufacturers of IR receivers on the market. Siemens, Vishay and Telefunken are the

main suppliers here in Europe. Siemens has its SFH506-xx series, where xx denotes the modulation frequency

of 30, 33, 36, 38, 40 or 56kHz. Telefunken had its TFMS5xx0 and TK18xx series, where xx again indicates the

modulation frequency the device is tuned to. It appears that these parts have now become obsolete. They are

replaced by the Vishay TSOP12xx, TSOP48xx and TSOP62xx product series.

Sharp, Xiamen Hualian and Japanese Electric are 3 Asian IR receiver producing companies. Sharp has devices

with very cryptic ID names, like: GP1UD26xK, GP1UD27xK and GP1UD28xK, where x is related to the

modulation frequency. Hualian has it's HRMxx00 series, like the HRM3700 and HRM3800. Japanese Electric

has a series of devices that don't include the modulation frequency in the part's ID. The PIC-12042LM is tuned

to 36.7kHz, and the PIC12043LM is tuned to 37.9kHz.

CHAPTER 5

GAS SENSOR AND BUZZER

Page 36: Gas Leakage Detection B-11

A Carbon monoxide (CO) gas sensor according to the present invention includes a gas collecting

container for collecting a measured gas therein; a detecting section provided within the gas collecting container

and having at least a pair of electrodes positioned through electrolyte; and a voltage applying apparatus for

applying voltage to the detecting section. One of the electrodes of the detecting section is a detection electrode

having the capability of adsorbing at least one of hydrogenous gas and CO gas when a voltage is applied and

then oxidizing it. By introducing a measured gas into a gas collecting container of the CO gas sensor and

carrying out electrolysis according to a potential sweep method or a pulse method with the measured gas being

in contact with the detecting section, a CO gas concentration in the measured gas can be measured based on an

electrical current value obtained at the detecting section and changes of the electrical current with elapse of

time. According to the CO gas sensor of the present invention, it is possible to accurately carry out detection

and measurement of the concentration of CO gas when CO gas is to be detected or measured even in a gaseous

atmosphere containing a relatively large amount of hydrogen gas and CO2 gas.

5.1 DESCRIPTION

The present invention relates to a CO gas sensor for measuring the concentration of CO gas contained in

a gaseous phase and to a method of measuring the concentration of CO gas, and in particular relates to a CO gas

sensor for measuring the concentration of CO gas in a gaseous atmosphere containing relatively high

concentrations of hydrogen gas and carbon dioxide gas, a fuel cell power generating apparatus equipped with

such CO gas sensor, and a method of measuring the concentration of CO gas

In many cases, hydrogen gas is used as a fuel gas for fuel cells. As such hydrogen gas, a hydrogen gas

rich reforming gas which is obtained by reforming methanol or the like is used. When manufacturing such a

reforming gas, a tiny amount of carbon monoxide (CO), namely several tens ppm to several hundred ppm, is

present as impurities. For this reason, when such a reforming gas is used as a fuel gas for a fuel cell, the CO gas

is adsorbed on the surface of the platinum catalyst of the fuel cell electrodes, thus hindering ionization of the

hydrogen gas and lowering the output of the fuel cell. In order to take appropriate measures to counter such a

problem caused by the CO gas, it is necessary to continuously monitor the concentration of CO gas in the

reforming gas used in the fuel cell.

Conventionally, as for the most commonly used CO gas sensor, there are known a controlled potential

analysis type CO gas sensor and a semiconductor type CO gas sensor. However, for the reasons given below,

neither of these CO gas sensors is appropriate for detecting CO gas in a reforming gas.

Page 37: Gas Leakage Detection B-11

Namely, the reforming gas contains hydrogen gas used as a fuel in the fuel cell for the amount of about

75% thereof. In comparison with this, the reforming gas contains a relatively tiny amount of CO gas as

described above. Therefore, it becomes necessary to detect or measure CO gas in a hydrogen gas atmosphere

containing a relatively large amount of hydrogen gas. However, in the case where the concentration of CO gas

is measured in such a hydrogen gas rich atmosphere using these CO gas sensors, there is a problem that it is

difficult to accurately detect (qualitative analysis) or measure (quantitative analysis) such CO gas with either

type of CO gas sensor due to influence of the hydrogen gas rich atmosphere in which interference by hydrogen

gas occurs.

In view of the problem mentioned above, it is an object of the present invention to provide a CO gas

sensor which can accurately carry out detection (qualitative analysis) and measurement (quantitative analysis)

of the concentration of CO gas when CO gas is detected or measured in a gaseous atmosphere containing a

relatively large amount of hydrogen gas and carbon dioxide gas, a fuel cell power generating apparatus

equipped with such a CO gas sensor, and a method of measuring the concentration of CO gas.

5.2 BUZZER:

A buzzer or beeper is a signalling device, usually electronic, typically used in automobiles, household

appliances such as a microwave oven, or game shows. It most commonly consists of a number of switches or

sensors connected to a control unit that determines if and which button was pushed or a preset time has lapsed,

and usually illuminates a light on the appropriate button or control panel, and sounds a warning in the form of a

continuous or intermittent buzzing or beeping sound. Initially this device was based on an electromechanical

system which was identical to an electric bell without the metal gong (which makes the ringing noise). Often

these units were anchored to a wall or ceiling and used the ceiling or wall as a sounding board. Another

implementation with some AC-connected devices was to implement a circuit to make the AC current into a

noise loud enough to drive a loudspeaker and hook this circuit up to a cheap 8-ohm speaker. Nowadays, it is

more popular to use a ceramic-based piezoelectric sounder which makes a high-pitched tone. Usually these

were hooked up to "driver" circuits which varied the pitch of the sound or pulsed the sound on and off.

Several game shows have large buzzer buttons which are identified as "plungers". The buzzer is also used

to signal wrong answers and when time expires on many game shows, such as Wheel of Fortune, Family Feud

and The Price is Right. ‘

The word "buzzer" comes from the rasping noise that buzzers made when they were electromechanical

devices, operated from stepped-down AC line voltage at 50 or 60 cycles. Other sounds commonly used.

Page 38: Gas Leakage Detection B-11

BLOCK DIAGRAM

_____________________________________________________________________________

Fig: Block diagram of project

Soon after the Micro Controller has been supplies with power, all the sensors onboard start functioning.

The Infrared sensors work as the obstacle detection sensors. The Infrared transmitter continuously transmits the

infrared light, which is detected by the Infrared receiver only when the emitted infrared light from the

transmitter bounces back from any obstacle surface and is been collected by the infrared receiver. The infrared

receiver then sends electrical pulse signals to the microcontroller, which then controls the DC motors of robot

using L293D bridge and hence changes the direction of the robot. The L293D bridge is a device which enables

the flow of power in either direction, and hence it can control the direction of rotation of motor shaft which,

IR Sensor

Microcontroller

BUZZER

Power supply

ROBOT

LED

Page 39: Gas Leakage Detection B-11

controls the direction of the robot. As soon as the gas sensor detects presence of gas in atmosphere around it, it

sends signals to the microcontroller which is be lowering the voltage across it and then the microcontroller

triggers the buzzer on.

CIRCUIT DIAGRAM

_________________________________________________________________________

Fig: Circuit diagram of the project

Page 40: Gas Leakage Detection B-11

CHAPTER 6

KEAL SOFTWARE

_____________________________________________________________________________

1. Click on the Keil uVision Icon on DeskTop.

2. The following fig will appear.

3. Then Click on New Project.

Page 41: Gas Leakage Detection B-11

4. Save the Project by typing suitable project name with no extension in u r own folder sited in either

C:\ or D:\

5. Then Click on Save button above.

6. Select the component for u r project. i.e. Philips……

7. Click on the + Symbol beside of Philips .

Page 42: Gas Leakage Detection B-11

8. Select AT89S52 as shown below.

9. Then Click on “OK”.

10. The Following fig will appear.

Page 43: Gas Leakage Detection B-11

11. Then Click either YES or NO………mostly “NO”.

12. Now your project is ready to USE.

13. Now double click on the Target1, you would get another option “Source group 1” as shown in next

page.

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

Page 44: Gas Leakage Detection B-11

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

boarder.

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

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

save it with extension “ .C”.

Page 45: Gas Leakage Detection B-11

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

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

Page 46: Gas Leakage Detection B-11

20. Now select as per your file extension given while saving the file.

21. Now Press function key F7 to compile. Any error will appear if so happen.

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

23. The new window is as follows.

Page 47: Gas Leakage Detection B-11

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

25. Drag the port a side and click in the program file.

Page 48: Gas Leakage Detection B-11

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

27. You are running your program successfully.

CHAPTER 7

CONCLUSSION

By using this technology we can reduce the stress and stain of the people in the heavy traffic jam

so the person can gain some good piece of mind and by doing this we can reduce the rate of accidents in the city

which is the main objective of this project

This would allow the driver to do something else while in stop-and-go traffic resulting in a more

enjoyable and less stressful drive.Could prevent accidents resulting from distractions, drowsiness/fatigue, or

impaired vision to the driver.Implementation of system could improve traffic flow and reduce congestion

Page 49: Gas Leakage Detection B-11

ABBRIVATIONS

WORD FULL FORM

IR Infrared

CCD Charge-Couple Devices

RF Radio Frequency

GPS Global Positioning System

PDA Personal Digital Assistant

RAM Random Access Memory

Page 50: Gas Leakage Detection B-11

ROM Read Only Memory

CD Compact Disc

UART Universal Asynchronous Receiver/Transmitter

PCI Peripheral Component Interconnect

MSRP Message Session Relay Protocol

CPU Central Processing Unit

EPROM Erasable Programmable Read Only Memory

ALE Address Latch Enable

PIC Programmable Interrupt Counter

PSEN Program Store Enable

EA/VPP External Access Enable

I/O Input/output

CMOS Complementary Metal–Oxide–Semiconductor

CO Carbon Monoxide

CO2 Carbon Di-Oxide

REFERENCES

[1] Sensors For Mobile Robots - Theory and Applications. H.R. Everett, ©1995 A.K. Peters, Ltd., Wellesley, MA.

[2] Autonomous Robots - From Inspiration to Implementation and Control. George A. Bekey, ©2005 MIT Press, Cambridge, MA.

Page 51: Gas Leakage Detection B-11

[3] Build Your Own Robot! Karl Lunt, ©2000 ©1999 A.K. Peters, Ltd., Natick, MA.

[4] R. Clarke."Asimov's Laws of Robotics - Implications for Information Technology". Australian National University/IEEE. Retrieved 2008-09-25.

[5] Lang, M.A. (2001). DAN Nitrox Workshop Proceedings. Durham, NC: Divers Alert Network. p. 197. Retrieved 2009-03-20.

[6] "34, Robotech". IGN. 2009-01-23. Retrieved 2009-01-24.