智能垃圾桶系统的设计摘要本篇文章针对目前我国国内目前垃圾箱发展缺陷设计了一种智能垃圾箱,这种垃圾箱的控制系统是基于STC89C52RC的。这种以单片机、RPR220光电传感器和超声波传感器为核心控制系统主要是由电机驱动模块、语音报警模块、光电感应模块、超声波测距电路等功能模块组成,并且该系统通过传感器来采集相关的距离信息后再由A/D转换让单片机发出指令,垃圾箱会在设定人与垃圾箱的距离,倘若超声波传感器检测到实际距离小于设定距离时自动翻盖。并且该控制系统会在RPR220光电检测到垃圾箱已满的情形下进行语音提示。通过理论与实践的结合,可知,本垃圾箱控制系统具有成本低、结构简单、智能化、操作简洁、性能稳定等优点,一定程度上弥补了我国智能垃圾箱系统的缺陷,对进一步隔开人与垃圾并防止细菌感染人类问题提供了一个可行性途径。关键词:单片机,超声波传感器,RPR220光电传感器,垃圾箱ﻬAProjectofIntelligentBinSystemABSTRACTIThisarticleinviewofthepresentdefectsatpresentdesignsakindofintelligentbinbasedonSTC89C52RC.Thesystemiswiththesinglechipprocessor,RPR220photoelectricsensorandultrasonicsensorsasthecorecontrolsystem.Itconsistsofpowercircuit,sensorcircuit,clockcircuitandvoicealarmmodule,etc.Usingthesensortocollectdistanceinformation,thentheinformationiscontrolledbyA/Dconversiontoissuecommands.,causestheSCMissuesaninstruction.Iftheultrasonicsensortodetecttheactualdistanceislessthanthesettingdistance,dustbinlidwouldopenautomatically.ThesystemwouldissueavoicemessageifRPR220photoelectricdetectsthatdustbinischock-full.Throughthecombinationoftheoryandpractice,weknowthatthissystemhasadvantagesoflowcost,simplestructure,intelligent,simpleoperationandstableperformance.Inaway,itmakesupdefectsoftheintelligentbincontrolsysteminChina.Itisafeasiblemethodtocompletelyisolatepeopleandrubbish,andpreventpeoplefrominfectingwiththebacteriaongarbage.KEYWORDS:singlechipmicrocomputer,Ultrasonicsensors,RPR220photoelectricsensors,dustbinII目录摘要ﻩIABSTRACT..................................................II1.绪论ﻩ11.1选题的意义............................................11.2研究现状及发展趋势ﻩ11.2.1研究现状...................................................11.2.2发展趋势ﻩ31.3课题研究的目标及内容.................................31.3.1研究目标ﻩ31.3.2研究内容ﻩ41.4本章小结ﻩ42.系统硬件电路..............................................52.1系统总体框架..........................................52.2单片机最小系统........................................52.2.1STC89C52RC单片机简介ﻩ52.2.2复位电路ﻩ72.2.3晶振电路...................................................82.3光电感应模块ﻩ82.4电机驱动模块.........................................92.5超声波测距模块......................................112.6语音模块ﻩ112.7电源模块............................................122.8本章小结ﻩ123.系统软件设计............................................143.1系统程序总体流程图ﻩ143.2超声波测距模块的程序设计...........................153.3控制电机正反转的程序设计ﻩ17III3.4本章小结ﻩ194.系统调试ﻩ204.1软件调试ﻩ204.2硬件调试.............................................204.3整体调试ﻩ205.实验结果及设计总结ﻩ225.1实验结果............................................225.2设计...