摘要由于经济的快速发展,人们的生活水平越来越高,私家车也越来越多,酒后驾车行为所造成事故也就越来越普遍,对社会的安定和经济发展也造成了很大的影响,酒精正在成为越来越凶残的“马路杀手”。为此,我国将酒驾列入了刑法范围内,那么就需要设计一个智能仪器能够检测驾驶员体内酒精含量。本课题设计的是一种以酒精浓度传感器、单片机和A/D转换器为主的,检测驾驶员呼出气体的酒精浓度的,而且还带有声光报警功能的酒精浓度检测仪。这种检测仪不仅可以检测出空气环境中酒精浓度值,还可以由不同的环境来设定不同的阈值,当空气中酒精浓度超过设定的阈值时进行声光报警。我的这个毕业设计分主要为两部分:硬件设计部分和软件设计部分。硬件设计部分是利用MQ3气敏传感器先测量空气中的酒精浓度,然后转换为电压信号,再通过A/D转换器转换成数字信号后再传给单片机系统,最后由单片机系统和相应外围电路进行信号处理,并由LCD显示酒精浓度值并且对超过的阈值进行报警。软件设计部分的程序采用的是模块化设计思想,各个子程序的功能相对独立,便于调试和修改。电路可分为单片机小系统电路、A/D转换电路、声光报警电路、LCD显示电路,按键电路。各部分电路的设计及原理图将会在硬件电路设计部分作出详细的介绍。关键词酒精浓度传感器(MQ3),A/D转换器,软件设计,硬件设计攀枝花学院本科毕业设计(论文)ABSTRACTIIABSTRACTDuetotherapiddevelopmentofeconomy,people'sstandardoflivingishigherandhigher,moreandmoreprivatecars,theaccidentcausedbydrunkendrivingbehaviorareincreasinglycommon,socialstabilityandeconomicdevelopmentalsocausedgreatinfluence,alcoholisbecomingincreasinglyviolentroadkiller.Tothisend,Chinawilldrunkdrivingintothescopeofcriminallaw,youwillneedtodesignaintelligentinstrumentcandetectdriver'salcoholcontentinthebody.ThistopicdesignisAkindoftoalcoholconcentrationsensorandsinglechipmicrocomputerA/Dconverter,Adriverexhaledgasalcoholconcentration,alcoholconcentrationmonitorwithsoundandlightalarmisandair.itcandetectthealcoholdensityintheairenvironment,alsocanaccordingtothedifferentenvironmentsetdifferentthreshold,thethresholdvalueofmorethanaudibleandvisualalarm.Thistopicisdividedintotwoparts:hardwaredesignandsoftwaredesignpart.thehardwarepartisusingMQ3gassensorsmeasurethealcoholconcentrationintheair,andconvertedintovoltagesignal,afterA/DconverterconvertedintoAdigitalsignaltotheSCMsystem,bysingle-chipmicrocomputeranditscorrespondingperipheralcircuitforsignalprocessing,displaythealcoholdensityandultraaudibleandvisiblealarmthreshold.programadoptsmodulardesignthought,functionofeachsubroutineisrelativelyindependent,easytodebugandmodify.Thehardwarecircuitcanbedividedintothesinglechipprocessorsystemcircuit,A/Dconversioncircuit,soundandlightalarmcircuit,LEDdisplaycircuit,keycircuit.Theprinciplediagramofthecircuitdesignofeachpartandwillbeinthehardwarecircuitdesignpartmakeadetailedintroduction.KeywordsAlcoholconcentrationsensor(MQ3),A/Dconverter,Softwaredesign,Hardwaredesign攀枝花学院本科毕业设计(论文)目录1目录摘要····························1ABSTRACT······················································································II1绪论························································································31.1课题的研究背景、发展历史及意义····················································31.2本课题研究的主要内容·································································42酒精浓度测试仪的硬件设计··························································52.1总体设计框图············································································52.289C51单片机············································································52.2.189C51单片机功能简介........................................................................52.2.289C51单片机片内结构介绍....................................62.2.389C51芯片介绍..............................................72.2.4晶振电路和复位电路...........................................................................92.3MQ303A酒精传感器····································································102.3.1MQ303A酒精传感器简介....................................................................102.3.2MQ303A酒精传感器特点....................................................................122.3.3MQ303A酒精传感器的工作条件及环境...............................................122.3.4MQ303A酒精传感器使用方法.............................................................132.4A/D转换设计··········································································142.5LCD显示电路··········································································152.5.1液晶显示器的优点...........................................................................152.5.2LCD1602液晶显示............................................................................162.6报警电路.........................................................................................................173酒精浓度测试仪的软件设计························································183.1编译语言的选择...............................................................................................183.2主程序设计......................................................................................................183.3子程序设计......................................................................................................194PROTEUS仿真结果与分析····························································204.1PROTEUS简介.....................................................................................................20攀枝花学院本科毕业设计(论文)目录24.2仿真过程.........................................................................................................205结论······················································································23参考文献················································································24附录1·························································································25致谢·················