毕业设计用纸共28页第I页摘要随着电子信息的快速发展,越来越多的电子设备应用在我们生活中。本次设以STC89C52单片机为控制核心,通过使用PM2.5检测传感器模块、LCD液晶显示模块、按键控制模块、报警模板,实现基于单片机的空气质量检测系统。本次设计主要针对的是解决检测空气中PM2.5的值,设计分为硬件设计和软件设计两个部分,软件设计主要是根据硬件需要实现的功能,按照软件流程图进行编码设计,硬件设计主要是按照不同的模块进行,把整体的硬件分成模块电路设计。软件设计中使用C语言作为单片机的开发语言,由于C语言是偏向于底层硬件语言,其比汇编更加通俗易懂,比高级语言更加适合对硬件的直接控制,而且具有很好的移植性。通过硬件和软件的设计系统可以实现对空气质量PM2.5的检测和显示,当系统检测空气中PM2.5的的浓度值高于正常标准时,报警模块将发出报警,当空气PM2.5浓度值低于报警阈值时,报警停止。本次设计空气检测仪操作简单、成本低、性能稳定、是只能家居的首选。关键字:单片机;PM2.5传感器;报警器;LCD显示器;毕业设计用纸共28页第II页ABSTRACTWiththedevelopmentofhighandnewtechnology,SCMhasbeenusedmoreandmoreindailyelectronicproducts.WiththeSTC89C52microcontrollerascontrolcore,throughtheuseofPM2.5sensormodule,LCDLCDmodule,keycontrolmodule,alarmtemplate,implementationofairqualitydetectingsystembasedonmcu.ThedesignoftheairqualitydetectioninstrumentbasedonMCUismainlydividedintothedesignofhardwarecircuitandsoftwareprogramofthepreparationofthetwopart,thehardwaredesignaccordingtotheoverallplanofsystemdiagramdesign,theoveralldesignofthehardwarecircuitisdividedintomodules.InthesoftwaredesignusesthemonolithicintegratedcircuitClanguagerealizationsystemthatthattheentireprocedurewrites,usestheClanguagetocarryontheprogrammingtobepossibletomaketheprogramreadabilitygood,andtheprocedureiseasytotransplant.ThroughthedesignofhardwareandsoftwarecanachievethemeasurementofairqualityinPM2.5andshowedthatwhentheconcentrationofthedetectionsystemofPM2.5intheairwashigherthanthenormalstandard,thealarmmodulewillgiveanalarmwhentheairPM2.5concentrationbelowthealarmthreshold,thealarmstops.Thedesignoftheairdetectorissimple,lowcost,stableperformance,istheonlychoiceforhome.KEYWORDS:MCU;PM2.5sensor;Alarm;LCDdisplay;毕业设计用纸共28页第III页目录摘要....................................................................................................................................IABSTRACT.....................................................................................................................II目录...............................................................................................................................III第一章绪论.....................................................................................................................51.1课题背景.....................................................................................................................51.2设计任务和基本要求.................................................................................................5第二章整体方案设计.....................................................................................................62.1设计内容介绍............................................................................................................62.2控制器选择................................................................................................................62.3显示模块选择.............................................................................................................62.4系统整体方案设计.....................................................................................................7第三章系统硬件设计.....................................................................................................83.1单片机电路设计.........................................................................................................83.1.1单片机的最小系统组成...................................................................................83.1.2单片机的时钟电路设计...................................................................................93.1.3单片机时钟复位电路设计...............................................................................93.2显示电路设计...........................................................................................................103.3PM2.5传感器电路设计...........................................................................................123.4报警电路设计..........................................................................................................133.5按键电路设计..........................................................................................................13第四章系统流程设计...................................................................................................154.1系统主流程设计......................................................................................................154.2按键流程设计..........................................................................................................16第五章仿真与调试.......................................................................................................185.1硬件调试..................................................................................................................185.2软件调试..................................................................................................................205.3仿真...........................................................................................................................21毕业设计用纸共28页第IV页5.3.1仿真软件介绍...............................................................................................215.3.2仿真结果...................................................................