Top Banner
28
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: Design of Ultrasonic Alarm System
Page 2: Design of Ultrasonic Alarm System

ABSTRACT

This alarm system is created to detect an object movement in the coverage

area. Alarm will trigger when object movement is detected. Nowadays, a lot of

crimes happened in ow life. The idea for this alarm project came out through the

total of frustration when there is no other ways to stop burglary from break-in into

the house, shop or car. Of course safety was the prime concern of the security system

companies. However, house owners cannot rely on neighbours or police for

protecting their home or warning them if a break-in has occurred in progress. To

overcome this problem, an ultrasonic security system has been developed in this

project. The system has a sensor that can detect an object movement in the covered

area This project consists of 6 parts of circuit which is the power supply circuit, the

battery indicator circuit, the ultrasonic sensor circuit, the alarm circuit, the remote

control circuit and the LCD display circuit. The power supply circuit produces and

supply the 12V and 5V voltages. The battery indicator circuit is used to show the

level of energy in the battery. The battery will act up if something happen to the

power supply such as blackout. Ultrasonic sensor circuit has a transmitter circuit and

the receiver circuit that operate at the same fkquency level namely 40 MIz. When

there's a movement in the area covered by the circuit, the circuit's fme balance will

be disturbed, thus trigger its alarm. The circuit is very sensitive and can be adjusted

automatically or to stay triggered until it is reset manually after an alarm. Actually,

this project use low costs budget and it is suitable for commercial used. From this

project, found that the maximum distance that ultrasonic sensor can detect the object

movement is 3.5 meters and for the sensitivity, it depend the environment factors

such as air and noise.

Page 3: Design of Ultrasonic Alarm System

ABSTRAK

Sistem Penggera ini direka untuk mengesan sebarang objek yang bergerak

didalam kawasan yang diliputi oleh sistem ini. Penggera akan berbunyi sekiranya

terdapat sebarang pergerakan objek yang dikesan. Pada masa kini, terdapat banyak

kejadian jenayah yang berlaku di sekeliling kita Idea untuk membuat projek ini

terhasil apabila sudah tiada jalan untuk menyekat perompak atau pencuri daripada

menceroboh rumah, kereta dan juga kedai. Oleh yang demikian, projek ini

merupakan salah satu altematif untuk mengatasi masalah berikut. Sudah semestinya,

keselamatan m e ~ p d c a n aspek terpenting yang dititik beratkan dalam sistem

keselamatan ini. Tambahan pula, pemilik rumah, kereta dan kedai tidak boleh

mengharapkan jiran-jiran dan polis sahaja mefindunpi atau mengelakkan rumah,

kereta dan kedai daripada diceroboh. Sebagai penyelesaian kepada masalah ini,

sistem keselamatan ultrasonik direka dalam projek ini. Sistem ini mempunyai

pengesan yang mengesan pergerakan objek dalam ka- yang mampu diliputi

oleh sistem tersebut. Projek ini mengandungi 6 bahagian litar yang terdiri daripada

litar kawalan jauh, litar bekalan kuasa, litar penunjuk paras bateri, litar pengesan

ultrasonik, litar penggera dan litar untuk paparan 'LCD'. Litar bekalan kuasa

berfungsi untuk menghasilkan voltan pada 12V dan 5V. Litar penunjuk paras bateri

pula berfungsi untuk menunjukkan paras tenaga di dalam bateri yang digunakan.

Bateri ini juga bertindak sebagai bekalan kuasa simpanan jika sesuatu terjadi kepada

litar bekalan kuasa tersebut seperti terputus bekalan dan sebagainya. Litar pengesan

ultrasonik mempunyai litar pemancar dan penerima yang beroperasi pada fkekuensi

yang sama iaitu 40kHz. Apabiia terdapat sebamng pergerakan yang akan

menyebabkan kestabilan litar terganggu, maka sistem penggera akan dihidupkan.

Litar ini sangat sensitif dan boleh dilaraskan secara autornatik atau terus dipicu

sehingga ia dilaraskan secara manual. Projek ini menggunakan kos yang rendah dan

