基于51单片机智能风扇控制系统的设计与实现
摘要:随着气温的逐渐上升,风扇的需求量也逐渐扩大。传统风扇不能根据外界温度的变化对风扇转速快慢进行调整,也不能对风扇的开关与否进行自动控制,这将会损耗大量的电力资源。针对这些问题,开发设计了智能风扇控制系统。
该系统以STC89C51RC单片机最小系统为核心,利用DS18B20温度采集模块,LCD 1602显示屏、L298N电机驱动模块、HC-SR501人体感应模块、舵机控制模块、ESP8266 WIFI控制模块组成智能风扇控制系统。当有人进入室内, HC-SR501人体感应模块会监测到有人出现,同时DS18B20温度采集模块将采集到的温度与系统开始设置的阈值做比较,并将采集到的温度数据显示在LCD 16 -02显示屏上。当室温高于所设置的温度且有人存在的情况下,风扇将会自动吹风;当温度低于所设置的温度时风扇仍保持关闭状态。该系统采取了三种工作方式,第一种工作方式为按键控制,从左至右按键功能依次为摇摆、红外、定温、定时。第二种工作方式为红外遥控器控制,在遥控器上按下相应的功能按键,即可控制风扇。第三种工作方式为手机终端APP控制,通过手机客户端实现风扇的自动启动和停止,旋转方向,改变风扇的转速等。
关键词:STC89C51RC单片机;智能风扇;人体感应;keil Uvision;
I
Intelligent Fan Control System Based on 51 Single Chip Design and Implementation
Abstract: With the gradual rise in temperature, the demand for fans has gradually expanded. However, the traditional fan can not adjust the speed of the fan according to the change of the outside temperature, and can not control the fan switch automatically. In response to this problem, we will develop intelligent control system of the fan.
The system is based on the minimum system of the STC89C51RC MCU.The intelligent fan control system is composed of DS18B20 temperature acquisition module, LCD 1602 display, L298N motor drive module, HC-SR501 human body induction module, steering control module and ESP8266 WIFI control module. When the person enters the room, the human body infrared sensor module will detect people, while the DS18B20 temperature acquisition module will collect the temperature and the system begins to set the threshold to compare, and the collected temperature data is displayed on the LCD 1602 display. When the room temperature is higher than the set temperature and someone exists, the fan will automatically blow; when the temperature is lower than the set temperature ,the fan will still turn off . The system takes three kinds of work, the first work for the key control, from left to right button function in order of swing, infrared, fixed temperature and timing. The second mode of operation for the infrared remote control, press the corresponding function button on the remote control, you can control the fan. The third type of work for the mobile terminal APP control, through the mobile client to achieve automatic fan start and stop, rotation direction, change the fan speed and so on.
Key words: STC89C51RC Single-Chip; Intelligent Fan; Human Infrared Sensor Module; Keil Uvision ;
II
目 录
一、论文(设计)正文..............................................................................................1 1绪论 .................................................................................................................... 1
1.1系统开发的背景...................................................................................... 1 1.2系统开发的目的和意义.......................................................................... 1 1.3国内外研究现状...................................................................................... 2 1.3.1国内研究现状....................................................................................... 2 1.3.2国外研究现状....................................................................................... 2 1.4主要研究内容.......................................................................................... 3 2系统分析 ............................................................................................................ 4
2.1可行性分析.............................................................................................. 4 2.2系统需求分析.......................................................................................... 5 2.2.1功能需求分析....................................................................................... 5 2.2.2性能需求分析....................................................................................... 6 2.2.3系统实现方式....................................................................................... 7 3系统硬件设计 .................................................................................................... 9
3.1系统概述.................................................................................................. 9 3.2单片机最小系统电路.............................................................................. 9 3.2.1 STC89C51RC单片机简介 .................................................................. 9 3.2.2 STC89C51RC单片机常用寄存器 .................................................... 10 3.3 LCD 1602显示屏模块.......................................................................... 11 3.4 DS18B20温度传感器模块 ................................................................... 12 3.4.1 DS18B20温度传感器的特性 ............................................................ 12 3.4.2 DS18B20温度传感器的电路实现 .................................................... 13 3.5红外遥控模块........................................................................................ 13 3.6 HC-SR501人体感应模块 ..................................................................... 14 3.6.1 HC-SR501人体感应模块工作原理 .................................................. 14 3.6.2 HC-SR501人体感应模块特性 .......................................................... 14 3.6.3 HC-SR501人体感应模块的电路实现 .............................................. 15