Ultrasonic Range Meter.

ULTRASONIC RANGE METER

RAHIAH BINTI ABDUL HAMID

This report is submitted in partial fulfilment of the requirements for the award of
Bachelor of Electronic Engineering (Industrial Electronics) With Honours

Faculty of Electronic an Computer Engineering
Universiti Teknikal Malaysia Melaka

May 2008

@
'h,

-

UNIVERSITI TEKNIKAL MALAYSIA MELAKA
FAKULTI KEJURUTERAAN ELEKTRONIK DAN KEJURUTERAAN KOMPUTER
BORANG PENGESAHAN STATUS LAPORAN


PROJEK SARJANA MUDA I1
T a j u k Projek: Ultrasonic Range Meter
Sesi Pengajian: 2007108

Saya RAHIAH BINTI ABDUL HAMlD mengaku membenarkan laporan Sarjana Muda ini disimpan di
Perpustakaan dengan syarat-syarat kegunaan seperti berikut:
I. Laporan adalah hakmilik Universiti Teknikal Malaysia Melaka.
2. Perpustakaan dibenarkan membuat salinan untuk tujuan pengajian sahaja.

3. Perpustakaan dibenarkan membuat salinan laporan ini sebagai bahan pertukaran antara institusi pengajian tinggi.
4. Sila tandakan ( 4 ) :

0
0
0

SULIT*

(Mengandungi maklumat yang berdarjah keselamatan atau kepentingan Malaysia
seperti yang termaktub di dalam AKTA RAHSIA RASM11972)


TERHAD*

(Mengandungi maklumat terhad yang telah ditentukan oleh organisasilbadan di
mana penyelidikan dijalankan)

TIDAK TERHAD

(TANDATANGAN PENULIS)
Alamat Tetap:
No.56, Jalan Sekolah,
Kg. Melayu Majidi,
81 100 Johor Bahru.

