南京信息职业技术学院
毕业设计论文
作者 赵鹏雪 学号 11141P18 系部 电子信息学院 专业 物联网应用技术 题目 基于单片机的智能温控风扇设计 指导教师 周波
评阅教师 完成时间:2014年4月 23日
摘要:本次设计的单片机系统是基于单片机的智能电风扇设计。使用的控制芯片是AT89C51,用数字温度传感器DS18B20检测温度并通过数码管显示,通过继电器来实现小电流的单片机控制大电流的电风扇电机工作,利用单片机内部定时器实现电风扇定时时间的设定。本套系统的软件程序思想主要是通过实时温度与设定的温度上下限值进行比较后,控制电风扇启停、强弱挡,最终使环境维持让人舒适的温度。 用户可以根据自身需求自行设定温度上下限值、电风扇启停及工作时间。用户设定的温度上下限值通过软件程序自动保存在数字温度传感器DS18B20内部的EPPROM内存单元中,掉电后数据不会丢失,不必劳烦用户每次启动风扇反复重新设定温度上下限值。 【关键词】:智能,传感器,温控,风扇
ABSTRACT The design is based on single-chip control thermostat fan designed to sensitive sensing temperature sensing and display, the design AT89C51 control center, as the temperature sensor DS18B20 sensor senses the temperature of the internal timer set time set the length to control the intensity and wind speed fan switch The design of single chip microcomputer system is based on single chip microcomputer intelligent temperature control fan design. Through the relay to achieve small current SCM control large current of the electric fan motor work, realize electric fan timing time of internal microcontroller timer setting.This set of system software program thought mainly through real-time temperature and setting temperature upper and lower limit value after comparison, strong or weak and eventually make the environment to maintain a comfortable temperature . The user can according to their own needs to set temperature upper and lower limit, electric fan start-stop and working time.Users to set the temperature of the upper and lower limit value automatically by the software program stored in the digital temperature sensor DS18B20 the internal EPPROM memory unit, don't need to bother the user with each fan launched again and again to reset temperature limit up and down. 【KEY WORD】: Intelligence, sensors, temperature, fan 目 录
1、引言 ................................................................... 1 2、总体设计 ................................................................ 1 3、硬件设计 ................................................................ 2
3.1 AT89C51单片机概述 ................................................. 2 3.1.1 AT89C51单片机组成 ............................................. 3 3.1.2.AT89C51单片机的引脚结构 ...................................... 4 3.2 DS18B20 单线数字温度传感器 ............................................ 5 4、系统电路设计 ............................................................. 6
4.1 单片机最小系统电路设计 ............................................... 6
4.1.1 AT89C51单片机的最小系统 ....................................... 6
4.2 按键电路设计 ........................................................ 7 4.3 控制电路设计 ........................................................ 8 4.3.1温度控制电路设计 ............................................... 8 4.3.2声响控制电路设计 ............................................... 8 4.4 温控自动电路设计 ..................................................... 9 4.4.1 双向晶闸管介绍 ................................................ 9 4.4.2 继电器介绍 .................................................... 9 4.4.3 电路设计 ...................................................... 9
4.5 数码显示电路设计 .................................................... 10 4.6 电源电路设计 ...................................................... 11
4.6.1 LM7805集成稳压器介绍 ......................................... 11 4.6.2电路设计 ...................................................... 11 5、软件设计 ............................................................... 12
5.1 总体设计思想 ....................................................... 12 5.2 各部分的软件框图和程序 .............................................. 12 5.2.1 主程序流程图 ................................................. 12 5.2.2 温度显示子程序流程图 ......................................... 13 总结 ..................................................................... 13
附录 ..................................................................... 14
附录一 电路原理图 ...................................................... 14 附录二 源程序 .......................................................... 15 致谢 ..................................................................... 31 参考文献 .................................................................. 32
相关推荐: