下载后可任意编辑2024 年小学期单片机设计实验报告题目:基于单片机的超声波测距班 级:班内序号: 实验组号: 学生姓名: 指导老师: 实验摘要 本次实验我们制作的超声波测距仪主要实现的功能是非接触式测距,应用于测量环境处于黑暗、有灰尘,烟雾,有毒的情况下的距离测量,利用超声波的直线传播性,较低速性,下载后可任意编辑便于发射和接收,有较高的分辨率和精准度。整个系统中,微控制器采纳了 Microchip 公司的 PIC16F877,软件设计中涉及 Rc1、RB4用作超声波发射和接收管脚和 LCD1602 液晶显示屏用作显示测量结果。本实验用单片机 RB4管脚产生高电平使发射电路使能发射超声波,并开始计时,当接收电路接收到超声波后,电平由高变低,送入到单片机 Rc1 管脚,发送中断请求,停止计时,计算出超声波传播距离,实现测距。 其中发射电路由 NE555 电路 40KHz 超声波发生模块和由 CD4069 反相器构成的信号推挽放大模块组成,接收电路由 CX20246 模块组成。概括来说,本实验就是用单片机通过记录超声波发射接收时间,并以此计算出距离。AbstractAbstractIn this experiment we produce ultrasonic range finder functions of the main non-contact distance, used in the measurement environment is dark, dust, smoke, toxic case of distance measurement, using an ultrasonic wave transmission line resistance, low speed , ease of transmitting and receiving, a higher resolution and accuracy.Throughout the system, the microcontroller uses Microchip's PIC16F877, software design involves Rc1, RB4 for transmitting and receiving ultrasonic LCD1602 LCD monitor as a pin and display the measurement results. The experimental chip produces high RB4 pin enables the emission of ultrasonic transmitter circuit and start the timer, when the receiving circuit receives the ultrasonic waves, the level from high to low, Rc1 fed to the microcontroller pin interrupt request is sent, stop time, calculated from the ultrasonic wave propagation, to achieve ranging. Wherein the transmission circuit from 40KHz ultrasonic NE5...