Design of ultrasonic ranging and anti-collision alarm system based on AT89C52

Publisher:星辰耀眼Latest update time:2012-07-16 Source: 中国汽车电子网Keywords:AT89C52 Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere

Introduction
With the rapid development of the national economy, the number of cars in China has increased significantly, causing road congestion and frequent traffic accidents, which has caused huge losses to people's lives and property safety. Safe driving has become the focus of everyone's attention, among which the design and demand of the car collision avoidance system (CAS) are very important and urgent. In view of this situation, it is imperative to design a car collision avoidance alarm system with fast response, high reliability and relatively economical.

Ultrasonic waves are a mechanical wave with a frequency exceeding 20 kHz. They have strong directivity, slow energy consumption, and long propagation distance in the medium. Therefore, ultrasonic ranging is the most common distance measurement method. Using ultrasonic waves to detect distance, the design is relatively convenient, the calculation and processing are relatively simple, and the accuracy is also high. This design uses AT89C52 microcontroller as the main controller, combined with the ultrasonic ranging principle, to design a car reversing collision avoidance alarm system. The system adopts a combination of software and hardware, and has the characteristics of modularization and versatility.

1 Ultrasonic ranging principle
This system uses a piezoelectric ultrasonic sensor. There are two ways to measure the ultrasonic ranging principle: resonance and pulse reflection. Because the application requirements of the resonance type are complex, the pulse reflection type is used here. The principle of ultrasonic distance measurement is shown in Figure 1.

this is a picture!
In Figure 1, the measured distance is H, half of the distance between the centers of the two probes is represented by M, and the distance traveled by the ultrasonic wave in one way is represented by L. From the relationship in the figure, we can get:

this is a picture!
In the formula: v is the propagation speed of the ultrasonic wave; t is the propagation time, that is, the time from the emission to the reception of the ultrasonic wave.
Substituting formula (4) into formula (3) we can get:

this is a picture!
It can be seen that in order to measure the distance H, we only need to measure the propagation time t of the ultrasonic wave. [page]

2 System Implementation
According to the design requirements and comprehensive factors, the AT89C52 single-chip microcomputer can be used as the main controller, dynamic scanning can be used to realize LCD digital display, and the ultrasonic drive signal can be completed by the timer of the single-chip microcomputer. The specific system block diagram is shown in Figure 2.

this is a picture!
The system mainly consists of a single-chip microcomputer system and a display circuit, an ultrasonic transmitting circuit, and an ultrasonic detection receiving circuit. AT89C52 is used to control the CX20106A infrared receiving chip and the TCT40-10 series ultrasonic conversion module.

The ultrasonic receiving circuit uses the integrated circuit CX2-0106A, which can be used to complete signal amplification, limiting, bandpass filtering, peak detection and waveform shaping. The display device uses an LCDl2864 display, and the D18820 temperature sensor is used

for temperature detection and temperature compensation. The main controller AT89C52 single-chip microcomputer is a low-power, high-performance CMOS 8-bit microcontroller with 8 KB of system programmable FLASH memory. It is fully compatible with AT80C51 pins and instructions. It has an 8-

bit CPU, an on-chip oscillator and clock circuit, three 16-bit timers/counters, 21 special function registers, four 8-bit parallel I/O ports, a total of 32 programmable I/O lines, one programmable full-duplex serial port, and eight interrupt sources.

The actual design is shown in Figure 3.

this is a picture!


3 System software design
The system software part includes the main program, interrupt subroutine and other subroutines. The main program flow chart is shown in Figure 4, where the core code of the interrupt subroutine is as follows:

this is a picture! this is a picture!
4 Conclusion
This reversing anti-collision alarm system can be used in occasions such as car reversing to remind the driver to effectively avoid obstacles and pedestrians that may cause harm to the reversing when reversing. This system strengthens the software and hardware processing measures for the common anti-interference problem. In terms of hardware, for example, the ultrasonic receiving circuit is shielded with a metal shell to improve the system's anti-interference ability; in terms of software, the system combines the use of the DS18820 temperature sensor to achieve temperature compensation correction, so that the system can work normally at any temperature, and the error will not exceed the specified range. The LCDl2864 with font function is used to display the distance in real time. When the distance condition is met, the buzzer will sound to remind the driver. It has strong practicality, simple hardware structure, small size and easy use. However, the measurement distance of this system is limited and it is only effective within a distance of 10 to 300 cm, which needs further improvement and enhancement.
Keywords:AT89C52 Reference address:Design of ultrasonic ranging and anti-collision alarm system based on AT89C52

Previous article:Design of electric vehicle seesaw based on 51 single chip microcomputer
Next article:Liquid Level Detection System Based on AT89C52 Single Chip Microcomputer

Recommended ReadingLatest update time:2024-11-16 16:01

Development of CAN Bus Distributed Measurement and Control System Based on AT89C52 Single Chip Microcomputer
This paper introduces a CAN bus distributed measurement and control system based on the single-chip microcomputer AT89C52. It mainly describes the overall design of the system, as well as the software and hardware design of the control module and the acquisition module. The focus is on the design of the CAN bus inte
[Microcontroller]
Development of CAN Bus Distributed Measurement and Control System Based on AT89C52 Single Chip Microcomputer
Design of intelligent parking system based on single chip microcomputer
0 Introduction As the number of cars in my country increases dramatically year by year, the number of parking spaces and parking lots cannot keep up with the pace of growth. More and more people are worried about how to park. The increasingly crowded parking environment requires people to be more proficient in
[Microcontroller]
51 microcontroller (AT89C52) external interrupt program
#include reg52.h   #define uchar unsigned char   #define uint unsigned int   #define DELAY 1000   void delay(uint z) //1ms   {       uint x,y;       for(x=z;x 0;x--)           for(y=111;y 0;y--);   }   void main()   {       uchar i,dt;       EA=1; //Enable total interrupt       EX1=1; //Enable external interrupt 1   /
[Microcontroller]
51 microcontroller (AT89C52) external interrupt program
Intelligent Control System of Washing Machine Based on AT89C52 Single Chip Microcomputer
  High-efficiency, energy-saving, water-saving, electricity-saving and environmentally friendly washing machines have always occupied a dominant position in the market. Whether in terms of quality, technology, function or appearance, they are closest to the purpose of serving people's lives. In the future, washing mac
[Microcontroller]
Intelligent Control System of Washing Machine Based on AT89C52 Single Chip Microcomputer
Latest Microcontroller Articles
  • Download from the Internet--ARM Getting Started Notes
    A brief introduction: From today on, the ARM notebook of the rookie is open, and it can be regarded as a place to store these notes. Why publish it? Maybe you are interested in it. In fact, the reason for these notes is ...
  • Learn ARM development(22)
    Turning off and on interrupts Interrupts are an efficient dialogue mechanism, but sometimes you don't want to interrupt the program while it is running. For example, when you are printing something, the program suddenly interrupts and another ...
  • Learn ARM development(21)
    First, declare the task pointer, because it will be used later. Task pointer volatile TASK_TCB* volatile g_pCurrentTask = NULL;volatile TASK_TCB* vol ...
  • Learn ARM development(20)
    With the previous Tick interrupt, the basic task switching conditions are ready. However, this "easterly" is also difficult to understand. Only through continuous practice can we understand it. ...
  • Learn ARM development(19)
    After many days of hard work, I finally got the interrupt working. But in order to allow RTOS to use timer interrupts, what kind of interrupts can be implemented in S3C44B0? There are two methods in S3C44B0. ...
  • Learn ARM development(14)
  • Learn ARM development(15)
  • Learn ARM development(16)
  • Learn ARM development(17)
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号