ia sangat sesuai untuk dipasarkan secara komersial. Selepas projek ini disiapkan dan

Page 4: Design of Ultrasonic Alarm System

vii

melalui analisis yang dibuat terhadap sistem penggera ini didapati bahawa pengesan

ultrasonik mampu mengesan objek sehingga pada jarak 3.5 meter. Selain i N didapati

juga faktor-faktor pemkitaran juga memainkan peranan yang penting dalam

mempengaruhi kesensitifan litar seperti udara dan hingar.

Page 5: Design of Ultrasonic Alarm System

CHAPTER 1

INTRODUCTION

1.1 BACKGROUND

This alarm system use an ultrasonic sensor to detect the object movement in

the covered area The ultmsonic sensor was chosen because it's more compatible and

appropriate for this alarm system. The features are better than i h - r e d sensor. The

main factors ultmwnic sensor was chosen is, it will not infected by any type of

material and color at object that has been detected. It also able to detect the small

object and not infected by dust, dirt and humidity. Thus, this is also an advantage

using the ultrasonic sensor. Ultrasonic sensor also has a weakness and disadvantage

that is the sensor can't be installed at area that has high air flow and high noise.

Actually, the ultrasonic sensor is a main component in this alarm system. Besides

that, this alarm system also combined with another circuit where this other circuit is

used as supporter to the ultrasonic sensor circuit. For ultrasonic sensor, it has 2 types

of kquencies in the market namely 40 kHz and 10 MHz where for 40 kHz, it can

detect up to 5 meter. Where else, for IOMHz, it capable to detect until 10 meter but

the price is very expensive. As a result, for this alarm system the sensor that uses 40

kHz is more effective and appropriate.

Page 6: Design of Ultrasonic Alarm System

This project has objectives that require to achieve. At the end of project, all of

objectives that list are satisfied or covered. The objectives of this project are listed as

below.

a) To design an alarm system that capable of detecting movement object.

b) Understand the operation of the circuit and applications of this alarm system.

c) To know how to simulate the circuit by using the appropriate softwares.

d) To improve the skills and techniques for making or designing the hardware.

1 3 PROJECT SCOPE

The scope of this project is using an ultrasonic sensor to detect the movement

object. ~ l t r a k n i c ranging and detecting devices used a high-fkquency sound wave

namely 40 kHz to detect the presence of an object.

Else, this project capable to detect object in distance about 5 meters. This is a

maximum distance that ultrasonic sensor can detect if using 40 kHz fkquency. So, in

this distance, the ultrasonic sensor can detect the movement object and trigger alarm

immidiately.

Page 7: Design of Ultrasonic Alarm System

1.4 PROBLEM STATEMENT.

Firstly, using the security guard is not effective and increases the cost. It

cause the security guard not capable to monitor the area for 24 hours. Else, the

security guard need paid the salary for every month. So, it will increase the cost for

monitor the area that required.

Second, high cost required to install the security system that sophisticated. To

install the security system that sophisticated, it need a high cost. So, the sophisticated

security system only can install by persons that have a ability. For persons that

haven't ability to install it because it need a high cost.

Third, nowadays, there have much a criminal that happen especially stealing,

intrusion and something like that. The house owners usually don't know that the

robbers have inside their house and not prepare to avoid them from steale.

1.5 PROJECT METHODOLOGY.

This project divided into hardware and software application.

Page 8: Design of Ultrasonic Alarm System

1.5.1 Software application.

For software application, compiler software used is The PIC Basic Pro

Compiler and the programmer software used is IC-Prog. For the Code Editor, it used

the Microcode Studio. So, the programs can wrote and edited in Microcode Studio.

It has a few steps to get the machine code (Hex) for the data to program in the

microcontroller. Figure below show the process done with the software to get the

.hex file.

Programming

I Compiling

I ICProgramming

I To interface circuit

Microcode Studio

PIC Basic Pro

IC-Prog

Figure 1.1 : PIC microcontroller programming process and software that used.

Page 9: Design of Ultrasonic Alarm System

1.5.2 Hardware application.

Such as software application, this part also has some steps that need to

