34
1 CERTIFICATE This is to certify that the project titled “Range detector using ultrasonic sensor and PIC microcontroller” carried out by Rishabh Ranjan Karn, MD. Asif Husain Jeelani, Raushan Kumar, Prateek Bhattacharya and Ritika Raman is a bonafide work for the award of the Bachelor of Technology degree in Electronics and Instrumentation Engineering, KIIT University, Bhubaneswar, India. (SUPERVISOR) DEAN, SCHOOL OF ELECTRONICS ENGINEERING

Report on ultrasonic range finder

Embed Size (px)

DESCRIPTION

A final year project report on ultrasonic ranger finder using PIC micro-controller.

Citation preview

Page 1: Report on ultrasonic range finder

1

CERTIFICATE

This is to certify that the project titled “Range detector using ultrasonic sensor and PIC

microcontroller” carried out by Rishabh Ranjan Karn, MD. Asif Husain Jeelani, Raushan Kumar,

Prateek Bhattacharya and Ritika Raman is a bonafide work for the award of the Bachelor of

Technology degree in Electronics and Instrumentation Engineering, KIIT University,

Bhubaneswar, India.

(SUPERVISOR)

DEAN,

SCHOOL OF ELECTRONICS ENGINEERING

Page 2: Report on ultrasonic range finder

2

ACKNOWLEDGMENT

We take this opportunity to express our sincere gratitude to our supervisor Prof. Ravada

Satish Kumar for his valuable guidance. It would have never been possible for us to take this

project to completion without his innovative ideas and his relentless support and encouragement.

It has been a very enlightening experience to work under him.

We are also grateful to Prof. A. K. Ray, Dean of School of Electronics Engineering, for

his constant inspiration and encouragement during our work. We would also like to thank all

faculty members of Department of Electronics Engineering for their invaluable knowledge they

imparted to us and for teaching the principles in an exciting and enjoyable way.

Our special thanks to my friends for their constant suggestions in my work and moral

boost. I thank all staff members of School of Electronics Engineering of KIIT University who

helped in many ways directly or indirectly during the period of our work.

We express my deep sense of reverence and gratitude to our parents, for their love,

concern and blessings which are always with us.

RISHABH RANJAN KARN

RAUSHAN KUMAR

PRATEEK BHATTACHARYA

MD. ASIF HUSAIN JEELANI

RITIKA RAMAN

Page 3: Report on ultrasonic range finder

3

ABSTRACT

This project consists of a handheld range device using ultrasonic transducer and a PIC micro

controller. A two-line LCD display is used to display the measurements. There is a 40 kHz transmitter

and receiver. The 40 kHz transmission signal is generated via a square wave outputted from the PIC.

The PIC is then used to calculate the time of flight (TOF) for the sound wave that is bounced off the

distant objects. The return signal is amplified using two opamp amplifiers. There are three

potentiometers that need to be calibrated for correct operation. One controls the contrast of the LCD

display. Another controls the amplification of the third stage of the system. The third controls the

voltage offset that connects to the base of a NPN switching transistor. The measurement range of the

device is about twenty feet. This device can be used to even large displacement with pin point

accuracy. The heart of this distance meter is the microcontroller PIC16F84. This system potentially

has very large applications not only in various industries, the luxury automobile sector but also in the

armed force where accuracy and durability is of primary importance.

Page 4: Report on ultrasonic range finder

4

Contents

1. Introduction………………………………………………………………………………05

1.1 Basic Properties...................................................................................................05

1.2 Ultrasonic as distance sensor…………………………………………………………..06

1.3 Block Diagram………………………………………………………………………….07

2. The Literature Review…………………………………………………………………...08

2.1 Literature review overview……………………………………………………………..08

2.2 Ultrasonic system for collision avoidance………………………………………..........08

3. Designing and Description……………………………………………………………….09

3.1 Circuit explanation…………………………………………………………………......09

3.2 Distance calculation.............................................................................................13

3.3 General operation process.....................................................................................13

3.4 Parts (Components) explanation............................................................................14

3.5 Assembly instructions............................................................................................23

3.6 PCB Assembly layout............................................................................................23

4. Issues....................................................................................................................25

5. Test result and discussions.......................................................................................27

6. Use in industries.....................................................................................................30

7. Capabilitites...........................................................................................................31

8. Limitations.............................................................................................................32

9. Conclusion and Outcomes........................................................................................33

References............................................................................................................................34

Page 5: Report on ultrasonic range finder

5

Chapter 1

Introduction

Ultrasonic is the application of ultrasound. Ultrasound is an oscillating sound pressure wave

with a frequency greater than upper limit of the human hearing range. Ultrasound is thus not separated

from ‘normal’ (audible) sound based on differences in physical properties, only the fact that humans

cannot hear it. Ultrasonic testing (UT) is a family of non-destructive testing techniques based in the

propagation of ultrasonic waves in the object or material tested. In most common UT applications,

