ultrasonic range finder

44
Welcome

Upload: hicham-berkouk

Post on 28-Nov-2014

375 views

Category:

Devices & Hardware


6 download

DESCRIPTION

These are the slides of my final project in my DEUA in Digital Electronics.

TRANSCRIPT

Page 1: Ultrasonic Range Finder

Welcome

Page 2: Ultrasonic Range Finder

Presentation of the final year ProjectJuly 6, 2011

Mr. BERKOUK Hicham

Digital

Under the supervision of: Mr. HAMADACHE

Ultrasonic Range finder

Page 3: Ultrasonic Range Finder

Outline

IntroductionProject overviewCircuit operationCircuit adjustmentsConclusion

Page 4: Ultrasonic Range Finder

Introduction

Ultrasound and piezoelectricity are two physical phenomena strongly related to the operation of the ultrasonic range finder, hence they should be defined. Ultrasound is cyclic sound pressure with a frequency

greater than the upper limit of human hearing.

Page 5: Ultrasonic Range Finder

Introduction

The applications of ultrasound are:

• Medical sonography• Ultrasonic testing• Ultrasonic cleaning• Ultrasonic welding• Sonochemistry• Ultrasonic weaponry• Ultrasonic range finding

Page 6: Ultrasonic Range Finder

Introduction

Piezoelectricity is the charge which accumulates in certain solid materials (notably crystals) in response to applied mechanical stress. In other words, piezoelectricity is the electricity resulting from pressure.

The applications of piezoelectricity are:

• Piezo-based ignition systems• Piezoelectric transformers• Piezoelectric sensors• Piezoelectric actuators• Quartz crystals• SONAR

Page 7: Ultrasonic Range Finder

Introduction

Ultrasonic range finding, called also SONAR (Sound Navigation and Ranging), is a technique used to measure how far away objects are from an ultrasonic source.

The principle of operation of ultrasonic range finding is:

An ultrasonic pulse is generated in a given direction. If there is an object in the path of this pulse, part or all of this pulse will be reflected back to the transmitter as an echo and can be detected through the receiver path. By measuring the difference in time between the pulse being transmitted and the echo being received, it is possible to determine how far away the object is.

Page 8: Ultrasonic Range Finder

Introduction

Page 9: Ultrasonic Range Finder

Introduction

The applications of ultrasonic range finding are:

• Autofocus cameras.• Motion detection.• Robotics guidance.• Proximity sensing.

Page 10: Ultrasonic Range Finder

Project overview

Ultrasound physics:In air, ultrasound travels by compression and rarefaction (expansion) of air molecules in the direction of travel (longitudinal motion).

As sound is a wave it is defined with parameters that characterize waves, namely: speed of propagation (), frequency () and wavelength ().

Page 11: Ultrasonic Range Finder

Project overview

Page 12: Ultrasonic Range Finder

Project overview

• The period () is the time needed for one wave cycle to occur, measured in seconds.

• The wavelength is the distance travelled by a wave in one period.

• The frequency () is the number of cycles that occur in one second, measured in Hertz.

From the definitions of frequency and period, we can deduce the frequency.

Page 13: Ultrasonic Range Finder

Project overview

To find the speed of ultrasound, we use the general definition of speed which is the distance travelled over the time required for that.

Speed= distance/time 

Using this latter equation and the definition of the wavelength, we can deduce the speed of ultrasound ():

/

/ Then, ×    

Page 14: Ultrasonic Range Finder

Project overview

The speed of ultrasound in air varies essentially in function of air temperature. In fact, it can be found using the following equation:

V²=×R×

Where: : is the adiabatic index of air, =1,4. R: is a constant, R=287 J/kg/°K. T: is the temperature of air in kelvin (T=C°+273,15).

Page 15: Ultrasonic Range Finder

Project overview

The following table gives the speed of sound for different air temperature values.

Temperature (°C) Speed of sound (m/s)

-20 319

-10 327

0 332

10 337

20 343

30 349

Page 16: Ultrasonic Range Finder

Project overview

The speed that will be used in this project is 343 m/s at 20 °C because 20°C is near to the mean temperature value on earth.

