1、 2012 Published by Elsevier Ltd. Selection and/or peer-review under responsibility of name organizer Available online at Physics Procedia 25 (2012) 1732 1737 中文 3380 字 2012 International Conference on Solid State Devices and Materials Science Design and Simulation of the Ultrasonic Rangefinder Base
2、d on Micro-controller SHI Yanbina, LIU Hong, HAO Xue a Aviation University of Air force, Changchun, 130022, China Abstract This paper describes the principle and techniques of ultrasonic rangefinder based on micro-controller AT89C2051. The performance characteristics of the ultrasonic rangefinder ar
3、e studied theoretically and experimentally. The primary objective of the study was to determine the hardware principle circuit and the main software design, the computed simulation by Pspice is provided for the key part of the hardware circuit. In this paper it is demonstrated that this type of the
4、ultrasonic rangefinder is available. by lsev B.V. Selection and/or peer-review under responsibility of Garry Lee Open access under CC BY-NC-ND license. Keywords: Ultrasonic rangefinder; DDS; signal source; micro-controller 1. Introduction The ultrasonic has many characteristics such as the strong di
5、rective property, the slow energy consumption, the long propagation distance in the medium and so on. Because each medium presents certain impedance to the propagation for the ultrasonic when the ultrasonic affects to two medium interfaces, if the difference of the acoustic impedance between these t
6、wo medium is very big, the ultrasonic can reflect from the contact surface, thus the ultrasonic can be used in the distance measurement frequently. Under the normal temperature, the acoustic impedance rate of the air is 415Pas/m, and the acoustic impedance rate of the water is 1.48106 Pas/m, the aco
7、ustic impedance rate of the steel is 4.5107 Pas/m, therefore the distance gauge and the position measuring instrument and so on between the air and steel, or between the air and the water surface all may realize through the E-mail address: shiyanbin_. 1875-3892 2012 Published by Elsevier B.V. Select
8、ion and/or peer-review under responsibility of Garry Lee Open access under CC BY-NC-ND license. doi:10.1016/j.phpro.2012.03.303 Shi Yanbin et al. / Physics Procedia 25 (2012) 1732 1737 1733 ultrasonic. The principle of the rangefinder is the ultrasonic launch some direction ultrasonic wave, at the s
9、ame time start time, the ultrasonic propagates in the air, bumps into the obstacle to reflect on the way, the ultrasonic wave receiver receives the reflected wave, and stops time immediately, records the time according to the timer, the distance between the emission point and obstacle can be calcula
10、ted. In this paper, takes the AT89C2051 one-chip micro-controller as the core, utilizes the characteristics of the ultrasonic to design the low cost, high precision, the digital display rangefinder, which can be used for measure distances. 2. Systematic characteristics describe and technical feature
11、 The main function of the rangefinder is carries on the distance measurement in the 6m range. Its characteristic is: its electric circuit is simple, and the volume is small; Used the micro-controller technology, it has high reliability and measuring accuracy; it adopts the loss consumed power compon
12、ent, which reduces the breakdown formation rate; it takes the liquid crystal digital display, which easy to use. The main technical performances of the rangefinder: x Measurement range: 0.76m; x Measuring error: 1.7%; x Resolution: 0.01m; x Main hardware: AT89C2051 micro-controller, ultrasonic detec
13、ting head (UCM-R40 and UCM-T40), character liquid crystal display module (TR0802B). 3. System design and improving Fig. 1.system structural block diagram The structural block diagram of the system is shown as Fig. 1. When switching on the working power, the micro-controller data processing unit init
14、ializes the square wave which forms 40 KHz, push the PTT button, it transmits the sinusoidal wave; the er begins to count at the same time, the ultrasonic carries on power amplification through the power amplifier, launched by the ultrasonic launcher. When it meet the reflector, the reflector reflec
15、ts the return wave echo at once, the receiver receives the reflected signal, reflect the signal and strain the wave, amplify and have a facelift sequentially, sends to the interrupt interface of the micro-controller and the, the micro-controller stops counting the counter after receives the signal.
16、The rangefinder calculates the distance according to the time; the calculating formula is shown as follows: S = v(t-t0 ) 2 (1) 1734 Shi Yanbin et al. / Physics Procedia 25 (2012) 1732 1737 2 10 12 RS R/W E DB0 DB1 DB2 DB3 DB4 DB5 DB6 DB7 2 GND 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 K A DB7 DB6 DB5 D
17、B4 DB3 DB2 DB1 DB0 E R/W RS VO VDD VSS 8 4 4 8 11 4 11 4 4 11 4 11 The transmit speed of the ultrasonic in the air is: v=v0 1+T / 273 (2) 3.1. Hardware design The system hardware architecture divides into four parts: 5V power source; micro-controller circuit for data processing and demonstration par
18、t; Ultrasonic transmitter part; receiver and amplifier unit. Fig. 2 shows the circuit diagram of the ultrasonic rangefinder based on micro-controller. AN1 M1 RT0802B GND U1C 5 6 4069 U1B 3 4 4069 U1A 1 4069 U1E A1 SEND R1 51 VCC C1 0.1uF RW1 10K U1D 9 8 11 4069 U1F GND VCC 4069 13 4069 RS R/W E DB0
19、U2 11 P3.7 12 P1.0(AIN0) GND (T1)P3.5 GND 10 9 C3 15P C5 33P R2 C6 VCC R14 DB1 13 DB2 14 P1.1(AIN1) (T0)P3.4 8 7 GND 100K R4 10K 300K C8 100P U3D A2 RECEIVE DB3 15 DB4 16 P1.2 P1.3 P1.4 (INT1)P3.3 (INT0)P3.2 XTAL1 6 C4 5 15P U3C 10uF U3A C10 2 12 R17 14 DB5 17 DB6 18 P1.5 XTAL2 4 3 CY1 9 1 8 3 100P
20、6.8K 13 VCC DB7 19 20 C2 P1.6 P1.7 VCC AT89C2051 (TXD)P3.1 (RXD)P3.0 2 RST/VPP 1 AN2 VCC 10 LM324 R8 10K LM324 R15 300K R16 6.8K LM324 +9V U4 78L05 1 Vin GND +5V 0.1uF 3 VCC VCC C12 1uF D1 R5 10K GND R6 10K 1 U5A 2 3 R7 10K GND U3B CN1 1 2 C11 47uF GND C7 10uF 1N4148 GND TLC393 C9 100P GND R3 100K V
21、CC VCC R9 10k 5 R10 6 10k GND 7 2.5V LM324 C13 0.1u GND R11 10K 5 R12 6 10K U5B 7 R13 10K TLC393 GND Fig. 2. circuit diagram of the ultrasonic rangefinder based on micro-controller The power unit uses three terminal integration regulator 78L05, which provides the stable +5V voltage for the micro-con
22、troller circuit and the amplifier. The micro-controller circuit uses the low voltage, high performance CMOS 8 machine AT89C2051 which American ATMEL Corporation produces, it is compatible with the industry standard MCS-51 instruction and the pin, thus is one kind of function formidable micro control
23、ler, has provided a highly nimble effective solution to the very many embedded control application. In this design, it produces the 40kHz transmitting signal, receives the echo signal, calculates the distance according the propagation time recorded by the internal counter, and controls the RT0802B c
24、haracter liquid crystal module to demonstrate the distance. RT0802B is the display unit; the key AN1 is used for control the back light of the RT0802B; RW1 is used for adjust the demonstration contrast gradient; the key AN2 is used for control the work switch condition of the rangefinder. The transm
25、ission circuit is composed by the CD4069 phase reverser, this circuitry is simple (see also schematic diagram), U1B and U1A, U1E and U1F joining-up enhance the output current; the output voltage phases of the 4th, 2nd pin and 10th, 12th pin are opposite. Thus, the transmitter may obtain the peak val
26、ue is the 9V AC sine signal (the Q value of the ultrasonic wave transmitter is very high, only the fundamental wave signal has an effect, the higher harmonic does not have influence), which enhanced the emissive power. The pre-amplifier selects the general low power consumed integration operational amplifier LM324, receives the weak signal by the ultrasonic wave acceptor and carries on the enlargement.U3B outputs the