very short ultrasonic pulse-waves with center frequencies ranging from 0.1-15 MHz, and occasionally

up to 50 MHz, are transmitted into materials to detect internal flaws or to characterize materials.

A common example is ultrasonic thickness measurement, which tests the thickness of the test

object, for example, to monitor pipework corrosion. Ultrasonic testing is often performed on steel and

other metals and alloys, though it can also be used on concrete, wood and composites, albeit with less

resolution. It is used in many industries including steel and aluminum construction, metallurgy,

manufacturing, aerospace, automotive and other transportation sectors. Ultrasonic Transducer work

on a principle similar to radar or sonar, which evaluate attributes of a target by interpreting the echoes

from radio or sound waves respectively. Active ultrasonic sensors generate high frequency sound

waves and evaluate the echo which is received back by the sensor, measuring the time interval

between sending the signal and receiving the echo to determine the distance to an object. Passive

ultrasonic sensors are basically microphones that detect ultrasonic noise that is present under certain

conditions.

An ultrasonic transducer is a device that converts energy into ultrasound, or sound waves

above the normal range of human hearing. While technically a dog whistle is an ultrasonic transducer

that converts mechanical energy in the form of air pressure into ultrasonic sound waves, the term is

more apt to be used to refer to piezoelectric transducers or capacitive transducers that convert

electrical energy into sound. Piezoelectric crystals have the property of changing size when a voltage

is applied; applying an alternating current (AC) across them causes them to oscillate at very high

frequencies, thus producing very high frequency sound waves. The location at which a transducer

focuses the sound can be determined by the active transducer area and shape, the ultrasound

frequency, and the sound velocity of the propagation medium.

1.1 Basic Properties

The term Sonic is applied to Ultrasound waves of very high amplitudes.

Ultrasound devices operate with frequencies from 20 kHz up to several GHz.

The molecules of the material in which the waves are traveling cannot pass the vibration

along rapidly enough.

Page 6: Report on ultrasonic range finder

6

1.2 Ultrasonic as distance sensor

Ultrasonic sensors work on a principle similar to radar or sonar which evaluates attributes of a

target by interpreting the echoes from radio or sound waves respectively. Ultrasonic sensors generate

high frequency sound waves and evaluate the echo which is received back by the sensors. Sound field

of a non-focusing 4 MHz ultrasonic transducer with the transducer surface have a spherical curvature.

Ultrasonic sensors are devices that use electrical–mechanical energy transformation to

measure distance from the sensor to the target object. Ultrasonic waves are longitudinal mechanical

waves which travel as a sequence of compressions and rarefactions along the direction of wave

propagation through the medium. Apart from distance measurement, they are also used

in ultrasonic material testing (to detect cracks, air bubbles, and other flaws in the products), Object

detection, position detection, ultrasonic mouse, etc.

These sensors are categorized in two types according to their working phenomenon –

piezoelectric sensors and electrostatic sensors. Here we are discussing the ultrasonic sensor using the

piezoelectric principle. Piezoelectric ultrasonic sensors use a piezoelectric material to generate the

ultrasonic waves

Page 7: Report on ultrasonic range finder

7

1.3 Block Diagram

12 milliseconds is the time taken for the ultrasound waves to travel a maximum distance of 4

meters (time of flight gives twice the time taken to traverse a unit distance).

This system of distance measurement does not require large amount of memory hence a 20

pin 8051 based microcontroller AT89C2051, is chosen as the controller with 12MHz clock.

It performs the operation of giving the switching signal, computing the distance, converting

the hex value to decimal and then to ASCII to be displayed in the LCD.

Page 8: Report on ultrasonic range finder

8

Chapter 2

LITERATURE REVIEW

2.1 Literature Review Overview

In completing this project, some literature reviews have been done on several resources. The

theory and description plus details about the project have taken as guidance in completing this project.

By this chapter, an overview of some application that similar to the project and related project design

is present.

2.2 Ultrasonic Sensor System for Collision Avoidance.

The ultrasonic sensor also designed for detecting the vehicle that pass by the side of the

vehicle. The invention of this system is to enhance the rear- view mirrors and an improvement to the

blind spot of vehicle. The detection range of this device is higher which is 6 meter because it is used

more than two ultrasonic sensors to detect the target range thus increasing the cost of the device. From

this paper, the general study about other existing sensor system also being done. The Doppler radar

system, ultrasonic sensor system and vision system are the most popular and usable system that used

to detect the object distance. For Doppler radar system, it is not suitable for low speed because it will

cause an error.

Page 9: Report on ultrasonic range finder

9

Chapter 3

Designing and Description

3.1 Circuit Explanation

3.1.1 General operating principles

The PIC18F84 is the heart of the device. The PIC drives the transmitter and the LCD display.

When the send key is depressed a 40 kHz pulse is transmitted from the device. After a wait period

determined by mask setting the PIC listens for a response from the receiver circuit. While the PIC is

