Ultrasonic Range Meter



Ultrasonic Range Meter

Senior Project

Submitted to the Department of Computer and Communication

Engineering

American University College of Science and Technology

In Partial Fulfillment of

the Requirements for the Degree of Bachelor of Science

In

Computer and Communication Engineering

Maroun Daher

Rami Freih

Gaby Al Jawabira

August 2006

Abstract

The Ultrasonic Range Meter is an efficient way to measure the distance of unreachable obstacles. It is based on sending sound waves through a specific medium and observing the returning echoes to measure the distance from the device to the obstacle.

The device is divided into three parts, transmitter, receiver and the microcontroller. The transmitter consists of an electronics circuitry which generates electrical signal .In addition, an electromechanical transducer to convert electrical signal to physical form to drive through the medium, which is air. The receiver also consists of an electronics circuitry which detects the echoes bounced back from the obstacles. The microcontroller is programmed for selectivity sequence and to calculate the time of flight of the signal to find the distance and display it.

The system architecture of the Ultrasonic Range Meter was built to be cheaper, requires less power and delivers better performance. It can be reconfigured to adapt to a variety of pulsed Ultrasonic systems.

Table of Contents

Chapter 1 Introduction 1

1.1 History of ultrasonic waves....................................................1

1.2 History of ultrasonic applications...........................................3

1.3 Future development of this technology...................................6

Chapter 2 Problem statement 7

2.1 Introduction.............................................................................7

2.2 Motivation...............................................................................7

2.3 Characteristics.........................................................................7

2.4 Conclusion..............................................................................8

Chapter 3 Constraints 9

3.1 Introduction.............................................................................9

3.2 Minimum target size and ultrasonic medium..........................9

3.3 Target range............................................................................9

3.4 Range measurement accuracy.................................................9

3.5 The battery............................................................................10

3.6 Weight and size.....................................................................10

3.7 Budget...................................................................................10

3.8 Time......................................................................................10

3.9 Number of engineers.............................................................10

3.10 Conclusion..........................................................................10

Chapter 4 Solutions 11

4.1 Introduction...........................................................................11

4.2 Hand-held laser range meter device......................................11

4.2.1 Description.........................................................................11

4.2.1.1 Time of flight measurement……………………............11

4.2.1.2 Triangulation…………………………………………...12

4.2.2 The advantages…………………………………………...13

4.2.3 The disadvantages ……………………………………….13

4.3 Hand-held ultrasonic range meter device.............................13

4.3.1 Description……………………………………………….13

4.3.2 The advantages…………………………………………...14

4.3.3 The disadvantages………………………………………..14

4.4 Comparison...........................................................................14

4.5 Conclusion............................................................................15

Chapter 5 System Design 16

5.1 Introduction...........................................................................16

5.2 The overall system…………………………………………16

5.2.1 Calculation of the distance to an object……….................17

5.3 Ultrasonic system..................................................................18

5.3.1 Ultrasonic transmitter……………….……………………19

5.3.1.1 The 555 timer datasheet………………………………..20

5.3.2 Ultrasonic receiver……………………………………….21

5.3.2.1 Basis of the operational amplifier. …………………….21

5.3.2.2 The difference gain amplification……………………...22

5.3.2.3 Signal amplification circuit…………………………….23

5.3.2.4 Datasheet of the TL082 operational amplifier…………24

5.3.3 Detection circuit………………………………………….26

5.3.4 The microcontroller...........................................................27

5.3.4.1 The CCP capture mode..................................................28

5.4 The program……………………………………………….29

5.4.1The flowchart......................................................................29

5.4.2 Include file “bit.h”.............................................................30

5.4.3 The main program..............................................................31

5.5 Power supply and battery…………………………………..38

5.6 Ultrasonic sensors.................................................................38

5.6.1 Electrostatic ultrasonic sensors…………………………..40

5.6.2 Piezoelectric ultrasonic sensors………………………….40

5.7 The schematic of the ultrasonic range meter design……….42

Chapter 6 System Implementation 46

6.1 Factors affecting the performance of ultrasonic sensors.......46

6.1.1Radiation pattern…………………………….……………46

6.1.2 Frequency, wavelength and attenuation………………….48

6.2 Environmental factors………………………….. …………48

6.2.1Temperature…………………………………….. ……….49

6.2.2 Pressure and humidity……………………………………50

6.2.3 Medium…………………………………………………..50

6.2.4 Acoustic interference…………………………………….51

6.2.5 Radio frequency interference…………………………….52

6.3 Target consideration………………………………………..52

6.3.1 Composition………………………………………. …….52

6.3.2 Size and shape………………………………....................52

6.3.3 Position and orientation………………………………….53

6.4 Power of the detected signal.................................................55

6.5 Noise.....................................................................................55

6.6 Errors.....................................................................................55

6.6.1 Truncation errors…………………………………………56

6.6.2 Cosine error………………………………........................57

6.6.3 Reflection error…………………………………………..57

Chapter 7 System Testing 58

7.1 System Testing......................................................................58

7.2 Testing the Transmitter…………………………………….59

7.3 Testing the Receiver……………………………………….60

7.4 Testing the Detection Circuit………………………………61

7.5 Conclusion…………………………………………………61

Chapter 8 Time line, Cost and conclusion 62

8.1 Time line..............................................................................62

8.2 Cost of the ultrasonic range meter design…………………63

8.3 Conclusion………………………………………………...64

List of Figures

Figure 2.1: The hand-held ultrasonic range meter device……………………....7