hnsyorah
Fakul Kej E k W i k C n Kej Kmputer (FKEKQ,
Universiti Teknikal Malays~aMelaka (UToM),
Karung Berkuna 1206, Hang Tuah Jaya
Ayer Keroh, 75450 Melaka.


Johor.
Tarikh:

....?.. !.!!.!.%.0~ ....

Tarikh: ....Q
.../.S
.. ./. O
. .. .b. ............

i

*CATATAN : Jika laporan ini SULIT atau TERHAD, sila lampirkan surat daripada pihak berkuasalorganisasi berkenaan
dengan menyatakan sekali tempoh laporan ini perlu dikelaskan sebagai SULIT atau TERHAD.

"I hereby declare that this thesis entitled, Ultrasonic Range Meter is a result of my
own research idea except for works that have been cited clearly in the references."

W


Signature

:

Name

: RAHIAH BINTI ABDUL HAMID

Date

:

9 /5/3008

"I, hereby declare that this I have read this report an in my opinion this report is
sufficient in terms of scope and quality for the award of Bachelor of Electronic
Engineering (Industrial Electronic) with honours."

Signature
Name

Date

1

~/s/o&

Special dedication to my loving mum Pn Juminah bt Sarbini, my dad En Abdul
Hamid bin Hj Sidek, my brother, my kind hearted supervisor En Ahrnad Sadhiqin bin
Mohd Isira, and my dearest friends.

ACKNOWLEDGEMENT

I have completed my thesis for PSM 1 which is a partial fulfilment of
requirements for the degree of Bachelor in Electronic Engineering (Industrial
Electronics).
On this opportunity, I would like to express my gratitude to the Faculty of
Electronic and Computer Engineering, Universiti Teknikal Malaysia Melaka (UTem)
and sincere gratitude to my supervisor, En. Ahmad Sadhiqin bin Mohd Isira, for his
assistance and guidance towards the progress of this thesis project. En Ahrnad
Sadhiqin has been patiently monitoring my progress and guided me in the right

direction and offering encouragement. Obviously the progress I have now will be
inconsistent without his assistance.
I am grateful to my family especially my dearest mom and dad, Puan
Juminah bt Sarbini and En Abdul Hamid b Hj Sidek and my sibling for their
unfailing encouragement and financial support for me to complete this thesis.
My special appreciation and thanks to all my friends in 4 BENE for the
invaluable assistances towards this thesis project. It is also to everyone who involved
in this project either direct or indirectly.

ABSTRACT

The Ultrasonic Range Meter is designed to measure any distance to
the object in between 0.25m to 8m using standard 40 kHz transducer. It is
useful for the robotic project such as mobile robot. This project is divided
into two important parts, which involve the design of hardware application
circuit and software development. Hardware implementation is to transfer the
software part of the circuit of Ultrasonic Range Meter onto the printed circuit
board. The software is developed by using PIC 16F873 as a microcontroller.
The measured distance is displayed on the LED seven segment connected to
the PIC. The time taken by the ultrasonic signal sent is measured. The

propagation speed of the sound changes with the temperature. The control
system is done by using PIC.

ABSTRAK

Ultrasonic Range Meter merupakan satu alat yang digunakan untuk
mengukur jarak diantara objek. Jarak yang dikehendaki adalah diantara
0.25m sehingga 8m. Ia amat berguna apabila diaplikasikan untuk robot
contohnya seperti mobile robot. Projek ini terbahagi kepada dua bahagian
iaitu hardware dan software(perisian). Bahagian hardware adalah untuk
membina litar Ultrasonic Range Meter di atas PCB. Manakala perisian untuk
software menggunakan PIC 16F873 sebagai mikropengawal. Jarak yang
diambil bacaan akan dipaparkan di seven segment. Cara untuk mengira jarak
dengan mengambil masa yang diambil ketika pemancar(transmitter)
memancarkan isyarat ke objek dan isyarat tersebut dipantul balik dan
diterima oleh penerima(receiver). Penyebaran kelajuan bunyi berubah
mengikut suhu. Semua sistem kawalan ini akan dikendalikan oleh PIC.

CONTENT


CHAP.

TITLE

PAGES

TITLE OF PROJECT

i

REPORT STATUS VERIFICATION FORM

ii

STUDENT'S DECLARATION

iii

SUPERVISOR'S DECLARATION


iv

DEDICATION

v

ACKNOWLEDGMENT

vi

ABSTRACT

vii

ABSTRAK

viii

CONTENTS


ix

LIST OF TABLE

xiii

LIST OF FIGURE

xiv

ABREVIATION

xvi

LIST OF APPENDICES

xvii

INTRODUCTION
1.1 Introduction of Project

1.2 Objectives Project
1.3 Problem statement
1.4 Scope of work

LITERATURE REVIEW
2.1

Ultrasonic

2.2

Type of Ultrasonic Transducer
2.2.1

Piezoelectric

2.2.2

Magnetostrictive

The differences Ultrasonic Transducer

5
6

between others transducer
The factors effects when measuring the distance

6

The propagation speed of the sound

6

The Ultrasonic Range Meter

9

2.6.1 The Block Diagram

9

2.6.2 Circuit of Ultrasonic Range Meter

10

The operations circuit of Ultrasonic Range Meter

11

2.7.1 Transmitter circuit

11

2.7.2 Receiver circuit

12

2.7.2.1

Signal Amplification circuit

12

2.7.2.2

Detection circuit

13

2.7.2.3

Signal Detector

13

2.7.2.4 Signal Holding Circuit

14

2.7.2.5 Temperature revision voltage

15

generating circuit
2.7.1.6

Resonator

16

2.7.1.7

Power supply

17

2.7.1.8

Seven segment LED

17

The components

18

2.8.1 Ultrasonic sensor

18

2.8.2

PIC 16F873

18

2.8.3

Low noise operational amplifiers (LM833N)

19

2.8.4 Low power operational amplifiers (LM358)

19

2.8.5 NAND gates (401 1B)

19

2.8.6 Inverters (4069UB)

20

2.8.7

3 terminal voltage regulator for +5 V (7805)

20

2.8.8 3 terminal voltage regulator for +9 V (78L09)

20

2.8.9 Transmitter drive transistor (2SC 1815)

21

2.8.10 Shottky barrier diode ( 1SS 106 )

21

2.8.1 1 Resonator

21

2.8.12 Variable resistor for display proofreading

22

2.8.13 Resistor

22

2.8.14 Ceramic Capacitor
2.8.15 Multilayer ceramic capacitor
2.8.16 Electrolytic capacitor
2.8.17 Printed circuit board
2.8.1 8 Jumper Wire
2.9 PIC microcontroller
2.9.1 Development Languages
2.10 The PIC 16F783
2.1 1 The other type of Ultrasonic Range Meter
2.1 1.1 Transmitter circuit
2.1 1.2 Receiver circuit
2.1 1.3 The comparison between Ultrasonic Range
Meter with PIC and without PIC.

PROJECT METHODOLOGY
3.1

The flow chart of methodology project

3.2

Explanation about the flow chart of methodology
3.2.1 Literature review for the Ultrasonic
Range Meter
3.2.2 Design the circuit and simulate

3.3

Construct circuit and hardware
3.3.1 Etching process
3.3.2 PCB drilling process
3.3.3 Component mounting process

3.4

Software programming

3.5

Circuits testing
3.5.1 Power supply circuit testing
3.5.2 Receiver circuit testing

RESULT
4.1 The simulation of Receiver circuit
4.2 The result from simulation
4.2.1

The result for Oscilloscope 1

4.2.2

The result for Oscilloscope 2

4.2.3

The result for Oscilloscope 3

4.2.4 The result for Oscilloscope 4
4.3 The result from testing circuit
4.3.1

The power supply circuit result

4.3.2 The receiver circuit result
4.4

The result of final Ultrasonic Range Meter

DISCUSSION AND CONCLUSION
5.1 Discussion
5.2 Conclusion

REFERENCES

LIST OF TABLE

TITLE
The differences of transducer
The speed of sound
The time for measuring the distance
The Features of PIC 16F873
The comparison of Ultrasonic Range Meter circuit
The power supply circuit result
The receiver circuit result

PAGES

LIST OF FIGURE

TITLE
Ultrasonic Range Meter
The process of Ultrasonic Range Meter block diagram
The circuit of Ultrasonic Range Meter
The transmitter block
The signal amplification circuit
The detection circuit
The signal detector circuit
The signal holding circuit
The temperature revision voltage generating circuit
The resonator circuit
The power supply circuit

LED seven segment display
The Ultrasonic Range Meter without using PIC
The flow chart of methodology project
The power supply circuit
The receiver circuit
The transmitter circuit
Power Supply circuit
Receiver circuit
Transmitter circuit
The receiver circuit
Result oscilloscope 1
Result oscilloscope 2
Result oscilloscope 4

PAGES

Result for LM 833N at pin 7
Result for LM 833N at pin 1

The distance measurement

ABREVIATION

PIC - Programmable Integrated Circuit
PCB - Printed Circuit Board
UV - Ultra Violet

LIST OF APPENDICES

NO

TITLE

A

Source code of Ultrasonic Range Meter

B

LM7905 and LM7909 datasheet

C

PIC 16F876A Datasheet

PAGE

CHAPTER I

INTRODUCTION

1.1

Introduction of Project

The Ultrasonic Range Meter is designed to measure the distance of any object
in between 0.25m to 8m using standard 40 kHz transducer. It is useful for the robotic
project. The measured distance is displayed on the seven segment connected to the
Programmable Integrated Circuit(P1C). The time taken by the propagation of the
ultrasonic signal sent to the object or place where it will take the effect of
temperature change as well in order to determine the distance. The propagation speed
of the sound changes with the temperature. All of those controls are done by the
software of PIC. The type of PIC used for this project is 16F873.

Figure 1.1: Ultrasonic Range Meter

1.2

Objectives
The objectives of this project are:

i) To design the Ultrasonic Range Meter using hardware and software (PIC
programming).
ii) To design and create and seven segment displayed distance measurement
device.
iii) To study and familiarize with PIC programming.
iv) Study and familiarize with the transducer, signal amplification circuit,
detection circuit, signal detector and other signal conditioners.