follow. Firstly, do the research and understand the concept of 'alarm system'.

Information collected are regarding with PIC, 'alarm system' concept. Through this

method, information that had collected previously is researched consistent with the

objective of the project. Through this method, concept and principle for the project

will be studied to produce the ideas for this project.

Second, the flow chart is build where this flow chart is used to show the steps

that need to follow before the project is implemented. The flow chart is planned and

built and this flow chart also consist ways for this project to operate and to

controlling. Third, the circuit is designed. The circuit is design using a software of

'ORCAD 10.0'.

The fourth step is do the circuit simulation. The designed circuit is simulated

by using software of 'Proteus ISIS 6 Profesional' or ' E m Cicuit Maker'. By this

method, the operation of circuit can be inspect wheather the circuit has problem or

not and if any, the improvement can implement.

The fifth step is build a prototype for the project. Prototype is built when the

circuit simulated is function and has no problem. It's built on the 'protoboard'. This

prototype is built to test wheather the circuit has a problem or not. The improvement

can implement if the circuit designed has a problem.

The sixth step is design the 'PCB Layout'. If the circuit designed has no

problem, next, the 'PCB Layout' is designed by using software of 'Protel' or

'Proteus ISIS 6 Profesional'. This method is did by full concentration to avoid a

something mistake that will give difficulty when to assemble the component.

Page 10: Design of Ultrasonic Alarm System

The seventh step is design the 'PCB'. The completed PCB Layout will be

printed on the PCB board and drilling hole on the PCB will be done. The last step is

install the component on the PCB board. Component is installed on the PCB board

that has completed follow the circuit that has designed previously. Pi of component

is cut and soldered. Soldering equipment is required during this process.

Circuit Design

fail

IC Programming

Check wiring

I

Construct on PCB

Check PCB

Figure 1.2 : Flowchart of the process of designing the project.

Page 11: Design of Ultrasonic Alarm System

1.6 PROJECT OVERVIEW.

Alarm System is circuits that capable to detect the moving objects as an input

and the output is alarm where alarm will trigger when detect the moving object. The

ultrasonic sensor is choosing because it capable to detect the moving object up to 5

meters for 40 kHz sensor and remote control is required to wntrol this circuit. Thus,

user can control the alarm system from certain distance that is about 10 meters.

Basically, this project consists of hardware and software programming, the

hardware such as power supply circuit, remote control circuit, ultrasonic detector

circuit, battery indicator circuit, LCD display circuit and alarm circuit.

Figure 1.3: Block diagram of project.

Power Supply

Structurally, the circuit consists of six parts: power supply circuit, battery

indicator circuit, remote control circuit, ultrasonic detector circuit alarm circuit and

LCD display circuit. Power supply circuit will produce 12V and 5V where it will

supply the voltage to remote control circuit and ultrasonic circuit. Battery indicator

t

circuit will show status of the battery in the power supply. Remote control circuit

will control the ultrasonic detector circuit for 'ON' and 'OFF'. Alarm circuit will

Remote Control

1 Battery

I Indicator

U k ~ ~ i ~ o n i c Detector

Alarm

LCD Display

Page 12: Design of Ultrasonic Alarm System

trigger the alarm when sensor detects the moving object. LCD display circuit will

display the output from ultrasonic detector circuit. So, input of this alarm system is

from sensor and the output is alarm and LCD display. PIC is used to control the

alarm circuit and LCD display circuit. The program is in PIC Basic Pro format. This

format is used because it short and easy to build. The discussion about the program is

review in next chapter.

At the last, the result from this project is the ultrasonic sensor able to detect

the moving object. An alarm will trigger when moving object is detected. Else,

remote control circuit able to control the ultrasonic detector circuit for 'ON' and

'OFF'.

Page 13: Design of Ultrasonic Alarm System

CHAPTER 2

LITERATURE REVIEW

2.1 INTRODUCTION

This alarm system circuit has parts or elements namely the Ultrasonic Sensor,

Remote Control, PIC microcontroller and Battery. Ultrasonic sensor is the main

element for this project because this sensor is used to detect any object movement