Figure 2.2: Description of each part of the device……………………………...8

Figure 4.1: Hand-held laser range meter device……………………………….12

Figure 4.2: Hand-held ultrasonic range meter device………………………….13

Figure 4.3: Beam width comparison of ultrasonic waves and laser beams…....15

Figure 5.1: General block diagram…………………………………………….17

Figure 5.2: Theoretical graph of the pulses and its echo-reflection pulse……..18

Figure 5.3: The overall design of the ultrasonic system……………………….18

Figure 5.4: The transmitter circuit design………………………………..…….19

Figure 5.5: The 555 block diagram…………………………………………….20

Figure 5.6: The receiver circuit design………………………………………..21

Figure 5.7: The difference gain amplification…………………………………22

Figure 5.8: The circuit of the signal amplification…………………………….23

Figure 5.9: Pin connections top view of the TL082 operational amplifier……24

Figure 5.10: The detection circuit……………………………………………...26

Figure 5.11: The microcontroller top view…………………………………….27

Figure 5.12: The flowchart of the program…………………………………….30

Figure 5.13: The power supply circuit…………………………………………38

Figure 5.14: The SQ-40T/R ultrasonic transducer……………………………..41

Figure 5.15: The sensitivity of the SQ-40T/R with respect to the frequency….41

Figure 5.16: The overall schematic of the Ultrasonic range meter…………….43

Figure 5.17: The printed circuit board diagram of the microcontroller………..44

Figure 5.18: The printed circuit board of the transmitter and receiver………...44

Figure 5.19: The packaging of the device……………………………………...45

Figure 6.1: Geometric approximation of the ultrasonic beam width…………..47

Figure 6.2: Beam pattern with respect to amplitude…………………………...48

Figure 6.3: Graph of speed with respect to temperature……………………….50

Figure 6.4: Undetected large object due to reflection………………………….53

Figure 6.5: Object offset due to ultrasonic beam width………………………..54

Figure 6.6: Range error due to angle between object and sonar……………….54

Figure 6.7: Error (increasing accuracy VS increasing precision)……………...56

Figure 7.1: Graph of error with respect to the measured distance……………..59

Figure 7.2: The transmitter oscilloscope graph………………………………...59

Figure 7.3: The receiver oscilloscope graph…………………………………...60

Figure 7.4: The transmitter and the receiver oscilloscope graph………………60

Figure 7.5: The detection oscilloscope graph………………………………….61

Figure 8.1: Timeline graph…………………………………………………….62

List of Tables

Table 4.1: Solutions comparison with respect to its accuracy and precision….15

Table 5.1: The delay times of boundary range………………………………...16

Table 5.2: The datasheet of the 555 timer……………………………………...20

Table 5.3: The datasheet of the TL082 operational amplifier…………………25

Table 5.4: The microcontroller specifications………………………………....28

Table 5.5: The Ultrasonic sensor specifications……………………………….38

Table 6.1: The speed of sound at each temperature……………………………49

Table 6.2: The ultrasonic wave speed through different mediums…………….51

Table 7.1: Distance measurement with its error……………………………….58

Table 8.1: Distribution of work………………………………………………..62

Table 8.2(a, b): Components and prices……………………………………….63

List of Terms, Symbols and Abbreviations

A Average Error

CCD Charge Couple Device

cm centi-meter

cMUTs Capacitive micro-machined Ultrasonic Transducer

D Spot Diameter

KHz Kilo-Hertz

MHz Mega-Hertz

MUT micro-machined Ultrasonic Transducer

NDT Non Destructive Testing

POD Probability of detection

PSD Position Sensitive Detector

PZT Lead-Zirconate Titanate

QNDT Quantitative Non Destructive Testing

Rx Receiver

S Distance

SNR Signal to Noise Ratio

T Truncation Error

t time of flight

Tx Transmitter

UT Ultrasonic Testing

Vi input Voltage

Vo output Voltage

λ Wavelength of sound

µs micro second

Є The target response to the ultrasonic wave

CHAPTER 1

Introduction

1 History of ultrasonic waves

Prior to World War II, sonar, the technique of sending sound waves through water and observing the returning echoes to characterize submerged objects, inspired early ultrasound investigators to explore ways to apply the concept to medical diagnosis. In 1929 and 1935, Sokolov studied the use of ultrasonic waves in detecting metal objects. Mulhauser, in 1931, obtained a patent for using ultrasonic waves, using two transducers to detect flaws in solids. Firestone (1940) and Simons (1945) developed pulsed ultrasonic testing using a pulse-echo technique.