1.3

Problem statement
The purpose of the Ultrasonic Range Meter is to measure the distance.

Nowadays ultrasonic application is only applied in short distances. Hence, this
project is upgraded for long distances. It is applicable since some sensors that are
used in the system application are not sensitive to the effect of temperature,
humidity, and others.

It is hoped that a best Ultrasonic Range Meter will be

produced at the end of the project duration.

1.4

Scope of project

Four steps taken to develop this device:

1. Literature review for the Ultrasonic Range Meter
Information gathering from books, internet and discussion with the
supervisor.
Analysis about the project.
Study about the PIC programming and the operations of circuit.

2. Software design
Design the PIC program by using assembly language.
Test run and troubleshoot the program

3. The circuit and hardware design and construction.
The circuit is designed by using Multisim for the simulation of circuit.
The circuit is constructed and measured to know the differences
between the simulation results.
The hardware is built and some adjustment are made for
troubleshooting purpose.

4. Test run and troubleshoot
The hardware and the software are integrated.
The device is tested and troubleshooting process is done with respect
to any problem.

CHAPTER I1

LITERATURE REVIEW

2.1

Ultrasonic
Ultrasonic is the sound that refers to anything above the frequencies of

audible sound, and nominally includes anything over 20,000 Hz.
Ultrasonic can be used to locate objects by means similar to the principle by
which radar works. High-frequency acoustic waves reflect from objects, even
comparatively small ones, because of the short wavelength. The distance to an object
can be determined by measuring the delay between the transmission of an ultrasound
pulse and the return of the echo. This is the well-known facts by which bats navigate
in darkness. It is also believed to be used underwater by cetaceans such as dolphins
and whales. Ultrasonic can be used in sonar systems to determine the depth of the
water in a location, to find schools of fish, to locate submarines, and to detect the
presence of SCUBA divers.
In an ultrasonic intrusion detection system, a constant, high-frequency
acoustic signal is transmitted by a group of transducers. The ultrasound waves flood
the protected area. Receiving transducers monitor the ultrasound reflected by objects
in the protected zone. If anything moves, it produces a change in the security
applications. It is also used in medicine to view internal organs of the body.