Knowing that the frequency of the transducers used in this project is 40kHz, we can compute the wavelength of our waveform: =/ = 343/40k = 8,5 mm .

Page 17: Ultrasonic Range Finder

Project overview

Ultrasonic range finder:The circuit measures the time required for the pulse being sent to come back as an echo to the receiver.

Page 18: Ultrasonic Range Finder

Project overview

As the pulse travels twice the same distance, so to find the time we have to use a distance of 2×l.

∆t=2×l/

General block diagram:

The following figure shows the general block diagram of the ultrasonic range finder implemented in this project.

Page 19: Ultrasonic Range Finder

Project overview

Page 20: Ultrasonic Range Finder

Circuit operation

The ultrasonic range finder can be divided into the following parts: Two ultrasonic transducers (emitter + receiver). Transmitter circuit. Receiver circuit Time duration detection and calculation circuit. Counter circuit. Decoder and display circuit.

In this chapter, the operation of each part is described.

Page 21: Ultrasonic Range Finder

Circuit operation

Ultrasonic transducers:They are used to send and detect the ultrasonic pulses.

Page 22: Ultrasonic Range Finder

Circuit operation

Transmitter circuit:The transmitter circuit is composed of two oscillators and a monostable latch.• Oscillators:

Page 23: Ultrasonic Range Finder

Circuit operation

This type of oscillators is called “CMOS relaxation oscillator”. Its output is a square wave that has a frequency that can be calculated using the following expression:

/2,2×R2×C1 (for 2nd oscillator, add value of A1)

Page 24: Ultrasonic Range Finder

Circuit operation

• Monostable latch:A monostable latch is circuit that has two output states; one is stable the other is unstable. The output of the latch stays stable, indefinitely, unless a pulse is presented at its input and forces the output to the unstable state. The time duration of the unstable state is related to values of R and C. After that, the output comes back to the stable state.

1

23

U2:A

4011

C 5

64

U2:B

4011

R

+Vdd

Page 25: Ultrasonic Range Finder

Circuit operation

This monostable latch has a low stable output. When a high is presented at its input, the output goes high for time duration (t) that can be found using the following expression:

t=R×C×ln2 Receiver circuit:The receiver circuit is composed of two parts: a differential amplifier and a comparator.• Differential amplifier:Once the ultrasonic receiver detects the echo, it converts it to voltage oscillations of some millivolts. These oscillations are presented to the inverting input of a differential amplifier through a coupling capacitor.

Page 26: Ultrasonic Range Finder

Circuit operation

The output of the differential amplifier can be found using the following expression:

Vₒ= (1+ A/R’) × V₂ - (A/R’) × V₁

R'

R

R

A

+Vdd

C

Receiver

3

21

84

U1:A

LM358

Page 27: Ultrasonic Range Finder

Circuit operation

Where: V₁: is the voltage from the receiver. V₂: is the voltage on the non-inverting input, V₂= 4,5 V.• Comparator:It compares the output of the amplifier to a voltage reference on its inverting input.

R2

R1

A

1

23

U1:A

4011

+Vdd

3

21

84

U2:B

LM358

Page 28: Ultrasonic Range Finder

Circuit operation

When the output of the amplifier is less than the voltage reference of the comparator, this latter one will have a low output that will be converted to a high by the inverter. Time duration detection and calculation circuit:This circuit is composed of three parts: an RS flip-flop, an oscillator and a Schmitt trigger.• RS flip-flop:

1

23

U1:A

4001

5

64

U1:B

4001

S

R

Q

Page 29: Ultrasonic Range Finder

Circuit operation

The truth table for this flip-flop is given the following table.

Only the set and reset conditions will be used in this project.

S R Qn+1

0 0 Qn

0 1 0 (reset)

1 0 1 (set)

1 1 ?

Page 30: Ultrasonic Range Finder

Circuit operation

• Schmitt trigger:

It is used for noise immunity and to stop the range finder operation when the maximum measurable value is overtook.

R28

910

U5:C

4011

12

1311

U5:D

4011

R1

R3C1

Page 31: Ultrasonic Range Finder

Circuit operation

