ultrasonic-based distance measurement device

16
GEETANJALI INSTITUTE OF TECHNICAL STUDIES UDAIPUR, RAJASTHAN (Affiliated to Rajasthan Technical University, Kota, Rajasthan Abstract The report details the implementation of distance measurement system using the ultrasonic waves. As the human ear’s audible perception range is 20 Hz to 20 kHz, it is insensitive to ultrasonic waves, and hence the ultrasound waves can be used for applications in industries/vehicles without hindering human activity. They are widely used as range meters and proximity detectors in industries also it can be used in parking assistance system. The distance can be measured using pulse echo and phase measurement method. Here the pulse echo method is used. The measurement unit uses a continuous signal in the transmission frequency range of ultrasonic transducers. The signal is transmitted by an ultrasonic transducer, reflected by an obstacle and received by another transducer where the signal is detected. The time delay of the transmitted and the received signal corresponds to the distance between the system and the obstacle.

Upload: mrinal-sharma

Post on 15-Jan-2015

1.232 views

Category:

Technology


1 download

DESCRIPTION

Project report for Ultrasonic-based distance measurement device.

TRANSCRIPT

Page 1: Ultrasonic-based distance measurement device

GEETANJALI INSTITUTE OF TECHNICAL STUDIES UDAIPUR, RAJASTHAN

(Affiliated to Rajasthan Technical University, Kota, Rajasthan

Abstract

The report details the implementation of distance measurement system using the ultrasonic

waves. As the human ear’s audible perception range is 20 Hz to 20 kHz, it is insensitive to

ultrasonic waves, and hence the ultrasound waves can be used for applications in

industries/vehicles without hindering human activity. They are widely used as range

meters and proximity detectors in industries also it can be used in parking assistance

system. The distance can be measured using pulse echo and phase measurement method.

Here the pulse echo method is used. The measurement unit uses a continuous signal in the

transmission frequency range of ultrasonic transducers. The signal is transmitted by an

ultrasonic transducer, reflected by an obstacle and received by another transducer where

the signal is detected. The time delay of the transmitted and the received signal

corresponds to the distance between the system and the obstacle.

Page 2: Ultrasonic-based distance measurement device

GEETANJALI INSTITUTE OF TECHNICAL STUDIES UDAIPUR, RAJASTHAN (Affiliated to Rajasthan Technical University, Kota, Rajasthan) 2

Contents

Chapter 1 3

1. Introduction 3

2. Origin of the Proposal 3

3. Definition of the problem 3

Chapter 2 4

1. Ultrasonic-based distance measurement: state of the art 4

2. Classification of measurement methods 5

3. Measurement method based on threshold detection 5

Chapter 3 7

1. Design procedure 7

1.1 Transmitting unit 7

1.1.1 Switch 7

1.1.2 Microcontroller 7

1.1.3 Gain Amplifier 8

1.2 Receiver unit 8

1.2.1 Amplifier 8

1.2.2 Comparator 8

2. Description 8

2.1 Firmware description 9

Chapter 4 13

1. Conclusion 13

2. Proposed outcome/ findings 13

References

APPENDIX

Page 3: Ultrasonic-based distance measurement device

GEETANJALI INSTITUTE OF TECHNICAL STUDIES UDAIPUR, RAJASTHAN (Affiliated to Rajasthan Technical University, Kota, Rajasthan) 3

Chapter 1

1. Introduction

The techniques of distance measurement using ultrasonic in air include

continuous wave and pulse echo technique. In the pulse echo method, a burst of pulses is sent

through the transmission medium and is reflected by an object kept at specified distance. The

time taken for the pulse to propagate from transmitter to receiver is proportional to the

distance of object. 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. The amplitude of the

received signal gets significantly attenuated and is a function of nature of the medium and the

distance between the transmitter and target. The pulse echo or time-of-flight method of range

measurement is subject to high levels of signal attenuation when used in an air medium, thus

limiting its distance range.

The measuring principle of most methods is the estimation of the time-of-light

(TOF) of an ultrasonic burst (high-frequency sinusoidal pulse train) generated by a proper

transducer; i.e. the time elapsing between the firing up of the transducer and the detection of

the echo originated by any discontinuity or reflector in the propagation medium. The desired

information, x, concerning distance (the object of unknown distance acts like a reflector), or

level (the surface of the fluid of unknown level gives rise to a discontinuity), or integrity (any

crack in the structure under test disturbs medium continuity) is then gained through a very

common and straightforward expression

Where c is the propagation velocity of the ultrasonic burst, and t is the TOF

estimate.

2. Origin of the Proposal Ultrasonic-based measurements are extensively used both in research

and production field, spanning in endless applications: environment sensing of autonomous

mobile robots, high definition imaging of biomedical devices, precise location of micro-flaws

in materials, accurate estimation of the level of flammable fluids or dangerous rivers, and so

on. The reason of this success mainly relies upon the opportunity offered by ultrasonic’s of

conceiving rather simple methods or building up relatively cheap meters, characterized by

satisfactory accuracy, reduced measurement time, and, above all, high level of intrinsic

safety.

3. Definition of the problem Ultrasonic waves are the waves with a frequency greater than the

upper limit of human hearing (greater than 20 kHz).Ultrasonic waves Send into(onto) a body

which are reflected at the interfaces and Return time of the waves tells us of the

depth(Distance) of the reflecting surface. The time taken for the pulse to propagate from

transmitter to receiver is proportional to the distance of object.

Page 4: Ultrasonic-based distance measurement device

GEETANJALI INSTITUTE OF TECHNICAL STUDIES UDAIPUR, RAJASTHAN (Affiliated to Rajasthan Technical University, Kota, Rajasthan) 4

Chapter 2

1. Ultrasonic-based distance measurement: state of the art The contactless and cheap measurement of distances in the range of a

few millimeters to a few meters is a strategic task in several fields [1]-[3]. Although several

solutions providing good accuracy can be conceived, for example optical solutions which are

based on lasers or position sensitive devices, such solutions are usually rather expensive. In

addition, in several cases the use of lasers or other high-power systems cannot be accepted in

hazardous environments or when low energy devices are prescribed [4]. In these cases low-

power ultrasonic sensors are a cost-effective solution, especially when low-frequency devices

(30-50 kHz) are used [5]-[7]. What are ultrasounds? Like the visible spectrum, the audio

spectrum corresponds to the standard human receptor response function and covers a

frequency range from 20 Hz to 20 kHz, although, with age, the upper limit is reduced

significantly. For both light and sound, the “human band” is only a tiny slice of the total

available bandwidth. In each case the full bandwidth can be described by a complete and

unique theory, that of electromagnetic waves for optics and the theory of stress waves in

material media for acoustics. Ultrasonic is defined as that band above 20 kHz. It continues up

into the MHz range and finally, at around 1 GHz, goes over into what is conventionally called

the hypersonic regime. The full spectrum is shown in Fig.1, where typical ranges for the

phenomena of interest are indicated. Most of the applications of interest take place in the

range of 1 to 100 MHz, corresponding to wavelengths in a typical solid of approximately 1

mm to 10 µm, where an average sound velocity is about 5000 m/s. In water-the most widely

used liquid-the sound velocity is about 1500 m/s, with wavelengths of the order of 3 mm to

30 µm for the above frequency range.

Fig.1 Common frequency ranges for various ultrasonic processes

An advantage of measuring methods exploiting ultrasonic waves is that they

enable the direct accomplishment of a digital measurement without the need for conversion

of an analog signal to a digital one by an analog-to digital converter (ADC). In most

applications, either the velocity of the ultrasonic wave or the time of flight of a wave over the

measured distance is utilized. From a technological point of view, another advantage is that

the propagation velocity of ultrasonic waves is many orders lower than that of

electromagnetic waves. Because of this, less stringent demands are required on the

transducers and associated electronic circuits. On the other hand, the use of ultrasonic waves

has certain drawbacks too, in particular the large dependence of their propagation velocity on

the parameters of the propagation medium, and their high attenuation and scattering,

especially in air.

These circumstances determine the boundaries for the full exploitation of

ultrasonic measuring methods. In the first instance, they are limited to relatively small

Page 5: Ultrasonic-based distance measurement device

GEETANJALI INSTITUTE OF TECHNICAL STUDIES UDAIPUR, RAJASTHAN (Affiliated to Rajasthan Technical University, Kota, Rajasthan) 5

distances, compared with methods employing electromagnetic radiation. In case where more

accurate measurements are required, ultrasonic techniques become more complicated due to

the need to compensate for the effects of fluctuations of the parameters of the propagation

medium. In the following, some general methods are described which are most often used for

in-air distance measurement.

2. Classification of measurement methods Measuring methods can roughly be divided into two fundamental

groups. One of them uses a continuous (harmonic, periodic) wave motion, the other one uses

discontinuous (pulsed) waves. The case of harmonic ultrasonic waves is commonly used to

evaluate the phase shift between the transmitted and the received signals. The phase change is

dependent on the measured quantity, e.g. a distance, in an unchanged and stationary medium,

on the composition the (fluid) medium at a stationary distance between the transducers, and

on the medium flow rate, temperature, etc. Therefore, these methods can be included in the

group of methods which use phase modulation.

In the case of measurements involving a pulsed ultrasonic wave, the duration

of the pulse propagation, from the transmitter (pulse generator) to the receiver (pulse front

detector), is usually evaluated. The duration of the pulse propagation depends on the

transmitter receiver distance, as well as on the properties (and the motion) of the intervening

medium.

It is worth noting that it is possible for the same transducer to act as

transmitter and receiver, thus allowing a reduction of complexity of the meter. Generally this

method can be classified among those using time-pulse modulation. In the case of the

detection of a reflected pulsed ultrasonic wave from an object, the method is analogous to the

radiolocation method. Both methods have advantages and drawbacks of their own. It is worth

noting that, although accurate, the phase determination is insufficient for the evaluation of the

pulse propagation because the result has a periodicity of one carrier wavelength. This way, in

the following, measuring methods using pulsed ultrasonic waves will only be analyzed in

details; in particular, the most interesting solutions, in order of increasing measurement

reliability, are presented.

3. Measurement method based on threshold detection As stated above, pulse methods evaluate the time of propagation (i.e.

the time of flight, TOF) of an ultrasonic pulse wave from a transmitted to a receiver. For the

case of distance measurement, a typical example of a digital evaluation of the TOF [8] is

illustrated in Fig.2. At the start of a measurement, a pulse generator excites a voltage

pulse, . This is converted in the transmitter to an ultrasonic pulse which propagates towards

the receiver at a velocity c. After the front edge of the pulse wave falls on the active surface

of the receiver, a voltage, , appears at the amplifier output. When the amplitude of the

received signal overcome a fixed threshold the echo is assumed to be detected, and the time

measuring pulse, is stopped. The conversion of the pulse propagation time into a number

is then carried out by a circuit depicted in the lower part of Fig.2.a; at its input there is a

bistable circuit whose output is set to the active (logical one) state.

Page 6: Ultrasonic-based distance measurement device

GEETANJALI INSTITUTE OF TECHNICAL STUDIES UDAIPUR, RAJASTHAN (Affiliated to Rajasthan Technical University, Kota, Rajasthan) 6

Fig.2. Measurement of distance through threshold-based method

This results in the opening of the gate through which pulses, , begin to pass

from the clock (time mark) generator to a reversible counter. After arrival of the pulse , the

bistable returns to its initial (zero) state and the measurement is over. On the counter display,

a number appears which corresponds to the measured distance. The process described is

illustrated in the time diagrams of Fig.2.b.

The measured distance, x, can be expressed through the propagation time, TOF, of the

ultrasonic wave as

According to the type (direct or reflected) of performed measurement. At the

same time, it is also true that , where f stands for the clock fundamental

frequency. By considering the inherent error of the time-to-digital conversion (i.e. the

quantization error), it can be written

In order to read the distance in a straightforward way in length units, its value

should be expressed in decimal order of tens. In order to lower the discretization error, the

working frequency of the clock is chosen sufficiently high (as a rule, tens of MHz are used).

As an example, if 20 °C is the environmental temperature in the working space, the frequency

can be 34.37 MHz. On measuring a distance of x=1 m, there is a reading of 100000±1 on

the counter display; the resolution is then 10 µm.

The threshold method proves itself very easy and simple to realize on actual

sensor. Its main drawback is the uncertainty associated to the instant of detection of the

received signal. As for all the similar threshold method, the echo receiver suffers from noise

sensitivity: in fact, spike superimposed to the useful signal can give rise to spurious

identification of the TOF. Finally, the threshold does not identify the right onset of the signal;

this way, the obtained measurements are unavoidably biased. The problem is makes worse in

the presence of signal shape distortion.

Page 7: Ultrasonic-based distance measurement device

GEETANJALI INSTITUTE OF TECHNICAL STUDIES UDAIPUR, RAJASTHAN (Affiliated to Rajasthan Technical University, Kota, Rajasthan) 7

Chapter 3

1. Design procedure The circuit has been divided into two divisions:

(i) Digital section- micro controller and LCD display unit with 5volt power supply.

(ii) Analog section-

1. Transmitting side - Ultrasonic transducers, gain amplifier using uA741 CD4066

CMOS analog switch.

2. Receiving side - TL084 comparator, gain amplifier, voltage limiter.

(iii) +15V and -15V power supply.

The overall block diagram is shown in Fig.3

Fig. 3 Block Diagram

The overall block diagram shows different blocks such as amplifiers,

microcontroller, receiver etc.

1.1 Transmitting unit 1.1.1 Switch

An analog switch CD4066 is used to allow the sine wave from function generator to

the gain amplifier. The excitation to the Transmitter is given from the Function generator

through the switch which can be digitally controlled. As the switch can pass only positive

voltages, the 40 kHz, 1Vp-p, sine wave from the function generator is given a DC shift of

0.5V.

1.1.2 Microcontroller

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: Ultrasonic-based distance measurement device

GEETANJALI INSTITUTE OF TECHNICAL STUDIES UDAIPUR, RAJASTHAN (Affiliated to Rajasthan Technical University, Kota, Rajasthan) 8

1.1.3 Gain Amplifier

As the 40 kHz sine wave cannot be passed through the analog switch 4066, a gain

amplifier with level shifter is required. Both are integrated and built using μA741 opamp.

1.2 Receiver unit

1.2.1 Amplifier

The Frequency of the received pulse is of 40 kHz which requires amplifiers working

at high frequency. TL084 is used, as it has good high frequency gain characteristics. The gain

of the amplifier is set to 1000 in two stages with first being 100 and second being 10. The

gain is set by taking into account the least magnitude (50mV) of the receiver output when

sensing an object at distance of 2 meters.

1.2.2 Comparator

The output signal from the amplifier is passed through the comparator which

compares with a reference threshold level to weed out the noises and false triggering. The

signal is a series of square pulses as shown in Fig.4 with amplitude of 15 volts. This is passed

through the voltage limiter (zener regulator) to be fed to the microcontroller for counting the

pulses.

2. Description The time of flight method is used for finding the distance between the

transmitter and the object. The transmitter sends out a burst of pulses and a receiver detects

the reflected echo. The time delay between the corresponding edges of the transmitted and

received pulses is measured by microcontroller, this gives the time of flight. Substituting the

time delay and the velocity of ultrasound in air (330 meters/second) in the following formula

we can determine the distance between the transmitter and the target. Fig.4 shows the

transmitted and received pulses.

Distance = Velocity X Elapsed time

Fig.4 Transmitted and Received Pulses

Page 9: Ultrasonic-based distance measurement device

GEETANJALI INSTITUTE OF TECHNICAL STUDIES UDAIPUR, RAJASTHAN (Affiliated to Rajasthan Technical University, Kota, Rajasthan) 9

Time of flight = 950μs

Distance measured =

Microcontroller calculates the distance by the above formula. This distance is

twice of the required distance. Hence it is reduced to half and this calculated distance is

displayed on the LCD. The LCD is refreshed every 250 milliseconds.

Fig.5 Signals in the receiver section

2.1 Firmware description The microcontroller closes the switch for duration of 250

microseconds to allow 10 cycles of 40 kHz sine wave. The sine wave varying between 0-1V

passes through the switch to the gain amplifier. The level shifter and gain amplifier gives a

sine wave with output varying between - 10V and +10V. The transmitter sends out a burst of

10 pulses. As the transducers are directional they are positioned to face the target. Flow chart

of the program is given in Fig. 6(a) & 6(b).

Page 10: Ultrasonic-based distance measurement device

GEETANJALI INSTITUTE OF TECHNICAL STUDIES UDAIPUR, RAJASTHAN (Affiliated to Rajasthan Technical University, Kota, Rajasthan) 10

Fig.6 (a) Flow chart of the Program

Page 11: Ultrasonic-based distance measurement device

GEETANJALI INSTITUTE OF TECHNICAL STUDIES UDAIPUR, RAJASTHAN (Affiliated to Rajasthan Technical University, Kota, Rajasthan) 11

Fig.6 (b) Flowchart of the Program.

Page 12: Ultrasonic-based distance measurement device

GEETANJALI INSTITUTE OF TECHNICAL STUDIES UDAIPUR, RAJASTHAN (Affiliated to Rajasthan Technical University, Kota, Rajasthan) 12

The microcontroller waits to receive the pulses for a maximum duration of 12

milliseconds. This 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). If it doesn’t

receive the pulses within this time it is considered as absence of object or object out of range.

Once the pulses are received the microcontroller counts 10 pulses with a time spacing of 25

microseconds only then the measurement is considered valid and the computation using the

formula is implemented. Necessary hex to decimal conversion and decimal to ASCII

conversions are performed to display the output of the computation in the LCD. The

appendix gives the detailed program with necessary comments for this application.

Page 13: Ultrasonic-based distance measurement device

GEETANJALI INSTITUTE OF TECHNICAL STUDIES UDAIPUR, RAJASTHAN (Affiliated to Rajasthan Technical University, Kota, Rajasthan) 13

Chapter 4

1. Conclusion The microcontroller with LCD makes it user friendly and can be

embedded in a single unit. The circuit has 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.

2. Proposed outcome/ findings 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 bought from foreign countries in their currency which also

effects on our economy. This will be homemade equipment so it will definitely charge less

than foreign equipment. It will become very useful product for new generation of research.

3. Utilization of the outcome of project Frequency used is higher than human audible range (i.e. less than 20 KHz) and much

less than microwave frequency (i.e. higher than 1GHz), so it is harmless for human

beings.

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.

Less hardware are used so smaller in size.

Inexpensive components used so that reduces the cost per unit.

By few modification according to use it can replace foreign instruments and reduce

the dependency on foreign countries.

Also support economy by all kind, cause all component easily available in our

country.

Size can be reducing with much higher rate by using nano technology and circuit can

be easily implemented on unmanned robots.

It can be use with automobiles and toys also in daily life’s instruments.

A broad range of devices needs to measure distance, so it will be useful and efficient

for them.

It can be utilize with Wi-Fi, GSM & wireless radios with a wide range of working

areas.

The range can be considerably increased by using high power drive circuit.

Using temperature compensation, it can be used over wide temperature range.

The resolution of the measurement can be improved by incorporating phase shift

method along with time of flight method.

Can be used as parking assistance system in vehicles with high power ultrasonic

transmitter.

The 40 kHz signal can be generated using microcontroller itself which will reduce

hardware.

It can be utilized with unmanned armed robot with easy modification.

It can be utilized with GPS system, so that directions and monitoring as well as

controlling become easier.

Page 14: Ultrasonic-based distance measurement device

GEETANJALI INSTITUTE OF TECHNICAL STUDIES UDAIPUR, RAJASTHAN (Affiliated to Rajasthan Technical University, Kota, Rajasthan) 14

References

[1] P. Kleinschmidt and V. Magori, Ultrasonic robotic-sensors for exact short range distance

measurement and object identification, Ultrasonics Symp. Proc, IEEE, 1985, Vol.1, pp.457-

462.

[2] D. Marioli, E. Sardini and A. Taroni, Ultrasonic distance measurement for linear and

angular position control, IEEE Trans. lustrum. Meas. Vol.37, N.4, December 1988, pp.578-

581.

[3] C. Lougblin, Ultrasonic measurement: keeping your distance, Sensor Rev., April 1989,

pp.85- 89.

[4] G. Hayward and Y. Gorfu, A digital hardware correlation system for fast ultrasonic data

acquisition in peak power limited applications, IEEE Trans. Ultrason. Ferroelec. Freq.

Control, Vol.35, N.6, November 1988, pp. 800-808.

[5] LM 1812 Ultrasonic Transceiver, National Semiconductor Special Purpose Linear

Devices Databook, 1989, pp. 9/77-9/84.

[6] Murata ultrasonic sensors, Murata Products 1991, 1991, p. 77.

[7] Honeywell ultrasonic distance sensors Series 942, Honeywell Data Sheet El 01, 1989.

[8] S. Kocis, Z. Figura, Ultrasonic Measurements and Technologies, Chapman and Hall,

London, 1996.

Page 15: Ultrasonic-based distance measurement device

GEETANJALI INSTITUTE OF TECHNICAL STUDIES UDAIPUR, RAJASTHAN (Affiliated to Rajasthan Technical University, Kota, Rajasthan) 15

Table.1 Components and their Specification

Item Quantity Reference Specification

1 15 Capacitors 10mF

2 10 Capacitors 33pF

3 8 Capacitors 0.1mF

4 5 Capacitors 1nF

5 5 Zener Diode 5Z1

6 10 Diode LED

7 6 Display LCD

8 4 Port BNC

9 20 Resistance 10K

10 6 Speaker 40F

11 10 Resistance 1K

12 8 Resistance 320K

13 5 Resistance 100K

14 5 Resistance 1M

15 6 Microcontroller AT89C2051

16 4 IC CD4066

17 5 3-Terminal Regulator LM7805

18 5 Op-Amp TLO84

19 5 Op-Amp UA741

20 5 Oscillator 12MHz

21 2 PCB Fabrication Kit Type G

21 5 PCB board 12 inch

22 20 IC Holders As per design

Page 16: Ultrasonic-based distance measurement device

GEETANJALI INSTITUTE OF TECHNICAL STUDIES UDAIPUR, RAJASTHAN (Affiliated to Rajasthan Technical University, Kota, Rajasthan) 16

23 10 Battery 9volt