listening for a response from the receiver it counts the times that it goes through a loop. Once the

signal is received this count is used to calculate the distance from far object using the value for the

speed of light through air. The count value is a measure of the time of flight (TOF). Once the distance

is calculated it is displayed on the screen.

Page 10: Report on ultrasonic range finder

10

3.1.2 Power Supply

The power to the device is supplied via 9 volt battery. A 5 volt 100mA voltage regulator

reduces the voltage to about 5 volts. Capacitors span both sides of the regulator to reduce circuit

noise.

3.1.3 LCD interface

The LCD is driven by the PIC via a 4-bit interface. Pins RB0-RB3 on the PIC connects to the

4-bit mode data pins on the display. The enable and RS pins on the display are connected to RB4 and

RB5 on the PIC. The contrast is connected to a 47 k Ω potentiometer that is connected between VCC

and GND. This adjusted to set the correct display contrast. Power and ground is also connected

directly to the display contrast. Power and ground is also connected directly to the display device. On

power up the PIC initializes the display and sets it for 4-bit operation. A welcome message is then

displayed. After a measurement is made or the mask value is changed display code routines are called

to print these response messages on the display.

3.1.4 Transmitter Circuit

The 40 kHz transmitter is connecting directly to pins RA0 and RA1 on the PIC. The PIC

oscillates at a frequency of 40 kHz square wave with a peak to peak voltage of about 10 volts. This

signal is transmitted for approximately 130 µs per measurement.

3.1.5 Receiver Circuit

A 40 kHz receiver is connected between ground and the input of one half of LM358 opamp

(single-source-dual-opamp). The signal from the receiver goes through three stages of amplification.

The first two stages amplify the signal 100 times, effectively providing 10 thousand times

amplification. The third stage of amplification is an adjustable gain amplifier. The input resistance is a

variable resistor that ranges between 1 k Ω and 47 k Ω. The feedback resistor is a 50 k Ω resistor. This

provides an additional amplification between 1 and 50 times. The final output from the amplifier

circuit is connected directly to the base of the NPN switching transistor. Also connected to the base of

the switching transistor is a voltage offset provided by a 10 k Ω potentiometer connected between

VCC and GND. This provides the extra push that the signal needs to reach the switching region of the

Page 11: Report on ultrasonic range finder

11

transistor. The signal provides spikes that add to the offset voltage and switch the transistor into the

ON state.

The collector of the NPN transistor is connected directly to ground and the emitter is

connected to a 10 k Ω resistor that is in turn connected to VCC. Also connected to the emitter is the

RB7 pin on the PIC. When the transistor is in the off state the voltage at the emitter is just slightly

below VCC. When the transistor is in the ON state the voltage at the emitter drops to ground or very

near. It is this transition that triggers the interrupt flag within the PIC. This interrupt flag is read to

determine if the return signal has been received yet.

PIEZOELECTRIC CRYSTAL:

The piezoelectric crystal is one of the most commonly used elements in the ultrasonic

transducers. It can be used as the both, transmitting as well as the receiving device, in the transducers.

It is enclosed within the casing so that it can work efficiently and securely. The piezoelectric crystals

can work in the frequencies ranging from 20 KHz to 15MHz. The voltage passed through these

devices generates the ultrasonic waves.

Page 12: Report on ultrasonic range finder

12

Piezoelectric sensors have proven to be versatile tools for the measurement of various

processes. They are used for quality assurance process control and for research and development in

many industries. Although the piezoelectric effect was discovered by Pierre Curie in 1880, it was only

in the 1950s that the piezoelectric effect started to be used for industrial sensing applications. Since

then, this measuring principle has been increasingly used and can be regarded as a mature

technology with an outstanding inherent reliability. It has been successfully used in various

applications, such as in medical, aerospace, nuclear instrumentation, and as a tilt sensor in consumer

electronics[1]

or a pressure sensor in the touch pads of mobile phones. In the automotive industry,

piezoelectric elements are used to monitor combustion when developing internal combustion engines.

The sensors are either directly mounted into additional holes into the cylinder head or the spark/glow

plug is equipped with a built-in miniature piezoelectric sensor.

The rise of piezoelectric technology is directly related to a set of inherent advantages. The

high modulus of elasticity of many piezoelectric materials is comparable to that of many metals and

goes up to 106 N/m².

Even though piezoelectric sensors are electromechanical systems that react

to compression, the sensing elements show almost zero deflection. This gives piezoelectric sensors

ruggedness, an extremely high natural frequency and an excellent linearity over a

wide amplitude range. Additionally, piezoelectric technology is insensitive to electromagnetic

fields and radiation, enabling measurements under harsh conditions. Some materials used

(especially gallium phosphate or tourmaline) are extremely stable at high temperatures, enabling

sensors to have a working range of up to 1000 °C. Tourmaline shows pyro-electricity in addition to

the piezoelectric effect; this is the ability to generate an electrical signal when the temperature of the

crystal changes.