around the area that is covered by this circuit. Besides that, a remote control is used

to control the ultrasonic sensor circuit where it can control namely on and off the

ultrasonic circuit in the distance of 10 meters. The PIC microcontroller is used to

control the display of the LCD and control the alarm circuit. The types of PIC

microcontroller used are 16F84A. The battery is used as back-up when something

happen to the electricity. The ability to maintain the regulated supply with no

electrical supply depends on the load taken from the UPS and also the Ampere how

capacity of the battery.

Page 14: Design of Ultrasonic Alarm System

10

2.2 ULTRASONIC SENSOR

2.2.1 An Introdnction to Ultrasonic Sensing

Ultrasonic ranging and detecting devices used a high-frequency sound wave

to detect the presence of an object and its range. The systems either measure the echo

reflection of the sound from objects or detect the interruption of the sound beam as

the objects passed between the transmitter and receiver.

Ultrasonic sensors are commonly used for a wide variety of non contact

presence, proximity, or distance measuring applications. These devices typically

transmit a short burst of ultrasonic sound toward a target, which reflects the sound

back to the sensor. The system then measures the time for the echo to return to the

sensor and computes the distance to the target using the speed of sound in the

medium.

Figure 2.1 : The 40 KHz Ultrasonic Sensor

Page 15: Design of Ultrasonic Alarm System

The wide variety of sensors currently on the market differs from one another

in their mounting configurations. Environmental sealing and electronics features.

Acoustically, they operate at different frequencies and have different radiation

pattern. It is usually not difficult to select a sensor that best meets the environmental

and mechanical requirement for a particular application, or to evaluate the electronic

features available with different models. Still, many users may not be aware of the

acoustic subtleties that can have major effects on ultrasonic sensor operation and the

measurement W i g made with them.

2.23 Selection of Ultrasonic Sensor.

Here we come to the section that can help user to select an ultrasonic sensor

with the best acoustical properties, such as frequency and beam pattern, for a

particular application, and how to obtain an optimum measurement fiom the sensor.

The first step in this process is to gain a better understand'ig of how variations in the

acoustical parameters of both the environment and the target affect the operation of

the sensors. Specifically, the following variable will be discussed namely variation in

the speed of sound as function of both temperature and the composition of the

transmission medium, usually air, and how these variations affect sensor

measurement accuracy and resolution.

Variation in the wavelength of sound as a function of both sound speed and

frequency, and how this effect the resolution, accuracy, minimum target size, and the

minimum and maximum target distances of an ultrasonic sensor. Variation in the

attenuation of sound as a function a both frequency and humidity, and how this

affects the maximum target distance for an ultrasonic sensor in air. Variation of the

amplitude of background noise as a function of frequency and how it can effects the

maximum target distance and minimum target size for an ultmmnic sensor. Variation

in the sound radiation pattern (beam angle) of both the ultrasonic transducer and the

Page 16: Design of Ultrasonic Alarm System

complete sensor system, and how this affects the maximum target distance and helps

eliminate extraneous target. Variation in the amplitude of the return echo as a

function of the target distance, geometry, surface and size, and how this affects the

maximum target distance attainable with and ultrasonic sensor.

2.2.3 Ultrasonic Motion Detectors.

Ultrasonic motion detectors can be used to detect motion in an area where

there are supposed no any moving objects. This type of motion detector is most

commonly used in burglar alarm systems since they are very effective in this

application.

Figure 2.2 : Ultrasonic motion detector

Page 17: Design of Ultrasonic Alarm System

Figure 2.2 shows the operation of an ultrasonic motion detector. There are

two transducers: one emits an ultrasonic wave and the other picks up reflections from

the different objects in the area. The reflected waves arrive at the receiver in constant

phase if none of the objects in the area are moving. If something moves, the received

signal is shifted in phase. A phase comparator detects the shifted phase and sends a

triggering pulse to the operation motor.

2.2.4 Transducer Configurations.

A transmitting transducer sends out a pulse of sound that is detected by a

receiving transducer. Figure 1 shows several types of transducer coniigurations. Two

