The concept and design scheme of the hottest ultra

  • Detail

The concept and design scheme of ultrasonic sensor rangefinder

the power fittings samples and overall string type developed have also been subjected to force analysis and experimental verification, and have passed the mechanical performance type test of Beijing Electric Power Construction Research Institute, power line equipment quality inspection and testing center of electric power industry and Shanghai Cable Research Institute. All indicators of the materials and samples meet the relevant technical standards and design requirements. From manual measurement with tape measure, to measurement and calculation with level gauge and triangle theory, and even laser ranging, these measurement methods are unsatisfactory due to low accuracy, cumbersome operation or high cost. With the increasingly extensive application of ultrasonic, ultrasonic ranging has been applied in the field of testing. Such products as imported ultrasonic liquid level gauge and ultrasonic position gauge have good performance, but they are expensive. At present, ultrasonic sensor technology has been widely used in industry, national defense, transportation, biomedicine and family fields. The combination of ultrasonic sensor technology, information technology and integrated technology creates favorable conditions for the development of intelligent and high-sensitivity ultrasonic instruments and equipment. In view of this, using embedded single-chip microcomputer technology, combined with CAN bus communication protocol standards, the design of an embedded ultrasonic rangefinder has great development prospects. It can achieve low cost, simple peripheral circuit, complete functions, and can meet certain measurement requirements

1 ultrasonic sensor

1.1 typical structure

ultrasonic sensor is a sensor developed by using the characteristics of ultrasonic wave. The typical structure of ultrasonic sensor is shown in Figure 1. It is to paste two piezoelectric wafers (also known as bicrystal oscillators) into a square according to the opposite polarity, and then lead out two electrodes. The piezoelectric chip is provided with a metal vibrating plate and a conical vibrator. Conical vibrator has strong directivity, which is convenient for sending and receiving ultrasonic waves. The ultrasonic sensor adopts a metal or plastic shell with a shielding grid on the top

1.2 ranging principle

ultrasonic wave has the characteristics of high frequency, propagation along a straight line, good directivity, small diffraction, strong penetration, and slow propagation speed (about 340m/s, the same as the speed of sound)

ultrasound has strong penetration ability to solids and liquids, especially for opaque solids in the sun, which can penetrate tens of meters deep. Some remedial measures can be taken when ultrasonic waves reach impurities or interfaces, which will produce reflected waves. Using this feature, ultrasonic flaw detectors or rangefinders can be formed. When ultrasonic waves encounter moving objects, they will produce Doppler effect, which will change the received frequency. Thus, a Doppler ranging system can be made

the principle of ultrasonic ranging is that the ultrasonic pulse emitted by the ultrasonic probe is transmitted to the object surface through the medium (air), and then transmitted to the receiving probe through the medium (air) after reflection, and the ultrasonic 1 is measured The time required for the universal experimental machine to produce random error pulse from transmitting to receiving. According to the sound velocity in the medium, the distance from the probe to the object surface is obtained. If the distance from the probe to the surface of the object is l, the propagation speed of ultrasound in the air is V, and the propagation time from transmission to reception is t, then l=vt/2. It can be seen that there is a definite functional relationship between the measured distance L and the propagation time. As long as the time t can be measured, the distance l can be calculated. Through the software, the number of power lithium battery enterprises in China has been reduced from 84 to 40, and now the value of L is directly displayed on the display

2 hardware circuit design

2.1 overall scheme design

according to the given design requirements, it has the functions of digital display, keyboard input, ultrasonic transmission and reception, communication with the upper computer through CAN bus, automatic alarm of abnormal conditions, etc. The overall scheme design block diagram of this embedded ultrasonic rangefinder can be constructed, as shown in Figure 2. It can be seen from Figure 2 that the overall hardware circuit design mainly includes: microprocessor AT89C51 part, power circuit part, ultrasonic transmitting and receiving circuit part, keyboard input part, can bus communication part, LED display part. Now we will focus on the specific design of ultrasonic transmitting and receiving circuit and can bus communication circuit

2.2 ultrasonic ranging circuit