One disadvantage of piezoelectric sensors is that they cannot be used for truly static

measurements. A static force will result in a fixed amount of charges on the piezoelectric material.

While working with conventional readout electronics, imperfect insulating materials, and reduction in

internal sensor resistance will result in a constant loss of electrons, and yield a decreasing signal.

Elevated temperatures cause an additional drop in internal resistance and sensitivity. The main effect

on the piezoelectric effect is that with increasing pressure loads and temperature, the sensitivity is

reduced due to twin-formation. While quartz sensors need to be cooled during measurements at

temperatures above300 °C, special types of crystals like GaPO4 gallium phosphate do not show any

twin formation up to the melting point of the material itself.

However, it is not true that piezoelectric sensors can only be used for very fast processes or at

ambient conditions. In fact, there are numerous applications that show quasi-static measurements,

while there are other applications with temperatures higher than 500 °C.

Piezoelectric sensors can also be used to determine aromas in the air by simultaneously

measuring resonance and capacitance. Computer controlled electronics vastly increase the range of

potential applications for piezoelectric sensors.

Piezoelectric sensors are also seen in nature. The collagen in bone is piezoelectric, and is

thought by some to act as a biological force sensor.

Page 13: Report on ultrasonic range finder

13

3.2 Distance Calculation

A measurement is initiated via the send button. When first depressed the 40 kHz pulse is send

out through the transmitter. After the PIC has completed the transmission pulse the receiving stage is

entered. The receiver stage waits a certain amount of time before checking for signal reception. The

receiver stage of the code waits for a specified amount of time based on the masked value. This wait

period is to insure that the receiver does register the transmission signal as the return signal and also

to ignore the return signal bounced back from small obstruction that are between the device and the

object that a measurement is being made to. If the mask is set to zero, then the minimum default wait

period is performed. This period of time is the time it takes for the transmitted signal to travel one foot

and to return. Given the speed of sound, 1125ft/s, and an actual distance of two feet this wait time is

approximately 1.8ms. If the mask is greater than zero then the wait period is the time that it takes for

sound to travel 2 metres times the mask. This serves to make the mask value the approximate distance

in metres below which a return signal will be ignored. This time period is approximately 5.8ms.

After the wait period has elapsed the PIC clears any interrupt flag and begins looking for an

interrupt triggered by the reception of the signal. The PIC goes through a loop checking for the return

signal and if it is not detected then a counter is incremented. This loop is repeated until either the

counter is full or the signal is received. If the counter becomes full then the value of 0m is displayed.

Otherwise the calculation phase is entered.

2d = Δt * v

Where, d is the distance of the object, Δt is the time delay; v is the velocity of sound.

After the signal is received the calculation phase is entered. Each counter value of 562

equates to 1 metre. The distance waited based on the mask value and the distance calculated from the

counter value are added together. The feet and inch distances is then calculated from the distance in

metres. These two values are then displayed on the LCD.

3.3 General Operating Procedures

The power switch is first turned ON and display will read codes kit by HOBBYKITS4U

PRESS SEND key. The send key is the RED button. Pressing this button will cause the device to take

a measurement. As long as the send key is depressed the device will continue to take successive

measurements. The measurement in metres and feet/inches are given on the display. To measure the

distance to a far object point the end of the device with the round, silver transceivers at the object.

Press the send key and the distance will be measured. The black button controls the mask. The value

of the mask is shown at the bottom right hand corner of the display. Pressing the mask button will

cause this value to cycle from 0-4. The value is the number of metres below which the device will not

listen for an echo. This is used if there is some obstruction in the way and you we to measure to an

object past the obstruction.

Page 14: Report on ultrasonic range finder

14

3.4 Parts (Components) Explanation

3.4.1 PIC16CXX Microcontroller

PIC (Peripheral Interface Controller) is the IC which was developed to control the peripheral

device, dispersing the function of the main CPU. PIC has the calculation function and the memory

like the CPU and is controlled by the software. However, the throughout, the memory capacity aren’t

big. It depends on kind of PIC but the maximum operation clock frequency is about 20 MHz and the

memory capacity to write the program is about 1K to 4K words. The clock frequency is related with

the speed to read the program and to execute the instructions. Only at the clock frequency, the

throughout cannot be judged. It changes with the architecture in the processing parts for same

architecture: the one with the higher clock frequency is higher about the throughout.

The point which the PIC convenient for is that the calculation part, the memory, the

input/output part and so on, are incorporated into one piece of the IC. The efficiency, the function is

limited but can compose the control unit only by the PIC even if it doesn’t combine with the various

ICs so, the circuit can be compactly made.

Page 15: Report on ultrasonic range finder

15

3.4.2 Ultrasonic sensor

The ultrasonic sensor for the air is made by the Nippon Ceramic company. This sensor

separates into the two kinds for the transmitter and the receiver. For the transmitter, it is T40-16 and

