摘 要:伴随着计算机科技、自动化科技的不断发展,测距与识别变得越来越重要,但操作人员在测距过程中往往会产生一些问题。超声波测距系统就可以解决这一问题,只要有反射位就能对目标距离进行便捷、准确的测量。本课题设计了基于AT89C52单片机的超声波测距系统,实现报警距离预设、超声波测距以及报警功能。79077
本系统用AT89C52单片机作为主控芯片,利用HC-SR04超声波测距模块的T/R-40-16超声波传感器、MAX232芯片和TL074芯片,来进行超声波的发射与接收。整个系统的硬件电路设计包括了:单片机核心模块、超声波测量模块和报警模块。软件部分采用了C语言进行编程,包括主程序、中断服务程序和显示与报警程序。系统最后在Proteus软件上进行仿真验证,实现了非接触测量功能。并且本系统的软硬件设计合理,具有强抗干扰能力和良好的实时性。
毕业论文关键词: AT89C52,超声波,测距,HC-SR04,报警
Abstract:With the continuous development of computer science and technology, automation technology, ranging and identification is becoming more and more important, but the operator in the process of ranging often have some problems。 Ultrasonic distance measurement system can solve this problem, as long as there is a reflection of the target distance can be convenient and accurate measurement。 This topic designs the ultrasonic distance measurement system based on AT89C52 single chip microcomputer, realizes the warning distance, the ultrasonic distance measurement and the alarm function。
The system uses AT89C52 microcontroller as the main control chip, the use of HC-SR04 ultrasonic ranging module T/R-40-16 ultrasonic sensor, MAX232 chip and TL074 chip, to carry out the ultrasonic transmission and reception。 The hardware circuit design of the whole system includes: MCU core module, ultrasonic measurement module and alarm module。 The software part uses the C language programming, including the main program, interrupt service program and display and alarm program。 At last, the system is simulated and verified on the Proteus software, and the non contact measurement function is realized。 And the hardware and software design of the system is reasonable, with strong anti-interference ability and good real-time performance。
Keywords: AT89C52, ultrasonic wave, distance measurement, HC-SR04, alarm
目 录
1 绪论 4
1。1 课题背景与研究意义 4
1。3 研究内容与设计指标 4
1。4 方案的设计与论证 5
2 系统硬件设计 6
2。1 硬件结构设计 6
2。2 AT89C52单片机 6
2。3 超声波测量模块HC-SR04 7
2。4 单片机核心模块 8
2。4。1 复位时钟电路 9
2。4。2 显示电路 9
2。5 超声波测量模块 10
2。5。1 超声波发射电路 10
2。5。2 超声波接收电路 11
2。6 报警模块 12
3 系统功能实现 13
3。1 主程序与中断服务程序