Shortly after the close of World War II, researchers in Japan began to explore the medical diagnostic capabilities of ultrasound. The first ultrasonic instruments used an A-mode presentation with blips on an oscilloscope screen. That was followed by a B-mode presentation with a two dimensional, gray scale image. Japan's work in ultrasound was relatively unknown in the United States and Europe until the 1950s. Researchers then presented their findings on the use of ultrasound to detect gallstones, breast masses, and tumors to the international medical community. Japan was also the first country to apply Doppler ultrasound, an application of ultrasound that detects internal moving objects such as blood coursing through the heart for cardiovascular investigation. Ultrasound pioneers working in the United States contributed many innovations and important discoveries to the field during the following decades. Researchers learned to use ultrasound to detect potential cancer and to visualize tumors in living subjects and in excised tissue. Real-time imaging, another significant diagnostic tool for physicians, presented ultrasound images directly on the system's CRT screen at the time of scanning. The introduction of spectral Doppler and later color Doppler depicted blood flow in various colors to indicate the speed and direction of the flow. The United States also produced the earliest hand held "contact" scanner for clinical use, the second generation of B-mode equipment, and the prototype for the first articulated-arm hand held scanner, with 2-D images. The Non-Destructive Testing NDT has been practiced for many decades, with initial rapid developments in instrumentation spurred by the technological advances that occurred during World War II and the subsequent defense effort. During the earlier days, the primary purpose was the detection of defects. As a part of "safe life" design, it was intended that a structure should not develop macroscopic defects during its life, with the detection of such defects being a cause for removal of the component from service. In response to this need, increasingly sophisticated techniques using ultrasonic, eddy currents, x-rays, dye penetrants, magnetic particles, and other forms of interrogating energy emerged. In the early 1970's, two events occurred which caused a major change in the NDT field. First, improvements in the technology led to the ability to detect small flaws, which caused more parts to be rejected even though the probability of component failure had not changed. However, the discipline of fracture mechanics emerged, which enabled one to predict whether a crack of a given size will fail under a particular load when a material's fracture toughness properties are known. Other laws were developed to predict the growth rate of cracks under cyclic loading (fatigue). With the advent of these tools, it became possible to accept structures containing defects if the sizes of those defects were known. This formed the basis for the new philosophy of “damage tolerant” design. Components having known defects could continue in service as long as it could be established that those defects would not grow to a critical, failure producing size.

A new challenge was thus presented to the nondestructive testing community. Detection was not enough. One needed to also obtain quantitative information about flaw size to serve as an input to fracture mechanics based predictions of remaining life. The need for quantitative information was particularly strongly in the defense and nuclear power industries and led to the emergence of quantitative nondestructive evaluation (QNDE) as a new engineering/research discipline. A number of research programs around the world were started, such as the Center for Nondestructive Evaluation at Iowa State University (growing out of a major research effort at the Rockwell International Science Center); the Electric Power Research Institute in Charlotte, North Carolina; the Fraunhofer Institute for Nondestructive Testing in Saarbrucken, Germany; and the Nondestructive Testing Centre in Harwell, England.[2]

2 History of ultrasonic applications

Ultrasonic sensing techniques have earned a pre-eminent position in a variety of fields including medicine, nondestructive testing and process monitoring, geophysics, and sonar surveillance. Ultrasonic flow sensors have been employed for a number of years for performing intraoperative or extracorporeal blood flow measurements. Intraoperative flow measurements are typically conducted to monitor blood flow in various vessels during vascular, cardiac, transplant, plastic and reconstructive surgery. Transit-time ultrasonic flow sensors detect the acoustic propagation time difference between the upstream and downstream ultrasonic transmissions in a moving fluid and process this information to derive a fluid flow rate. Ultrasonic array transducers rely on wave interference for their beam forming effects, and typically include a plurality of individual transducer elements organized as either a one-dimensional (linear) array or a two-dimensional array. Ultrasound is used as a non-invasive technique for obtaining image information about the structure of an object which is hidden from view, and is widely known as a medical diagnostic tool as well as a tool for non-destructive testing and analysis in the technical arts. Ultrasound diagnostic imaging systems are in widespread use for performing ultrasonic imaging and measurements. Ultrasonic imaging sensors act as both transmitters and receivers of ultrasonic energy. The sensor first acts as a transmitter; emitting ultrasonic energy in a train of high frequency pulses, typically in the range of 2 to 10 Mhz. Then the transmitter is turned off and the sensor acts as a receiver, which listens for returned echoes at the transmitted frequency. Ultrasonic sensors are used to make remote distance measurements. One particular use of ultrasonic sensors is within a vehicle occupant protection system within a vehicle. Ultrasonic range finders typically use ultrasonic frequencies which are inaudible to the human ear. These high frequencies have inherently shorter wavelengths, which lead to greater positional accuracy than audible frequencies. Parking aid systems of today usually consist of an electronic control unit and several ultrasonic sensors. Each ultrasonic sensor possesses a separate data line, since, in order to improve evaluation, echo information from several ultrasonic sensors is required at a certain instant. Thus, the evaluation of several ULS on the basis of one transmitted sound wave permits more precise conclusions to be made about the position of and the range of the obstacle. Ultrasonic sensors are equipped in robots and used for detecting objects positioned along a robot travel path. Such ultrasonic sensors are adapted to convert a pulse signal into an ultrasonic wave energy which is, in turn, radiated at a search area.

Ultrasonic testing UT has been practiced for many decades. Initial rapid developments in instrumentation spurred by the technological advances from the 1950's continue today. Through the 1980's and continuing through the present, computers have provided technicians with smaller and more rugged instruments with greater capabilities.

Thickness gauging is an example application where instruments have been refined make data collection easier and better.  Built-in data logging capabilities allow thousands of measurements to be recorded and eliminate the need for a "scribe."  Some instruments have the capability to capture waveforms as well as thickness readings. The waveform option allows an operator to view or review the A-scan signal of thickness measurement long after the completion of an inspection. Also, some instruments are capable of modifying the measurement based on the surface conditions of the material.  For example, the signal from a pitted or eroded inner surface of a pipe would be treated differently than a smooth surface. This has led to more accurate and repeatable field measurements.

