The overall block diagram of this design is shown in the figure. It is mainly composed of ultrasonic emission, ultrasonic reception and signal conversion, button display circuit and temperature sensor circuit. Ultrasonic ranging is to measure the time difference T between the emission and reception of echoes by continuously detecting the echo reflected by obstacles after the ultrasonic emission, and then calculate the distance S=CT/2, where C is the ultrasonic wave speed. At room temperature, the speed of sound in air is about 340m/s. Since ultrasonic waves are also a kind of sound waves, their propagation speed C is related to temperature. When used, if the temperature does not change much, the sound speed can be considered to be basically unchanged. Because the ranging accuracy of this system is very high, the propagation speed of ultrasonic waves is corrected by detecting the temperature. After the ultrasonic propagation speed is determined, the distance can be calculated by measuring the round-trip time of the ultrasonic wave. This is the basic principle of the ultrasonic ranging system.
Ultrasonic signal transmitting and receiving circuit
The transmitting circuit is shown in Figure 3, which is mainly composed of a pulse modulation signal generating circuit, an isolation circuit and a driving circuit, and is used to provide a transmitting signal for the ultrasonic sensor. In the pulse modulation signal generating circuit, the 555 timer works in time-sharing mode by controlling the reset (RESET) terminal of the 555 through the single-chip microcomputer, thereby generating a pulse modulation signal with a pulse frequency of 40KHz and a period of 30ms. The signal waveform is shown in Figure 2. In this design, 10 pulse signals are sent in one cycle. The isolation circuit is mainly composed of two NAND gates to isolate the output stage from the pulse generating circuit. The output stage is composed of two general-purpose integrated operational amplifiers TL084CN. Since the transmission distance of the ultrasonic sensor is proportional to the voltage applied at its two ends, the circuit is required to generate a sufficiently large driving voltage. Its basic principle is a comparison circuit. When the input signal is greater than 2.5V, the output voltage of operational amplifier A VA=+12V, and the output voltage of operational amplifier B VB=-12V. When the input signal is 2.5V, the output voltage of operational amplifier A VA="-12V", and the output voltage of operational amplifier B VB=+12V. Therefore, two symmetrical waveforms with completely opposite polarities are obtained at both ends of the ultrasonic sensor, that is, VB=-VA. Therefore, the voltage applied to both ends of the ultrasonic sensor is V=VA-VB=2VA, and the voltage at both ends can reach 24V, thereby ensuring that the ultrasonic wave can be transmitted over a longer distance and improving the measurement range.
The receiving circuit consists of an amplifier circuit, a bandpass filter circuit and a signal conversion circuit. The amplifier circuit and the bandpass filter circuit are shown in Figure 4. Since the ultrasonic signal is greatly attenuated when propagating in the air, the reflected ultrasonic signal is very weak and cannot be directly sent to the subsequent circuit for processing. The signal must be amplified to a sufficient amplitude so that the subsequent circuit can process it correctly. The preamplifier circuit is a bootstrap in-phase AC amplifier circuit composed of an integrated operational amplifier with a very high input impedance. C5, C6, and C7 are DC blocking capacitors, and R5, R6, and R7 are bias resistors used to set the static operating point of the amplifier. The bandpass filter uses a second-order RC active filter to eliminate the influence of interference signals during ultrasonic propagation.
Amplifier circuit and bandpass filter circuit
As shown in Figure 4 below, this circuit is a second-order voltage-controlled voltage source bandpass filter circuit. In the figure, RW and C10 form a low-pass filter network, and C9 and R12 form a high-pass filter network. The two are connected in series to form a bandpass filter circuit. The integrated operational amplifier and resistors R9 and R10 together form a common-phase proportional amplifier. In order to make the circuit work stably, the gain of the common-phase proportional amplifier must be guaranteed. The center frequency of the bandpass filter ω0=40kHz, and the circuit parameters can be determined by AV=1+R9/R10 and ω0=1/R12C2 (1/RW+1/R13). The signal after bandpass filtering is amplified by a dedicated instrument amplifier AD620 and then sent to the signal conversion circuit. The signal conversion circuit mainly converts the received envelope signal into an interrupt trigger signal of the single-chip microcomputer. It consists of an envelope detection circuit, a voltage comparator and an RS trigger. The envelope detection circuit consists of a diode D3, a resistor R19, and a capacitor C13. The signal obtained after envelope detection is shown as V2 in Figure 6. The voltage comparator is composed of an integrated operational amplifier and a capacitor and resistor. In order to eliminate the interference signal of the transmitting probe, we add the signal output by the single chip P1.2 to the in-phase end of the voltage comparator. Its waveform is a high level of 250μs and a low level square wave of 29750μs. P1.2 and the positive end of the comparator are isolated by diode D3. When P1.2 outputs a high level, the capacitor C14 is charged through the diode. Since the diode is forward-conducting, the charging is very fast. When P1.2 outputs a low level, the diode is reversely cut off, and the capacitor is discharged through resistors RW and R21. Since the total resistance is relatively large, the discharge is very slow. The waveform is shown as V3 in Figure 6. It can be seen from the figure that when no return signal is received, the comparator outputs a high level. If a return signal is received, the comparator outputs a low level. The output waveform is shown as Vo in Figure 6. This method can eliminate the interference of the transmitting probe on the reflected signal.
When the ultrasonic signal is sent from the transmitter, P1.2 outputs a high level, and after passing through the inverter, it becomes a low level and is added to the R end of the trigger. Because the voltage comparator outputs a high level before receiving the reflected signal, the input of the basic RS trigger is R=O, S=1, which is 0 state, that is, Q=0, Q=1, and Q signal is added to the interrupt input of the microcontroller. Because the interrupt of the microcontroller is triggered by the falling edge, the input is high level and no interrupt is generated. When the transmission is completed, P1.2 outputs a low level, and after passing through the inverter, it becomes a high level and is sent to the R end of the trigger. When the reflected signal is not received, the voltage comparator output is still high level, so the basic RS trigger R=“1”, S=1, is in the hold state, that is, Q=1, Q=0, and no interrupt is generated. When the reflected signal is received, the voltage comparator outputs a low level, so the input of the basic RS trigger R=“1”, S=0, the trigger works in 0 state, that is, Q=O, Q=1. The level of the interrupt input terminal of the microcontroller changes from high level to low level, causing the microcontroller to generate an interrupt.
The peripheral circuit diagram of the single-chip microcomputer is shown in Figure 7. The display circuit is controlled by the single-chip microcomputer to display the seven-segment digital tube. The digital temperature sensor DS18820 is used to detect the ambient temperature, so as to perform temperature compensation on the propagation speed of the ultrasonic wave and improve the measurement accuracy. Two buttons are used to control the start and stop of the measurement and the switching of the distance and temperature display.
Due to the transmission power and ultrasonic transmitter probe, the measurement distance of this system is between 10cm and 500cm. There are large errors in close-range and long-range measurements. The accuracy is best when measuring between 50cm and 200cm, and the error is no more than 1cm. In this design, since the ultrasonic transmission cycle is 10 square waves of 25μs, the transmission time is T=250μs. It is known that the sound speed C at room temperature is 340m/s, so S=CT/2=250μs/2=8.5cm, so the ranging blind area is confirmed to be 9cm. That is, when the measurement distance is less than 9cm, it cannot be measured correctly.
Previous article:Flow monitoring system signal measurement electronic circuit
Next article:Application of Single Chip Microcomputer in Inverted Pendulum Control System
- Popular Resources
- Popular amplifiers
- Learn ARM development(16)
- Learn ARM development(17)
- Learn ARM development(18)
- Embedded system debugging simulation tool
- A small question that has been bothering me recently has finally been solved~~
- Learn ARM development (1)
- Learn ARM development (2)
- Learn ARM development (4)
- Learn ARM development (6)
Professor at Beihang University, dedicated to promoting microcontrollers and embedded systems for over 20 years.
- LED chemical incompatibility test to see which chemicals LEDs can be used with
- Application of ARM9 hardware coprocessor on WinCE embedded motherboard
- What are the key points for selecting rotor flowmeter?
- LM317 high power charger circuit
- A brief analysis of Embest's application and development of embedded medical devices
- Single-phase RC protection circuit
- stm32 PVD programmable voltage monitor
- Introduction and measurement of edge trigger and level trigger of 51 single chip microcomputer
- Improved design of Linux system software shell protection technology
- What to do if the ABB robot protection device stops
- Analysis of the application of several common contact parts in high-voltage connectors of new energy vehicles
- Wiring harness durability test and contact voltage drop test method
- From probes to power supplies, Tektronix is leading the way in comprehensive innovation in power electronics testing
- From probes to power supplies, Tektronix is leading the way in comprehensive innovation in power electronics testing
- Sn-doped CuO nanostructure-based ethanol gas sensor for real-time drunk driving detection in vehicles
- Design considerations for automotive battery wiring harness
- Do you know all the various motors commonly used in automotive electronics?
- What are the functions of the Internet of Vehicles? What are the uses and benefits of the Internet of Vehicles?
- Power Inverter - A critical safety system for electric vehicles
- Analysis of the information security mechanism of AUTOSAR, the automotive embedded software framework
- The STM8S003F3P6 chip is very interesting
- 【Wireless closed-loop feedback system for desktop robotic arms】
- 8/21-22@Wuhan! Intel/World Peace Group invites you to participate in the Artificial Intelligence Technology Introduction and Implementation Seminar
- Professor Li Xia: How basic should basic research be?
- 【i.MX6ULL】Driver Development 11——LCD Driver Practice
- Microcontroller interview question collection
- HEF4051 is easy to damage
- Microchip Automotive Innovation Series Online Seminar Invites You to Attend!
- [STM32WB55 review]——by damiaa
- 【DIY Creative LED】WS2812 test successful