【正文】
摘 要 當今社會上,出現(xiàn)了許多煤氣報警器,而這些產(chǎn)品大都是針對煤氣的泄漏所做出的相應的報警, 即為家庭式煤氣報警器。本課題設計煤氣報警采用了 AT89S52 單片機為報警器的核心部件,對煤氣報警器進行控制 。通過對偏差信號的處理獲得控制信號,發(fā)生報警信號,并把報警通道顯示并儲存在 DS12887 的 RAM 中,八個單元的煤氣濃度對應模擬量利用 A/D 轉換為數(shù)字量,并加入了鍵盤輸入控制, 從而實現(xiàn)對家用和工 業(yè)煤氣漏氣的監(jiān)控。 關鍵詞 :單片機 煤氣濃度 報警器 II Design of the coal gas’ alarm device ABSTRACT There are many coal gas alarm’s devices in our lives. These devices will alarm after the coal gas leaking. We call them household or industy appliances. This paper introduces the design of a coal gas alarm’s device that use the AT89S52 SCM as the most important controller. It is a coreponents that control the whole programs and circuit of the coal gas alarm’ device. The appliance monitors the density of coal gas with the sensor of NAP505 and pares the current density with the setting density. We get the control signal through the dealing with the deviation signal and then sent a alarm signal that is memoried in a RAM of DS12887. The analog signal of eight densities of the coal gas are transformed into the digital signal with the A/D converter, in addition which is cotrolled with the keyboard. We can monitor the leak of coal gas in the house or industy. The hardware design of circuits is reasonable and the performance of the coal gas alarm’s device is safe and reliable. Keywords: SCM Density Alarm’ device III 目 錄 摘 要 ............................................................................................................ I ABSTRACT ............................................................................................... II 1 前言 ........................................................................................................ 1 研究背景 ................................................................................................. 1 研究意義 ................................................................................................. 2 研究內(nèi)容 ................................................................................................. 2 2 系統(tǒng)總體設 計 ....................................................................................... 3 方案的選擇 ............................................................................................. 3 系統(tǒng)流程框圖 ......................................................................................... 3 3 硬件系統(tǒng)設計 與傳感器選用 .............................................................. 4 主機部分 ................................................................................................. 4 單片機 ................................................................................... 4 實時時鐘芯片及其電路 ........................................................ 6 看門狗定時器及復位電路 ........................................................ 8 電源電路 ............................................................................................. 9 功能模塊部分 ......................................................................................... 9 的數(shù)據(jù)采集單元 ................................................................. 10 的人機接口電路模塊 ........................................................... 12 數(shù)據(jù)處理模塊 .................................................................................... 15 聲光報警模塊 .................................................................................... 16 IV 下載電路 DIY .............................................................................. 17 傳感器的選 用 ....................................................................................... 18 型電化學式傳感器 ............................................................. 19 半導體氣體傳感器 ................................................................... 20 硬件設計小結 ....................................................................................... 22 4 軟件設 計 .............................................................................................. 23 主程序設計 ........................................................................................... 23 初始化程序和主程序 ........................................................................ 23 中斷服務程序 .................................................................................... 27 功能實現(xiàn)主要子程序 ........................................................................... 28 采集程序 ............................................................................................ 28 數(shù)據(jù)處理模塊 .................................................................................... 30 報警記錄和報警模塊 ........................................................................ 31 人機對話子程序設計 ........................................................................ 31 小結 ...................................................................................................... 34 5 系統(tǒng)調(diào)試與分析 ................................................................................. 35 硬件焊接與調(diào)試 ................................................................................... 35 軟件調(diào)試 ............................................................................................... 36 系統(tǒng)調(diào)試 ............................................................................................... 38 小結 ...................................................................................................... 39 參考文獻 .................................................................................................... 40 附 錄 1 程序源代碼 ............................................... 錯誤 !未定義書簽。 附 錄 3 元器件清單 ............................................... 錯誤 !未定義書簽。 1 1 前言 研究背景 隨著我國燃氣的變革及西氣 東輸工程的進行,煤氣或天燃氣已成為多數(shù)家庭的燃料。所以怎樣防止煤氣中毒與爆炸已成為人們的迫切需要。 計算機的普及和信息技術的迅猛發(fā)展,人們己不滿足于傳統(tǒng)的居住環(huán)境,對家庭及住宅小區(qū)提出了更高的要求,智能化被引入家庭,并迅速在世界各地發(fā)展起來。 家庭及住宅小區(qū)智能化的定義,在國際上至今尚無一致的般認為,在現(xiàn)代化的城鄉(xiāng)住宅小區(qū)內(nèi)綜合采用微型計算機、自動控制、通信與網(wǎng)絡及智能卡等技術,建立一個由住宅小區(qū)綜合物業(yè)管理中心與安防系統(tǒng)、信息通信服務與管理系統(tǒng)和家庭智能化系統(tǒng)組成的“三合一”住宅小區(qū)服務與管理集成系統(tǒng),最終目