Many ultrasonic flaw detectors have a trigonometric function that allows for fast and accurate location determination of flaws when performing shear wave inspections. Cathode ray tubes, for the most part, have been replaced with LED or LCD screens. These screens, in most cases, are extremely easy to view in a wide range of ambient lighting.  Bright or low light working conditions encountered by technicians have little effect on the technician's ability to view the screen. Screens can be adjusted for brightness, contrast, and on some instruments even the color of the screen and signal can be selected. Transducers can be programmed with predetermined instrument settings. The operator only has to connect the transducer and the instrument will set variables such as frequency and probe drive. Along with computers, motion control and robotics have contributed to the advancement of ultrasonic inspections. Early on, the advantage of a stationary platform was recognized and used in industry. Computers can be programmed to inspect large, complex shaped components, with one or multiple transducers collecting information.  Automated systems typically consisted of an immersion tank, scanning system, and recording system for a printout of the scan. The immersion tank can be replaced with squirter systems, which allows the sound to be transmitted through a water column.  The resultant C-scan provides a plan or top view of the component. Scanning of components is considerably faster than contact hand scanning; the coupling is much more consistent.  The scan information is collected by a computer for evaluation, transmission to a customer, and archiving.

Today, quantitative theories have been developed to describe the interaction of the interrogating fields with flaws. Models incorporating the results have been integrated with solid model descriptions of real-part geometries to simulate practical inspections. Related tools allow the Nondestructive Evaluation NDE to be considered during the design process on an equal footing with other failure-related engineering disciplines. Quantitative descriptions of NDE performance, such as the probability of detection (POD), have become an integral part of statistical risk assessment. Measurement procedures initially developed for metals have been extended to engineered materials such as composites, where anisotropy and inhomogeneity have become important issues. The rapid advances in digitization and computing capabilities have totally changed the faces of many instruments and the type of algorithms that are used in processing the resulting data. High-resolution imaging systems and multiple measurement modalities for characterizing a flaw have emerged. Interest is increasing not only in detecting, characterizing, and sizing defects, but also in characterizing the materials. Goals range from the determination of fundamental microstructural characteristics such as grain size, porosity, and texture (preferred grain orientation), to material properties related to such failure mechanisms as fatigue, creep, and fracture toughness. As technology continues to advance, applications of ultrasound also advance. The high-resolution imaging systems in the laboratory today will be tools of the technician tomorrow.

3 Future development of this technology

Looking to the future, those in the field of NDE see an exciting new set of opportunities. The defense and nuclear power industries have played a major role in the emergence of NDE. Increasing global competition has led to dramatic changes in product development and business cycles. At the same time, aging infrastructure, from roads to buildings and aircraft, present a new set of measurement and monitoring challenges for engineers as well as technicians. Among the new applications of NDE spawned by these changes is the increased emphasis on the use of NDE to improve the productivity of manufacturing processes. Quantitative nondestructive evaluation (QNDE) both increases the amount of information about failure modes and the speed with which information can be obtained and facilitates the development of in-line measurements for process control. The phrase, "you cannot inspect in quality, you must build it in," exemplifies the industry's focus on avoiding the formation of flaws. Nevertheless, manufacturing flaws will never be completely eliminated and material damage will continue to occurring in-service so continual development of flaw detection and characterization techniques are necessary.

Advanced simulation tools that are designed for inspectability and their integration into quantitative strategies for life management will contribute to increase the number and types of engineering applications of NDE. With growth in engineering applications for NDE, there will be a need to expand the knowledge base of technicians performing the evaluations. Advanced simulation tools used in the design for inspectability may be used to provide technical students with a greater understanding of sound behavior in materials.

As globalization continues, companies will seek to develop, with ever increasing frequency, uniform international practices. In the area of NDE, this trend will drive the emphasis on standards, enhanced educational offerings, and simulations that can be communicated electronically.  The coming years will be exciting as NDE will continue to emerge as a full-fledged engineering discipline.

CHAPTER 2

Problem statement

2.1 Introduction

The main purpose of this project is to measure the distance to unreachable objects, obstacles or places using a portable device.

[pic]

Figure 2.1: The hand-held ultrasonic range meter device.

2.2 Motivation

The motivation of using this device is when construction engineers at any sites need to measure distances to unreachable places in a quick and easy way using this device with high efficiency and accuracy.

2.3 Characteristics

This device detects the distance to an object and shows the result in centimeters. This device is activated by a trigger mechanism, pressing the trigger for one time will give us the distance to an object if there was no error like poor aiming. The distance to an object is displayed using a digital display with a high intensity in order to be seen in any lighting conditions.

It is a simple and portable device similar to a gun as shown in Figure 2.2 that uses a laser pointer to aim at a specific area to get the reflection at the receiver side.

[pic]

Figure 2.2: Description of each part of the device.

2.4 Conclusion

In order to design and build a portable device, the weight of the device is a primary problem. The technology of using ultrasonic to measure distances is in continuous progress, features have been added to this technology to make it easy to use and more accurate by assigning more challenging constraints. The constraints of our device are discussed in the next chapter.

CHAPTER 3

Constraints

3.1 Introduction

Defining the constraints of our device will help to design and then build the hand-held ultrasonic range meter device. By defining these constraints, the problems will be clearer, the suitable solutions will become easier to find and those constraints will help to get the design needed from the engineer.

3.2 Minimum target size and ultrasonic medium

The minimum target size is 40cm*40cm in order to get detection at the receiver side.

The ultrasonic medium is air.

3.3 Target range

The target range is the distance range between the person who is using the hand-held ultrasonic range meter device and the targeted object. The target range consists of two boundaries, one is the minimum distance limit and the other is the maximum distance limit. If the operator of the hand-held ultrasonic range meter device exceeds these two boundaries, the hand-held ultrasonic range meter device may not detect the distance or may display a false detection.

