天津工业大学2015届毕业论文
ADC_RES=0;//Clearpreviousresult
ADC_CONTR=ADC_POWER|ADC_SPEEDLL;//开AD电源,设置为最高速,最后三位为0P1^0作为AD输入delay(2);//ADCpower-onanddelay}//得到转换值u8GetADCResult()
{u8i;u16n;for(i=0;i<10;i++){ADC_RES=0;//高八位数据清零
ADC_CONTR|=ADC_START;//启动AD转换
while(!(ADC_CONTR&ADC_FLAG));//等待ADC_FLAG位置一,转换完成
ADC_CONTR&=0xe7;//关AD,清ADC_FLAG位n=n+ADC_RES;//只取八位}
returnn/10;//取10次转换结果的平均值}
u8ppm_v(u8ad)//返回ppm值{floatvo;u8i;
vo=ad/51.2;//八位转换结果,得到电压值for(i=0;i<24;i++){
if(vo {if(i==0)returnppm[i];if((vo-vin[i-1])<(vin[i]-vo))returnppm[i-1];else returnppm[i];} return75;//最高测75ppm} 4.3本章小结 选择适当的汇编语言,对各模块画出流程图并进行编程,做出仿真,在对仿真进行调试,实现各模块的功能。 25 天津工业大学2015届毕业论文 第五章总结与展望 随着大家生活水平的不断提高,对室内的环境质量要求也明显提高,室内不仅是家庭团聚和生活的场所,而且还是生活的重要物质保障,但是随着生活用品多元化和各种装修材料的大量使用,家庭环境的危险系数大幅度提高。本系统实现了声光报警、换气扇的启动及阀门的开断,温湿度及有害气体的检测功能。本设计内容如下: 1、为达到监测甲醛浓度、环境温湿度和燃气浓度的采集与存储的功能,我们将采用单片机控制技术和传感技术才能达到检测的效果。 2、利用蜂鸣器报警功能,在甲醛浓度值和温度变量湿度变量超过标准值时,实现自动报警功能。通过LED数码显示技术实时显示出环境的温湿度及显示电路的设计。 3、依靠发光二极管遥感性强的特点对有害气体浓度超过安全值时或者温湿度超过设定值时报警。 4、采用单片机简单易操作的特点控制启动换气扇和关闭燃气阀门。通过近一段时间的研究发现还有一些不足,在以后的工作中,当燃气泄漏时可设置无线通信装置,一方面可以及时联系维修人员,另一方面可以快速控制阀门以减小人员伤亡。为了达到操作简单快捷的目的,所以该装置的发展方向是变得更加智能化。 26 天津工业大学2015届毕业论文 参考文献 [1]刑凯.基于单片机的室内环境监测系统设计与应用,广西民族大学,2014.[2]贾劲松.室内环境检测技术.北京:中国环境科学出版社,2009.[3]白志鹏.室内空气污染与防治·北京:化学工业出版社,2006. [4]姚营营.基于MSP430单片机的环境监测设计[D].大连交通大学,2010. [5]杨晨.基于ARM11和Linux的室内环境监测系统的设计与实现[D]).沈阳:沈阳工业大 学,2013. [6]刘威.基于DS18B20和nRF9E5的多点无线测温系统[D].长春:吉林大学,2010.[7]王绍杰.列车车厢环境监测系统设计与实现[D].成都:西南交通大学,2011.[8] Chao-TungYang,Chi-JuiLiao,Jung-ChunLiu.ConstructionandApplicationofanIntelligentAirQualityMonitoringSystemforHealthcareEnvironment[J].JournalofMedicalSystems,2014,Vol,38(2),pp.1-10.[9] S.Zampolli,I.Elmi,F.Ahmed,M.Passini.Anelectrionicnosebasedonsolidstatesensorarraysforlow-costindoorairqualitymonitoringapplications[J].Sensors&Actuators:B.Chemical,2004,Vol.101(1),pp.39-46.[10] StudyonanAgriculturalEnvironmentMonitoringServerSystemusingWirelessSensorNetworks[J].Sensors,2010,10(12),pp.11189. [11]刘文凯.室内环境空气质量监测技术规范研究[D].北京:清华大学,2004.[12]北京华运安特科技有限责任公司.气体检测仪产品[M].[13]褚家美.无线传感器网络的硬件设计.南京大学学报.2010 [14]毛春奎.基于CAN总线的自动气象站系统的研究与开发:[硕士学位论文].南京:南京 信息工程大学,2010 [15]宋小坚.可燃气体传感器研究进展.煤气与热力,2010,第30卷第5期[16]马天.甲醛分析仪现场检测技术[J].中国测试技术.2005年05期 [17]罗亚萍.基于AT89C52单片机的室内有害气体监控系统.山西电子技术.2011[18]袁易君.基于单片机室内恒温系统的设计.现代企业文化.2008 [19]徐晓辉.电气火灾报警系统及其信号处理:[硕士学位论文].杭州:浙江大学,2007[20]许鹏翔.基于单片机的燃气预警设计.数字技术应用.2010[21] HamldStone.MieroeomPuterInterfaeing.UniversityofMassachusetts.Amhorst.Addisonwesle.1982. [22]陈洪财.单片机原理与应用技术.哈尔滨工程出版社,2014 [23]孙育才.ATME新型AT89S52系列单片机及其应用.北京:清华大学出版社.2005.53-57[23]杨俊.单片机原理与实践教程.-北京:清华大学出版社,2011[24]何钦铭.C语言程序设计.-北京:高等教育出版社,2008 [25]王志宏.基于DHT11的实验室多点温湿度报警系统设计.山西电子技术.2011 27 天津工业大学2015届毕业论文 附录一:英文原文 DesignofIndoorTemperatureandHumidityMonitoringSystemBasedonCC2430andFuzzy-PIDAbstract-Aimingattheactualdemandofenvironmentalinformationmonitoring,anindoortemperatureandhumiditymonitoringsystembasedonfuzzy-PIDstrategyisdesigned.ThesystemusesCC2430asthecoretodevelopwirelesssensornodeswhichfollowtheZigBeecommunicationprotocol,usesthedatacollectionterminalwithhigh-precisiontemperatureandhumiditysensortocollecttemperatureandhumiditydataoftheenvironment,usesZigBeetechnologytoachievenetworkingofwirelesssensorsandtheautomaticaggregationofmonitoringdata,andusesthefuzzyPIDcontrolalgorithmtoimprovetheaccuracyoftestdata.TheindoortemperatureandhumidityregulationisachievedbasedonfuzzyPIDcontroltechnology.Themanagementfunctionofvarioussensornodesandalargenumberofenvironmentaldataisachievedbasedonembeddeddatabase.Themonitoringresultsfortemperatureandhumidityhaveshownthatthissystemisstable,highreliableindatatransmissionandeasytouse,andcanbewidelyusedinvariousareasofautomaticmonitoringofenvironmentalparameters Keywords-CC2430;FUZ7J'-PIDStrategy;TemperatureandHumidityMonitoring I.INTRODUCTION People'sdailylifeiscloselyrelatedtotemperatureandhumidityofthesurroundingenvironment,andtherearealsohigherrequirementsfortemperatureandhumidityinindustry,agricultureandotherfields.Therefore,ithasbecomeaveryimportanttechnologyonthetemperatureandhumiditymonitoringandcontrolintheproductionprocess.Thelayoutoftraditionalindoortemperatureandhumiditymonitoringsystemaremostlywiredcommunication,suchasfieldbus,distributedcontrolbus,whichiscomplicatedwiringandisnotconducivetochangeandmaintainthesystemlayout.Therapiddevelopmentofembeddedsystemsprovidesanewideaforthedevelopmentofindoortemperatureandhumiditycontrolsystem.Therapiddevelopmentofwirelessnetworksmakestheremotedatatransmissionwidelyused.Usingawirelesssensornetworktobuildthemonitoringsystemhastheadvantagesofeasydeploymentandlowcost,caneffectivelyachieveenvironmental 28 天津工业大学2015届毕业论文 informationcollectionandtransmission,andcantimelyadjustmanagementstrategies,whichcanprovideanovel,low-costsolutionforthedetectionofindoorenvironmentalparameters. Anindoortemperatureandhumidityintelligentcontrolsystemisdesignedusingwirelesssensornetworktechnology,advancedcomputertechnology,microprocessorcontroltechnologyandintelligentsensordataacquisitiontechnology.DatacollectionterminalismadeupoftheCC2430wirelesscommunicationmodules,whichcanmonitorcontinuouslyon-siteenvironmentaltemperatureandhumidityinreal-time.FuzzyPIDcontrolalgorithmisappliedtoprocessparametervalues,whichimprovethecontrolaccuracy.ThePCinthemonitoringcentercaneffectivelycontrolthedatacollectionterminalandcandisplay,storage,analysisandprocessdatainreal-time,whichachievethecontrolpurposestotheindoorenvironmentalparameters. II.OVERALLDESIGNOFMONITORINGSYSTEM A.SystemRequirementsAnalysis Thecontrolledobjects,suchastemperatureandhumidityinindoorenvironment,havethecharacteristicsoflongdelayandlargeinertiaandsoon.Throughinvestigationandanalysis,theapplicationsofenvironmentalmonitoringsystemincludethatthefactorsofenvironmentaresampledandprocessedinreal-timein24hoursandputintoadatabaseforthequery,thesampleddataaretransmittedandaggregatedinreal-timebylow-cost,low-powerwirelesscommunicationinordertoprovidediagnosis,limitalarmfunction,theintuitivesystemmanagementplatformisprovidedtocompletefunctionssuchassensormanagement,environmentalinformationprocessing,storage,analysisandsoon,informationisprocessedonthebasisofthedetection,andcontrolsignalsareformattedandoutputbasedonpredeterminedcontrolstrategy.B.SystemArchitectureDesign TheoverallstructureofsystemisshowninFigure1,whichisbasedonZigBeetreetopologyandincludessensornodescomposedofZigBeeterminalnodes,gatewaynodesservedbytheZigBeecoordinator,andthemonitoringcentercomposedofaPCandrelatedmanagementsoftware.Thetaskofsensornodeistocollectindoortemperatureandhumidityandtransmitthedatatothegatewaynode.Gatewaynodeisresponsibleforreceivingdatainformationandcommunicatingwiththemonitoringcenterbytheserialport.Themonitoringcenterprovidesagraphicaloperatingenvironmentanddisplaysdataforthestafftoquery. 29