Ultrasonic Sensor Thesis
Ultrasonic Sensor Thesis
111111111111111111111
0000071 383
JUNE 2012
Iv
ABSTRACT
ABSTRAK
Alat mengukur jarak adalah peralatan yang digunakan untuk mengukur jarak di
antara dua tempat atau lebih. Pengukuran secara manual akan sedikit rumitjikajarak
ukuran yang ingin dibuat adalah terlalu jauh ataupun tempat tinggi. Tujuan projek mi
direkabentuk dan dicipta adalah untuk menangani masalah pengukuran. jarak dan
memboiehkan pengukuran jarak yang lebih. Mat pengukur yang dicadangkan
menggunakan peranti ultrasonik dapat menyelesaikan rnasalah kerana peranti
ultrasonik menggunakan bunyi ultrasonik. Peranti ultrasonik beroperasi pada
frekuensi diantara 40 kHz sehingga 250 kHz. Konsep projek mi yang menggunakan
skrin LCD untuk memaparkan bacaan jarak yang diukur dan pengguna boleh
menggunakan butang suis sernasa niiai ukuran diambil. Dalam litar projek mi
mempunyai butang suis seperti "Send", "Store", "Mask" dan suis "Recall". Projek
mi menggunakan mikro pengawal PlC 16F84A, yang dianggap sebagai komponen
utama di bahagian perkakasan, yang boieh menyimpan sehhgga 32 ukuran, di mana
PlC mi akan mengawal keseluruhan operasi litar sernasa pengukuran dilaksanakan.
Vi
S
TABLE OF CONTENTS
CHAPTER TITLE PAGE
DECLARATION 1
DEDICATION U
ACKNOWLEDGEMENT Ill
ABSTRACT iv
ABSTRAK V
JABLE OF CONTENTS vi
LIST OF TABLES X
LIST OF FIGURES Xi
LIST OF SYMBOLS Xl'
LIST OF APPENDICES XIII
1 INTRODUCTION 1
2 LITERATURE REVIEW 5
3 METHODOLOGY 18
3.1 Introduction 18
3.2 Software 20
3.2.1 Design Circuit and Simulation 20
3.2.2 PlC programming 21
3.2.3 Printed Circuit Board (PCB) 23
3.3 Hardware 24
3.3.1 Transmitter / Receiver 25
3.3.2 Sampling and Data Storage 25
3.4 Test on Training Board 26
3.5 Design Prototype 26
vu'
4.1 Introduction 28
4.2 Software 28
4.3 Circuit Application 29
4.3.1 Power Supply 29
4.3.2 Amplification 30
4.3.3 Calculation 30
4.3.4 Measurement Recording 31
4.3.5 Playback 32
4.3.6 EEPROM Reset 32
4.3.7 Masking 33
4.4 Measuring the Distance 33
4.4.1 Flat Surface 33
4.5 Experimental Result 35
4.6 Discussion 36
4.6.1 The Speed of Sound 36
4.6.2 Wave Models 38
4.6.3 Frequencies 40
5.1 Conclusion 42
5.2 Recommendation 43
REFERENCES . 44
APPENDICES 45
Ix
LIST OF FIGURES
LIST OF SYMBOLS
Hz Hertz
A Ampere
TX Transmitter
RX Receiver
CPU Central Processing Unit
mt meter
EM! electromagnetic interference
dB decibel
V Voltage
DB Data Bus
VCC Collector Supply Voltage
VEE Emitter Supply
LED light emitting diode
LM358 Dual Op-Amp
LM7 805 Voltage regulator
DC Direct Current
EEPROM electrically erasable programmable read-only memory
Degrees
mm milimeter
PlC Peripheral interface Controller
XIII
LIST OF APPENDICES
CHAPTER 1
INTRODUCTION
The PlC microcontroller (1C2) is the mastermind that controls the whole
operation. When prompted by pressing of Send button, the PlC will transmit a series
of 40 kHz pulses via the ultrasonic transmitting transducer (TX). The pulses are
accurately generated.
The purposed of these projects are to design and create a suitable electronic distance
measuring device. The objectives of the projects are:
In the construction field, the usage of electronic measuring device is still not
widely used yet. Due to the high cost of these equipments at market, an economic
way needs to think of in order to create an accurate measuring device with low cost.
Improvement had been done where some products have infrared light emitters
and receivers to determine an object's distance. Other devices have laser-based
systems which have improved accuracy and precision. Presently, the detection
techniques of laser, radar, and infrared ray have been widely applied at the aspect of
obstruction detection and distance measurement. Because of the expensive price, the
distance measurement system of laser and radar is only set on the minority of
instruments. For infrared sensor, the range of the distance that can be measured is
very short with only a range of 4-30 cm [1].
This report consists of five chapters which Chapter 1 cover about the
background, problem statement, objectives, project scope and report outline as
additional part to summarize for the whole chapter of the report.
For the Chapter 3, there will have a discussion about the methodology. Having
a clear description of the methods that will be used and accomplish the project
objectives to make a strong application even more competitive. For this project
methodology, there will have some discussion on how the project was organized and
the flow of the system designed. Before developing the prototype, the simulation has
been done to make sure that the circuit would be working properly. Thus, it can be
divided into two parts, hardware development and software development which
involve the overview of PlC microcontroller, circuit and PCB fabrication.
For the Chapter 4, the result and overall discussion will be presented with some
of proof. The result are categorized into three parts includes the hardware, software
and analysis of the system. Last but not least, Chapter 5 will be having the
conclusion to conclude overall results. It is also includes recommendation for the
project to improve in near future.
5
CHAPTER 2
LITERATURE REVIEW
Ultrasonic (US) sensors are also widely used to measure distances. Thus they
have provided a reliable source of obstacle detections. Since they are not vision-
based, they are useful under conditions of poor lighting and transparent objects.
However, ultrasonic sensors have limitations due to their wide beam-width,
sensitivity to specular surfaces, and the inability to discern objects within 0.5 m.
Because of the typical specular nature of the ultrasonic waves reflection, only
reflecting objects that are almost normal to the sensor acoustic axis may be
accurately detected [2].
Most ultrasonic sensors use a single transducer to both transmit the sound
pulse and receive the reflected echo, typically operating at frequencies between 40
kHz and 250 kHz. A variety of different types of transducers are used in these
systems [3].
Ultrasonic is one of the distances measuring sensors that had been studied.
Ultrasonic transducers measure the amount of time taken for a pulse of sound to
travel to a particular surface and return as the reflected echo[4] Typically, an
b
ultrasonic rangefinder sends a 'ping' and waits to hear an echo. Sound waves
propagate from the transmitter and bounce off objects, returning an echo to the
receiver (below left). If the speed of sound is known, the distance to an object can be
calculated from the time delay between the emitted and reflected sounds. While the
principle of calculating distance from the time of travel is simple, there are many
limiting factors to consider. Sound diverges very rapidly, so transducers are carefully
designed to produce as small a beam as possible. While some applications require a
wide beam, a narrow beam improves the range and reduces background interference.
There is a direct relationship between beam width and target surface angle: the wider
the beam, the greater the possible angle between the transducer and the surface.
When the angle is too great (>12 degrees), the reflected beam misses the transducer
as Figure 2. While some surfaces may produce scattered diffuse reflections, these are
much weaker and are not used for distance measuring purposes.
i1
"
Transer
4
Pe?d Wvs
The speed of sound varies with temperature: as air gets warmer, sound travels
faster. Hence ultrasonic systems must incorporate a thermometer to estimate the
current speed of sound. While the ambient air temperature can be measured, other
warming effects, such as convection and turbulence, can cause errors in the
calculated distance. Humidity alters the attenuation of sound in air, which determines
the maximum range of an ultrasonic device. Attenuation is also related to the
frequency of the emitted sound: higher frequencies improve the sampling resolution,
but attenuate more thus reducing the range [4].
The attenuation of sound in air increases with the frequency, and at any given
frequency the attenuation varies as a function lof humidity. The value of humidity
that produces the maximum attenuation is not the same for all frequencies J.
When used for sensing functions, the ultrasonic method has unique advantages
over conventional sensors:
There are two main types of transducer used to transmit ultrasonic signals.
They are the Piezo type and the electrostatic type. It is even possible to send
ultrasonic signals using a conventional high frequency electromagnetic speaker
(tweeter) [6].
The general transducer design features a piezo ceramic disc bender that is
resonant at a normal frequency of 20 - 60 kHz and radiates or receives ultrasonic
energy. They are distinguish from the piezo ceramic audio transducer in that they
produce sound waves above 20 kHz which are inaudible to human and the ultrasonic
energy is radiated or receive in a relatively narrow beam.
The open type ultrasonic transducer design exposes the piezo bender bonded
with a metal conical cone behind a protective screen. The enclosed type transducer
design has the piezo bender mounted directly on the underside of the top of cases
9
which then machined to resonant at the desired frequency. Following are the
specifications of ultrasonic.
Specifications:
• Sensitivity: -38dB
• Impedence: >1k *
• Operating Voltage: 3V - 20V
• Mounting: solder pad
PlC 1617 84A perfectly fits many uses, from automotive industries and
controlling home appliances to industrial instruments, remote sensors, electrical door
locks and safety devices, it is also ideal for smart cards as well as for battery
supplied devices because of its low consumption.
PlC 16F84A have total of 18 pins and have the following meaning:
RA2 .-. El -+ RM
R48 .-. RAO
RMITOCKI IX - IM OSJi/Clj(jN
Reset is used for putting the microcontroller into a known condition. That
Practically means that microcontroller can behave rather inaccurately under certain
undesirable conditions. In order to continue its proper functioning it has to be reset,
meaning all registers would be placed in a starting position. Reset can also be used
when trying out a device as an interrupt in program execution, or to get a
microcontroller ready when loading a program [7].
be between 5 and 10k. This kind of resistor, whose function is to keep a certain line
on a logical one as a preventive, is called a pull up.
la
von
I RAIDIG
MCLR
Ws 16F84
ra
RMW
R81
2.3.1 XT Oscillator
:jIa
1?
C2
MCLR is °s
1•
)CTPLD
FAMWRAt OSC2 cL
JRAI?
Q
Figure 2.7: Connecting resonator to microcontroller