The target range is between 10 centimeters and 300 centimeters.

3.4 Range measurement accuracy

Each specific distance has an error percentage; the more samples sent the less the error is.

The range measurement accuracy is the accuracy of the distances measured between the operator of the hand-held ultrasonic range meter device and the targeted object; it allows knowing how much each distance is close to the real value of the distance. The range measurement accuracy is +/- 3 cm. The less this value is, the more accurate distances would be calculated by the hand-held ultrasonic range meter device.

3.5 The battery

A 9 V battery could be used to activate this device.

3.6 Weight and size

Our device would not exceed the weight 0.5 kilogram. This weight is acceptable for the operator to carry the hand-held ultrasonic range meter device and to fix his arm while aiming at the targeted object.

The area of the cover is 15cm x 7 cm, and the height is 8 cm.

3.7 Budget

This hand-held ultrasonic range meter device is between 50 U.S dollars and 75 U.S dollars.

3.8 Time

The time estimated to accomplish the hand-held ultrasonic range meter device is one month due to the changes in the constraints.

3.9 Number of engineers

The number of engineers working on the hand-held ultrasonic range meter device is three engineers.

3.10 Conclusion

After discussing and choosing the constraints, the solutions for these sets of challenging problems are to be discussed and solved physically and mathematically in the next chapter.

CHAPTER 4

Solutions

4.1 Introduction

To solve the problem of detecting the distance to an object, many solutions are presented. In this chapter the solutions are discussed, all the advantages and disadvantages are shown. The comparison between these solutions will help to determine which solution has more advantages and satisfies the constraints at the same time.

4.2 Hand-held laser range meter device

4.2.1 Description

This device is characterized by its accuracy and portability; it uses a laser beam. The two techniques might be used to measure the distance. There are two techniques that have been used in order to measure distances, the time of flight technique and the triangulation technique.

4.2.1.1 Time of flight measurement

Even the fastest photon requires a certain period of time to cover the distance from the sensor to the target and back. This time is directly proportional to the distance traveled, taking into account the velocity of light in the medium involved, which may be easily derived from the velocity of light in a vacuum. The cost and complexity of this method depends upon the precision and resolution required.

Data acquisition and analysis electronics must cope with ns and sub-ns time scales: decimeter ranges may be easily resolved by nanosecond pulses but precision in the millimeter and sub-millimeter range requires pulse lengths of a few tens of picoseconds and the associated electronics. Clearly, a poorly resolved pulse will lead to uncertainty in the accuracy of the measurement; the standard deviation in measured distance is proportional to the optical pulse rise time and is inversely proportional to the signal-to-noise ratio. At ranges of a few kilometers and above, a different problem arises; at such distances the amount of reflected photons which reach the detector is very small. Signal intensity can be improved by optimum beam focusing at the source, or by the use of a retro reflector mounted in the target.

4.2.1.2 Triangulation

Triangulation is the most commonly used method for distances of 10 meters or less. A laser or LED is used to produce a collimated beam which then impinges on the surface of the target. The target reflects light in many directions, some of the reflected light reaching the detector. The position of the reflected light focused onto the detector depends on the distance between the sensor and target. Detectors such as position sensitive detectors (PSD), diode arrays or CCD arrays enable the reflected light to be detected with high spatial resolution and at high sampling frequencies. The sensor-object distance is calculated trigonometrically and accuracies of better than 0.5% are the norm.

Measurement times of less than 10 ms are common, allowing real-time study of moving or vibrating objects. The light source should be compact and should produce an intense, small spot of light with minimal divergence. Amplitude modulation is used in order to eliminate the effects of stray (background) light.

[pic]

Figure 4.1: Hand-held laser range meter device.

4.2.2 The advantages

As shown in Figure 4.1, the hand-held laser range meter device is a portable device.

It is characterized with its high accuracy and high precision. The laser beam consists of a small beam width which reaches a long target range.

4.2.3 The disadvantages

The poor aiming on the targeted object causes a bad reflection of the laser and that would display a false detection of the object’s distance that has been targeted.

The atmospheric conditions may affect the ranging capabilities of the hand-held laser range meter device. The rain and snow reflect the laser beam and that may display a false detection of the object’s distance.

4.3 Hand-held ultrasonic range meter device

4.3.1 Description:

This device works on the same concept of the laser gun device but the difference is that it uses a large beam width of ultrasonic waves as shown in Figure 4.2. The time of flight and triangulation techniques might be used to measure the distance using ultrasonic waves.

[pic]

Figure 4.2: Hand-held ultrasonic range meter device.

4.3.2 The advantages

The hand-held ultrasonic range meter device is a portable device as shown in Figure 4.2. The hand-held ultrasonic range meter device is characterized with its precision and high accuracy. Atmospheric conditions will not affect the capabilities of the device.

4.3.3 The disadvantages

The beam of the hand-held ultrasonic range meter device consists of a large beam width as shown in Figure 4.2 and that may cause a false detection of the object’s distance at the receiver side because the beam may hit a group of objects placed near each others and the reflection of the ultrasonic wave is caused by several objects. The object must be flat and not an absorber and it should be normal to the direction of the ultrasonic wave. This device could be jammed and is affected by interference.

4.4 Comparison

After looking at the advantages and the disadvantages, the best solution is to use the gun device using laser beams. The beam width of the hand-held laser range meter device is smaller than the beam width of the hand-held ultrasonic range meter device as shown in Figure 4.5; this enables the operator of the hand-held laser range meter device to hit a specific object and get less reading errors unlike other devices.