for the receiver, it is R40-16. T shows the thing for the transmitter and R shows the thin for the

receiver. 40 show the resonant frequency of the ultrasonic (40 kHz). 16 show the diameter of the

sensor. The one of the terminal is connected with the case, when grounding; the terminal on the side

of the case should be used.

3.4.3 Low power operational amplifier (LM358)

This IC is the single power supply-type operational amplifier. This IC is used for the

detection of the received signal. The comparator can be used. The LM358 consists of two

independent, high gain , internally frequency compensated operational amplifier which were designed

specifically to operate from a single power supply over a wide range of voltages. Operation from split

power supplies is also possible and the low power supply current drain is independent of the

magnitude of the power supply voltage. Application area include transducers amplifiers ,dc gain

blocks and all the conventional op-amp circuit, which now can be more easily implemented in single

power supply systems.

Page 16: Report on ultrasonic range finder

16

Description

These devices consist of two independent, high-gain frequency-compensated operational

amplifiers designed to operate from a single supply over a wide range of voltages. Operation from

split supplies also is possible if the difference between the two supplies is 3 V to 32 V (3 V to 26 V

for the LM2904), and VCC is at least 1.5 V more positive than the input common-mode voltage. The

low supply-current drain is independent of the magnitude of the supply voltage.

Applications include transducer amplifiers, dc amplification blocks, and all the conventional

operational amplifier circuits that now can be implemented more easily in single-supply-voltage

systems. For example, these devices can be operated directly from the standard 5-V supply used in

digital systems and easily can provide the required interface electronics without additional ±5-V

supplies.

Features

Wide Supply Ranges

Single Supply: 3 V to 32 V (26 V for LM2904)

Dual Supplies: ±1.5 V to ±16 V (±13 V for LM2904)

Low Supply-Current Drain, Independent of Supply Voltage:

0.7 mA Typ

Wide Unity Gain Bandwidth: 0.7MHz

Common-Mode Input Voltage Range Includes Ground,

Allowing Direct Sensing Near Ground

Low Input Bias and Offset Parameters

Input Offset Voltage: 3 mV Typ

A Versions: 2 mV Typ

Input Offset Current: 2 nA Typ

Input Bias Current: 20 nA Typ

A Versions: 15 nA Typ

Differential Input Voltage Range Equal to Maximum-Rated

Supply Voltage: 32 V (26 V for LM2904)

Open-Loop Differential Voltage Gain: 100dB Typ

Internal Frequency Compensation

On Products Compliant to MIL-PRF-38535,

All Parameters Are Tested Unless Otherwise Noted.

On All Other Products, Production Processing Does

Not Necessarily Include Testing of All Parameters.

Page 17: Report on ultrasonic range finder

17

3.4.4 16-character LCD display (2x16)

The dot matrix liquid crystal display controller and driver LSI displays alphanumeric,

Japanese kana characters and symbols. It can be configured to drive a dot matrix liquid crystal display

under the control of a 4 or 8-bit microprocessor. Since all the functions such as display RAM

,character generator and liquid crystal driver, require for driving a dot matrix liquid crystal are

internally provided on one chip , a minimal system can be interfaced with this controller/driver.

2.4.5 LM7805

Three terminal positive voltage regulators are used to make the stable voltage of +5 volt for

microcontroller. The LM7805 is three terminal positive regulators are available in the TO-220/D-PAK

package and with several fixed output voltage, making them useful in a wide range of applications.

Each type employs internal current limiting, thermal shut down and safe operating area protection,

making it essentially indestructible. If adequate heat sinking is provided, they can deliver over 1 amp

output current. Although designed primarily as fixed voltage regulator.

Page 18: Report on ultrasonic range finder

18

A LM7805 Voltage Regulator is a voltage regulator that outputs +5 volts.

An easy way to remember the voltage output by a LM78XX series of voltage regulators is the last two

digits of the number. A LM7805 ends with "05"; thus, it outputs 5 volts. The "78" part is just the

convention that the chip makers use to denote the series of regulators that output positive voltage. The

other series of regulators, the LM79XX, is the series that outputs negative voltage. So:

LM78XX: Voltage regulators that output positive voltage, "XX"=voltage output.

LM79XX: Voltage regulators that output negative voltage, "XX"=voltage output

The LM7805, like most other regulators, is a three-pin IC.

Pin 1 (Input Pin): The Input pin is the pin that accepts the incoming DC voltage, which the voltage

regulator will eventually regulate down to 5 volts.

Pin 2 (Ground): Ground pin establishes the ground for the regulator.

Pin 3 (Output Pin): The Output pin is the regulated 5 volts DC.

Page 19: Report on ultrasonic range finder

19

Be advised, though, that though this voltage regulator can accept an input voltage of 36 volts,

it is recommended to limit the voltage to 2-3 volts higher than the output regulated voltage. For a 5-

volt regulator, no more than 8 volts should be applied as the input voltage. The difference between the

input and output voltage appears as heat. The greater the difference between the input and output

