单 位 计算机09-1班
学 号 09202134
江西农业大学南昌商学院本科毕业论文
(电子信息工程专业)
基于单片机的红外线遥控器设计与仿真
姓 名 李卫民
专 业 电子信息工程 指导教师 衷裕水
江西农业大学南昌商学院
二0一二年十一月
论文独创性声明
本人声明,所呈交的学位论文系在导师指导下独立完成的研究成果。文中合法应用他人的成果,均已做出明确标注或得到许可。论文内容未包含法律意义上已属于他人的任何形式的研究成果,也不包含本人已用于其他学位申请的论文或成果。
本文如违反上述声明,愿意承担以下责任和后果: 1.交回学校授予的学士学位;
2.学校可在相关媒体上对本人的行为进行通报;
3.本文按照学校规定的方式,对因不当取得学位给学校造成的名誉损害,进行公开道歉;
4.本人负责因论文成果不实产生的法律纠纷;
论文作者签名: 日期: 年 月 日
江西农业大学南昌商学院 摘要
摘 要
随着家电行业的不断发展,如今家电市场的竞争越来越激烈。作为家电的重要部件之一,遥控器的竞争也是可想而知的。红外遥控器是一种用户可以在几米甚至十几米外就能对各种电器进行操作控制的装置,而且他有控制功能强、结构简单、体积小、功耗低、扩展灵活、可靠性高、易于掌握、价格低廉等特点,所以在家电产品中有广泛应用,但各产品的遥控器不能相互兼容,使得生活中遥控器数目也越来越多,使用时常常混淆。另外若遥控器丢失,找到配套的遥控器也很困难,所以就现在这种状况,研究一种万能型的遥控器势在必行。
具有学习功能的智能遥控器是以普通的低成本单片机为核心,能解码与记忆遥控器编码,并模拟发射,使一个遥控器可以代替多个遥控器控制多个电器,是一种智能化的控制工具,由于它比以前的遥控器更加方便,所以研究一个万能型的遥控器是现在电子厂商掌控电子市场的必要途径。目前市面上常见的智能遥控器大多只能对某几种产品进行控制,不是真正的“万能”。
本文介绍的多功能红外遥控器利用AT89C52单片机作为整个系统的主控部件,具有多功能自适应性, 两种工作状态:即学习状态和控制状态。即对不同的家用电器,如电视、空调、冰箱、VCD、遥控机器人、无人飞机等都能实现无线遥控功能。
【关键词】红外线遥控器,AT89C52单片机
I
江西农业大学南昌商学院 Abstract
Abstract
Along with the development of the household electrical appliance industry, now the home appliance market more and more competition. As one of important component of home appliance, the remote control competition is palpable. Infrared remote control is a user can in a few meters or more than ten meters away to all sorts of electric equipment can operate control device, and he has the control function of strong, simple structure, small volume, low power consumption, expand flexibility, high reliability, and is easy to grasp, low prices and other characteristics, so in the home appliance product is widely applied, but the product of the remote control can't compatible with each other, make life more and more remote control number, when used, often confuse. In addition if lost remote control, find supporting the remote control is very difficult also, so now this situation, a type of remote control everything is imperative.
Has the function of intelligent remote control study is common low cost microcontroller as the core, can decode and memory remote control code, and simulated launch, make a remote control can take the place of the more remote control more electric appliances, is a kind of intelligent control tool, and because it is more convenient than the previous remote control so research a universal remote control type of electronic manufacturers now is the necessary way to control electronics market. On the market at present is most common intelligent remote control only to be a few products control, is not a true \\\
This paper introduces the multi-function infrared AT89C52 single chip microcomputer as the whole system of the main controlling parts, has the multi-function adaptability, two working condition of learning state and control state. That is different to the household appliances, such as television, air conditioning, the refrigerator, VCD, remote control robot, the aircraft can realize the wireless remote control function.
【Key Words】infrared remote control, AT89C52 single chip microcomputer
II
江西农业大学南昌商学院 目录
目 录
摘 要 ................................................................. I Abstract ............................................................... II
绪 论 .................................................................. 1 1 课题背景 .............................................................. 2
1.1 红外遥控电路设计的目的 ........................................... 2 1.2单片机的发展和应用 ............................................... 2
1.2.1单片机的发展概况及趋势 ...................................... 2 1.3红外遥控器原理 ................................................... 3 2 系统设计方案论证 ...................................................... 6
2.1设计该系统的功能要求 ............................................. 6 2.2设计思路分析与方案论证 ........................................... 6
2.2.1设计思路分析................................................ 6 2.2.2方案论证 ................................................... 6
3 系统硬件电路的设计 .................................................... 8
3.1 AT89C52单片机简介 .............................................. 8 3.2遥控发射器的电路设计 ............................................ 14
3.2.1 红外线发射电路 ............................................ 14 3.2.2遥控器信息码............................................... 15 3.3遥控接收器的电路设计 ............................................ 16
3.3.1红外遥控接收器的接收过程为图3.3所示 ....................... 16 3.3.2接收电路 .................................................. 17
4 系统程序的设计 ....................................................... 18
4.1初始化程序 ...................................................... 18 4.2遥控码读入处理程序 .............................................. 18 4.3遥控码发射处理程序 .............................................. 20 4.4主程序 .......................................................... 21 4.5延时程序 ........................................................ 21 5 调试及性能分析 ....................................................... 22