基于单片机的倒车防撞报警系统的设计专业:2010级电气工程及其自动化(3)班摘要本设计的基本内容为基于AT89S52单片机的倒车防撞报警系统的设计。主要是结合了超声波的特点和优势,将AT89S52单片机和超声波测距系统结合成一体,设计出一种稳定准确可靠地倒车防撞报警系统。本设计的系统具有模块化和多用途的特点,因为采用了软件和硬件结合的办法。在本文中,采用了一种简单可行的三路测距原理搭建了防撞报警系统,并且对倒车防撞系统的设计及各部分的设计原理进行详细的分析,介绍了单片机的原理,超声波测距原理,HC-SR04模块以及它们的应用。利用这些原理,本系统最后可实现小车后方的全方位实时监控显示并报警的功能,很大程度上解决了倒车泊车的安全问题。关键词AT89S52,超声波,多路测距,倒车防撞ABSTRACTThebasicdesignisbasedonthecontentsofthisAT89S52microcontrollerreversingcollisionavoidancewarningsystemdesign.Mainlyacombinationofultrasoundfeaturesandadvantages,willcombineAT89S52microcontrollerandultrasonicrangingsystemasawhole,todesignastableandaccurateandreliableparkingproximitywarningsystem.Thesystemhasamodulardesignandversatilefeatures,becausetheuseofsoftwareandhardwarecombinationapproach.Inthispaper,usingasimplethree-wayrangingprinciplefeasibletobuildacollisionwarningsystem,andthedesignprinciplesofthedesignofeachpartreversingcollisionavoidancesystemtoconductadetailedanalysisoftheprinciplesoftheMCU,ultrasonictestingfromprinciple,HC-SR04moduleandtheirapplications.Usingtheseprinciples,thesystemcanachievethefinalroundthebackofthecartodisplayreal-timemonitoringandalarmfunctions,largelysolvethesecurityproblemofreversingparking.KeyWordsAT89S52,ultrasound,multi-ranging,reversingcrash绪论在当今社会不断发展的经济和工业科学技术的不断提升,汽车已经成为大部分家庭的一个成员。所以在使用过程中,特别是在新手驾车的过程中,汽车的安全问题就成为一个很大的问题。当大量的汽车在城市道路行驶时,就会出现行车或倒车撞击事故,行车或者倒车的安全问题也越来越明显,给道路交通施加了更多的压力。在这时候一个倒车防撞系统的作用就突显出来了,可以减少不必要的汽车剐蹭或者交通事故,这样就可以减小交通压力,并且在汽车车倒车或者泊车的时候,防撞系统就可以辅助驾驶员操作,当驾驶员对车后方的障碍物无法目测或者判断的时候,系统通过测距并进行显示报警,在未发生安全事故之前主动提醒驾驶员采取措施,大大方便了人们的生活。目录ABSTRACT......................................................................................................................................2绪论..................................................................................................................................................21引言..............................................................................................................................................41.1研究目的和意义...............................................................................................................51.1.1研究目的................................................................................................................51.1.2研究意义................................................................................................................51.2国内外现状.......................................................................................................................51.3本文研究的主要内容.......................................................................................................62总体方案.......................................................................................................................................62.1整体设计与分析...............................................................................................................62.2各功能模块方案分析.......................................................................................................62.3方案确定...........................................................................................................................83硬件电路电路设计........................................................................................................................93.1AT89S52单片机控制单元................................................................................................93.1.1AT89S52单片机....................................................................................................93.1.2单片机引脚功能...................................................................................................93.2超声波测距原理..............................................................................................................123.3发射与接收电路设计...................................................................................................133.3.1HC-SR04模块......................................................................................................133.3.2超声波发射电路..................................................................................................193.3.3超声波接收电路..................................................................................................203.4显示报警单元设计.......................................................................................................223.4.1系统显示电路设计.............................................................................................223.4.2系统报警电路设计.............................................................................................233.4.3复位电路.............................................................................................................243.5供电电路.........................................................................................................................254系统软件设计..............................................................................................................................254.1主程序流程图.................................................................................................................254.2测