基于单片机的电风扇模拟自然风控制器设计毕业论文
- 1、下载文档前请自行甄别文档内容的完整性,平台不提供额外的编辑、内容补充、找答案等附加服务。
- 2、"仅部分预览"的文档,不可在线预览部分如存在完整性等问题,可反馈申请退款(可完整预览的文档不适用该条件!)。
- 3、如文档侵犯您的权益,请联系客服反馈,我们会尽快为您处理(人工客服工作时间:9:00-18:30)。
I
本科毕业设计(论文)
基于单片机的电风扇模拟自然风控制器设计
学 院 电子信息工程学院
专 业 电气工程及其自动化
年级班别 13电气工程及其自动化
学 号 *************
学生姓名 胡长新
2017年3月21日
II
摘要
随着社会的不断发展,科技的不断进步,人们对于电风扇的选择也变得更苛
刻了,面临着强大的竞争力,电风扇想要在市场上取得一席之地就必须变得更加
人性化,更加智能化。因此,模拟自然风的电风扇就会越来越被重视,从而被广
泛的应用。本文设计的是基于单片机的电风扇模拟自然风控制器,通过使用
STC12C5A60S2单片机来输出PWM波,并由两个BTS7960芯片组成一个H桥驱动
电路来驱动电风扇电机转动。该设计能够实现控制风扇的扇叶由停止→慢慢转动
→快速转动→慢速转动→停止进行这种周期性的转动,而且能够对这个周期的时
间进行调节。这样风扇就可以模拟成自然风了,给人们带来了更好的舒适感。
关键词:单片机;PWM波;H桥驱动电路;模拟自然风
II
Abstract
With the continuous development of society, the progress of science and
technology, people's choice for electric fan has become more severe, facing strong
competition, the electric fan to make a space for one person in the market must
become more humane, more intelligent. Therefore, the simulation of natural wind
fans will be more and more attention, which is widely used. This paper is the design
of MCU simulation natural wind controller for electric fan based on STC12C5A60S2
MCU by using PWM wave output, and by two BTS7970 chip is composed of a H
bridge driving circuit to drive the electric fan motor rotation. The design of the utility
model can realize the control of the fan blade from the stop to the slow rotation, the
fast rotation, the slow rotation and the periodic rotation, and can adjust the time of
the cycle. So that the fan can simulate the natural wind, to bring people a better
sense of comfort.
Key words: single chip; PWM wave; H bridge driver circuit; simulation of natural
wind
IV
目录
1.绪论 ............................................................................................................................................... 1
1.1 选题的依据和意义 ............................................................................................................ 1
1.2 本设计需实现的功能 ........................................................................................................ 1
2.系统设计总体方案 ........................................................................................................................ 2
2.1风扇的功能需求分析 ......................................................................................................... 2
2.2 系统方案论证 .................................................................................................................... 2
2.2.1 电机调速控制方案 ................................................................................................. 2
2.2.2显示功能方案 ........................................................................................................ 2
2.3 系统整体结构框图 ............................................................................................................ 3
3.系统硬件设计 ................................................................................................................................ 4
3.1 STC12C5A60S2单片机系统的硬件设计 ............................................................................ 4
3.1.1 STC12C5A60S2单片机详情 ..................................................................................... 4
3.1.2单片机晶振与复位电路设计 .................................................................................. 5
3.1.3单片机电源电路设计 .............................................................................................. 6
3.2键盘电路设计 ..................................................................................................................... 6
3.3 LCD显示电路设计 ............................................................................................................. 7
3.4风扇电机驱动电路与调速电路设计 ................................................................................. 8
4.系统软件设计 .............................................................................................................................. 12
4.1 开发工具概述 .................................................................................................................. 12
4.2 系统主程序设计 .............................................................................................................. 12
4.3初始化程序设计 ............................................................................................................... 14
4.4 按键子程序设计 .............................................................................................................. 14
4.5 LCD显示屏子程序设计.................................................................................................... 15
5.系统调试...................................................................................................................................... 16
5.1 单片机最小系统调试 ...................................................................................................... 16
5.2 PWM调试 ......................................................................................................................... 16
5.3 屏幕显示调试 .................................................................................................................. 17
6.总结 ............................................................................................................................................. 18
致谢 ................................................................................................................................................ 19
参考文献......................................................................................................................................... 20
附录一:系统原理图 ..................................................................................................................... 21
附录二:程序代码 ......................................................................................................................... 23