transducers are mounted side by side. In this application, ultrasonic energy from the

transmitter is reflected by an object and the echo is detected by the receiving

transducer. This system measures the elapsed time from when the sound pulse is

transmitted to when the echo is detected to determine the exact range of the object

from the transducers. The application differs only in that a single transducer is used

to transmit the sound pulse and receive the echo.

In some applications, such as high-speed counting and mechanical equipment

positioning, it may be desirable to position the transducers opposing each other. For

clarity, the term "sensor" will be used in this article to describe either a single or dual

transducer configuration [5].

Page 18: Design of Ultrasonic Alarm System

2.25 Beam Angles and Side Lobes.

Ultrasonic transducers are often designed to be directional so that the sound is

efficiently transmitted or received only over a certain conical beam angle in fiont of

the sensor. Ultrasonic transducers can be designed to produce any beam angle

desired, from narrow (with beam widths of a just few degrees) to virtually omni

directional. Some narrow beam transducer designs produce side lobes as the sound

energy is transmitted. Advanced transducer designs eliminate all secondary side

lobes and are more desirable for ultrasonic echo ranging.

Different applications may require different beam angles for the sensors. In

most cases, however, narrower beam angles are usually preferable to broader ones. A

narrow beam angle system will not detect unwanted objects that are not in the

insonified path of the transducer. (To insonify means to fill a specific volume with

sound from a transducer). Namw beam angle systems are also less susceptible to

background ultrasonic noise, and the systems will also operate over a greater range.

The beam angle of a transducer, alpha, is defined as the total angle between

the points at which the sound power has been reduced to half its peak value. These

are commonly referred to as the 3 dB down points. It is often advantageous to

compute the spot diameter that is insonifid by the ultrasonic beam. To calculate this

spot diameter, use the formula:

D = 2 * R * tan(O.5 * alpha)

Where :

D = spot diameter in inches

R = target range in inches

alpha = total beam angle in degrees

Page 19: Design of Ultrasonic Alarm System
Page 20: Design of Ultrasonic Alarm System

sound travels through air, its energy attenuates more rapidly if the frequency is

increased.

The maximum theoretical attenuation for ultrasonic sound (up to 200 kHz)

may be calculated by this formula:

amax = f * 10-2 (2.4)

where:

amax =maximum attenuation in dB/fi

f = frequency in kHz

For example, using this equation, sound energy from a 215 kHz transducer

would be attenuated a maximum of 2.15 dl3/ft as it traveled through air. Attenuation

may be less, depending on humidity, but is not so easily defined or calculated.

Although attenuation limits the range of higher frequency transducers, there is a

bonus: background noise at the same higher frequency is also Iess. Higher frequency

ultrasonic sensors therefore, have a much better chance of working in an acoustically

noisy environment than do lower frequency sensors. Beam angle also helps to lower

background noise interference by limiting the transducer's noise sensitivity to the

area defined by the beam angle of the sensor. Some transducer designs utilize a

detachable horn. When the horn is attached, the beam angle of the transducer is

reduced. This concentration of acoustical energy into a tighter beam increases the

range of the sensor and reduces the background noise as well.

Page 21: Design of Ultrasonic Alarm System

2.2.7 Environmental Factors

2.2.7.1 Temperature.

The velocity of sound in air is 13,044 in./s at 0 C; it is directly proportional to

air temperature. As the ambient air temperature increases, the speed of sound also

increases. Therefore if a fixed target produces an echo after a certain time delay, and

if the temperature drops, the measured time for the echo to return increases, even

though the target has not moved. This happens because the speed of sound decreases,

returning an echo more slowly than at the previous, warma temperature. If varying

ambient temperatures are expected in a specific application, compensation in the

system for the change in sound speed is recommended.

2.2.7.2 Air Turbulence and Convection Currents.

A particular temperature problem is posed by convection currents that contain

many bands of varying temperature. If these bands pass between the sensor and the

target, they will abruptly change the speed of sound while present. No type of

temperature compensation (either temperature measurement or reference target) will

provide complete high-resolution correction at all times under these circumstances.