voltage, the more heat is generated. If too much heat is generated, through high input voltage, the

regulator can overheat. If the regulator does not have a heat sink to dissipate this heat, it can be

destroyed and malfunction. So the two options are, design your circuit so that the input voltage going

into the regulator is limited to 2-3 volts above the output regulated voltage or place a heat sink in your

circuit to dissipate the created heat.

Other components are-

BC549 transistor (npn)

Page 20: Report on ultrasonic range finder

20

Features

Low current (max 100 mA)

Low voltage (max 45v)

Applications-

Low noise stages in audio frequency equipment

Description

NPN transistor

1. emitter

2. base

3. collector

1N4007 DIODE

The 1N4001 series (or 1N4000 series[1]

) is a family of popular 1.0 A (ampere) general

purpose silicon rectifier diodes commonly used in AC adapters for common household

appliances. Blocking voltage varies from 50 to 1000 volts. Blocking voltage of 1N4007 is 1000V.

This diode is made in an axial-lead DO-41plastic package.

These are fairly low-speed rectifier diodes, being inefficient for square waves of more than 15 kHz.

4MHz CRYSTAL

A crystal oscillator is an electronic oscillator circuit that uses the mechanical resonance of a

vibrating crystal of piezoelectric material to create an electrical signal with a very

precise frequency. This frequency is commonly used to keep track of time to provide a stable clock

signal for digital integrated circuits, and to stabilize frequencies for radio transmitters and receivers.

The most common type of piezoelectric resonator used is the quartz crystal, so oscillator circuits

incorporating them became known as crystal oscillators, but other piezoelectric materials including

polycrystalline ceramics are used in similar circuits.

Quartz crystals are manufactured for frequencies from a few tens of kilohertz to hundreds of

megahertz. More than two billion crystals are manufactured annually. Most are used for consumer

Page 21: Report on ultrasonic range finder

21

devices such as wristwatches, clocks, radios, computers, and cell phones. Quartz crystals are also

found inside test and measurement equipment, such as counters, signal generators, and oscilloscopes.

33pF DISC

The 89000 series is a range of insulated disc, monolithic fixed ceramic capacitors. They are

most commonly used in consumer electronics and telecommunication equipment.

Capacitance: 33pf

Voltage: 50 volts DC

Withstand voltage: 150 volts DC

Operating temperature range: -13°F to 185°F

Tolerance range: ±10%

Series dimensions (DØxD): 5x4mm

Page 22: Report on ultrasonic range finder

22

0.1uF DISC (100N /104)

10uF / 25V

3386 PRESET

Page 23: Report on ultrasonic range finder

23

2.4 Assembly Instructions

The components supplied in the kit were checked. All the components were identified. The

lowest height components were soldered first: the IC socket, resistors and diode. The IC socket was

installed. Now the pin of the socket was soldered. The entire resister was installed next. In order to

find their values the colour code was checked. Then all the diode was installed. The bars on the diodes

were matched with the bar on the overlay. Afterwards the capacitors, switch, trimmer, transistors, and

other remaining components were soldered. Special care was taken to find the polarity of the

electrolytic capacitors. The LCD display module was connected to the PCB by the help of 16-pin

male-female connecter.

3.5 PCB Assembly Layout

R1 - 22E

R2 - 20K PRESET

R3, 5, 11, 12, 14- 10K

R6 - 1M

R7, 16, 10 - 100K

R8 - 470K

R9 - 47K

R13 - 50K / 3386 PRESET

R15 - 10K / 3386 PRESET

C1, 2 - 10uF / 25V

Page 24: Report on ultrasonic range finder

24

C3, 10 - 0.1uF DISC (100N /

104)

C4, 5 - 33pF DISC

C6, 7, 8, 9 - 0.022uF POLY (223 /

22N)

Y1 - 4MHz CRYSTAL

D1 - 1N4007 DIODE

Q1 - BC549

U1 - LM7805

U2 - PIC16F84 PRE

PROGRAMMED

MCU

U3, 4 - LM358

TX, RX - ULTRASONIC

SENSOR

Page 25: Report on ultrasonic range finder

25

Chapter 4

Issues

1) Conditions on the target

For contact less measurement of distance, the device has to rely on the target to reflect the

pulse back to itself. The target needs to have a proper orientation that is it needs to be perpendicular to

the direction of propagation of the pulses. Also if the reflectivity of the target is low, the signal

received by the device may not be detectable. For example we cannot expect the device to work on a

sound absorbing target. Hence the target needs to be oriented perpendicularly and it should have

high enough reflectivity.

2) Power and beam width

The power in the ultrasonic waves reduces exponentially with distance in the medium it

travels. We used 40 kHz ultrasonic because of the easy availability of the corresponding transducers.

Secondly, the beam width of typical ultrasonic sources is high, so that the waves diffuse in space.

These two considerations greatly limit the range achievable by ultrasonic methods. We can do our