The comparison has shown that the hand-held ultrasonic range meter devices could be better in some cases because it will not be affected by the atmospheric conditions. As shown in Table 4.1, using a descending order from the best accuracy and precision of the devices to the worst, the most accurate and precise is the hand-held laser range meter device. The second is the hand-held ultrasonic range meter device. Depending on our constraints, our choice was to design an ultrasonic range meter because of the budget and availability of the components.

Table 4.1: Solutions comparison with respect to its accuracy and precision.

|Devices |Hand-held laser range meter |Hand-held ultrasonic range meter |

|Accuracy |High accuracy |High accuracy |

|Precision |High precision |Precise |

[pic]

Figure 4.3: Beam width comparison of ultrasonic waves and laser beams.

4.5 Conclusion

Each solution has its advantages and disadvantages depending on the situation where the device is used; the hand-held laser range meter device is a fast growing technology because of its efficiency and its accuracy as well as the hand-held ultrasonic range meter device as shown in Table 4.1. In the next chapter the design of the hand-held ultrasonic range meter device will be implemented.

CHAPTER 5

System Design

5.1 Introduction

All designs are based on specific constraints. The design of the hand-held ultrasonic range meter device is based on measuring the distance using the time of flight technique. The process of this design is more explained in details in the next section.

5.2 The overall system

The calculations are done by the following way. First of all, the device calculates the time that the ultrasonic wave took to reach the targeted object and come back to the receiver. Thus, if we need to calculate the time needed for the ultrasonic wave to reach the object from the device, we divide the previous time we had by two. Second, the device multiplies the time by the speed of sound (340 m/s) to get the distance between the device and the object. The time from transmission of the pulse to reception of the echo is the time taken for the sound energy to travel through the air to the object and back again. Since the speed of sound is constant through air, measuring the echo reflection time lets you calculate the distance to the object using this equation:

Distance = (s * t)/2 (in meters) (5.1)

Where: s [m/s] is the speed of sound in air and t [s] is the round trip echo time.

Table 5.1: The delay times of boundary range

| Round trip echo time |Distance |

|t = 588 us |10 cm |

|t = 17.6 ms |3 m |

.

[pic]

Figure 5.1: General block diagram.

5.2.1 Calculation of the distance to an object

The hand-held Ultrasonic Range meter device offers precise ranging information from roughly 10cm to 3 meters. The ranger works by transmitting a pulse of sound outside the range of human hearing. This pulse travels at the speed of sound away from the ranger in a cone shape and the sound reflects back to the ranger from any object/target in the path of this sonic wave. The ranger pauses for a brief interval after the sound is transmitted and then awaits the reflected sound in the form of an echo. The controller driving the ranger then requests a ping; the ranger creates the sound pulse, and waits for the return echo. If received, the ranger reports this echo to the controller and the controller can then compute the distance to the object based on the elapsed time.

The Pulse Trigger Input line should be held low and then brought high for a minimum of 100μsec to initiate the sonic pulse. The pulse is generated on the falling edge of this input trigger. The ranger’s receiver circuitry is held in a short blanking interval of 600 μsec to avoid noise from the initial ping and then it is enabled to listen for the echo. The echo line is low until the receive circuitry is enabled. Once the receive circuitry is enabled, the falling edge of the echo line signals an echo detection or nothing if there is no reflection.

The long-range measurement is difficult a little. To measure the correct distance, the following conditions are necessary.

The object must be perpendicular to the range meter.

The surface of the object must be flat.

There is not object which reflects the ultrasonic around.

[pic]

Figure 5.2: Theoretical graph of the pulses and its echo-reflection pulse.

5.3 Ultrasonic system

It consists of a transmitter and receiver pair on the device and a microcontroller with a digital display. There are two different transducers for transmitter and receiver. The transmitter transmits and the receiver waits for the reflected signals. The Figure 5.3 illustrates this system.

[pic]

Figure 5.3: The overall design of the ultrasonic system.

5.3.1 Ultrasonic Transmitter

The transmitter consists of an electronics circuitry and an electromechanical transducer.

The electronic circuitry generates the required frequency electrical signal and the electromechanical transducer converts that electrical signal into the physical form and activates the open medium surface. This oscillating physical surface creates the ultrasonic Waves. The oscillating surface creates a pressure variation and ultimately a pressure wave with a frequency equal to that of the surface oscillation. The Figure 5.4 shows the generation of ultrasonic waves.

[pic]

Figure 5.4: The transmitter circuit design.

The transmitter was designed to oscillate at a resonant frequency of about 40 KHz. The 555 timer generates a 40 KHz sinusoidal ultrasonic wave. The frequency is calculated by using the following formula:

F = 1.44 / 2 * R1 * C = 1.44 / 2 * 15.6 KΩ * 1nF = 46 kHz. (5.1)

This design of the transmitter was done in way to get the closest value to 40 KHz by adjusting the resistor and the capacitor to the values shown in the Figure 5.4.

5.3.1.1 The 555 timer datasheet

The 555 monolithic timing circuits is highly stable controller capable of producing accurate time delays, or oscillation .In the delay time of operation, the time is precisely controlled by one external resistor and capacitor .For a stable operation as an oscillator, the free running frequency and the duty cycle are both accurately controlled with two external resistors and one capacitor. As shown in Figure 5.5:

[pic]

Figure 5.5: The 555 block diagram.