In some applications it may be desirable to install shielding around the sound beam

to reduce or eliminate variations due to convection currents. Averaging the return

times h m a number of echoes will also help reduce the random effect of convection

currents. Users addressing applications requiring high accuracy and resolution should

evaluate these suggestions carellly.

Page 22: Design of Ultrasonic Alarm System
Page 23: Design of Ultrasonic Alarm System

2.2.7.5 Acoustic Interference.

Special consideration must be given to environments that contain background

noise in the ultrasonic frequency spectrum. For example, air forced through a nozzle,

such as air jets used for cleaning machines, generates a whistling sound with

harmonics in the ultrasonic range. When in close proximity to a sensor, whether

d i t e d at the sensor or not, ultrasonic noise at or around the sensor's frequency may

affect system operation. Typically, the level of background noise is lower at higher

frequencies, and narrower beam angles work best in areas with a high ultrasonic

background noise level. Often a baffle around the noise source will eliminate the

problem. Because each application differs, testing for interference is suggested.

2.2.7.6 Radio Frequency Interference.

Another possible source of noise is RFI emitting from SCRs in a variable

speed drive. Shielding around the back and sides of the transducer may prevent RFI

noise from entering the system.

2.2.7.7 Splashing Liquids.

Splashing liquids should be kept from striking the surface of the sensor, both

to protect the sensor from damage if it is not splash proof and to ensure an open path

for the sound energy to travel. Sensors used in a splashing environment, however,

should be designed to operate when wet.

Page 24: Design of Ultrasonic Alarm System

Mounting orientation is also a consideration in such an environment. Straight-

down orientation can cause moisture to form as a large drop on the face of the sensor,

reducing the efficiency of the system. Certain applications permit mounting the

sensor so that it is aimed lower than horizontal but not pointed straight down; in this

orientation, gravity will help to keep moisture h m collecting on the face of the

sensor.

Two methods may be used to improve the reliability of ultrasonic in the

presence of splashing liquids. While beam bouncing provides a clever way of

keeping the sensor out of the immediate area of splashing liquids, some applications

don't lend themselves to this technique. An alternative method involves placing

around the sensor a short tube that extends out past its face but not into the actual

beam pattern. It is very important that the acoustic beam not be allowed to touch the

edge of the tube; if it does, the tube might deteriorate the acoustic performance.

2.2.8 Target Considerations.

2.2.8.1 Composition.

Nearly all targets reflect ultrasonic sound and therefore produce an echo that

can be detected. Some textured materials produce a weaker echo, reducing the

maximum effective sensing range. The reflectivity of an object is often a function of

fkquency. Lower fkquencies can have reduced reflections &om some porous

targets, while higher frequencies reflect well from most target materials. Precise

performance specifications can often be determined only through experimentation.

Page 25: Design of Ultrasonic Alarm System

2.2.8.2 Shape.

A target of virtually any shape can be detected ulhasonically if sufficient

echo returns to the sensor. Targets that are smooth, flat, and perpendicular to the

sensor's beam produce stronger echoes than irregularly shaped targets. A larger target

relative to sound wavelength will produce a stronger echo than a smaller target until

the target is larger than approximately 10 wavelengths across. Therefore, smaller

targets are better detected with higher frequency sound. In some applications a

specific target shape such as a sphere, cylinder, or internal cube comer can solve

alignment problems between the sensor and the target.

2.2.8.3 Target Orientation to Sensor.

To produce the strongest echoes, the sensor's beam should be pointed toward

the target. If a smooth, flat target is i n c l i i off perpendicular, some of the echo is

deflected away from the sensor and the strength of the echo is reduced. Targets that

are smaller than the spot diameter of the transducer beam can usually be inclined

more than larger targets. Sensors with larger beam angles will generally produce

stronger echoes from flat targets that are not perpendicular to the axis of the sound

beam. Sound waves striking a target with a coarse, irregular surface will diffise and

reflect in many d i i o n s . Some of the reflected energy may return to the sensor as a

weak but measurable echo. As always, target suitability must be evaluated for each

application.

Page 26: Design of Ultrasonic Alarm System

