摘要随着经济和科学技术的快速发展,人们对生活质量的提高和生活环境的改善越来越重视,液化气、煤气进入家庭的使用为人们带来了方便,也改善了城市的环境,但同时也给人们带来了潜在的危险,其中一氧化碳是最主要的危险源。若管道和阀门密封不好,它们泄露出去,轻者引起中毒,重者造成火灾,危及人们的生命财产。由于这些原因,对于气体的检测与控制就变得很重要了,研究各种气体的检测方法与传感器也随之成为一个重要课题。本课题设计煤气报警采用了AT89C51单片机为报警器的核心部件,对煤气报警器进行控制。通过MQ-7一氧化碳气体传感器对煤气进行检测,当检测到有煤气泄漏,会发生报警信号,而且DS18B20温度检测装置也能监测温度的异常,从而实现对家用和工业煤气漏气的监控。整个系统的硬件电路设计合理,性能安全可靠。关键词:煤气检测单片机温度检测ABSTRACTWiththerapiddevelopmentofeconomyandthesciencetechnology,peoplebecomepaymoreandmoreattentiontothequalityoflifeandimprovingtheenvironment,andcoalgasusedintothefamilybringsconveniencetopeople,butalsotoimprovethepotentialdangers,includingtheriskofcarbonmonoxideisthemostimportantsource.Ifnotsealedpipesandvalves,gasleak,lightlycausespoisoning,heavilycausesfire,endangeringpeople'slivesandproperty.Forthesereasons,itisveryimportantforustoinspectandcontrolthesegaseswell,anditisobviouslyveryimportanttostudyontheinspectionmethodsandsensorsofallkindsofgases.Thispaperintroducesthedesignofacoalgasalarm’sdevicethatusestheAT89C51SCMasthemostimportantcontroller.ThroughtheMQ-7COgassensorgasdetection,whenthedetectionofthegasleakagehappens,alarmsignals,andtheDS18B20temperaturemonitoringdevicecanmonitortemperatureanomaly.Thenwecanmonitortheleakofcoalgasinthehouseandindustry.Thehardwaredesignofcircuitsisreasonableandtheperformanceofthecoalgasalarm’sdeviceissafeandreliable.Keywords:gasdetectionMCUtemperaturemonitoring目录1前言..............................................................................................................................................11.1课题背景.....................................................................................................................................11.2国内外发展状况和趋势..........................................................................................................11.3研究目标.....................................................................................................................................32元件介绍..............................................................................................................................................42.1AT89C51简介.............................................................................................................................42.2传感器MQ-7................................................................................................................................62.3DS18B20.......................................................................................................................................72.3.1DS18B20的主要特征............................................72.3.2DS18B20的内部结构............................................82.3.3DS18B20工作原理..............................................83硬件电路设计.........................................................103.1系统原理介绍......................................................103.2主控制电路设计....................................................113.3温度显示电路设计............................