Counter circuit:The counters used in this project are: CD 4029, which are presettable up/down counters that count in either binary or decade mode depending on the voltage level applied at binary/decade input. When binary/decade is at logical “1”, the counters count in binary, otherwise they count in decade. Similarly, the counters count up when the up/down input is at logical “1” and vice versa.In this project, the counters count up and in decade mode (binary-coded-decimal, BCD mode).

Page 32: Ultrasonic Range Finder

Circuit operation

Decoder and display circuit:• Decoders:The decoders used in this project are: CD 4543, which are BCD-to-seven segment latch/decoder/driver designed primarily for liquid-crystal display (LCD) applications. They are also capable of driving light emitting diode (LED), incandescent, gas-discharge, and fluorescent displays.In this project, the decoders are used for LED application (common-anode ones), so we have to apply a logic “1” at the phase inputs of these decoders.• 7-segment display:The 3-digit 7-segment display used in project is common-mode type from ROHM Semiconductor.

Page 33: Ultrasonic Range Finder

Circuit operation

General circuit operation:The following figure shows the general schematic diagram of the ultrasonic range finder.

Page 34: Ultrasonic Range Finder

1

23

U1:A

4001R11M

5

64

U1:B

4001 C11u

R2220k

C2

10n

R310k D1

1N4148

1

23

U2:A

4011

C3

22n

5

64

U2:B

4011

8

910

U2:C

4011

R422k

12

1311

U2:D

4011

1

23

U3:A

4011

R622k C4

220pR5220k

+9 V

Transmitter

R7

220R

C51n

Receiver

R810k

R910k

R1010k

R1110k

+9 V

5

64

U3:B

4011

8

910

U3:C

4011

12

1311

U3:D

4011

1

23

U5:A

4011

5

64

U5:B

4011R127k5

C62n2R13

100k

R14

10k

8

910

U5:C

4011

12

1311

U5:D

4011

R15

22k

R1610k C7

1n

A5

B3

C2

D4

CLK

6

LE

1

BI

7

QA

9

QB

10

QC

11

QD

12

QE

13

QF

15

QG

14

U64543

A5

B3

C2

D4

CLK

6

LE

1

BI

7

QA

9

QB

10

QC

11

QD

12

QE

13

QF

15

QG

14

U74543

A5

B3

C2

D4

CLK

6

LE

1

BI

7

QA

9

QB

10

QC

11

QD

12

QE

13

QF

15

QG

14

U84543

R17

220R

R18

220R

R19

220R

A4

QA

6

B12

QB

11

C13

QC

14

D3

QD

2

CI

5CO

7

CLK

15

PE

1

B/D

9

U/D

10

U94029

A4

QA

6

B12

QB

11

C13

QC

14

D3

QD

2

CI

5CO

7

CLK

15

PE

1

B/D

9

U/D

10

U104029

A4

QA

6

B12

QB

11

C13

QC

14

D3

QD

2

CI

5CO

7

CLK

15

PE

1

B/D

9

U/D

10

U114029

D21N4148

D31N4148

D41N4148

C81n

A4

1M

A122k

A310k

+9 V +9 V +9 V

BAT19 V

C9470n

SW1

SW-SPST+9 V

+9 V +9 V +9 V

A210k

3

21

84

U4:A

LM358

3

21

84

U4:B

LM358

Page 35: Ultrasonic Range Finder

Circuit operation

The ultrasonic range finder circuit works as follows:• The oscillator.1 oscillates at a frequency of 2 Hz. Its output

is connected to a monostable latch through a capacitor and to the preset enable inputs of the counters. The capacitor discharges quickly through a resistor, and hence gives a short pulse to the preset enable inputs of the counters to clear them before they start counting.

• The monostable latch is at a low stable output state. When it receives a high input from the oscillator output, its output goes high for time duration of 300 μs, hence it limits the transmission time. The output is connected to the input of the oscillator.3 and to the S input of the RS flip-flop.

Page 36: Ultrasonic Range Finder

Circuit operation

