太原工业学院毕业设计
毕业设计
智能定时电源开关设计
崔亮 09203921学生姓名: 学号: 自动化 系 部: 自动化 专 业: 刘志成 指导教师:
二零一三年六月
太原工业学院毕业设计
智能定时电源开关设计
摘要
随着家用电器的越来越普及和人们生活节奏的加快,人们对电器的依赖性进一步提高,对电器的定时需求也进一步加大。智能定时电源开关可以实现人为地设置电源的开通关断时间,这样就可以实现用电设备的通电开启与关闭的人为控制,在方便人们的同时又节省了大量电能
本文介绍了一种基于STC89C52RC单片机的智能定时电源开关设计方案,该系统是通过STC89C52RC的定时器与中断设计一段时间的倒计时,当倒计时到了预设的时间继电器就会接通,相应的电器就会开始工作,时间结束继电器关闭,电器也停止工作。本设计通过程序的循环设计可以实现倒计时的无限重复,即第一次倒计时结束后会自动复位,继续下一轮的倒计时,所以一旦开始工作,无需人为的其他任何操作就可以实现时间无限制的循环工作,真正实现智能、定时。 关键词: STC89C52RC,定时器,数码管,继电器
I
太原工业学院毕业设计
A Design Of Smart Timing Power Switch
Abstract
With the increasingly popularity of the household appliances and people life rhythm speeding up, people for the dependence of the electrical appliances to further improve, further intensify the timing requirements for appliances. Smart timing power switch can be achieved artificially set the opening of the power turn off time, so that it can be opened and closed electricity of electrical equipment of artificial control, at the people at the same time convenient and saves a lot of energy.
In this paper, a intelligent timing power switch design scheme based on STC89C52RC single-chip microcomputer, the system is through the STC89C52RC countdown timer and interrupt design for a period of time, when the countdown to the appropriate relay will switch on and the corresponding electrical appliance will start to work, time relay closed the end of the electric and stop working. This design can be achieved through the program loop design infinite repetition, the countdown will automatically reset after the end of the countdown for the first time, continue to the next round of the countdown, so once you start working, without any other operation can be achieved artificially time unlimited cycle work, truly realize intelligent, timing.
Key Words: STC89C52RC, Timer,Nixie,Tube,Relay
II
太原工业学院毕业设计
目录
第1章 绪论 ...........................................................1 1.1 智能定时电源开关研究的目的和意义 ..............................1 1.2 智能定时电源开关目前国内外研究现状 ............................2 1.3 本论文研究的主要内容 ..........................................2 第2章 系统控制方案及硬件电路设计 .....................................4 2.1 采用STC89C52RC为核心的单片机控制方案 .........................4 2.2 智能定时电源开关硬件电路 ......................................4 2.2.1 智能定时电源开关总体硬件电路 ...............................4 2.2.2 数码管显示电路 .............................................5 2.2.3 继电器控制电路 .............................................6 2.2.4 晶振电路 ...................................................8 2.3 本章小结 .......................................................9 第3章 STC89C52RCRC单片机的介绍 ....................................10 3.1 STC89C52RCRC单片机的组成原理 ................................10 3.2 单片机定时/计数器的原理与应用方法 ..............................13 3.2.1定时/计数器的基本结构.......................................13 3.2.2定时/计数器的工作原理 ......................................14
3.2.3定时/计数器的方式寄存器与控制寄存器 .........................15 3.2.4定时/计数器的MODE0 ..........................................16 3.2.5定时/计数器的MODE1 ..........................................17
3.2.6定时/计数器的MODE2 ..........................................18 3.2.7定时/计数器的MODE3 ..........................................19 3.3单片机中断系统的介绍 ............................................21 3.4 本章小结 .......................................................26 第4章 软件设计 .......................................................27 4.1 软件开发环境 ...................................................27 4.2 智能定时电源开关主程序图 .......................................27 4.3 智能定时电源开关实现程序 .......................................29
III
太原工业学院毕业设计
4.4 本章小结.. .....................................................31 第5章 系统调试与仿真设计 ..............................................32 5.1 KEIL工程的建立 ...............................................32 5.2 源文件的输入 ..................................................34 5.3 硬件电路的仿真 ................................................34 5.4 本章小结 ......................................................35 结论 ..................................................................37 参考文献 ..............................................................38 致谢 ..................................................................40 附录一:智能定时电源开关的程序设计 ....................................41 附录二:智能定时电源开关硬件接线图 ....................................44
IV