Ultrasonic transmitting circuit principle as well as components,thanks!
Abstract ultrasonic rangefinder, can be applied to automobile reversing, building construction site and some industrial site location monitoring, can also be used for such as liquid level, well depth, pipeline length measurement and other occasions. Requirements for the measurement range of 0.10-5.00m, measurement accuracy of 1cm, measurement without direct contact with the measured object, can clearly and stably display the measurement results. Due to the strong directionality of ultrasonic waves, slow energy consumption, in the medium of the propagation of the distance is farther, so ultrasonic waves are often used for distance measurement, such as rangefinders and level meters can be realized by ultrasonic waves. The use of ultrasonic detection is often more rapid, convenient, simple calculation, easy to do real-time control, and in the measurement accuracy can reach the requirements of industrial practice, so in the development of mobile robots have also been widely used. Keywords Microcontroller AT82S51 ultrasonic sensor measuring distance I. Design Requirements Design an ultrasonic rangefinder, which can be applied to automobile reversing, building construction sites and some industrial site location monitoring, but also can be used in such occasions as liquid level, well depth, pipe length measurement. Requirements for the measurement range of 0.10-3.00m, the measurement accuracy of 1cm, no direct contact with the measured object, can clearly and stably display the measurement results. Second, the design idea of ultrasonic sensors and their distance measuring principle Ultrasonic waves are mechanical waves with a frequency higher than 20KHz. In order to use ultrasonic waves as a means of detection, it is necessary to generate ultrasonic waves and receive ultrasonic waves. The device that accomplishes this function is the ultrasonic transducer, which is customarily called ultrasonic transducer or ultrasonic probe. Ultrasonic transducers have a transmitter and a receiver, but an ultrasonic transducer can also have the dual role of sending and receiving sound waves. Ultrasonic transducers utilize the principle of the piezoelectric effect to convert electrical energy and ultrasonic waves into each other, i.e., when transmitting ultrasonic waves, the electrical energy is converted to transmit ultrasonic waves; and when receiving the echo, the ultrasonic vibrations are converted into an electrical signal. The principle of ultrasonic distance measurement generally uses the transit time method TOF (timeofflight). First measured ultrasonic waves from the launch to meet the obstacle to return to the time experienced, and then multiplied by the speed of the ultrasonic waves to get two times the distance between the sound source and the obstacle Measurement of distance has a variety of methods, short distances can be used with a ruler, long distances, such as laser ranging, ultrasonic ranging for high-precision measurements of the long and medium distances. Because the ultrasonic wave propagation speed in standard air is 331.45 meters/second, and the microcontroller is responsible for timing, the microcontroller uses 12.0M crystal, so the measurement accuracy of this system can theoretically reach millimeter level. Ultrasonic waves can be used for distance measurement because of their strong directionality, slow energy consumption and long propagation distance in the medium. Using ultrasonic waves to detect the distance, the design is more convenient, and the calculation processing is simpler, and it can also meet the requirements in terms of measurement accuracy. Ultrasonic generators can be divided into two categories: one is to generate ultrasonic waves electrically and the other is to generate ultrasonic waves mechanically. This topic belongs to the proximity measurement, which can be realized by using the commonly used piezoelectric ultrasonic transducer. According to the design requirements and a combination of factors, we can use the AT89S51 microcontroller as the main controller, with the dynamic scanning method to achieve the LED digital display, ultrasonic drive signals with the microcontroller timer to complete the ultrasonic range finder system block diagram is shown in the following figure: ultrasonic range finder system design block diagram, the system components Hardware part of the microcontroller system and the display circuit, the ultrasonic transmitter circuit and ultrasonic detection and reception circuit in three parts. and ultrasonic detection and reception circuit is composed of three parts. AT89S51 is used to realize the control of CX20106A infrared receiver chip and TCT40-10 series ultrasonic conversion module. Microcontroller through the P1.0 pin through the inverter to control the ultrasonic transmission, and then the microcontroller keeps detecting the INT0 pin, when the level of INT0 pin from the high level to the low level, it is considered that the ultrasonic wave has returned. The data counted by the counter is the time experienced by the ultrasonic wave, and the distance between the sensor and the obstacle can be obtained through conversion. The software part consists of the main program, ultrasonic generation subroutine, ultrasonic reception interrupt program and display subroutine and other parts. IV. System Hardware Circuit Design 1. Microcontroller System and Display Circuit The microcontroller adopts 89S51 or its compatible series. The 12MHz high-precision crystal is used to obtain a more stable clock frequency and reduce the measurement error. The microcontroller uses the P1.0 port to output the 40KHz square wave signal required by the ultrasonic converter, and uses the external interrupt 0 port to detect the return signal output by the ultrasonic receiving circuit. The display circuit uses a simple and practical 4-bit ****yang LED digital tube, segment code driven by 74LS244, bit code driven by a PNP transistor. Microcontroller system and display circuit shown below Microcontroller and display circuit schematic 2. Ultrasonic transmitter circuit schematic reference journal as shown in the figure: Ultrasonic transmitter circuit schematic Piezoelectric ultrasonic converter function: the use of piezoelectric crystal resonance work. The internal structure is shown in the figure above, it has two piezoelectric wafers and a **** vibration plate. When its poles plus a pulse signal, its frequency is equal to the piezoelectric chip's intrinsic oscillation frequency, the piezoelectric chip will occur *** vibration, and drive the *** vibration plate vibration generates ultrasonic waves, then it is an ultrasonic generator; such as no voltage, when the *** vibration plate accepts ultrasonic waves, will be compressed piezoelectric oscillator vibration, will be converted to mechanical energy into electrical signals, then it becomes ultrasonic wave acceptance converter. Ultrasonic emission converter and acceptance converter has a slightly different structure. 3. Ultrasonic detection and acceptance circuit Referring to the infrared conversion to receive the circuit of the journal using integrated circuits CX20106A, which is an infrared detection and reception of special chips, commonly used in infrared remote control receivers for television sets. Taking into account the infrared remote control commonly used carrier frequency of 38KHz and ranging ultrasonic frequency of 40KHz is relatively close to the ultrasonic detection circuit can be used as it. Experiments have proved that it has high sensitivity and strong anti-interference ability. Appropriate changes in the size of C4 can change the sensitivity of the receiving circuit and anti-interference ability. Ultrasonic receiving circuit diagram V. System Programming The ultrasonic rangefinder software design is mainly composed of the main program, ultrasonic transmitter subroutine, ultrasonic receiver interrupt program and display subroutine. The following ultrasonic rangefinder algorithm, the main program, ultrasonic transmitter subroutine and ultrasonic acceptance interrupt program is introduced one by one. 1. Algorithm Design of Ultrasonic Distance Measuring Instrument The following figure illustrates the principle of ultrasonic distance measuring, that is, the ultrasonic generator T sends out an ultrasonic signal at a certain moment, and when the ultrasonic wave encounters the object to be measured and then reflects back, it will be accepted by the ultrasonic receiver R. So that as long as the time used to calculate the occurrence of the signal to accept the return signal, you can calculate the distance between the ultrasonic generator and the reflected object. Distance formula: d = s / 2 = (c * t) / 2 * d for the measured object and rangefinder distance, s for the return journey of sound waves, c for the speed of sound, t for the time used by the sound wave back and forth The speed of sound c and the temperature is related to the temperature, such as the temperature does not change much, then the speed of sound can be considered as basically unchanged. If the ranging accuracy requirements are very high, it should be corrected by the method of temperature compensation. After the speed of sound is determined, as long as the ultrasonic round-trip time is measured, the distance can be obtained. In the system to join the temperature sensor to monitor the ambient temperature, the temperature can be compensated. Here you can use DS18B20 to measure the ambient temperature, according to different ambient temperatures to determine the speed of sound to improve the stability of the distance measurement. In order to enhance the reliability of the system, anti-interference measures should be used in hardware and software. Ultrasonic speed of sound table at different temperatures Temperature/ -30 -20 -10 0 10 20 30 100 Speed of sound c(m/s) 313 319 325 323 338 344 349 386 2. Main program The main program first initializes the system environment, sets the timer T0 working mode to 16-bit timer counter mode, sets the total interrupt allowable bit EA, and clears 0 to the display ports P0 and P2, and then calls the ultrasonic wave program. Then call the ultrasonic generator subroutine to send out an ultrasonic pulse, in order to avoid direct wave triggering caused by the ultrasonic wave directly transmitted from the transmitter to the receiver, it is necessary to delay 0.1ms (this is the reason that the range finder will have a minimum measurable distance) before turning on the external interrupt 0 to receive the returned ultrasonic signal. As a result of the use of 12MHz crystal, the machine cycle of 1us, when the main program to detect the reception of the successful flag bit, the counter T0 in the number (that is, the ultrasonic back and forth time) can be calculated according to the formula below to measure the distance between the object being measured and the rangefinder, designed to take the speed of sound at 20 ℃ for 344m / s then there are: d = (C * T0)/2 = 172T0/10000cm (), where T0 is the counter T0, the distance between the object being measured and the rangefinder. Where T0 for the counter T0 count value) Measured distance after the results will be decimal BCD code way LED, and then send ultrasonic pulses to repeat the measurement process. The block diagram of the main program is as follows 3. Ultrasonic generation subroutine and ultrasonic reception interrupt program Ultrasonic generation subroutine is used to send two or so ultrasonic signals through the P1.0 port frequency of about 40KHz square wave, the pulse width of 12us or so, and at the same time the counter T0 open for timing. The main program of the ultrasonic rangefinder uses external interrupt 0 to detect the return ultrasonic signal, and enters the interrupt program as soon as it receives the return ultrasonic signal (a low level on the INT0 pin). Into the interrupt immediately after the shutdown timer T0 to stop the clock, and distance measurement success flag word assigned 1. If when the timer overflow has not been detected when the ultrasonic return signal, the timer T0 overflow interrupt will be the external interrupt 0 shut down, and distance measurement success flag word assigned 2 to indicate that the distance measurement is not successful. VI. Hardware and software debugging and performance of ultrasonic rangefinder production and debugging, which ultrasonic transmission and reception of Φ15 ultrasonic transducer TCT40-10F1 (T transmitter) and TCT40-10S1 (R receiver), the center frequency of 40kHz, the installation should be to keep the two transducer center axis parallel and 4-8cm apart, the rest of the components have no special requirements. If the ultrasonic receiving circuit can be shielded with a metal shell, it can improve the anti-interference ability. According to the different requirements of the measurement range, you can adjust the size of the filter capacitor C4 connected with the receiving transducer to obtain the appropriate receiving sensitivity and anti-interference capability. After the hardware circuit is completed and debugged, the program can be compiled and downloaded to the microcontroller for trial operation. According to the actual situation, the ultrasonic generation subroutine can be modified each time to send the pulse width and the interval time between two measurements, in order to adapt to the needs of different distance measurements. According to the designed circuit parameters and procedures, the range of the rangefinder can be measured from 0.07 to 5.5 m, and the maximum error of the rangefinder is not more than 1 cm. After the commissioning of the system, several experiments should be carried out to analyze the measurement error and repeatability, and optimize the system so that it can meet the requirements of the actual use of the measurement. Follow-up work needs to be verified after the experiment According to the reference circuit and the integrated circuit device ranging range is limited to 10m or less for good. /cdbbs/2008-12/17/081217A9D4D0217.html I hope this helps you!