best by transmitting pulses of high power, so that even after attenuation the signal is strong enough for

detection. This would mean the use of a good drive circuit for the transducer. To avoid the beam from

spreading, we can enclose the transmitter and receiver in a sound absorbing material.

3) Resonance of transducer

The transducer resonates at 40khz.(It has a narrow bandwidth of about 4khz centred at

40kHz).The transmitted signal must hence be a pulse train of 40kHz, consisting of enough cycles to

allow the transients to die down.

4) Conditions on the target

For contact less measurement of distance, the device has to rely on the target to reflect the

pulse back to itself. The target needs to have a proper orientation that is it needs to be perpendicular to

the direction of propagation of the pulses. Also if the reflectivity of the target is low, the signal

received by the device may not be detectable. For example we cannot expect the device to work on a

sound absorbing target. Hence the target needs to be oriented perpendicularly and it should have

high enough reflectivity.

5) Power and beam width

The power in the ultrasonic waves reduces exponentially with distance in the medium it

travels. We used 40 kHz ultrasonic because of the easy availability of the corresponding transducers.

Secondly, the beam width of typical ultrasonic sources is high, so that the waves diffuse in space.

These two considerations greatly limit the range achievable by ultrasonic methods. We can do our

best by transmitting pulses of high power, so that even after attenuation the signal is strong enough for

detection. This would mean the use of a good drive circuit for the transducer. To avoid the beam from

spreading, we can enclose the transmitter and receiver in a sound absorbing material.

Page 26: Report on ultrasonic range finder

26

6) Resonance of transducer

The transducer resonates at 40khz.(It has a narrow bandwidth of about 4khz centred at

40kHz).The transmitted signal must hence be a pulse train of 40kHz, consisting of enough cycles to

allow the transients to die down. The very narrow bandwidth of the transducer requires us to generate

40 kHz pulse train of adequate number of cycles accurately and reliably. Rather than generating this

pulse using hardware, for example by using the 555 timer, we would like to generate this pulse train

using a microcontroller (in software). Since it operates from a crystal, the microcontroller is accurate

and reliable.

7) Detection

Because of the resonance, the receiver must give a voltage of frequency 40 kHz across its

terminals. But a lot of other noisy waveforms were also detected. For example when the transmitter

was idle, some high frequency noise (in MHz) was detected at the receiver terminals. Also some noise

in 80-90 KHz range was present when the receiver was operating. Since we need to detect the 40 kHz

waveform, we must be frequency selective in our detection, and not send out false detections coming

from the noisy range to the measuring circuit. So the detection mechanism must ensure that it reports

the measuring unit only when it detects a near 40 kHz component. Once detected, the delay between

the corresponding edges of the transmitted and received pulses needs to be measured, and using the

velocity of sound, the distance can be estimated as

2d = Δt * v

Where, d is the distance of the object, Δt is the time delay; v is the velocity of sound.

8) Atmospheric Influences

The velocity of sound is dependent on temperature. The variation is about 1% every 6° C

around 20° C. Whether this is a critical problem or not depends on the accuracy the device achieves.

For accurate measurements, or if the device requires to operate under diverse environments with

similar results, then this must be taken into consideration. If not, it must be possible to include this

later without too much change in the design and the components.

Page 27: Report on ultrasonic range finder

27

Chapter 5

Test results and discussions

The circuit has been implemented on the PCB with a single gain stage with a gain of

about 200. This limits the maximum distance that can be measured and is observed to be about 4

meters with accuracy of about 3cm. This can be increased further by better amplification at the

receiver stage through cascading of amplifiers. With a gain of 900, a maximum range of 6m can be

achieved. This has been done and verified on the bread board. But this also limited the minimum

range because we had to increase the number of cycles transmitted. This was essential for proper

decoding at the tone decoder. The minimum distance that can be measured is about 60 cm. This

limitation is caused by the fact that we have signal detection during transmission itself.

To avoid this, the external interrupt pin is disabled for some time during transmission period.

This time approximately corresponds to the aforementioned distance. When the transmission and

reception was continuous, the current drawn from 18V source (with a 7805 regulator to give 5V to the

microcontroller) was about 30mA. Since transmission and reception are only done for a short time,

power consumption takes place only for a short time. Nevertheless, a battery that can provide the

required peak current needs to be chosen. The transmitter and receiver have been enclosed in foam to

improve directivity.

Page 28: Report on ultrasonic range finder

28

TABLE-I:

Observation table

Minimum range : 10 inches

Maximum range: 120inches

Sl. No. Actual Readings

(inches)

Observed Readings

(inches)

01 0 10

02 4 10

03 8 10

04 12 11

05 16 15

06 20 19

07 24 23

08 28 27

09 32 32

10 36 36

11 40 40

12 44 44

13 48 48

Page 29: Report on ultrasonic range finder

29

A graph was plotted between the number of readings and Distance (in inch) for both actual

reading and observed reading. Initially there was an error of 10inches due to the limitation of

