基于单片机的红外遥控窗帘设计论文(含C语言源程序) 下载本文

摘 要

随着电子技术和自动化技术的发展,人们对生活质量的要求越来越高。家用电器产品也在不断的更新换代。从始初的晶体管、到电子管;由模拟到数字;由分立元件到集成电路;从普通向高性能、多功能型;由手动控制向红外线遥控、向智能化发展。此次要设计的就是红外遥控窗帘。它是采用89C2051单片机的最小系统设计,控制一个220V的可逆、直流电动机控制窗帘的拉开和关闭。

红外遥控的重点就在红外发送和接收及编码与解码问题。所以讨论的重点也就是这些个方面。当今专用的红外发送和接收器件非常多,编码与解码的方法也很多,所以要根据实际的情况来选取合适的发送、接收器件和编码、解码方法。除此之外,还要 了解单片机的接口技术的应用和单片机的抗干扰方法。接口方面主要介绍单片机的串口。抗干扰技术有:指令冗余、拦截技术、软件陷阱的设计、软件“看门狗”技术等。

关键词: 遥控,红外线,编码 ,抗干扰,智能,串行口

I

ABSTEACT

With the development of electronic technology and automatic technology, people have more and more high expectations for life quality. The home electric equipment products are in constant update too. From the transistor of the beginning of beginning, to the electron tube ; Imitated it to the figure; From the discrete component to the integrated circuit; From ordinary to high performance , multi-functional type; By manual to control to infrared ray remote control, to intelligent to develop. This one that designed less important is an infrared remote control curtain. It adopt minimum system , 89C2051 of MCU design , control one 220V reversible changing speed the motor control to draw back and shut off the curtain.[27]

Infrared focal point of remote control in infrared to send with receiving and code and decode the issue. So focal point that discuss the. A special-purpose one infrared to send and receive device very more, code and method that decode too a lot of nowadays, so will choose suitable sending, receiving the device, code, decoding method according to the real situation. In addition, should understand the application of the interface technology of the one-chip computer and one-chip computer anti-interference method. Interface respect introduces one cluster of mouths of the one-chip computer mainly. Anti-interference technology is as follows, order redundancy, interception technology, design, software, software of trap “guard the gate dog \

Keywords: Remote control, Infrared ray ,Code ,Anti-interference ,Intelligence,Serial

mouth

II

目 录

摘 要 ........................................................................................................................... I ABSTEACT .................................................................................................................. II 1绪论 ................................................................................................................... 1 2 概述 ........................................................................................................................... 2 2.1选题背景 .................................................................................................................. 2 2.2设计思路 .................................................................................................................. 3 3 红外遥控电路原理及编码解码 ............................................................................... 5 3.1电路原理 .................................................................................................................. 5 3.2红外遥控解码原理 ................................................................................................... 8 4 单片机介绍 ............................................................................................................. 11 4.1单片机简介与接口技术 ........................................................................................ 11 4.2单片机抗干扰技术 ................................................................................................ 15 5 实际电路设计 ......................................................................................................... 19 5.1窗帘控制器原理图 ................................................................................................ 19 5.2工作原理解说 ........................................................................................................ 19 5.3遥控器按键功能 .................................................................................................... 22 总结与展望 ................................................................................................................. 23 致 谢 ......................................................................................................................... 24 参考文献 ..................................................................................................................... 25 附录1 .......................................................................................................................... 27 附录2 .......................................................................................................................... 31

3

1绪论

当今,计算机技术带来了科研和生产的许多重大飞跃,微型计算机的应用已渗透到生产、生活的各个方面。其中单片机问世不久,然而体积小、廉价、功能强,其销售额每年近80%的速度增长。它的性能不断提高,适用范围越来越宽,在计算机应用领域已占有日益重要的地位[1]。

近几年来,随着科学技术的发展和人民生活水平的日益提高,城市建设步伐的加快,一栋栋居民楼、写字楼、宾馆拔地而起。进入寻常百姓的家用电器品种与数量愈来愈多,这些家用电器有的能减轻人们的家务、有的能丰富人们的文娱生活,有的则能提高人们的生活质量??

为了进一步满足人们高水准生活的需要,家用电器产品性能也在不断的更新挽代,从始初的晶体管、到电子管;由模拟到数字;由分立元件到集成电路;从普通向高性能、多功能型;由手动控制向红外线遥控、向智能化发展。与此同时,窗帘作为装修业不可缺少的一部分,也日益火爆起来,目前,常用的窗帘轨道都是钢丝绳手拉式或滑轮式,只有一部分高收入的家庭采用是电动遥控轨道。但价格相当昂贵,不能普及。所以设计的目标就是实现功能全、造价省。能够进入大众生活。一款使用微电脑管理的、红外遥控器控制的多功能窗帘,控制器符合当今的发展趋势。该窗帘控制器采用89C2051单片机的最小系统设计,控制一个220V的可逆、直流电动机控制窗帘的拉开和关闭。

窗帘控制器可以使用红外遥控器进行远程手动开、手动关和手动停控制;可以执行事先输入的开启时间和关闭时间进行时间控制;还可以根据室外环境亮度实现环境亮度光控。三种工作方式可以方便地进行选择,当选择时间控制的方案时,数码管还能显示当时小时和分钟时间,不过时间数据只能顺序显示,显示一遍后,略等片刻再显示下一遍时间。另外、电机拉动窗帘的工作的时间长度,电机工作的时候是否有鸣响提示,以及光控状态下环境亮度的控制参数的调整等等都可以通过遥控器进行设置[16]。

1