2.2

Type of Ultrasonic Transducer
There are two types of ultrasonic transducer:

2.2.1 Piezoelectric
Crystals which acquire a charge when compressed, twisted or distorted are
said to be piezoelectric. This provides a convenient transducer effect between
electrical and mechanical oscillations. Quartz demonstrates this property and is
extremely stable. Quartz crystals are used for watch crystals and for precise
frequency reference crystals for radio transmitters. Rochelle salt produces a
comparatively large voltage upon compression and was used in early crystal
microphones. Barium titanate, lead zirconate, and lead titanate are ceramic materials
which exhibit piezoelectricity and are used in ultrasonic transducers as well as
microphones. If an electrical oscillation is applied to such ceramic wafers, they will
respond with mechanical vibrations which provide the ultrasonic sound source. The
standard piezoelectric material for medical imaging processes has been lead zirconate
titanate (PZT). Piezoelectric ceramic materials have found use in producing motions
on the order of nanometers in the control of scanning tunneling microscopes.
2.2.2

Magnetostrictive
The magnetostrictive transducers can be used to produce high intensity

ultrasonic sound in the 20-40 kHz range for ultrasonic cleaning and other mechanical
applications. There is a magnetic analogue where ferromagnetic material responds
mechanically to magnetic fields. This effect, called magnetostriction, is responsible
for the familiar hum of transformers and other AC devices containing iron cores.

2.3 The differences Ultrasonic Transducer between others transducer
Table 2.1 : The differences of transducers

2.4

DESCRIPTION

ULTRASONIC

INFRA RED

Accuracy

High

Low

Range

Above 8 meter

300 cm

Power Supply

3V to 5V

5V to 24V

Frequency

Above 20kHz

4

1014HZ

The factors effects when measuring the distance
The factors effects when measuring the distance are:
1. Temperature
2. The propagation speed of the sound

3. Time
4. Distance

2.5

The propagation speed of the sound
The speed of sound describes how much distance such a wave travels in a

given amount of time. In Earth atmosphere the speed varies with atmospheric
conditions; the most important factor is the temperature. The formula for the speed of
sound in air is:

Csound
in air = 33 1.5 t 0.6 Tc

,where T, is Celsius temperature

Calculation;
Assume Tc = 25 "C,

Table 2.2: The speeds of sound
Temperature

The speeds of sound

of air "C

c in rnls

-10

325.5

-5

328.5

0

33 1.5

5

334.5

10

337.5

20

343.5

25

346.5

30

349.5

40

355.5

This range meter calculates a distance by dividing the propagation time which was
measured by the capture feature. The calculation for determine the time when
measure a distance is showed as below:
Assume Tc = 30 "C, and the distance to measure is 1 meter.