电子科技大学成都学院电子工程系课程设计 题目名称 基于单片机的课程设计 学生姓名 郭庆 学 号 1240840221 专 业 机械设计制造及其自动化 指导老师 陈 芳 2025 年 6 月制摘 要随着当今社会的飞速进展,越来越多的流水线上的产品和各种公共场所需要进行自动计数。基于单片机构成的产品自动计数器有直观和计数精确的优点,目前已在各种行业中得到广泛应用。数字计数器有多种形式,总体来说有接触式和非接触式两种,在科技进展的今日,非接触式红外计数器得到了广泛的应用。本设计采纳一对红外发射接收管作为红外计数器的信号检测头,具有价格低廉,抗干扰性好,结构简单,操作方便等特点。指导思想是利用红外发光管发射红外线,红外接收管接收此红外线,并将其放大、整流形成低电平信号.当有人或物挡住红外光时,接收数码管没有接收到红外信号,放大器将输出高电平,同时将这个电平信号送入单片机进行控制计数,并且使数码管显示数值。这样就得到要统计的人或物的数量关键字: 单片机;红外对射管;LED 数码管。ABSTRACTRapid development in the pattern of today's society, more and more of the pipeline of products and a variety of business occasions need to automatically count. Based on SCM products constitute automatic counter has the advantages of intuitive and accurate count, now in a variety ofcommonly used in industry. This article is designed to counter radio-style method using infrared,interference immunity and high reliability.The design of the guiding idea is to use infrared emission infrared LED, infrared receiver toreceive the infrared, and enlarge, forming high commutation signal. When persons or blockinfrared light, the receiver does not receive infrared control signals, the amplifier the output low,while the level control signal into the microcontroller counts, and by decoding the digital displaydrive circuit values. This will be the number of persons or things to statistics,The AT89C51 microcontroller chip design applications as a core, 4 LED digital tube, the useof i...