The Table 5.2 shows the datasheet of the 555 timer, the parameter rating and the units characterized by each component.

Table 5.2: The datasheet of the 555 timer

|Symbol |Parameter |Rating |Unit |

|VCC |Supply Voltage |+16 |V |

|Pd |Maximum allowable power dissipation |600 |mW |

|TA |Operating ambient temperature range |0 to 70 |ºC |

|VTH (Vcc = 5v) |Threshold voltage |3.33 |V |

|VTRIG(Vcc = 5v) |Trigger Voltage |1.67 |V |

|VRESET |Reset Voltage |0.3 to 1.0 |V |

.5.3.2 Ultrasonic Receiver

The receiver also has the same configuration except that it has a receiver electronic circuitry and a transducer, which converts the ultrasonic sound waves into an electrical signal. The sound waves travel into the medium and are reflected by an object in the path of the waves. This reflected wave is then sensed by the receiver, which actually calculates the time of flight of the signal to find the distance. The Figure 5.6 illustrates the receiver circuit.

[pic]

Figure 5.6: The receiver circuit design.

5.3.2.1 Basis of the operational amplifier

The operational amplifier is the amplifier with the very big voltage gain.

In case of TL082 to be using this time, at the specification, the voltage gain becomes 150V/mV. It is the 15 V output in 0.1 mV of the input. To say becomes 150,000 times of gain. In case of the operational amplifier, the value of the voltage gain doesn't have the relation too much. Anyway, the fact that the voltage gain is big is important.

5.3.2.2 The Difference Gain amplification

There are positive input and negative input in the operational amplifier.

The voltage gain can be calculated by the following formula.

G = Vo/Vi = -(Rf/Ri) (5.2)

[pic]

Figure 5.7: The difference gain amplification.

Using the voltage divider formula:

Vb = V1 * R2/(R1 + R2) (5.3)

The current passing through Ri is the same current passing through Rf because the current entering the negative input is negligible in μA (in the ideal operational amplifier, it is considered zero) and this gives the following equation:

(Vi – Va) / Ri = (Va – Vo) / Rf (5.4)

Vo = (V1 * R2 * (Rf + Ri) / (R1 + R2) * Ri)– Vi * Rf / Ri (5.5)

5.3.2.3 Signal amplification circuit

The signal amplification circuit is illustrated below in the Figure 5.8.

[pic]

Figure 5.8: The circuit of the signal amplification.

The ultrasonic signal which was received with the reception sensor is amplified by 2500 times (68dB) of voltage with the operational amplifier with two stages.

The voltage gain G is 100 times at the first stage (40dB) and 25 times (28dB) at the next stage. Generally, the positive and the negative power supply are used for the operational amplifier. The circuit this time works with the single power supply of +5 V. Therefore, for the positive input of the operational amplifiers, the half of the power supply voltage is applied as the bias voltage and it is made 2.5 V in the central voltage of the amplified alternating current signal.

When using the operational amplifier with the negative feedback, the voltage of the positive input terminal and the voltage of the negative input terminal become equal approximately. So, by this bias voltage, the side of the positive and the side of the negative of the alternating current signal can be equally amplified. When not using this bias voltage, the distortion causes the alternating current signal. When the alternating current signal is amplified, this way is used when working the operational amplifier for the two power supply with the single power supply.

Using the formula in 5.1:

Vi is the input voltage at the ultrasonic transducer.

Vo1 is the output voltage of the first amplification stage.

Vo2 is the output voltage of the second amplification stage.

At minimum distance, d = 10 cm,

Vi max = 2.50004 V.

Vo1 = (5 * 47K * (100k + 1k) / (47k + 47k) * 1K) - 2.50004 * 100k / 1k = 2.496 V.

Vo2 = (5 * 47K * (100k + 3.9k) / (47k + 47k) * 3.9K) - 2.496 * 100k / 3.9k = 2.6 V.

At maximum distance, d = 3 m,

Vi max = 2.4999 V.

Vo1 = (5 * 47K * (100k + 1k) / (47k + 47k) * 1K) - 2.4999 * 100k / 1k = 2.46 V.

Vo2 = (5 * 47K * (100k + 3.9k) / (47k + 47k) * 3.9K) - 2.46 * 100k / 3.9k = 2.50156 V.

ΔVi = 2.50004 – 2.4999 = 0.04 mV.

A slight change in Vi formed a bigger change in Vo2.

Δ Vo2 = ΔVi * Gain = 0.04 * 2500 = 100 mV.

5.3.2.4 Data of the TL082 operational amplifier

As for TL082, the two operational amplifiers are enclosed with the one package.

[pic]

Figure 5.9: Pin connections top view.

Table 5.3: The datasheet of the TL082 operational amplifier.

|Symbol |Symbol |Value |Unit |

|Supply Voltage |VCC |+18 |V |

| |VEE |-18 | |

|Differential Input Voltage |VID |±30 |V |

|Input Voltage Range |VIDR |±15 |V |

|Output Short Circuit Duration |tSC |Continuous | |

|Power Dissipation |PD |680 |mW |

|(Plastic Package) |1/8JA |10 |mW/°C |

|Operating Ambient Temperature Rage |TA |0 - +70 |°C |

|Storage Temperature Range |Tstg |-65 - +150 |°C |

|Slew rate |SR |16 |V/μs |

|Gain bandwidth product |GBW |4 |MHz |

The magnitude of the input voltage must not exceed the magnitude of the supply voltage or 15V, whichever is less. The output may be shorted to ground or either supply. Temperature and/or supply voltages must be limited to ensure that power dissipation ratings are not exceeded.