2.2.8.4 Averaging.

Certain applications involve a constantly moving target, such as the surface

of agitated liquid in a tank. Analog outputs, which may be averaged by a

Programmable Logic Controller or computer, will track the constant movement with

little difficulty, but set point outputs might turn on and off unnecessarily as the target

hovers around a set point distance. Hysteresis will prevent switched outputs from

oscillating to a certain extent, but if the agitation or movement is great enough, the

outputs will still switch on and off.

This problem can be easily solved in a number of ways. One method is to

delay the decision process by using a time delay relay (TDR). A DC powered on-

delay TDR may be directly connected to a set point output and programmed to delay

switching on its output until it has received power for a specific length of time. The

target will then have to be past the set point distance for that programmed time

before the TDR will turn on, activating the primary load. Measurement can also be

averaged with a Programmable Logic Controller (PLC) or an averaging digital panel

meters. PLCs have done for industrial control what word processing has done for the

modem office--they have provided flexibility and have reduced costs by greatly

simplifying the wiring and troubleshooting of a complete process system.

Ultrasonic systems have also increased the flexibility of measurement and

control systems used in typical applications. One ultrasonic system can often replace

multiple photoelectric, capacitive, or mechanical l i t switches and at the same time

provide additional distance information. The fact that all measurements are made

without physical contact with the target improves the lives of both the target and the

sensing system.

Page 27: Design of Ultrasonic Alarm System

2.3 PIC MICROCONTROLLER

23.1 What is a Microcontroller?

A computer revolution in the last 15 years has produced computer with very

high speeds and computing power while keeping their sizes compact. This revolution

has occurred as a result of a development of Large-scale Integration (LSI) and Very

Large-scale integration (VLSI) technologies, which put tern s of thousands of

transistor on a single chip. This has made in possible to fabricate the heart of a

microcomputer as a single chip called a microprocessor (h4F'U). This chip, with

additional auxiliary chips called peripherals, constitutes 'a microcomputer'. Such

peripherals are VO ports, memories, timers and so on.

The new technology has also made it possible to integrate this microprocessor

and its peripherals in a single chip called a microcontroller (MCU) That is the reason

a microcontroller is called a single-chip microcomputer.

23.2 Why Use a Microcontroller?

Microcontroller is inexpensive. The microcontroller's ability to store and run

unique programs makes it extremely versatile. For example, we can program a

microcontroller to make decision (pelform functions) based on predetermined

situations (VO line logic) and selections. The microcontroller's ability to perform

math and logic functions allows it to mimic sophisticated logic and electronic circuit.

Other program can make the microcontroller behave l i e a neural circuit andfor a

fuzzy logic controller. Microcontroller is responsible for the "intelligence" in most

smart devices on the consumer market.

Page 28: Design of Ultrasonic Alarm System

The are literally hundreds of microcontrollers on the market. Listed here are

some of the popular 8-bit microcontroller and their features 121. These devices are

the lowest cost representative devices fiom respective manufactures.

Table 2.1: Some 8-bit microcontroller s and their features.

COMPANY DEVICE ON-CHIP OTHER FEATURES

MEMORY

Atmel Attiny I1 1-Kbyte flash 8-bit timer, analog

comparator, watchdog, on-

chip oscillators, one external

intermpt.

Hitachi H813640 8-Kbyte ROM 512 Three, 8-bit timers, one 16-bit

Byte RAM PWM timer, one watchdog,

two SCI ports, eight 8-bit

ADC, 32 KHz sub clock

generator.

Microchip

Motorola

Zilog

PIC 16CR54C

68HC705KJl

Z8E000

768-byte ROM

25-byte Ram

1240-byte OTP

@-byte RAM

0.5-Kbyte OTP

32-byte RAM

Twelve VO pins, 8-bit timer,

high current sink/source fro

direct LED drive, watchdog,

timer RC oscillator.

15-stage multifunction timer,

on-chip oscillator, low voltage

reset, watchdog, keyboard,

intempt, high current YO

port.

One 16-bit timer, Watchdog,

four hardware interrupts, 13

vo pins.