1、 1 基于基于 5151 单片机的超声波测距仪设计单片机的超声波测距仪设计 摘要摘要: 本方案以 stc89c52 为核心,通过编程(C 语言)来实现该单片机对外围电路的 适时控制,并提供给外围电路各种所需的信号和接收超声波反射回来的微小信号,包括 频率振荡信号,时钟信号,数据处理信号和显示信号等等。其核心功能是对距离的检测 并实时的进行距离的显示,在检测距离方面通过发射端与接收端的时间差来计算,理论 上所测距离与其时间差成线性关系,所以可以通过线性回归统计方法求出实际距离与所 求距离的关系。该电路简化了一些外围电路,任能做到较为精确的测量工作,由于是采 用程控操作,所以其移植性和可扩展性还是
2、较好。在设计时分,分模块进行设计来实现 各部分功能,简化了在设计过程中的调试难度。 关键词:关键词: 超声波测距、单片机控制、液晶显示、距离报警、线性回归 Abstract:This program stc89c52 programming (C language) to achieve the timely control of the single-chip peripheral circuits, and made available to the peripheral circuits of the desired signal and receiving the ultrasonic
3、 reflected the small signal, including frequency oscillation signal, the clock signal, data signal processing and display signals, and so on. The its core function is to to the detection of pairs the distance and real-time of the carried out the distance the display of goes as follows. In the to cal
4、culate the, in the the detection distance aspects of through the launch of the-side with the the time of the the receiving end is poor, in theory, the measured distance with its time difference into a linear the relationship between, so can through the the linear regression statistical methods calculate the actual distance of the seek distance relationship. The circuit simplifies the peripheral circuit, any more accurate measurements can be done, because it is programmed operation, its portab