• The oscillator.3 is controlled by the output of the monostable latch. When the output of the latch is high, the oscillator oscillates. So, in this case, the oscillator oscillates for 300 μs at a frequency of 40 kHz, i.e. a period of 25 μs. The number of pulses to be sent is 300/25, which equals to 12 pulses. This oscillator drives the ultrasonic transmitter, connected across an inverter to increase the power of transmission.

• The ultrasonic receiver is connected to the inverting input of a differential amplifier through a coupling capacitor. The non-inverting input is connected to a voltage divider of +4,5 V. The output of this amplifier is connected to the non-inverting input of a comparator. The inverting input of the comparator is connected to a voltage reference of value less than +4,5V by some millivolts.

Page 37: Ultrasonic Range Finder

Circuit operation

When an echo is present at the non-inverting input of the differential amplifier, its output oscillates around the value of +4,5V and at some time is less than the reference voltage at the inverting input of the comparator. In this condition, the output of the comparator goes low. This low state is converted to a high state by an inverter and presented to the R input of the RS flip-flop.

• When the transmission operation starts, the output of the RS flip-flop goes high and when an echo is received it goes low. The time duration for the high state corresponds to the time needed for the ultrasonic range finding operation. When the output of the flip-flop goes high, the oscillator.3 becomes operational and delivers a square wave output with a frequency that depends on the value of the variable resistor in this oscillator.

Page 38: Ultrasonic Range Finder

Circuit operation

The output of this oscillator is connected to the clock input of the first counter through a Schmitt trigger circuit. As we know, the counter outputs are incremented by 1 each clock pulse and knowing that the circuit displays the results in centimetres; so, the number of pulses delivered by the oscillator should correspond to a value in centimetres. We will see in the next chapter how to adjust the variable resistor in order to have a frequency that gives the right number of pulses.When the first clock pulse raising edge is presented on the clock input of the first counter (the counter of units), it starts counting. When this counter reaches the value 9 (1001 in binary), the carry out output (CO) will have a low value. This CO output is connected to the clock input of the second counter. After that the first counter comes back to the value 0000B and its CO output goes to the high value.

Page 39: Ultrasonic Range Finder

Circuit operation

This condition will increment the second counter. The same thing happens for the second counter. When it reaches the value 9, its CO output connected to the clock input of the third counter, goes low. When the second counter comes back to zero, its CO output goes high. In this situation, the third counter will be incremented.If all the CO outputs are low, the circuit will stop counting and will display the value 999. This situation occurs only when the distance is greater than the maximum measurable range.

• As the results of the counters are in BCD, they will be decoded by BCD to 7-segement display decoders before being displayed.

Page 40: Ultrasonic Range Finder

Circuit adjustments

An oscilloscope is needed in this practical part.• Oscillator.2 40 kHz (=25μs).Vary (A1) until we get on the oscilloscope a waveform having this frequency.

• Oscillator.3As we said in the previous chapter, the number of pulses delivered by this oscillator corresponds to centimetres on the display.

∆t= 2×l/= ∆t/n

Where; n: is number of cycles.The number of cycles in this case is n= 100×l.

Page 41: Ultrasonic Range Finder

Circuit adjustments

The period then is: = ∆t/(100×l) = (2×l/)/(100×l) = 0,02/ =0,02/343 ≈ 60 μs.Adjust the variable resistor (A3) until we get a waveform having a period of 60 μs.

• Voltage gain:What we need here, is to have the oscillating output of the amplifier less than the reference voltage of the comparator at some time.• Voltage reference of comparator:We change the value of (A2) until we get a reference voltage value less but close to the output voltage of amplifier at rest.

Page 42: Ultrasonic Range Finder

Conclusion

• In this work, an ultrasonic range finder has been realized to perform different possible applications.

• The project allowed us to study a great number of other circuits; such as, oscillators, monostable latches, and to use them to perform a given application.

• The speed of ultrasound in air is affected by air temperature variations. So, we can propose, for future improvements on the circuit, to add a temperature sensor, with its circuitry, to take into account these variations.

• We can also implement the range finder using a PIC microcontroller and develop the corresponding software to perform the required calculations.

The following figure shows an example of an improved ultrasonic range finder.

Page 43: Ultrasonic Range Finder

Conclusion

Page 44: Ultrasonic Range Finder

Thank you for your

attention