minimum measurement of 10inches. Later, as the distance increased the actual reading and observed

reading were found to be equivalent.

Page 30: Report on ultrasonic range finder

30

Chapter 6

Use in Industry

Ultrasonic sensors are used to detect movement of targets and to measure the distance to

targets in many automated factories and process plants. Sensors with an on or off digital output are

available for detecting the movement of objects, and sensors with an analog output which varies

proportionally to the sensor to target separation distance are commercially available. They can be used

to sense the edge of material as part of a web guiding system. Ultrasonic sensors are widely used in

automotive applications for parking assist technology. Ultrasonic sensors are being tested in a number

of uses including ultrasonic people detection and assisting in autonomous UAV navigation. Because

ultrasonic sensors use sound rather than light for detection, they work in applications where

photoelectric sensors may not.

Ultrasonic is a great solution for clear object detection, clear label detection and for liquid

level measurement, applications that photo electrics struggle with because of target translucence.

Target color and/or reflectivity do not affect ultrasonic sensors which can operate reliably in high-

glare environments. Passive ultrasonic sensors may be used to detect high-pressure gas or liquid leaks,

or other hazardous conditions that generate ultrasonic sound. High-power ultrasonic emitters are used

in commercially available ultrasonic cleaning devices. An ultrasonic transducer is affixed to a

stainless steel pan which is filled with a solvent (frequently water or isopropanol), and a square wave

is applied to it, imparting vibrational energy in the liquid.

Page 31: Report on ultrasonic range finder

31

Chapter 7

Capabilities

Accounting for Temperature dependence

The variation in the velocity of sound can be accounted for by using a temperature sensor and

taking the value of velocity according to the temperature. Or, we can also include a self-calibration

feature, which is that the device measures a standard distance and calculates the velocity and uses it

for subsequent calculations. This can be included without too much change in the hardware.

Improvement of accuracy

One more method for determining the distance of a target is the phase shift method, wherein a

continuous wave is transmitted, and the shift in phase of the received wave is measured to get the

distance. In this method the maximum range is limited by the wavelength of the ultrasonic wave

transmitted. This means the maximum distance is very low (of the order of 7.5 mm), hence not good

for long range applications. But this method can be combined with the time of flight method to obtain

very high accuracies at large range. One recent method (“A high accuracy ultrasonic distance

measurement system using binary frequency shift-keyed signal and phase detection” Huang Et Al

Review Of Scientific Instruments Volume 73, Number 10 October 2002) uses the above principle.

Using this method, very high accuracies can be obtained.

Internal defects can be detected and sized.

Thick specimens take no more time to examine than thin ones.

Access to only one side of the component is needed.

There is no radiation hazard in ultrasonic examination, and hence no disruption of work as

there is with radiography.

Planar defects can be detected, irrespective of their orientation.

Page 32: Report on ultrasonic range finder

32

Chapter 8

Limitations

Implementing circuit with a larger range on PCB

The range of the circuit implemented on PCB currently is small. This can be improved by

including a higher gain receiver circuitry. This has been already tested on bread board. Further

limitations are-

A high degree of operator skill and integrity is needed. Hence, the need for trained

and certified NDT personnel

In most examinations, there is no permanent record of the inspection as there is in

radiography

In certain materials, like austenitic steel, the large grain size found in welds can cause

attenuation and this may mask defects

Spurious indications, and the misreading of signals, can result in unnecessary repairs

Page 33: Report on ultrasonic range finder

33

Chapter 9

Conclusions and Outcomes

CONCLUSION

The microcontroller with LCD makes it user friendly.

The circuit can easily been implemented on bread board and tested for its functionality by

varying the distance between the transducer and the target.

The target surface needs to be perpendicular to the impinging ultrasound waves.

The power level of the signal is too low for long range measurement.

Less hardware are used so smaller in size.

Inexpensive components used so that reduces the cost per unit.

OUTCOMES

We have found that this project is effectively useful in research and development area as well

as in Army and civil area.

Major outcome is that this project can replaced too many costly types of equipment which we

have to buy from foreign countries.

Product is also eco-friendly because it does not harm Earth’s environment.

Project is less complicated than other, so analysis and replacement of components is easy.

Page 34: Report on ultrasonic range finder

34

REFERENCES

http://www.pepperl-fuchs.com/global/en/classid_182.htm

http://ieeexplore.ieee.org/stamp/stamp.jsp?arnumber=936931

http://www.sensorsmag.com/sensors/acousticultrasound/choosing-ultrasonic-sensor-

proximity-or-distancemeasurement-825

http://ieeexplore.ieee.org/xpls/icp.jsp?arnumber=5601109

http://ieeexplore.ieee.org/xpls/abs_all.jsp?arnumber=6125847

http://technav.ieee.org/tag/7997/piezoelectric-effect

http://ieeexplore.ieee.org/xpls/abs_all.jsp?arnumber=5995125