Ultrasonic Based Distance Measurement System
Ultrasonic Based Distance Measurement System
Ultrasonic Based Distance Measurement System
A
Introductory
Project Report
On
“Ultrasonic Based Distance Measurement
System”
Of
In the guidance of
Prof. Solanke P.J.
Certificate
DR.B.M. Patil
Contents
Chapter 1.
1. Introduction 4
Chapter 2.
2. Origin of the proposal 5
2.1 Definition of the problem: 5
2.2Measurement method based on threshold detection: 6
Chapter 3.
3. Ultrasonic based distance measurement:: a state of art 7
3.1. Flowchart of the program 8-9
Chapter 4.
4. Design procedure 9
Chapter 5.
5. Block diagram 10
5.1. Transmitting unit 11
5.2. Receiving unit 12
Chapter 6.
6. Description 13
6.1. At a glance 14
6.2. Ultrasonic as a distance sensor 15
Chapter 7.
7. Advantages. 16
Chapter 8.
8. Conclusion 21
Chapter 9
9. References 22
ACKNOWLEDGEMENT
Date: / /
Abstract
The report details the implementation of distance measurement system using the
ultrasonic waves. As the human ears audible perception ranges 20 Hz to 20 KHz, It is
insensitive to the ultrasonic waves and hence the ultrasound waves can be used for
application 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 range of ultrasonic transducer. The signal is
transmitted by an ultrasonic transducer, elected by an obstacle and received by another
transducer where the signal is detected. The time delay of transmitted and received
signal corresponds to the distance between the system and the obstacle.
1. Introduction
Where c is the propagation velocity of the ultrasonic burst, and t is the TOF estimate.
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 the gained through a very
common and straightforward expression.
X=c.t/2
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 .At the start of a measurement; pulse generator excites a voltage pulse, Vi.
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, Va, 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, Vp is stopped. The conversion of the pulse propagation time into a number
Nx 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.
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 include in the group of
methods which use phase modulation.
The contactless and cheap measurement of distances in a range of s few millimetres to a few
meters is a strategic task in several fields. Although several solutions providing good
accuracy can be conceived, for example optical solutions are usually rather expensive. In
addition, cases the use of lasers or other high power environment or when low energy devices
are prescribed. In these cases low – power systems cannot be accepted in hazardous
ultrasonic sensors are cost effective solutions, especially when low frequency devices (30-50
KHz) are used. What are ultrasounds? Like the visible spectrum, the audio frequency range
from 20Hz – 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 the
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 MHz range
and finally around 1 GHz, goes over into what is conventially called the hyper sonic regime.
The full spectrum s as shown in figure. Where typical ranges for phenomena of interest are
indicated. most of the applications of interests take place in the range of 1- 100 MHz,
corresponding to wavelengths in typical solid of approximately 1 mm to 10um, where an
average sound velocity is about 5000m/s, with wavelength of the order of 3mm to 30 um for
the above frequency range. An advantage of measuring methods exploiting ultrasonic waves
is that they enable the direct accomplishments of a digital measure measured distance is
utilized. From a technological
An advantage of measuring methods exploiting ultrasonic waves is that they enable the direct
accomplishment is that they enable the direct contact of a digital measurement without the
need for conversion of an analog signal to a digital one by an analog to digital convertor
(ADC). In most of the applications either the velocity of the ultrasonic waves or the time of
flight of a wave over the measured the distance is utilized; from a technological point of
view, another advantage is that the propagation velocity of the ultrasonic waves in many
orders lower than that of electromagnetic waves . Because of this less stringent demands are
required on the transducers and the associated electronic circuits. On the other hand the use of
ultrasonic waves has certain drawbacks too, in particular the parger the dependent on their
propagation velocity on the parameters of the propagation medium , and the high attenuation
and scattering especially in air.
4. Design procedure
1. Digital section – Microcontroller and LCD display unit with 5 Volt power supply
2. Analog section –
51.1. Switch
An analog switch CD4066 is used to allow the sine wave from the function generator to the
gain amplifier. The excitation to the transmitter is given to the function generator through the
switch 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.5 volts .
5.1.2. Microcontroller
This system of s distance measurement does not require a large amount of memory, hence a
20 pin 8051 based microcontroller AT89C2051, is chosen as the controller with a 12 MHz
clock. It performs the operation of giving the switching signal computing the distance
converting the hex value to the decimal and then to the ASCII to be displayed on the LCD.
As the 40 KHz sine wave cannot be passed through the analog switch 4066, a gain amplifier
with a level shifter is required. Both are integrated and built using uA741 OP-Amp 5.2.
5.2.1 Amplifier
The frequency of received pulse is of 40 KHz which requires amplifiers working at a high
frequency.TL084 is used, as it has a good high frequency gain characteristics. The gain of the
amplifier is set to 1000 in two stages with the first being 100 and the second being 10. The
gain is set by taking into account the least magnitude (50Mv) of the receiver output when
sensing an object at a distance of two meters.
5.2.2. Comparator
The output signal from the amplifier is passed through the comparator which compares with a
references threshold level to weed out the noise and false triggering. The signal is a series of
square pulses as shown in the figure with amplitude of 15 volts this is passed through the
voltage limiter (zener regulator) to be fed to the microcontroller for counting the pulses
6. 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 the receiver detects the reflected echo.
The time delay between the corresponding ages of the transmitted and received ones is
measured by microcontroller; this gives the time of light. Substituting the time delay and the
velocity of ultrasound in air (330meters/second). In the following formula we can determine
the distance between the transmitter and the target. Figure 2 shows the transmitted and
received pulses.
6.1. At a glance:
The diagram given as follows shows the transmission and reception of ultrasonic wave.
That is ultrasonic wave propagate through solid liquid and gases.
When the ultrasonic wave come in contact with an object or obstacle they tend to
reflect
The time taken by the wave to travel determines the distance at which the obstacle is
present.
The time taken by the wave to travel from the transmitter to the object/ obstacle/or
target is proportional to the distance and time.
Using IO trigger for at least 10 ms high level signal
The module automatically sends eight 40 KHz and detect whether there is a pulse
signal back.
If the signal back, through high level time of high output IO duration is the time prom
sending ultrasonic to returning.
Test distance = High level time X velocity of sound (340ms)/2.
7. Advantages:
Harmless for human beings as the ultrasonic waves are inaudible to the human ears
the high frequencies produces by the waves do not cause any harm.
Project is eco-friendly as a large amount of e- waste is not produced and thus
providing betterment to the environment.
The components used in this project are comparatively cheaper and hence the are
also replaceable and also the components can be easily locally available.
Compared to the other projects this project is smaller in size, because of which it is
handy as well as portable.
The components that are used in this project are inexpensive.
As the components that are used in this project are inexpensive thus they support
the economy i.e. they are economical.
An ultrasonic sensors response is not dependent upon the surface colour or optical
reflectivity if the object, for eg : the sensing of a clear glass plate, a brown pottery
plate, a white plastic plate and a shiny aluminium plate is the same’
Ultrasonic sensors with digital (On/ off) outputs have excellent repeat sensing
accuracy.
It is possible to ignore immediate background objects , even at long sensing
distances because switching hysteresis is relatively low
The response of analog ultrasonic sensor is linear with the distance by interfacing
the sensor to an LED display it is possible to have a visual indication of target
distance. This makes ultrasonic sensors ideal for level monitoring or linear
motion monitoring motions.
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 mili seconds.
Firmware description
The microcontroller close the switch for duration of 250 microseconds to allow 10 cycles of
40kHz 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 .
This results in the opening of the gate through which pulses, Vc, begin to pass from the clock
(time mark) generator to a reversible counter. After arrival of the pulse Va, the bistable
returns to its initial (zero) state and the measurement is over. On the counter display, a
number Nx appears which corresponds to the measured distance. The process described is
illustrated in time diagrams
The measured distance, x can be expressed through the propagation time, TOF, of the
ultrasonic waves as
X= c TOF or x=c/2 TOF
According to the type (direct or reflected) of performed measurement. At the same time, it is
also true that Nx =ft0F, when 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
X=(c\f) or c\2 TOF
In order to real the distance in a straight forward 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 environment temperature in the working space ,the frequency
can be 34.37MHz On measuring a distance of x=1 m , there is reading Nx of the 100000 +or-
on the counter display. The resolution is then 10 um.
The threshold method proves itself very easy and simple to realize on actual sensors. 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 useful signal can give rise to spurious identification of the TOF.
Finally, the threshold does not the right onset of the signal; this way, the obtained
measurements are unavoidably biased. The problem is making worse in the presence of the
signal shape distortion.
7. Conclusion: the micro controller 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 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.
7.1. Proposed outcome \finding: We find that this project is effectively useful in research
and development which area as well as in Army and civil area.
Major outcome is that this project can be 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 charges less than foreign
equipment. It will become very product for new generation of research .
7.2. Utilization of the outcome of project:
a. Frequency used is higher than human audible range (i.e. less than 20 KHz ) and much less
than microwave frequency (i.e. higher than 1 GHz), so harmless for human beings.
b. Product is also eco -friendly because it does not harm Earth’s environment.
c. Project is less complicated because than other, so analysis and replacement of components
is easy.
8. References:
Mazzidi Muhammad Ali , 8051 microcontroller and embedded systems , the (first
edition) 1999,prentice hall.
K.J Ayala, 8051 microcontroller, architecture , programming and applications , 2nd
edition ,penram international publishing ( India) , Mumbai 1998.
“A High accuracy ultrasonic distance measurement system using binary frequency
shift keyed signal and phase detection”, Huang Etal review of scientific instruments
volume 73, number 10 October 2002.
Data sheets of all components’ involved (AT89C2051, IC 4066, IC 7805, ICTL084,
UA 741).