For the 741 operational amplifier, GBW = 1 MHz, SR = 0.5 V/μs.

For the TL082 operational amplifier, GBW = 4 MHz, SR = 16 V/μs.

Vi(t) = 0.04 cos ( 40000 * 2 * Π * t) mV.

Vo(t) = 100 cos ( 40000 * 2 * Π * t) mV.

(Vo(t))′ = 2 * Π * 40000 * 0.1 = 0.025 V/μs.

0.025 V/μs < 0.5 V/μs the 741 operational amplifier could be used.

0.025 V/μs < 16 V/μs the TL082 operational amplifier could be used.

The TL082 operational amplifier has a better slew rate.

For a 10% error in the frequency, F = 40000 * 0.9 = 36000 Hz.

The required gain bandwidth product for a gain = 2500 is,

GBW = 36000 * 2500 = 90 MHz > 4 MHz.

The signal amplification is split into two stages because of this gain bandwidth product.

The maximum gain G max = 4 MHz / 36000 Hz = 111.11.

The maximum gain is greater than the gain for the first stage 100 and the second stage 25.

5.3.3 Detection circuit

The detection is done to detect the received ultrasonic signal. It is the half-wave rectification circuit which used the 1N4148 diodes.

[pic]

Figure 5.10: The detection circuit.

The DC voltage according to the level of the detection signal is gotten by the capacitor behind the diode. The 1N4148 diode is used because it is a fast switching diode.

5.3.4 The microcontroller

[pic]

Figure 5.11: The microcontroller top view.

The microcontroller used in this project is the 40 pin PIC16f877A. This microcontroller was chosen because it consists of two timers, two capture modes CCP, five ports, a good size of memory and its low price compared to other microcontroller with less functionality. By manipulating the program of this project, this microcontroller with its big number of ports could be added to a robot or other applications and also it could control other applications due to the measured distance needed to react for.

The clock used for this project is 4 MHz. The port B is an output port used for the digital display of the distance measured. The bit RC4 of the port C is used to enable the transmitter in order to send pulses. The bit RC2/CCP1 of the port C is used for its capture mode by capturing the echo reflected, it is connected to the receiver.

Table 5.4: The microcontroller specifications.

|Device |PIC16f877a |

| |Bytes |14.3 K |

|Program memory | | |

| |# single word instruction |8192 |

|Data SRAM (Bytes) |368 |

|EEPROM (Bytes) |256 |

|I/O |33 |

|Ports |A, B, C, D, E |

|10 bit A/D (ch) |8 |

|CCP (PWM) |2 |

| |SPI |yes |

|MSSP | | |

| |Master I²C |yes |

|USART |yes |

|Timers 8/16 bit |2/1 |

|Comparators |2 |

5.3.4.1 The CCP capture mode

This project makes use of the CCP module (in its capture mode) to accurately measure the signal reception time at the CCP port pin. When a signal triggers the CCP module the value of timer 1 is stored in a CCP register (or captured).

If you store the value of timer 1 and then enable the CCP after transmitting an ultrasound pulse the CCP will trigger when the comparator activates i.e. as soon as an ultrasonic echo is received.

Subtracting the stored value from the CCP register value gives the time delay in machine cycles. Since the project uses a 4MHz main clock then the time delay will be measured in micro-seconds.

5.4 The program

This program is written in C code. It is compiled using the program MicroC in order to generate the Hex file. It consists of an include header “bit.h”, the main program with eight functions.

5.4.1 The flowchart

It enters a continuous loop calling “ulta_gen” the routine that generates the ultrasound at 40 kHz. The “ultra_gen” routine is set up using the simulator to set the timing of the output signal for a period of 25 μs (40 kHz). This is then repeated every 40 ms.

The required refresh rate of the seven segment display is 20 ms so the display update routine “seg_display_int” is called twice over the 40 ms period. The display update routine takes 20 ms and calling this twice creates the total 4 0ms delay. The display relies on persistence of vision to make it appear that the display is not flickering; a refresh rate of 50Hz or more does the job (1 / 50 Hz = 20 ms).

In theory the maximum distance that you could measure is (20 ms * 340 m) / 2 = 3.4 m, but in practice this is limited by the signal conditioning circuits. If they were changed, more range could be got. If a capture occurs indicated by “gCapInt”, then the distance calculation is performed and the value of variable “val” is updated. “val” is the value displayed by the seven segment display routine “seg_display_int”, so “val” is continuously refreshed to the seven segment display.

The interrupt routine is only enabled when required and when the capture occurs, only the first capture is stored. So that later reflections are ignored by resetting “gCapOn”.

The first reflection should be the strongest and therefore the closest object. When captured, the variables “t_capL”, “t_capH” and “t_capO” are set to the value of the capture register which will be the value of timer 1 when the capture module triggered.

[pic]

Figure 5.12: The flowchart of the program.

5.4.2 Include file “bit.h”

This macro preserves the current value of the 'PORT' or register. WRITEPORT is the same as writing to a port but preserves the keepmask bits.

The macro WRITEPORT(port,newval,keepMask) is used to write only to specific bits of a port. The PORT is read, keepMask bits are preserved when the data value is output to the port.

#define WRITEPORT(port,newval,keepMask) \

(port) = ((newval) & (~keepMask)) | ((port) & (keepMask));

#define setBit(var, bitnum) (var)|=(1 ................
................

In order to avoid copyright disputes, this page is only a partial summary.

Google Online Preview   Download