ultrasonic ranging circuit mainly includes two parts: ultrasonic transmitting circuit and ultrasonic receiving circuit. The specific circuit design is shown in Figure 3. The upper part of Figure 2 is the ultrasonic transmitting circuit. The microprocessor AT89C51 generates a 40KHz ultrasonic signal on port p16 through programming, drives and reshapes the signal through two 74ls14 non gates, amplifies it by triode Q9, and finally sends it to ultrasonic sensor csb-t40 through transformer T1, so that the corresponding ultrasonic signal can be sent through ultrasonic sensor csb-t40. The lower half of Figure 3 is the ultrasonic receiving circuit. After the ultrasonic signal is transmitted to the ultrasonic sensor csb-r40 through obstacles, a certain electrical signal is generated. The electrical signal is amplified by the integrated block bx1490 and sent to two 74ls14 non gate circuits for shaping, and finally enters the p17 port of microprocessor AT89C51. In this way, the scanning process of an ultrasonic ranging is completed. It can control the counter through a program, convert the counter data into the corresponding time, and then multiply the time by the ultrasonic propagation speed and divide it by 2 to obtain the distance between the obstacle and the ultrasonic sensor

2.3 can bus communication circuit

considering that the current intelligent test equipment is increasingly networked, the CAN bus communication function is also designed into this embedded ultrasonic rangefinder. The CAN bus communication circuit system is mainly composed of AT89C51 microcontroller, independent can communication controller SJA1000, can bus driver PCA82C250 and reset circuit imp708. The specific circuit design of CAN bus application node is shown in Figure 4 below. In order to improve the anti-interference ability of the system, a photoelectric isolator 6n137 is added between SJA1000 and can bus driver PCA82C250. When the microprocessor AT89C51 sends the experimental performance of the ranging universal data to the CAN bus controller SJA1000 through the P0 port according to the appearance state of the test piece, the SJA1000 converts the parallel data into serial data and sends it from the port tx0. After passing through the photoelectric isolator 6n137, it reaches the CAN bus driver PCA82C250, and finally sends the data to the CAN bus. On the contrary, the data from the CAN bus can also reach the microprocessor through the corresponding circuit. In this way, the communication function between the distance meter and the upper computer can be realized

3 program design

3.1 main program design

the main program of the system mainly includes initialization of the system after startup, ultrasonic transmission and reception, interrupt management, timing program, ranging calculation, result display, can communication, alarm and other subroutines. According to the above description of the working principle of the ultrasonic rangefinder, the flow chart design of the main program of the system is shown in Figure 5. After the initialization of the main program, enter the ultrasonic signal sending program, that is, use the program to generate the ultrasonic signal and send it out by the p16 port of the microprocessor. At this time, the system enters the timing state, and detects whether the p17 port can receive the ultrasonic echo signal, but when the echo signal is detected, close the external interrupt and enter the distance calculation subroutine, and then carry out the alarm verification and can communication subroutine, Finally, open the external interrupt to complete a ranging scanning process, that is, the end of the main program

3.2 can communication subroutine design

can communication subroutine mainly includes three parts: initialization subroutine, sending subroutine and receiving subroutine. In the initialization subroutine, it mainly sets some parameters of the system, such as acceptance code register, timing register, output control register, timing register, working mode register, interrupt timing synchronization and so on. The program flow chart design of sending and receiving subroutines in can communication is shown in Figure 6. In the sending subroutine, it is mainly to read the status register bit Sr.2 to see whether Sr.2 is 1. If this bit is 1, the corresponding sending preparations will be carried out, and the command register cmr 0 set the request to send, and it will return automatically after sending. In the receiving subroutine, first read the status register bit sr.0 to see whether the buffer data is allowed to be read into the CPU ram. After reading, release the receiving buffer, and then see whether sr.1 is 1. If sr.1 is 1, clear sr.1 and do overflow processing. Otherwise, read sr.6 and sr.7 and do timer warning and corresponding processing

4 conclusion

the embedded ultrasonic rangefinder designed has simple structure, low price and reliable performance. The range of measuring and displaying obstacle distance is 0.05 ~ 10m. It is suitable for measuring object surface and liquid surface. It can be used as a small rangefinder in automobile reverse monitoring and alarm device, and can also be embedded into other large industrial detection and control systems as an embedded device

Copyright © 2011 JIN SHI