【正文】
基于單片機(jī)的多氣體濃度測(cè)試儀摘要近些年來,我國(guó)經(jīng)濟(jì)快速發(fā)展,人民生活水平日益提高,全國(guó)機(jī)動(dòng)車輛數(shù)量和駕駛員人數(shù)猛增,醉酒駕車造成嚴(yán)重后果的違法犯罪也日益增多,給社會(huì)和廣大人民群眾生命、健康造成嚴(yán)重危害。2000年以來,酒后駕車行為所造成事故越來越多,對(duì)社會(huì)的影響也越來越大,酒精逐漸成為兇殘的“馬路殺手”。據(jù)有關(guān)資料統(tǒng)計(jì),全世界每年因車禍喪生的人數(shù)就超過60萬(wàn)人,留下永久性傷殘者在400萬(wàn)以上,一般受傷者則不計(jì)其數(shù)。在許多國(guó)家,車禍已成為第一位意外死亡原因。另外,交通事故所造成的經(jīng)濟(jì)損失也相當(dāng)驚人。據(jù)統(tǒng)計(jì),大約50%—60%的車禍與飲酒有關(guān)。中國(guó)公安部門在2009年8月,在全國(guó)各地加強(qiáng)查處酒后駕駛的力度,以減少由酒后駕駛造成的惡性交通事故。要查處就涉及到檢測(cè)人體內(nèi)的酒精含量和使用設(shè)備來進(jìn)行檢測(cè)的問題。近年來我國(guó)煤炭工業(yè)的安全生產(chǎn)狀況不容樂觀,中小型煤礦的情況尤為嚴(yán)重,已經(jīng)直接威脅到整個(gè)煤炭工業(yè)的穩(wěn)定生產(chǎn),給國(guó)家財(cái)產(chǎn)和人民生命造成了很大的損失,作為“萬(wàn)惡之首”的甲烷爆炸事故更是重大事故發(fā)生率之首。出于安全考慮,甲烷濃度的測(cè)量,顯得尤為重要?;谝陨峡梢钥闯觯嘘P(guān)氣體的濃度檢測(cè)問題,至關(guān)重要。本文研究設(shè)計(jì)了一種可以測(cè)量多種氣體濃度,并可以進(jìn)行超限報(bào)警的智能測(cè)試儀。其設(shè)計(jì)方案基于STC89C52單片機(jī),MQ3酒精濃度傳感器,MQ4甲烷濃度傳感器。系統(tǒng)將傳感器回路輸出的信號(hào)通過以AD0832為核心的A/D轉(zhuǎn)換電路調(diào)理后,經(jīng)由單片機(jī)進(jìn)行數(shù)據(jù)處理,由LCD顯示酒精濃度值。并設(shè)計(jì)一定的限值,超限聲光報(bào)警。限值可由按鍵調(diào)整??紤]到單片機(jī)計(jì)算能力有限,難以進(jìn)行復(fù)雜數(shù)據(jù)處理,故單片機(jī)系統(tǒng)與PC機(jī)系統(tǒng)通過RS232串行通信端口進(jìn)行互連,從而單片機(jī)用作下位機(jī)進(jìn)行數(shù)據(jù)采集和設(shè)備控制,而PC機(jī)用做上位機(jī)進(jìn)行復(fù)雜的數(shù)據(jù)處理和對(duì)單片機(jī)的控制。文中詳細(xì)介紹了數(shù)據(jù)采集子系統(tǒng)、數(shù)據(jù)處理過程以及數(shù)據(jù)顯示子系統(tǒng)和報(bào)警電路、單片機(jī)與PC機(jī)通信的軟硬件實(shí)現(xiàn)的設(shè)計(jì)方法和過程。系統(tǒng)對(duì)于采樣地點(diǎn)超出規(guī)定的指定氣體濃度時(shí),通過聲光報(bào)警電路提醒監(jiān)測(cè)人員。同時(shí),操作人員對(duì)于具體報(bào)警點(diǎn)的上限值可以通過單片機(jī)編程進(jìn)行設(shè)置。關(guān)鍵詞:酒精濃度傳感器(MQ3)、甲烷濃度傳感器(MC113)、STC89C5A/D轉(zhuǎn)換器、數(shù)據(jù)選擇器(74HC4051)、串口通信、RS23VB;AbstractIn recent years, China39。s rapid economic development, increasing people39。s standard of living, the number of motor vehicles and drivers has soared, drunk driving has caused serious consequences of illegal crime is also increasing, to the society and the life of the masses, causing serious harm to health. Since 2000, drinking and driving behavior caused by increasing number of accidents, on the social impact is also growing, alcohol has bee fierce killer on the road. According to the statistics, the whole world because of traffic accident every year the number of people killed more than 600000 people, left permanently disabled in 4000000 above, general injuries are too many to count. In many countries, traffic accident has bee the first cause of accidental death. In addition, the traffic accidents caused by the economic loss is quite amazing. According to statistics, approximately 50% 60% of the accidents are related to alcohol. China public security departments in 2009August, throughout the country to strengthen and driving force, so as to reduce the driving caused by malignant traffic accident. To investigate the related to detection of human with an alcohol content and the use of equipment to detect problem.In recent years, industry of our country coal production safety situation is not optimistic, middle and small coal mine situation is particularly serious, has a direct threat to the stable production of the whole coal industry, to the national property and people39。s lives and caused great damage, as the worst of all evils methane explosion is a major accident rate in the first. For security reasons, the methane concentration measurement, appear particularly on the above, the gas concentration detection problem, critical. This paper studied and designed a variety of gas concentration can be measured, and can alarm intelligent tester. The design scheme based on STC89C52 MCU, MQ3 alcohol concentration sensor, MQ4 methane concentration sensor. System circuit of the sensor output signals from the AD0832 as the core of the A / D conversion circuit after conditioning, through the singlechip microputer for data processing, LCD display by the alcohol concentration value. And the design of certain limits, overrun alarm. Limit value by the keys to adjust. Considering the SCM calculation ability is limited, to plex data processing, so singlechip system and PC system through the RS232 serial munication port interconnect, thereby SCM as the next bit machine data acquisition and control equipment, and the machine used PC do PC for plex data processing and the SCM control. This paper introduces the data acquisition subsystem, data processing and data display system and alarm circuit, SCM and PC munication hardware and software to achieve the design method and process. System for sampling locations beyond the prescribed specified gas concentrations, through sound and light alarm circuit to remind staff monitoring. At the same time, the operator for a specific alarm limit values can be set through the singlechip programming.Key words: alcohol oncentration sensor (MQ3), methane concentration sensor ( MC113), STC89C52, A/D converter,Dataelector (74HC4051), serial munication, RS232,VB。目錄引言 1第1章 前言 2 2 3 3 4 單片機(jī)與PC機(jī)串行通信研究背景和意義 5 5第2章 方案器件簡(jiǎn)介 6 MCU簡(jiǎn)介 6 模數(shù)轉(zhuǎn)換器簡(jiǎn)介 9 12 電源電平轉(zhuǎn)換芯片(TTL電平轉(zhuǎn)RS232電平) 13 數(shù)據(jù)選擇器 13第3章 串口通信基礎(chǔ)理論 14 兩種常用接口方式 14.并行接口 14.串行接口 14 RS232串行接口標(biāo)準(zhǔn) 15 VB編程過程中使用到的MSComm控件 16. MSComm控件處理通信的方式 16.MSComm控件的主要屬性 16第4章 總體方案設(shè)計(jì) 18 STC89C52 MCU 19 ADC0832數(shù)模轉(zhuǎn)換 19 LCD1602液晶顯示 19 MAX232 21 數(shù)據(jù)選擇器 74HC4051 21 用于串口轉(zhuǎn)USB的芯片CP2102(實(shí)際使用) 22 23第5章 硬件設(shè)計(jì) 25 最小系統(tǒng)的實(shí)現(xiàn) 25 信號(hào)采集電路 27 MC113及其測(cè)量電路的特點(diǎn) 27 MQ3特點(diǎn)及其測(cè)量電路原理 29 32 A/D轉(zhuǎn)換設(shè)計(jì) 33 按鍵設(shè)計(jì) 34 LCD1602液晶顯示設(shè)計(jì) 35 報(bào)警線路設(shè)計(jì) 36 電源電路設(shè)計(jì) 37 差動(dòng)放大器與濾波電路設(shè)計(jì) 37 串口與USB互轉(zhuǎn)電路設(shè)計(jì)(實(shí)際使用) 38第6章 軟件設(shè)計(jì) 39 編譯語(yǔ)言的選擇 39 程序設(shè)計(jì) 39 AD轉(zhuǎn)換模塊 39 按鍵模塊 40 41PC機(jī)程序設(shè)計(jì) 41 VB應(yīng)用界面設(shè)計(jì)流程 41 41 42 43第7章 系統(tǒng)調(diào)試 44 軟件仿真 44 硬件調(diào)試 45第8章 結(jié)束語(yǔ) 50第9章 致謝 51參考文獻(xiàn) 52附錄一 :proteus仿真原理圖 53附錄二 PCB圖 54附錄三 :硬件設(shè)計(jì)原理圖 55附錄四:?jiǎn)纹瑱C(jī)程序 56附錄五:PC機(jī)程序 66III成都理工大學(xué)2012屆本科畢業(yè)設(shè)計(jì)(論文)引言隨著我國(guó)經(jīng)濟(jì)的快速發(fā)展,人民生活水平日益提高,全國(guó)機(jī)動(dòng)車輛數(shù)量和駕駛員人數(shù)猛增,醉酒駕車造成嚴(yán)重后果的違法犯罪也日益增多,給社會(huì)和廣大人民群眾生命、健康造成嚴(yán)重危害。2000年以來,酒后駕車行為所造成事故越來越多,對(duì)社會(huì)的影響也越來越大,酒精逐漸成為兇殘的“馬路殺手”。在許多國(guó)家,車禍已成為第一位意外死亡原因。另外,交通事故所造成的經(jīng)濟(jì)損失也相當(dāng)驚人。據(jù)統(tǒng)計(jì),大約50%—60%的車禍與飲酒有關(guān)。中國(guó)公安部門在2009年8月,在全國(guó)各地加強(qiáng)查處酒后駕駛的力度,以減少由酒后駕駛造成的惡性交通事故。要查處就涉及到檢測(cè)人體內(nèi)的酒精含量和使用設(shè)備來進(jìn)行檢測(cè)的問題。近年來我國(guó)煤炭工業(yè)的安全生產(chǎn)狀況不容樂觀,中小型煤礦的情況尤為嚴(yán)重,已經(jīng)直接威脅到整個(gè)煤炭工業(yè)的穩(wěn)定生產(chǎn),給國(guó)家財(cái)產(chǎn)和人民生命造成了很大的損失,作為“萬(wàn)惡之首”的甲烷爆炸事故更是重大事故發(fā)生率之首。出于安全考慮,甲烷濃度的測(cè)量,顯得尤為重要?;谝陨峡梢钥闯觯嘘P(guān)氣體的濃度檢測(cè)問題顯得尤為重要。本文研究設(shè)計(jì)了一種可以測(cè)量多種氣體濃度,并可以進(jìn)行超限報(bào)警的智能測(cè)試儀。其設(shè)計(jì)方案基于STC89C52單片機(jī),MQ3酒精濃度傳感器,MQ4甲烷濃度傳感器。系統(tǒng)將傳感器回路輸出的信號(hào)通過以AD0832為核心的A/D轉(zhuǎn)換電路調(diào)理后,經(jīng)由單片機(jī)進(jìn)行數(shù)據(jù)處理,由LCD顯示酒精濃度值。并設(shè)計(jì)一定的限值,超限聲光報(bào)警。限值可由按鍵調(diào)整??紤]到單片機(jī)計(jì)算能力有限,難以進(jìn)行復(fù)雜數(shù)據(jù)處理,故單片機(jī)系統(tǒng)與PC機(jī)系統(tǒng)通過RS232串行通信端口進(jìn)行互連,從而單片機(jī)用作下位機(jī)進(jìn)行數(shù)據(jù)采集和設(shè)備控制,而PC機(jī)用做上位機(jī)進(jìn)行復(fù)雜的數(shù)據(jù)處理和對(duì)單片機(jī)的控制。從現(xiàn)實(shí)角度考慮,此儀器可以讓開車的人知道自己在什么情況下可以開車;煤礦井是否處在安全的狀態(tài)下等等。這是一個(gè)在現(xiàn)代生活很實(shí)用,很負(fù)責(zé)的一個(gè)設(shè)計(jì),對(duì)社會(huì)的健康發(fā)展具有積極的意義。第1章 前言目前半導(dǎo)體氣體傳感器的研究動(dòng)態(tài)及其發(fā)展方向——?dú)怏w傳感器向低功耗、多功能、集成化方向發(fā)展國(guó)外氣體傳感器發(fā)展很快,一方面是由于人們安全意