学号:201057308002分类号:TN911硕士学位论文基于STM32的智能家居系统研究生姓名:刘鹏飞指导教师:刘云学副教授学科门类:工学专业名称:信号与信息处理论文提交日期:2013年04月烟台大学硕士学位论文I摘要随着经济的不断发展和生活水平的不断提高,人们对个人人身、财产的安全以及生活和工作环境的质量越来越关注。为了给用户提供一个安全舒适的生活环境,安全可靠的智能家居系统成为必然选择。传统的自动化设施已经不能满足现今的需求,于是各种新型的智能家居系统应运而生。本文设计了一种将智能报警与开窗电机相结合的系统,不仅实现了智能报警的功能,还实现了由微控制器根据传感器信息控制窗的开、关,从而调节环境的目的。同时着重对系统中的电气隔离,过压和过流保护,遥控器收发,GSM模块收发信息,电机驱动控制,液晶显示,电池充电等部分的硬件电路和相应软件进行了介绍。系统以STM32F103为控制核心,通过分析各传感器信息、GSM模块接收的信息与用户通过人机界面的操作信息,向电机模块发送相应的动作命令(控制开关窗户),同时将危险报警信息通过GSM模块发送至用户手机,以保证居住的舒适性及安全性。系统采用多种保护措施和隔离措施,并加入了备用电源以保证掉电后开、关窗操作仍然能够得到执行,如此不仅使整个系统具了有很强的抗干扰能力及很高的可靠性,也拓宽了系统的应用领域。在软件设计中将系统功能划分为多个任务,按任务重要性划分优先级,这样既保证了任务的可靠执行,也提高了系统的实时性。由此使本方案可适用于智能家居及智能农业等多种领域。关键词:STM32F103;智能家居;GSM模块;传感器;烟台大学硕士学位论文IIAbstractWiththedevelopmentofeconomyandtheimprovementoflifequality,personalandpropertysafety,aswellasthequalityoflifeandworkenvironmenthavebeenpaidmoreattentionto.ReliableSmarthomesystemsarebecomingmoreandmoreimportant.Newtypesofsmarthomesystemaregeneratedtosatisfythecurrentneedsinsteadofthetraditionalautomatedfacilities.Asystemthatcombinesintelligentalarmsystemwithwindowopeningmachineisdesigned,withthefunctionofintelligentalarmandlowriskcoefficientreceivedbycontrollingtheswitchofthewindowthroughanalyzingthesensorinformation.Emphasisontheanalysisofhardwareandsoftwaredesignofelectricalisolation,over-voltageandover-currentprotection,remotecontrol,GSMmodule,motorcontrol,LCDdisplayandbatterycharging,etc.Combiningthemodernsensortechnologiestothemoderninformationprocessingtechnologies,asmarthomesystembasedonSTM32F103isdeveloped.Thesystemanalyzesinformationfromsensors,GSMmoduleandhuman-computerinterface,thencontrolmotormodulestoopenandshutdowncorrespondingwindows.Atthesametime,warninginformationissenttouser’smobilephonebyusingshortmessage.Inthisway,user’ssecurityandcomfortcanbeguaranteed.Moreover,multipleprotectivemeasuresandisolationmeasuresaretaken,andstandbyelectricpowerisswitchedonwhenACpoweroff.Sonotonlymakethewholesystemhasstronganti-interferenceabilityandhighreliability,andexpandtheapplicationfieldofthesystem.Insoftwaredesign,systemfunctionisdividedintomultipletasks,andaccordingtotheimportanceofthetasksassignedtothempriority,bothtoensurethereliabletaskexecution,andimprovethereal-timeperformanceofthesystem.SothatthissystemcanbeappliedtoIntelligentAgricultureandotherrelatedfields.Keywords:STM32F103;smarthomesystem;GSMmodule;sensor;烟台大学硕士学位论文III目录摘要.............................................................................IAbstract........................................................................II1绪论............................................................................11.1国内外智能家居系统的现状.................................................11.1.1国外现状...........................................................11.1.2国内现状...........................................................21.2研究目的及意义...........................................................21.3论文主要工作.............................................................32系统总体设计与系统隔离介绍......................................................42.1系统设计需求.............................................................42.2系统整体设计原则.........................................................42.3系统整体设计结构.........................................................52.4电气隔离介绍.............................................................62.4.1供电系统的隔离.....................................................72.4.2数字信号的隔离.....................................................82.3.3模拟信号的隔离....................................................112.3传感器介绍.............................................................122.4开窗机简介.............................................................142.5系统整体方案设计小结....................................................153系统硬件电路设计..............................................................163.1系统硬件电路整体结构....................................................163.2智能家居系统中隔离设计..............................................173.3主控制芯片简介..........................................................173.4系统供电结构............................................................183.4.1开关电源设计......................................................193.4.2DC/DC隔离降压模块................................................203.4.35V离降压电路.....................................................213.4.412VDC降压电路....................................................213.5外部看门狗.............................................................223.6传感器接口.............................................................223.7433MHz遥控器功能.......................................................243.7.1HCS300编码器简介.................................................243.7.2对HCS300编程.....................................................253.7.3HCS300编码过程...................................................273.7.4解码过程..........................................................293.8LCD界面显示............................................................333.8.1液晶显示..........................................................333.8.2按键设计.....................................