智能温控风扇报告

  • 格式:doc
  • 大小:1.02 MB
  • 文档页数:58

洛阳理工学院毕业设计(论文)

I 基于51单片机的温控风扇设计

摘 要

在炎热的夏天人们用电风扇来降温;在工业生产中,大型机械用电风扇来散热等。随着温度控制的技术不断发展,应运而生的温控电风扇也逐渐走进了人们的生活中。温控电风扇可以根据环境温度自动调节电风扇启停与转速,在实际生活的使用中,温控风扇不仅可节省宝贵的电资源,也大大方便了人们的生活和生产。

本设计为一种温控风扇系统,具有灵敏的温度感测和显示功能,系统采用STC89C51 单片机作为控制平台对风扇转速进行控制。利用DS18B20数字温度传感器采集实时温度,经单片机处理后通过三极管驱动直流风扇的电机。根据采集的实时温度,实现了风扇的自起自停。可由用户设置高、低温度值,测得温度值在高低温度之间时打开风扇弱风档,当温度升高超过所设定的温度时自动切换到大风档,当温度小于所设定的温度时自动关闭风扇,控制状态随外界温度而定。

关键词:温控风扇,单片机,DS18B20,自动控制 洛阳理工学院毕业设计(论文)

II Temperature control fan design based on 51

single chip microcomputer

ABSTRACT

In the hot summer, people use cooling fan; in the industrial production, is

used toheat the electric fan large machinery. With the continuous

development of thetechnology of temperature control, temperature controlled

electric fan emerge as the times require gradually into people's

lives. Temperature controlled electric fan can be adjusted

automatically stop and start the fan speed according to the environment

temperature, the use of real life, temperature controlled fan not only can

save power resources valuable, but also greatly facilitate the people's life and

production.

The design of a temperature controlled fan system, sensitive temperate-

easuing and display, the system uses STC89C51 microcontroller as the

control platform to control the speed of the fan. The

real-time temperature using DS18B20 digital temperature sensor, SCM

processing through the transistor DCfan motor drive. According to the

real-time temperature acquisition, the fan selfstop. High, low temperature

value set by the user, the measured temperaturevalues in the high and low

temperature between open fan weak wind profile,when the

temperature exceeds the set temperature automatically switch

to thefile, automatically turn off the fan when the temperature is lower than

the set temperature, the control state varies with the outside temperature.

KEY WORDS: Temperature control fan, MCU, DS18B20,automatic control

洛阳理工学院毕业设计(论文)

III 目 录

前 言 ................................................................................................ 1

第1章 绪论 ...................................................................................... 2

1.1 研究本课题的目的和意义 ................................................... 2

1.2 发展现状 ............................................................................... 2

第2章 整体方案选择 ....................................................................... 4

2.1 温度传感器的选用 ............................................................... 4

2.2 主控机的选择 ....................................................................... 6

2.3显示电路 ................................................................................ 6

2.4调速方式 ................................................................................ 7

第3章 系统硬件组成 ....................................................................... 8

3.1 系统结构 ............................................................................... 8

3.2 主控芯片介绍 ....................................................................... 8

3.2.1 STC89C51简介 ........................................................... 8

3.2.2 STC89C51主要功能和性能参数 .................................. 9

3.2.3 STC89C51单片机引脚说明 ...................................... 10

3.2.4 STC89C51单片机最小系统 ........................................ 12

3.2.5 STC89C51中断技术概述 ............................................ 14

3.3 DS18B20温度采集电路 ...................................................... 15

3.3.1 DS18B20 的特点及内部构造 ..................................... 15

3.3.3 DS18B20的工作原理 ................................................. 17

3.3.3 DS18B20的工作时序 ................................................. 19

3.4 数码管驱动显示电路 ......................................................... 22

3.4.1 数码管驱动电路 ....................................................... 22

3.4.2 数码管显示电路 ....................................................... 23

3.5 风扇驱动电路 ..................................................................... 24

3.6 按键模块 ............................................................................. 26

第4章 系统软件设计 ..................................................................... 28

4.1 软件介绍 ............................................................................. 28 洛阳理工学院毕业设计(论文)

IV 4.1.1 Keil C51 ..................................................................... 28

4.1.2 Protel99SE .................................................................. 29

4.1.3 Proteus ........................................................................ 30

4.2 主程序流程图 ..................................................................... 32

4.3 DS18B20子程序流程图 ...................................................... 33