【正文】
本科畢業(yè)論文(設計) 題目:基于單片機的煙霧報警器的設計 姓 名: 韋阿俊 學 號: 1042051334 專 業(yè): 電子信息工程 院 系: 電子通信工程學院 指導老師: 秦永平 職稱學位: 副教授/碩士 完成時間: 2020 年 5 月 教務處制 安徽新華學院本科畢業(yè)論文(設計)獨創(chuàng)承諾書 本人按照畢業(yè)論文(設計)進度計劃積極開展實驗(調查) 研究活動,實事求是地做好實驗(調查)記錄,所呈交的畢業(yè)論文(設計)是我個人在導師指導下進行的研究工作及取得的研究成果。據(jù)我所知,除文中特別加以標注引用參考文獻資料外,論文(設計)中所有數(shù)據(jù)均為自己研究成果,不包含其他人已經(jīng)發(fā)表或撰寫過的研究成果。與我一同工作的同志對本研究所做的工作已在論文中作了明確說明并表示謝意。 畢業(yè)論文(設計)作者簽名: 日期: 安徽新華學院 2020 屆本科畢業(yè)論文(設計) I 基于單片機的煙霧報警器的設計 摘 要 隨著社會和經(jīng)濟的發(fā)展,防火工作無疑變得越來越重要了,但是目前國內的許多研發(fā)都在專注大型場所的火災報警。因此,我們很有必要設計一種結構簡單、經(jīng)濟實用的家庭煙霧報警器來滿足市場的需求?;诠┘彝ナ褂玫臒熿F報警器應該具備的基本要求和功能,因此設計了一種比較合理適用的煙霧報警器。 該設計以單片機 STC89C52 和傳感器 MQ2 作為煙霧報警器的核心元器件,并配合其它元器件來實現(xiàn)聲音報警等功能。設計中選用 STC89C52 單片機作為控制器,選用MQ2 型 半導體可燃氣體敏感元件傳感器來實現(xiàn)煙霧的檢測。煙霧報警器主要由模數(shù)轉換電路、單片機控制電路、聲音報警電路、煙霧信號采集及前置放大電路、安全保護電路和顯示電路構成,設計比較合理并且價格低廉、簡單易懂,使單片機在整個煙霧報警器系統(tǒng)控制中得到了較為充分的應用,并且具有很高的的實用價值。論文主要針對煙霧報警的各個功能以及組成部分進行詳細的介紹和說明,并對其外圍設備電路和主控電路之間的接口連接方式,以及系統(tǒng)軟件設計進行了重點的講解和分析。 關鍵字 : 煙霧報警器;單片機;傳感器 安徽新華學院 2020 屆本科畢業(yè)論文(設計) II The Design of Smoke Alarm Based on MCU Abstract With the development of society and economy, fire prevention is being more and more important. However, many of the Ramp。D in China focus on fire alarm for large scale places at present. Therefore, it is necessary to design a economical and practical family smoke detector of simple structure to meet the demand of the market. Based on the basic requirements and functions of smoke alarm for family use, this applicable smoke alarm is designed. Taking STC89C52 MCU and MQ2 sensor as the core ponents, the smoke alarm can realize the function of sound alarm and other functions with the help of other ponents and this design, STC89C52 MCU is chosen as the controller and MQ2 semiconductor inflambale gas sensitive ponent is used to realize the smoke detection. The device is mainly posed of analogtodigital conversion circuit, MCU control circuit, voice alarm circuit, smoke signal acquisition and preamplifier circuit, protection circuit and display circuit. The design at a low cost is rational and easy to understand. By making full use of MCU in the system control of the device, the design is of great practical value. Providing detailed introduction and explanation to the functions and positions of the smoke alarm, the paper elaborates on and analyzes the connection interface between the peripherals and major control circuits and the design of system software. Key Words: The Smoke Alarm; MCU; Sensor 安徽新華學院 2020 屆本科畢業(yè)論文(設計) 目 錄 1 緒 論 ......................................................................................................... 1 課題背景 ..................................................................................................... 1 設計概述 ..................................................................................................... 1 設計任務分析 ............................................................................................. 2 2 總體方案設計 ................................................................................................ 2 煙霧傳感器的介紹 ..................................................................................... 4 MQ2 半導體氣體煙霧傳感器 ................................................................. 4 STC89C52 單片機簡介 ............................................................................... 5 單片機的引腳功能描述 .......................................................................... 5 溫度采集模塊 ............................................................................................. 6 3 系統(tǒng)的硬件電路 ............................................................................................ 8 單片機最小系統(tǒng) ......................................................................................... 8 單片 機的時鐘電路與復位電路設計 .......................................................... 9 煙霧檢測 AD 采集電路 ........................................................................... 10 顯示模塊 ................................................................................................... 10 聲音報警電路 ............................................................................................11 按鍵控制電路 ........................................................................................... 12 電源模塊 ................................................................................................... 12 溫度傳感器 (DS18B20)電路 ..................................................................... 13 DSl8B20 具體參數(shù) ................................................................................. 14 安徽新華學院 2020 屆本科畢業(yè)論文(設計) DSl8B20 接口電路 ................................................................................. 15 4 系統(tǒng)軟件的設計 .......................................................................................... 17 STC89C52 系列單片機開發(fā)工具 .............................................................. 17 系統(tǒng)主程序設計及流程圖 ....................................................................... 17 主程序初始化流程圖 ............................................................................ 19 報警子程序設計及流程圖 ..................................................................... 19 按鍵輸入設計子程序流程圖 ................................................................. 20 5 調試 ............................................................................................................. 22 軟件調試的步 驟 ....................................................................................... 22