Design of ultrasonic distance measurement system based on μC/OS-Ⅱ and ARM

Publisher:自由探索者Latest update time:2013-09-07 Keywords:ARM  ultrasonic Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere

1 Introduction

  Ultrasonic waves have strong directivity, slow energy consumption, and can propagate over long distances in a medium, so they are used for distance measurement. Ultrasonic detection is often quick, convenient, simple to calculate, easy to control in real time, and the measurement accuracy can meet industrial practical requirements, so it is widely used in the development of mobile robots. Mobile robots must have automatic navigation and obstacle avoidance functions to operate in unknown and uncertain environments. Ultrasonic sensors are widely used as ranging sensors for mobile robots due to their simple information processing, fast speed, and low price, to achieve functions such as obstacle avoidance, positioning, environmental modeling, and navigation.

  2 Overall system design

  2.1 Principle of Ultrasonic Distance Measurement

  2.1.1 Ultrasonic generator

  Ultrasonic waves propagate in a straight line, with high frequency and strong reflection ability. Its propagation speed in the air is 340 m/s, which is easy to control and less affected by the environment. Therefore, ultrasonic sensors are used as the "eyes" of distance detection. The ultrasonic frequency that can be used in the field of distance measurement is in the frequency range of 20 to 400 kHz, and 40 kHz is commonly used in the air medium.

  2.1.2 Principle of piezoelectric ultrasonic generator

  Piezoelectric ultrasonic generators actually work by using the resonance of piezoelectric crystals. The internal structure of the ultrasonic generator consists of two piezoelectric chips and a resonance plate. When a pulse signal is applied to its two electrodes, and its frequency is equal to the natural oscillation frequency of the piezoelectric chip, the piezoelectric chip will resonate and drive the resonance plate to vibrate, generating ultrasonic waves. On the contrary, if no voltage is applied between the two electrodes, when the resonance plate receives ultrasonic waves, it will compress the piezoelectric chip to vibrate, converting mechanical energy into electrical signals, and then it becomes an ultrasonic receiver.

  2.1.3 Principle of Ultrasonic Distance Measurement

  The ultrasonic transmitter emits ultrasonic waves in a certain direction and starts timing at the same time. The ultrasonic waves propagate in the air and return immediately when they hit an obstacle. The ultrasonic receiver stops timing immediately after receiving the reflected wave. The propagation speed of ultrasonic waves in the air is 340 m/s. In the system, ultrasonic ranging uses the method of detecting the round-trip time of ultrasonic waves. Since the length of time is proportional to the distance the sound passes, when the ultrasonic transmitter emits a short pulse wave, the timing starts; when the ultrasonic receiver receives the first return wave pulse, the timing stops immediately. According to the time t recorded by the timer, the distance (s) from the emission point to the obstacle can be calculated, that is: s=340t/2. This is the so-called time difference ranging method.

  2.2 Overall system design

  The system uses μC/OS-1I operating system, and the system divides the software into four functional modules: echo A/D acquisition module, LED display and key processing module, LCD display module, alarm, storage and serial port processing module. Among them, the echo A/D acquisition module is used for sampling and saving real-time data; the LED display and key processing module is used to process the sampled data and convert it into meaningful parameters; the LCD display module displays various parameters on the LED; and the alarm, storage and serial port processing module mainly processes the corresponding data in real time. Figure 1 is the overall block diagram of the system design.

  

  3 System Hardware Design

  3.1 Introduction to LPC2138 Microcontroller

  LPC2138 has built-in 512 KB high-speed Flash memory and 32 KB RAM, and has rich peripheral resources: 2 32-bit timers (with capture and comparison channels), 2 10-bit 8-channel A/D converters, 1 10-bit D/A converter, PWM channels, 47 GPIOs, 9 edge- or level-triggered external interrupts, RTC with independent power supply and clock, and multiple serial interfaces (UART, I2C, SPI, SSP). It contains a vector interrupt controller with configurable interrupt priority and vector address. The on-chip Boot loader can realize in-system application programming (ISP/IAP), and the on-chip PLL can achieve a CPU operating frequency of 60 MHz. It has two low-power modes: idle and power-down, and can be awakened by external interrupts. Figure 2 is the overall structure of LPC2138.

  

3.2 Ultrasonic Transmitter Circuit

  The ultrasonic transmitting circuit is composed of the ultrasonic transmitter T and the 40 kHz frequency signal generated by PWM, the driving (or excitation) circuit, etc. The system design uses the PWM module in ARM to generate a high-precision 40 kHz frequency signal, and then passes through the driving circuit composed of 74HC00, etc., and finally sends the transmitting signal to the ultrasonic transmitter T. For the radiation probe T, a type with a transmitting frequency of 40kHz is selected. This type is now widely used and the circuit is simple. Only a 40 kHz pulse is given to the transmitting end, and the transmitting probe will continuously send ultrasonic waves. The specific hardware circuit is shown in Figure 3.

  

  The ultrasonic transmitter and receiver use φ15 ultrasonic transducers TCT40-10F1 (T transmitter) and TCT40-10S1 (R receiver), with a center frequency of 40 kHz. When installing, the center axes of the two transducers should be kept parallel and 4 to 8 cm apart.

  If the ultrasonic receiving circuit is shielded with a metal shell, the anti-interference ability can be improved. According to different measurement range requirements, the filter capacitor C4 connected in parallel with the receiving transducer can be appropriately adjusted to obtain appropriate receiving sensitivity and anti-interference ability.

  3.3 Ultrasonic receiving circuit

  The ultrasonic receiving circuit is composed of a three-stage filter amplifier circuit with MC3403 as the core and a diode voltage doubler and current stabilization circuit. The processed echo signal is sent to the ARM A/D conversion module for A/D sampling, thereby triggering the return time. The specific pin configuration of Texas Instruments' MC3403 is shown in Figure 4. The ultrasonic receiving circuit is shown in Figure 5.

  

  

  5 Measurement results

  After repeated debugging, the system was tested and the measurement range was 0.1~4.5m, the measurement accuracy was 1cm, and the measurement error was kept below 4cm, so the system performance was relatively good. The test data is shown in Table 1.

  

  6 Conclusion

  The ultrasonic distance measurement system based on ARM and μC/OS-II uses LCD display, has simple circuit, friendly display interface, strong communication capability, good scalability, and good practical application value. The system can be used for robot intelligent walking and navigation, and also has certain application areas in the automotive electronics industry. It can be used with other modules to achieve multi-functional measurement, and the touch screen function can be expanded in display input.

Keywords:ARM  ultrasonic Reference address:Design of ultrasonic distance measurement system based on μC/OS-Ⅱ and ARM

Previous article:Principle and method of realizing high-speed and low-power ADC with new pipeline
Next article:A brief discussion on the lighting design of indoor badminton courts

Latest Analog Electronics Articles
Change More Related Popular Components

EEWorld
subscription
account

EEWorld
service
account

Automotive
development
circle

About Us Customer Service Contact Information Datasheet Sitemap LatestNews


Room 1530, 15th Floor, Building B, No.18 Zhongguancun Street, Haidian District, Beijing, Postal Code: 100190 China Telephone: 008610 8235 0740

Copyright © 2005-2024 EEWORLD.com.cn, Inc. All rights reserved 京ICP证060456号 京ICP备10001474号-1 电信业务审批[2006]字第258号函 京公网安备 11010802033920号