I基于51单片机智能风扇控制系统的设计与实现摘要:随着气温的逐渐上升,风扇的需求量也逐渐扩大。传统风扇不能根据外界温度的变化对风扇转速快慢进行调整,也不能对风扇的开关与否进行自动控制,这将会损耗大量的电力资源。针对这些问题,开发设计了智能风扇控制系统。该系统以STC89C51RC单片机最小系统为核心,利用DS18B20温度采集模块,LCD1602显示屏、L298N电机驱动模块、HC-SR501人体感应模块、舵机控制模块、ESP8266WIFI控制模块组成智能风扇控制系统。当有人进入室内,HC-SR501人体感应模块会监测到有人出现,同时DS18B20温度采集模块将采集到的温度与系统开始设置的阈值做比较,并将采集到的温度数据显示在LCD16-02显示屏上。当室温高于所设置的温度且有人存在的情况下,风扇将会自动吹风;当温度低于所设置的温度时风扇仍保持关闭状态。该系统采取了三种工作方式,第一种工作方式为按键控制,从左至右按键功能依次为摇摆、红外、定温、定时。第二种工作方式为红外遥控器控制,在遥控器上按下相应的功能按键,即可控制风扇。第三种工作方式为手机终端APP控制,通过手机客户端实现风扇的自动启动和停止,旋转方向,改变风扇的转速等。关键词:STC89C51RC单片机;智能风扇;人体感应;keilUvision;IIIntelligentFanControlSystemBasedon51SingleChipDesignandImplementationAbstract:Withthegradualriseintemperature,thedemandforfanshasgraduallyexpanded.However,thetraditionalfancannotadjustthespeedofthefanaccordingtothechangeoftheoutsidetemperature,andcannotcontrolthefanswitchautomatically.Inresponsetothisproblem,wewilldevelopintelligentcontrolsystemofthefan.ThesystemisbasedontheminimumsystemoftheSTC89C51RCMCU.TheintelligentfancontrolsystemiscomposedofDS18B20temperatureacquisitionmodule,LCD1602display,L298Nmotordrivemodule,HC-SR501humanbodyinductionmodule,steeringcontrolmoduleandESP8266WIFIcontrolmodule.Whenthepersonenterstheroom,thehumanbodyinfraredsensormodulewilldetectpeople,whiletheDS18B20temperatureacquisitionmodulewillcollectthetemperatureandthesystembeginstosetthethresholdtocompare,andthecollectedtemperaturedataisdisplayedontheLCD1602display.Whentheroomtemperatureishigherthanthesettemperatureandsomeoneexists,thefanwillautomaticallyblow;whenthetemperatureislowerthanthesettemperature,thefanwillstillturnoff.Thesystemtakesthreekindsofwork,thefirstworkforthekeycontrol,fromlefttorightbuttonfunctioninorderofswing,infrared,fixedtemperatureandtiming.Thesecondmodeofoperationfortheinfraredremotecontrol,pressthecorrespondingfunctionbuttonontheremotecontrol,youcancontrolthefan.ThethirdtypeofworkforthemobileterminalAPPcontrol,throughthemobileclienttoachieveautomaticfanstartandstop,rotationdirection,changethefanspeedandsoon.Keywords:STC89C51RCSingle-Chip;IntelligentFan;HumanInfraredSensorModule;KeilUvision;目录一、论文(设计)正文..............................................................................................11绪论....................................................................................................................11.1系统开发的背景......................................................................................11.2系统开发的目的和意义..........................................................................11.3国内外研究现状......................................................................................21.3.1国内研究现状.......................................................................................21.3.2国外研究现状.......................................................................................21.4主要研究内容..........................................................................................32系统分析............................................................................................................42.1可行性分析..............................................................................................42.2系统需求分析..........................................................................................52.2.1功能需求分析.......................................................................................52.2.2性能需求分析.......................................................................................62.2.3系统实现方式.......................................................................................73系统硬件设计....................................................................................................93.1系统概述..................................................................................................93.2单片机最小系统电路..............................................................................93.2.1STC89C51RC单片机简介..................................................................93.2.2STC89C51RC单片机常用寄存器....................................................103.3LCD1602显示屏模块..........................................................................113.4DS18B20温度传感器模块...................................................................123.4.1DS18B20温度传感器的特性............................................................123.4.2DS18B20温度传感器的电路实现....................................................133.5红外遥控模块........................................................................................133.6HC-SR501人体感应模块.....................................................................143.6.1HC-SR501人体感应模块工作原理..................................................143.6.2HC-SR501人体感应模块特性..........................................................143.6.3HC-SR501人体感应模块的电路实现..............................................153.7舵机控制模块........................................................................................163.7.1舵机的特性.........................................................................................163.7.2舵机控制模块工作原理..............................................................