CN108001345A - Reversing early warning system and its control method based on STM32 microcontrollers - Google Patents
Reversing early warning system and its control method based on STM32 microcontrollers Download PDFInfo
- Publication number
- CN108001345A CN108001345A CN201711483397.4A CN201711483397A CN108001345A CN 108001345 A CN108001345 A CN 108001345A CN 201711483397 A CN201711483397 A CN 201711483397A CN 108001345 A CN108001345 A CN 108001345A
- Authority
- CN
- China
- Prior art keywords
- module
- stm32
- car
- distance
- chip microcomputer
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Pending
Links
- 238000000034 method Methods 0.000 title claims abstract description 17
- 238000012545 processing Methods 0.000 claims abstract description 24
- 238000009529 body temperature measurement Methods 0.000 claims description 19
- 238000007493 shaping process Methods 0.000 claims description 11
- 239000013078 crystal Substances 0.000 claims description 6
- 230000005355 Hall effect Effects 0.000 claims description 4
- 238000001514 detection method Methods 0.000 abstract description 2
- 238000010586 diagram Methods 0.000 description 5
- 206010039203 Road traffic accident Diseases 0.000 description 4
- 238000005259 measurement Methods 0.000 description 3
- 241000282414 Homo sapiens Species 0.000 description 2
- 238000011161 development Methods 0.000 description 2
- 238000005516 engineering process Methods 0.000 description 2
- 238000001914 filtration Methods 0.000 description 2
- 230000000007 visual effect Effects 0.000 description 2
- 101100494448 Caenorhabditis elegans cab-1 gene Proteins 0.000 description 1
- 230000009286 beneficial effect Effects 0.000 description 1
- 230000019771 cognition Effects 0.000 description 1
- 230000007812 deficiency Effects 0.000 description 1
- 238000013461 design Methods 0.000 description 1
- 238000009434 installation Methods 0.000 description 1
- 239000000523 sample Substances 0.000 description 1
Classifications
-
- B—PERFORMING OPERATIONS; TRANSPORTING
- B60—VEHICLES IN GENERAL
- B60Q—ARRANGEMENT OF SIGNALLING OR LIGHTING DEVICES, THE MOUNTING OR SUPPORTING THEREOF OR CIRCUITS THEREFOR, FOR VEHICLES IN GENERAL
- B60Q9/00—Arrangement or adaptation of signal devices not provided for in one of main groups B60Q1/00 - B60Q7/00, e.g. haptic signalling
- B60Q9/002—Arrangement or adaptation of signal devices not provided for in one of main groups B60Q1/00 - B60Q7/00, e.g. haptic signalling for parking purposes, e.g. for warning the driver that his vehicle has contacted or is about to contact an obstacle
- B60Q9/004—Arrangement or adaptation of signal devices not provided for in one of main groups B60Q1/00 - B60Q7/00, e.g. haptic signalling for parking purposes, e.g. for warning the driver that his vehicle has contacted or is about to contact an obstacle using wave sensors
- B60Q9/006—Arrangement or adaptation of signal devices not provided for in one of main groups B60Q1/00 - B60Q7/00, e.g. haptic signalling for parking purposes, e.g. for warning the driver that his vehicle has contacted or is about to contact an obstacle using wave sensors using a distance sensor
-
- B—PERFORMING OPERATIONS; TRANSPORTING
- B60—VEHICLES IN GENERAL
- B60R—VEHICLES, VEHICLE FITTINGS, OR VEHICLE PARTS, NOT OTHERWISE PROVIDED FOR
- B60R16/00—Electric or fluid circuits specially adapted for vehicles and not otherwise provided for; Arrangement of elements of electric or fluid circuits specially adapted for vehicles and not otherwise provided for
- B60R16/02—Electric or fluid circuits specially adapted for vehicles and not otherwise provided for; Arrangement of elements of electric or fluid circuits specially adapted for vehicles and not otherwise provided for electric constitutive elements
- B60R16/023—Electric or fluid circuits specially adapted for vehicles and not otherwise provided for; Arrangement of elements of electric or fluid circuits specially adapted for vehicles and not otherwise provided for electric constitutive elements for transmission of signals between vehicle parts or subsystems
- B60R16/0231—Circuits relating to the driving or the functioning of the vehicle
- B60R16/0232—Circuits relating to the driving or the functioning of the vehicle for measuring vehicle parameters and indicating critical, abnormal or dangerous conditions
-
- G—PHYSICS
- G01—MEASURING; TESTING
- G01D—MEASURING NOT SPECIALLY ADAPTED FOR A SPECIFIC VARIABLE; ARRANGEMENTS FOR MEASURING TWO OR MORE VARIABLES NOT COVERED IN A SINGLE OTHER SUBCLASS; TARIFF METERING APPARATUS; MEASURING OR TESTING NOT OTHERWISE PROVIDED FOR
- G01D21/00—Measuring or testing not otherwise provided for
- G01D21/02—Measuring two or more variables by means not covered by a single other subclass
Landscapes
- Engineering & Computer Science (AREA)
- Mechanical Engineering (AREA)
- Radar, Positioning & Navigation (AREA)
- Remote Sensing (AREA)
- Transportation (AREA)
- Human Computer Interaction (AREA)
- Automation & Control Theory (AREA)
- Physics & Mathematics (AREA)
- General Physics & Mathematics (AREA)
- Measurement Of Velocity Or Position Using Acoustic Or Ultrasonic Waves (AREA)
Abstract
Description
技术领域technical field
本发明涉及一种倒车预警系统,尤其涉及一种基于STM32单片机的倒车预警系统及其控制方法。The invention relates to a backing warning system, in particular to a backing warning system based on an STM32 single-chip microcomputer and a control method thereof.
背景技术Background technique
汽车在带给人类便捷的同时,也给人类生活带来了安全隐患,交通事故时有发生,使许多人失去了宝贵的生命。有很多事故是因为驾驶员疏忽大意,未及时刹车造成的。另外,路面工况、天气环境的变化以及驾驶员的误操作也引发交通事故的原因之一。道路交通事故给国家、集体和家庭带来了巨大损失,因此,汽车安全技术的发展和完善亟待解决。While automobiles bring convenience to human beings, they also bring potential safety hazards to human life. Traffic accidents occur from time to time, causing many people to lose their precious lives. Many accidents are caused by the driver's negligence and failure to brake in time. In addition, changes in road conditions, weather conditions, and driver misuse are also one of the reasons for traffic accidents. Road traffic accidents have brought huge losses to the country, collectives and families. Therefore, the development and improvement of automobile safety technology needs to be solved urgently.
现有技术中有自动刹车系统,常用于汽车在倒车的时候进行预警制动,一般为检测汽车背后障碍物从而对汽车进行有效制动,但是目前很少存在对于汽车在倒车的时候,能检测到后面的凹沟的存在,而针对汽车倒车时检测不到凹沟的存在可能发生一系列交通事故,因此目前急需一种可以检测到凹沟并能及时预警制动的倒车预警系统及其控制方法。In the prior art, there is an automatic braking system, which is often used for early warning braking when the car is reversing. Generally, it is used to detect obstacles behind the car so as to effectively brake the car. However, a series of traffic accidents may occur if the existence of the groove is not detected when the car is reversing. Therefore, there is an urgent need for a reversing warning system and its control system that can detect the groove and brake in time. method.
发明内容Contents of the invention
本发明所要解决的技术问题是针对上述现有技术的不足提供一种基于STM32单片机的倒车预警系统及其控制方法,本基于STM32单片机的倒车预警系统及其控制方法能够做到目前倒车预警系统所不能做到的检测凹沟的存在,能够计算并且显示出汽车在倒车过程中与凹沟之间的实时距离,让驾驶者在倒车时对凹沟的位置有一个更确切的认知。The technical problem to be solved by this invention is to provide a kind of reversing warning system based on STM32 single-chip microcomputer and its control method for the above-mentioned deficiencies in the prior art. It is impossible to detect the existence of the groove, and it can calculate and display the real-time distance between the car and the groove during the reversing process, so that the driver can have a more accurate understanding of the position of the groove when reversing.
为实现上述技术目的,本发明采取的技术方案为:For realizing above-mentioned technical purpose, the technical scheme that the present invention takes is:
一种基于STM32单片机的倒车预警系统,包括档位传感器、数据处理模块、距离显示模块、超声波测距模块、预警模块,紧急制动模块、车速传感器、温度测量模块和电源模块,所述档位传感器安装在汽车档位操纵器上,所述数据处理模块和电源模块安装在汽车后备箱内,所述距离显示模块、预警模块、车速传感器和紧急制动模块均安装在汽车驾驶室内,所述超声波测距模块倾斜的安装在汽车尾部,所述温度测量模块安装在汽车外部,所述档位传感器与所述数据处理模块连接,所述车速传感器与所述数据处理模块连接,所述数据处理模块分别与距离显示模块、超声波测距模块、预警模块,紧急制动模块、温度测量模块和电源模块连接;A kind of reversing early warning system based on STM32 single-chip microcomputer, comprises gear position sensor, data processing module, distance display module, ultrasonic ranging module, early warning module, emergency brake module, vehicle speed sensor, temperature measurement module and power supply module, described gear position The sensor is installed on the car gear manipulator, the data processing module and the power supply module are installed in the trunk of the car, and the distance display module, early warning module, vehicle speed sensor and emergency braking module are all installed in the cab of the car. The ultrasonic ranging module is installed obliquely at the rear of the car, the temperature measuring module is installed outside the car, the gear position sensor is connected to the data processing module, the vehicle speed sensor is connected to the data processing module, and the data processing module The modules are respectively connected with the distance display module, ultrasonic distance measurement module, early warning module, emergency braking module, temperature measurement module and power supply module;
所述数据处理模块包括STM32单片机、晶振电路和复位电路,所述超声波测距模块包括超声波发射器、超声波接收器、滤波电路、放大电路和整形电路,所述晶振电路和复位电路与所述STM32单片机连接,所述STM32单片机与超声波发射器连接,所述超声波接收器与所述滤波电路连接,所述滤波电路与放大电路连接,所述放大电路与整形电路连接,所述整形电路与所述STM32单片机连接。Described data processing module comprises STM32 single-chip microcomputer, crystal oscillator circuit and reset circuit, and described ultrasonic ranging module comprises ultrasonic transmitter, ultrasonic receiver, filter circuit, amplifying circuit and shaping circuit, and described crystal oscillator circuit and reset circuit and described STM32 The single-chip microcomputer is connected, the STM32 single-chip microcomputer is connected with the ultrasonic transmitter, the ultrasonic receiver is connected with the filter circuit, the filter circuit is connected with the amplifying circuit, the amplifying circuit is connected with the shaping circuit, and the shaping circuit is connected with the STM32 microcontroller connection.
作为本发明进一步改进的技术方案,所述温度测量模块采用DS18B20数字温度传感器。As a further improved technical solution of the present invention, the temperature measurement module adopts a DS18B20 digital temperature sensor.
作为本发明进一步改进的技术方案,所述预警模块采用声光报警电路。As a further improved technical solution of the present invention, the early warning module adopts an audible and visual alarm circuit.
作为本发明进一步改进的技术方案,所述档位传感器采用MLX92232可编程数字霍尔效应传感器。As a further improved technical solution of the present invention, the gear position sensor adopts MLX92232 programmable digital Hall effect sensor.
为实现上述技术目的,本发明采取的另一个技术方案为:For realizing above-mentioned technical purpose, another technical scheme that the present invention takes is:
一种基于STM32单片机的倒车预警系统的控制方法,包括以下步骤:A control method of a reverse warning system based on STM32 single-chip microcomputer, comprising the following steps:
步骤1:档位传感器实时监测汽车所在的档位并发送信号到STM32单片机,STM32单片机根据接收到的信号判断档位传感器监测的汽车所在的档位是否为倒车档位,若是,则执行步骤2;Step 1: The gear sensor monitors the gear of the car in real time and sends a signal to the STM32 microcontroller. The STM32 microcontroller judges whether the gear of the car monitored by the gear sensor is a reverse gear according to the received signal. If so, go to step 2 ;
步骤2:STM32单片机同时发送控制信号到超声波测距模块和温度测量模块,温度测量模块监测环境温度并发送信号到STM32单片机,STM32单片机处理接收到的环境温度并匹配与环境温度相对应的声速,STM32单片机驱动超声波测距模块中的超声波发射器倾斜向下发射超声波,超声波信号在空气中传播,遇到地面后发生反射,STM32单片机在超声波发射的同时开始计时,超声波接收器接收地面反射的回波,并依次经过滤波电路、放大电路和整形电路从而进入STM32单片机的外部中断口产生中断,STM32单片机停止计时,STM32单片机根据与环境温度相对应的声速和计时的时间计算汽车与地面之间的距离,距离显示模块根据STM32单片机控制指令实时显示汽车与地面之间的距离;Step 2: The STM32 MCU sends control signals to the ultrasonic distance measuring module and the temperature measurement module at the same time. The temperature measurement module monitors the ambient temperature and sends the signal to the STM32 MCU. The STM32 MCU processes the received ambient temperature and matches the sound velocity corresponding to the ambient temperature. The STM32 single-chip microcomputer drives the ultrasonic transmitter in the ultrasonic ranging module to emit ultrasonic waves obliquely downward. The ultrasonic signal propagates in the air and is reflected after encountering the ground. Wave, and then through the filter circuit, amplifier circuit and shaping circuit to enter the external interrupt port of the STM32 MCU to generate an interrupt, the STM32 MCU stops timing, and the STM32 MCU calculates the distance between the car and the ground according to the sound velocity corresponding to the ambient temperature and the timing time Distance, the distance display module displays the distance between the car and the ground in real time according to the STM32 microcontroller control command;
步骤3:STM32单片机对计算出的距离进行判断,如果计算出的距离产生骤变且骤变的距离值超过预设的骤变阈值时,则STM32单片机判断汽车尾后的地面为凹沟,执行步骤4;如果计算出的距离持续增大,则STM32单片机判断汽车尾后的地面为下降缓坡,预警模块根据STM32单片机控制指令进行报警,结束;Step 3: The STM32 microcontroller judges the calculated distance. If the calculated distance changes suddenly and the distance value of the sudden change exceeds the preset sudden change threshold, the STM32 microcontroller judges that the ground behind the rear of the car is a groove, and executes Step 4: If the calculated distance continues to increase, then the STM32 single-chip microcomputer judges that the ground behind the rear of the car is a descending gentle slope, and the early warning module reports to the police according to the STM32 single-chip microcomputer control command, and ends;
步骤4:当STM32单片机判断汽车后面为凹沟时,预警模块根据STM32单片机控制指令进行报警,同时STM32单片机控制车速传感器开始工作,STM32单片机接收车速传感器的信号,STM32单片机根据车速传感器检测的车速信息计算汽车尾部与凹沟之间的实时距离;Step 4: When the STM32 MCU judges that the back of the car is a concave ditch, the early warning module will alarm according to the STM32 MCU control command. At the same time, the STM32 MCU controls the vehicle speed sensor to start working. Calculate the real-time distance between the rear of the car and the groove;
步骤5:当STM32单片机计算出的汽车尾部与凹沟之间的实时距离小于预设的距离阈值范围时,STM32单片机控制紧急制动模块,紧急制动模块对汽车进行制动。Step 5: When the real-time distance between the rear of the car and the groove calculated by the STM32 microcontroller is less than the preset distance threshold range, the STM32 microcontroller controls the emergency braking module, which brakes the car.
作为本发明进一步改进的技术方案,所述的STM32单片机根据车速传感器检测的车速信息计算汽车尾部与凹沟之间的实时距离包括:As a further improved technical solution of the present invention, the real-time distance between the rear of the car and the concave groove is calculated according to the vehicle speed information detected by the vehicle speed sensor by the STM32 single-chip microcomputer:
(1)STM32单片机计算凹沟与汽车尾部之间的水平距离:(1) STM32 MCU calculates the horizontal distance between the groove and the rear of the car:
S=D*sin(A);S=D*sin(A);
其中S为STM32单片机计算的凹沟与汽车尾部之间的水平距离,D为超声波测距模块在检测到凹沟之前测量的汽车与地面之间的距离,A为所述超声波测距模块发射的超声波与垂直向下方向的夹角;Among them, S is the horizontal distance between the groove calculated by the STM32 microcontroller and the rear of the car, D is the distance between the car and the ground measured by the ultrasonic ranging module before detecting the groove, and A is the distance emitted by the ultrasonic ranging module. The angle between the ultrasonic wave and the vertical downward direction;
(2)根据车速传感器实时检测的汽车行驶速度计算汽车倒车时行驶的路程;(2) According to the vehicle speed detected by the vehicle speed sensor in real time, the distance traveled by the vehicle when reversing is calculated;
(3)将STM32单片机计算的凹沟与汽车尾部之间的水平距离减去汽车倒车时行驶的路程等于汽车尾部与凹沟之间的实时距离。(3) The horizontal distance between the groove and the rear of the car calculated by the STM32 microcontroller minus the distance traveled by the car when reversing is equal to the real-time distance between the rear of the car and the groove.
本发明的有益效果为:本发明提出一种基于STM32单片机的对于倒车预警系统的改进,能够做到目前倒车预警系统所不能做到的检测凹沟的存在,能够计算并且显示出汽车在倒车过程中与凹沟之间的实时距离,让驾驶者在倒车时对凹沟的位置有一个更确切的认知。并且能够实现在驾在驶者知道凹沟的存而由于主观原因不能及时进行人为制动时采取紧急制动措施。The beneficial effects of the present invention are as follows: the present invention proposes an improvement to the reversing warning system based on the STM32 single-chip microcomputer, which can detect the existence of grooves that cannot be achieved by the current reversing warning system, and can calculate and show that the car is in the process of reversing The real-time distance between the center and the groove allows the driver to have a more accurate understanding of the position of the groove when reversing. And it can be realized that when the driver knows the existence of the concave groove and cannot perform artificial braking in time due to subjective reasons, emergency braking measures can be taken.
附图说明Description of drawings
图1为本发明的电路原理示意图。Fig. 1 is a schematic diagram of the circuit principle of the present invention.
图2为本发明检测到凹沟前超声波测距模块发射的超声波的结构示意图。Fig. 2 is a schematic structural diagram of the ultrasonic waves emitted by the ultrasonic ranging module before the groove is detected in the present invention.
图3为本发明检测到凹沟时超声波测距模块发射的超声波的结构示意图。Fig. 3 is a schematic structural diagram of the ultrasonic waves emitted by the ultrasonic ranging module when the present invention detects a groove.
图4为本发明检测到下降缓坡前超声波测距模块发射的超声波的结构示意图。Fig. 4 is a schematic structural diagram of the ultrasonic waves emitted by the ultrasonic ranging module before the detection of the descending gentle slope according to the present invention.
图5为本发明检测到下降缓坡时超声波测距模块发射的超声波的结构示意图。Fig. 5 is a schematic structural diagram of the ultrasonic waves emitted by the ultrasonic distance measuring module when the present invention detects a gentle descending slope.
图6为本发明的工作流程图。Fig. 6 is a working flowchart of the present invention.
具体实施方式Detailed ways
下面根据图1至图6对本发明的具体实施方式作出进一步说明:Below according to Fig. 1 to Fig. 6, the specific embodiment of the present invention is further described:
参见图1,一种基于STM32单片机的倒车预警系统,包括档位传感器、数据处理模块、距离显示模块、超声波测距模块4、预警模块,紧急制动模块、车速传感器、温度测量模块和电源模块,所述档位传感器安装在汽车1的档位操纵器上,所述数据处理模块和电源模块安装在汽车1的后备箱内,所述距离显示模块、预警模块、车速传感器和紧急制动模块均安装在汽车1的驾驶室内,所述超声波测距模块4倾斜的安装在汽车1的尾部,保证超声波测距模块4中的发射探头安装角度为A,可使超声波测距模块4发射到地面3的超声波2与垂直向下方向之间的角度为A,如图2所示,所述温度测量模块安装在汽车1的外部,主要检测汽车1外的环境温度,所述档位传感器与所述数据处理模块连接,档位传感器用于发送汽车1档位信息给数据处理模块,所述车速传感器与所述数据处理模块连接,车速传感器用于发送倒车车速到数据处理模块,所述数据处理模块分别与距离显示模块、超声波测距模块4、预警模块,紧急制动模块、温度测量模块和电源模块连接;所述数据处理模块包括STM32单片机、晶振电路和复位电路,所述超声波测距模块4包括超声波发射器、超声波接收器、滤波电路、放大电路和整形电路,所述晶振电路和复位电路与所述STM32单片机连接,所述STM32单片机与超声波发射器连接,所述超声波接收器与所述滤波电路连接,所述滤波电路与放大电路连接,所述放大电路与整形电路连接,所述整形电路与所述STM32单片机连接。Referring to Figure 1, a reversing warning system based on STM32 single-chip microcomputer, including a gear sensor, a data processing module, a distance display module, an ultrasonic ranging module 4, an early warning module, an emergency braking module, a vehicle speed sensor, a temperature measurement module and a power supply module , the gear sensor is installed on the gear manipulator of the car 1, the data processing module and the power supply module are installed in the trunk of the car 1, the distance display module, early warning module, vehicle speed sensor and emergency braking module All are installed in the cab of the automobile 1, and the ultrasonic ranging module 4 is installed obliquely at the rear of the automobile 1, so that the installation angle of the transmitting probe in the ultrasonic ranging module 4 is A, so that the ultrasonic ranging module 4 can be launched to the ground The angle between the ultrasonic wave 2 of 3 and the vertical downward direction is A, as shown in Figure 2, the temperature measurement module is installed on the outside of the car 1, mainly detects the ambient temperature outside the car 1, the gear sensor and the The data processing module is connected, the gear sensor is used to send the vehicle 1 gear information to the data processing module, the vehicle speed sensor is connected to the data processing module, the vehicle speed sensor is used to send the reverse speed to the data processing module, and the data processing Module is connected with distance display module, ultrasonic ranging module 4, early warning module, emergency brake module, temperature measurement module and power supply module respectively; Described data processing module comprises STM32 single-chip microcomputer, crystal oscillator circuit and reset circuit, described ultrasonic ranging module 4 includes an ultrasonic transmitter, an ultrasonic receiver, a filter circuit, an amplifying circuit and a shaping circuit, the crystal oscillator circuit and the reset circuit are connected to the STM32 single-chip microcomputer, the STM32 single-chip microcomputer is connected to the ultrasonic transmitter, and the ultrasonic receiver is connected to the Described filtering circuit is connected, and described filtering circuit is connected with amplifying circuit, and described amplifying circuit is connected with shaping circuit, and described shaping circuit is connected with described STM32 one-chip computer.
本实施例中,所述温度测量模块采用DS18B20数字温度传感器。In this embodiment, the temperature measurement module uses a DS18B20 digital temperature sensor.
本实施例中,所述预警模块采用声光报警电路。In this embodiment, the early warning module adopts an audible and visual alarm circuit.
本实施例中,所述档位传感器采用MLX92232可编程数字霍尔效应传感器。所述车速传感器采用霍尔式车速传感器。In this embodiment, the gear position sensor adopts MLX92232 programmable digital Hall effect sensor. The vehicle speed sensor adopts a Hall type vehicle speed sensor.
本发明还提供一种基于STM32单片机的倒车预警系统的控制方法,以汽车1处于倒车档位为系统的开始,超声波测距模块4和温度测量模块同步工作,将测量的数据传送至STM32单片机开发板进行处理,STM32单片机对处理后的数据与预先设定的数据比较分析,得出下一步进行的工作。若符合预先设定的范围值,则进行预警与紧急制动。The present invention also provides a control method for the reverse warning system based on the STM32 single-chip microcomputer. Starting with the car 1 in the reverse gear, the ultrasonic ranging module 4 and the temperature measurement module work synchronously, and the measured data are transmitted to the STM32 single-chip microcomputer for development. The board is processed, and the STM32 single-chip microcomputer compares and analyzes the processed data with the preset data, and obtains the work to be carried out in the next step. If it meets the pre-set range value, it will perform early warning and emergency braking.
参见图6,具体包括以下步骤:Referring to Figure 6, it specifically includes the following steps:
步骤1:档位传感器(采用MLX92232可编程数字霍尔效应传感器,其高可靠性、小封装、提供各种输出选项并且易于实现)实时监测汽车1所在的档位并发送信号到STM32单片机,STM32单片机根据接收到的信号判断档位传感器监测的汽车1所在的档位是否为倒车档位,若是,则执行步骤2;Step 1: The gear position sensor (using MLX92232 programmable digital Hall effect sensor, which has high reliability, small package, provides various output options and is easy to implement) monitors the gear position of the car 1 in real time and sends a signal to the STM32 microcontroller, STM32 Whether the single-chip microcomputer judges whether the gear position of the automobile 1, which the gear position sensor monitors, is a reverse gear position according to the received signal, if so, then perform step 2;
步骤2:STM32单片机同时发送控制信号到超声波测距模块4和温度测量模块(超声波测距模块4和温度测量模块同步工作,温度测量模块采用温度传感器),温度测量模块监测环境温度并发送信号到STM32单片机,STM32单片机处理接收到的环境温度并匹配与环境温度相对应的声速,确保测量的准确性;STM32单片机驱动超声波测距模块4中的超声波发射器倾斜向下发射超声波2,超声波信号在空气中传播,遇到地面3后发生反射,STM32单片机在超声波2发射的同时开始计时,超声波接收器接收地面3反射的回波,并依次经过滤波电路、放大电路和整形电路从而进入STM32单片机的外部中断口产生中断,STM32单片机停止计时,STM32单片机根据与环境温度相对应的声速和计时的时间计算汽车1与超声波2反射的地面3之间的距离,距离显示模块根据STM32单片机控制指令实时显示汽车1与超声波2反射的地面3之间的距离;Step 2: The STM32 MCU sends control signals to the ultrasonic distance measuring module 4 and the temperature measurement module at the same time (the ultrasonic distance measurement module 4 and the temperature measurement module work synchronously, and the temperature measurement module uses a temperature sensor), the temperature measurement module monitors the ambient temperature and sends signals to STM32 single-chip microcomputer, STM32 single-chip microcomputer processes the received ambient temperature and matches the sound velocity corresponding to the ambient temperature to ensure the accuracy of measurement; the STM32 single-chip microcomputer drives the ultrasonic transmitter in the ultrasonic ranging module 4 to emit ultrasonic waves 2 obliquely downward, and the ultrasonic signals are It propagates in the air and reflects when it encounters the ground 3. The STM32 single-chip microcomputer starts timing at the same time as the ultrasonic wave 2 is emitted. The external interrupt port generates an interrupt, the STM32 single-chip microcomputer stops timing, and the STM32 single-chip microcomputer calculates the distance between the car 1 and the ground 3 reflected by the ultrasonic wave 2 according to the sound velocity corresponding to the ambient temperature and the timing time, and the distance display module displays it in real time according to the STM32 single-chip microcomputer control command The distance between the car 1 and the ground 3 reflected by the ultrasonic wave 2;
步骤3:STM32单片机对计算出的距离进行判断,如果计算出的距离产生骤变且骤变的距离值超过预设的骤变阈值(本实施例中预设的骤变阈值设为20 CM)时,则STM32单片机判断汽车1尾后的地面3为凹沟5,如图2和3所示,执行步骤4;如果计算出的距离持续增大,持续增大的幅度小于等于20 CM,则STM32单片机判断汽车1尾后的地面3为下降缓坡6,如图4和5所示,预警模块根据STM32单片机控制指令进行报警,预警模块采用LED光报警和蜂鸣器声报警,LED(可设置为绿灯)与蜂鸣器间歇性闪亮和发声,LED与蜂鸣器还可以根据剩余距离的远近调整相应的频率,结束;Step 3: The STM32 microcontroller judges the calculated distance, if the calculated distance changes suddenly and the distance value of the sudden change exceeds the preset sudden change threshold (in this embodiment, the preset sudden change threshold is set to 20 CM) , then the STM32 single-chip microcomputer judges that the ground 3 behind the rear of the car 1 is a groove 5, as shown in Figures 2 and 3, and executes step 4; if the calculated distance continues to increase, and the range of continuous increase is less than or equal to 20 CM, then The STM32 microcontroller judges that the ground 3 behind the rear of the car 1 is a gentle slope 6, as shown in Figures 4 and 5. The early warning module issues an alarm according to the STM32 microcontroller control command. The early warning module uses LED light alarm and buzzer sound alarm, LED (can be set Green light) and the buzzer flash and sound intermittently, and the LED and buzzer can also adjust the corresponding frequency according to the remaining distance, end;
步骤4:当STM32单片机判断汽车1后面为凹沟5时,预警模块根据STM32单片机控制指令进行报警,LED(可设置为红灯,从而与下降缓坡6的LED绿灯预警进行区分,驾驶员看可通过观察驾驶室内的预警模块的LED灯亮的颜色来判断汽车1)与蜂鸣器间歇性闪亮和发声,同时STM32单片机控制车速传感器开始工作,STM32单片机接收车速传感器的信号,STM32单片机根据车速传感器检测的车速信息计算汽车1尾部与凹沟5之间的实时距离;Step 4: When the STM32 single-chip computer judges that there is a groove 5 behind the car 1, the early warning module will give an alarm according to the control command of the STM32 single-chip computer. Judging the car by observing the color of the LED lights of the early warning module in the cab 1) and the buzzer flashes and sounds intermittently, and at the same time the STM32 MCU controls the speed sensor to start working, the STM32 MCU receives the signal from the speed sensor, and the STM32 MCU according to the speed sensor The detected vehicle speed information calculates the real-time distance between the tail of the automobile 1 and the groove 5;
步骤5:当STM32单片机计算出的汽车1尾部与凹沟5之间的实时距离在预设的距离阈值范围内时(本实施例将预设的距离阈值范围设为小于等于100CM且大于50CM),预警模块中LED红灯亮度达到最高,蜂鸣器音量达到最大并且持续鸣笛,以警告驾驶者如若继续倒车将倒车入沟,当STM32单片机计算出的汽车1尾部与凹沟5之间的实时距离小于预设的距离阈值范围(小于等于50CM)时,STM32单片机控制紧急制动模块,紧急制动模块对汽车1进行制动。Step 5: When the real-time distance between the tail of the car 1 and the groove 5 calculated by the STM32 microcontroller is within the preset distance threshold range (in this embodiment, the preset distance threshold range is set to be less than or equal to 100CM and greater than 50CM) , the brightness of the LED red light in the early warning module reaches the highest, the volume of the buzzer reaches the maximum and continues to whistle to warn the driver that if the car continues to reverse, it will reverse into the ditch. When the real-time distance is less than the preset distance threshold range (less than or equal to 50CM), the STM32 single-chip microcomputer controls the emergency braking module, and the emergency braking module brakes the car 1 .
本实施例中,参见图2和图3,所述的STM32单片机根据车速传感器检测的车速信息计算汽车1尾部与凹沟5之间的实时距离包括:In the present embodiment, referring to Fig. 2 and Fig. 3, described STM32 single-chip microcomputer calculates the real-time distance between automobile 1 rear end and groove 5 according to the vehicle speed information that vehicle speed sensor detects and comprises:
(1)STM32单片机计算凹沟5与汽车1尾部之间的水平距离:(1) The STM32 microcontroller calculates the horizontal distance between the groove 5 and the rear of the car 1:
S=D*sin(A);S=D*sin(A);
其中S为STM32单片机计算的凹沟5与汽车1尾部之间的水平距离,D为超声波测距模块4在检测到凹沟5之前测量的汽车1与超声波2反射的地面3之间的距离,A为所述超声波测距模块4发射的超声波2与垂直向下方向的夹角;Where S is the horizontal distance between the groove 5 calculated by the STM32 microcontroller and the rear of the car 1, and D is the distance between the car 1 and the ground 3 reflected by the ultrasonic wave 2 measured by the ultrasonic ranging module 4 before detecting the groove 5, A is the angle between the ultrasonic wave 2 emitted by the ultrasonic ranging module 4 and the vertical downward direction;
(2)根据车速传感器实时检测的汽车1行驶速度计算汽车1倒车时行驶的路程;(2) Calculate the distance traveled by the car 1 when reversing according to the speed of the car 1 detected in real time by the speed sensor;
(3)将STM32单片机计算的凹沟5与汽车1尾部之间的水平距离减去汽车1倒车时行驶的路程等于汽车1尾部与凹沟5之间的实时距离。(3) The horizontal distance between the groove 5 and the tail of the car 1 calculated by the STM32 microcontroller minus the distance traveled by the car 1 when reversing is equal to the real-time distance between the tail of the car 1 and the groove 5 .
本实施例中,当汽车1倒车时,遇到角度在90°左右的凹沟5时,超声波2所测量的距离D1会产生突变,在本设计里,人为设定这个骤变距离△D=D2-D1>20CM时就认定为是凹沟5(当角度A为30度时,经勾股定理可求出此时H>10CM),之所以将△D和H设定如此小是出于安全考虑,当设定的值越小,汽车1的自主安全性越高。In this embodiment, when the car 1 is reversing and encounters a groove 5 with an angle of about 90°, the distance D1 measured by the ultrasonic wave 2 will undergo a sudden change. In this design, the sudden change distance △D= When D2-D1>20CM, it is considered as concave groove 5 (when the angle A is 30 degrees, it can be obtained by the Pythagorean theorem that H>10CM at this time), the reason why △D and H are set so small is because Safety considerations, when the set value is smaller, the autonomous safety of car 1 is higher.
如图4至图5,当汽车1处于持续倒车遇到缓坡时,可以看出超声波2测到的距离是逐渐增大的,此种情况盲目倒车依旧存在一定风险,所以检测到缓坡的存在并且进行预警是十分必要的。As shown in Figure 4 to Figure 5, when the car 1 is continuously reversing and encounters a gentle slope, it can be seen that the distance measured by the ultrasonic wave 2 is gradually increasing. In this case, there is still a certain risk of blind reversing, so the existence of the gentle slope is detected and Early warning is very necessary.
本发明提出一种基于STM32单片机的对于倒车预警系统的改进。能够做到目前倒车预警系统所不能做到的检测凹沟5的存在,能够计算并且显示出汽车1在倒车过程中与凹沟5之间的实时距离,让驾驶者在倒车时对凹沟5的位置有一个更确切的认知。并且能够实现在驾在驶者知道凹沟5的存而由于主观原因不能及时进行人为制动时采取紧急制动措施。The present invention proposes an improvement to the reversing warning system based on the STM32 single-chip microcomputer. It can detect the existence of the groove 5, which cannot be done by the current reverse warning system, and can calculate and display the real-time distance between the car 1 and the groove 5 during the reversing process, so that the driver can check the groove 5 when reversing. The location has a more precise cognition. And it can be realized that when the driver knows the existence of the concave groove 5 and cannot perform artificial braking in time due to subjective reasons, emergency braking measures can be taken.
本发明的保护范围包括但不限于以上实施方式,本发明的保护范围以权利要求书为准,任何对本技术做出的本领域的技术人员容易想到的替换、变形、改进均落入本发明的保护范围。The scope of protection of the present invention includes but is not limited to the above embodiments. The scope of protection of the present invention is based on the claims. Any replacement, deformation, and improvement that are easily conceived by those skilled in the art for this technology fall within the scope of the present invention. protected range.
Claims (6)
Priority Applications (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN201711483397.4A CN108001345A (en) | 2017-12-29 | 2017-12-29 | Reversing early warning system and its control method based on STM32 microcontrollers |
Applications Claiming Priority (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN201711483397.4A CN108001345A (en) | 2017-12-29 | 2017-12-29 | Reversing early warning system and its control method based on STM32 microcontrollers |
Publications (1)
| Publication Number | Publication Date |
|---|---|
| CN108001345A true CN108001345A (en) | 2018-05-08 |
Family
ID=62049345
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| CN201711483397.4A Pending CN108001345A (en) | 2017-12-29 | 2017-12-29 | Reversing early warning system and its control method based on STM32 microcontrollers |
Country Status (1)
| Country | Link |
|---|---|
| CN (1) | CN108001345A (en) |
Cited By (5)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN111332239A (en) * | 2019-09-17 | 2020-06-26 | 厦门乐创智联科技有限公司 | Anti-collision early warning system for backing |
| CN111367298A (en) * | 2020-05-07 | 2020-07-03 | 哈尔滨理工大学 | A vehicle intelligent and safe driving control system based on STM32 |
| CN112415523A (en) * | 2019-08-20 | 2021-02-26 | 罗伯特·博世有限公司 | Method, processing device and driver assistance system for detecting a falling steep slope |
| CN113930941A (en) * | 2020-07-13 | 2022-01-14 | 青岛海尔滚筒洗衣机有限公司 | Method for detecting installation position of filtering device and clothes processing equipment |
| CN115128619A (en) * | 2022-08-31 | 2022-09-30 | 威海爱思特传感技术有限公司 | Ultrasonic-based reversing radar early warning system |
Citations (3)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| KR100610859B1 (en) * | 2004-10-05 | 2006-08-09 | 현대자동차주식회사 | Rear warning method of the vehicle |
| CN105751999A (en) * | 2016-03-31 | 2016-07-13 | 汪家琳 | Fully intelligent and fully automatic (unmanned) automobile |
| CN206096446U (en) * | 2016-09-05 | 2017-04-12 | 罗伯特·博世有限公司 | Vehicle and obstacle detecting device thereof |
-
2017
- 2017-12-29 CN CN201711483397.4A patent/CN108001345A/en active Pending
Patent Citations (3)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| KR100610859B1 (en) * | 2004-10-05 | 2006-08-09 | 현대자동차주식회사 | Rear warning method of the vehicle |
| CN105751999A (en) * | 2016-03-31 | 2016-07-13 | 汪家琳 | Fully intelligent and fully automatic (unmanned) automobile |
| CN206096446U (en) * | 2016-09-05 | 2017-04-12 | 罗伯特·博世有限公司 | Vehicle and obstacle detecting device thereof |
Cited By (6)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN112415523A (en) * | 2019-08-20 | 2021-02-26 | 罗伯特·博世有限公司 | Method, processing device and driver assistance system for detecting a falling steep slope |
| CN111332239A (en) * | 2019-09-17 | 2020-06-26 | 厦门乐创智联科技有限公司 | Anti-collision early warning system for backing |
| CN111367298A (en) * | 2020-05-07 | 2020-07-03 | 哈尔滨理工大学 | A vehicle intelligent and safe driving control system based on STM32 |
| CN113930941A (en) * | 2020-07-13 | 2022-01-14 | 青岛海尔滚筒洗衣机有限公司 | Method for detecting installation position of filtering device and clothes processing equipment |
| CN115128619A (en) * | 2022-08-31 | 2022-09-30 | 威海爱思特传感技术有限公司 | Ultrasonic-based reversing radar early warning system |
| CN115128619B (en) * | 2022-08-31 | 2022-12-06 | 威海爱思特传感技术有限公司 | Ultrasonic-based reversing radar early warning system |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| CN107444256B (en) | Automobile omnibearing anti-collision system and method thereof | |
| CN108001345A (en) | Reversing early warning system and its control method based on STM32 microcontrollers | |
| CN107472244B (en) | Vehicle intelligence anticollision early warning system based on VLC | |
| CN201400150Y (en) | A vehicle anti-rear collision control device | |
| CN201166707Y (en) | Vehicle-mounted distance-finding system base on GPS | |
| CN205524233U (en) | Car obstacle detection early warning system based on infrared detection technology | |
| CN101590846A (en) | Automatic protection system for vehicle anticollision | |
| CN204821318U (en) | On -vehicle ponding degree of depth detection alarm device based on PSD | |
| CN110284437B (en) | Tower anti-collision alarm device and method based on infrared detection technology | |
| CN108068804A (en) | A kind of vehicle prevents knock into the back early warning and avoiding system in case of the high-speed travel state | |
| CN203681462U (en) | Intelligent anti-collision system of two-wheeled vehicle | |
| CN207747879U (en) | A kind of vehicle prevents knock into the back early warning and avoiding system in case of the high-speed travel state | |
| CN202345600U (en) | Advanced RISC Machines (ARM)-based car ranging and anti-collision warning device | |
| CN208172811U (en) | A kind of intelligent vehicle collision prevention device based on monocular vision | |
| CN203864558U (en) | Car rear-end collision prevention alarming device | |
| CN201380837Y (en) | Vehicle anti-collision automatic protection device | |
| CN107064945A (en) | A kind of oscillatory type Ultrasonic Range Finder for Parking | |
| CN207617713U (en) | A kind of automobile is with vehicle early warning system and automobile | |
| CN205311477U (en) | Driving safety of vehicle -mounted quick -changingization is apart from alarm system | |
| CN205113137U (en) | Brake warning system based on it is infrared | |
| CN203698192U (en) | Automatic auto alarming brake | |
| CN202083799U (en) | A car anti-collision alarm device | |
| CN102303562A (en) | Prewarning device for preventing rear-end collision of automobiles | |
| CN204359932U (en) | A kind of automobile ultrasonic ranging for preventing collision radar | |
| CN202827301U (en) | Automatic inspection device for safe opening of car door |
Legal Events
| Date | Code | Title | Description |
|---|---|---|---|
| PB01 | Publication | ||
| PB01 | Publication | ||
| SE01 | Entry into force of request for substantive examination | ||
| SE01 | Entry into force of request for substantive examination | ||
| RJ01 | Rejection of invention patent application after publication | ||
| RJ01 | Rejection of invention patent application after publication |
Application publication date: 20180508 |