【正文】
繼電器中含有電感元件,那么必然會在此刻產(chǎn)生極大的電流,如果不加二極管D2,電路可能會因電流過大而損壞,而加上二極管后,電流改變流向,通過二極管D2和繼電器中的電感組成的回路完成放電過程,不會損壞電路。 整體軟件流程圖因為首先要給傳感器預(yù)熱,QM2型半導(dǎo)體電阻式煙霧傳感器在不通電存放一段時間后,再次通電時,傳感器不能立即正常采集煙霧信息,需要一段時間的預(yù)熱。當(dāng)檢測到煙霧時,煙霧傳感器會將信號傳輸?shù)絾纹瑱C(jī),單片機(jī)再控制語音報警電路和自動排氣電路工作。編寫的程序為:include //包含頭文件define uchar unsigned char //宏定義define uint unsigned int sbit yanwu=P1^0。 sbit jidianqi=P1^2。 for(x=z。x) for(y=110。y)。 jidianqi=0。 while(1) { if(yanwu==0) {yuyin=1。} else {yuyin=0。} }} 編譯及下載在keil軟件中對程序進(jìn)行編譯及調(diào)試。新建工程projectnew project將彈出 creat new project框,寫入工程名稱。點擊確定后 彈出一個芯片選擇項,選atmel AT89S51。新建文件filenew將彈出一個文本框,輸入程序。加載程序,把我們編寫的c文件加載進(jìn)入看到左邊 source group1,點擊右鍵,選擇倒數(shù)第四項 “add files....”進(jìn)入add框,然后add看到左邊source 。生成HEX文件。開始編譯了,projectbuild target或者按F7或者看到上面圖標(biāo)(一個圖標(biāo)有兩個方向向下的箭頭)編譯的時候,你會發(fā)現(xiàn)最前面編譯結(jié)果0 Errors就表示程序沒有錯誤。 Progisp程序下載界面 Proteus仿真 Proteus軟件是英國Labcenter Electronics公司出版的EDA工具軟件。雖然目前國內(nèi)推廣剛起步,但已受到單片機(jī)愛好者、從事單片機(jī)教學(xué)的教師、致力于單片機(jī)開發(fā)應(yīng)用的科技工作者的青睞。是目前世界上唯一將電路仿真軟件、PCB設(shè)計軟件和虛擬模型仿真軟件三合一的設(shè)計平臺,其處理器模型支持805HC11 PIC10/12/16/18/24/30/DsPIC3AVR、ARM、8086和MSP430等,2010年又增加了Cortex和DSP系列處理器,并持續(xù)增加其他系列處理器模型。) 整體電路仿真圖Proteus仿真步驟:(1) 創(chuàng)建文件并命名“”。(3) 雙擊單片機(jī)芯片,添加“.hex”文件。(5) 檢查錯誤直至達(dá)到要求。焊接前首先需要檢測元器件是否合格,元器件檢驗合格后在面包板上按照整體電路圖(附錄C)連接電路圖并檢測電路是否工作。焊接一般遵循先低后高,一個方向的原則。 實物圖 系統(tǒng)調(diào)試 單片機(jī)最小系統(tǒng)電路的調(diào)試單片機(jī)最小系統(tǒng)電路的調(diào)試需要從以下幾個方面進(jìn)行:(1)用萬用表檢測電源是否接通,檢測VCC(40腳)和GND(20腳)之間是否有5V電壓。目的是確保使用了片內(nèi)存儲器。(4)用萬用表檢測復(fù)位電路,通過復(fù)位按鍵,檢測9引腳的電壓是否會變化,如果按鍵沒有按下,電壓為0V,按鍵按下后,電壓立刻變?yōu)?V,之后很快的降為0 V,則表示復(fù)位電路正常。檢測是否有振蕩波產(chǎn)生。 煙霧檢測電路的調(diào)試煙霧檢測電路主要通過調(diào)試可變電阻 ,可以調(diào)節(jié)煙霧傳感器的靈敏度,以獲得滿意的煙霧濃度風(fēng)扇啟動點。因為家用煤氣中主要成分為甲烷,所以本實驗在煙霧標(biāo)定時,選用甲烷煙霧。5%范圍內(nèi)。5%之 內(nèi)。 語音報警電路的調(diào)試語音報警電路中語音芯片的選型很重要,不同型號的芯片功能和連接電路都不相同。焊接時,所有外圍元件盡可能靠近LM386;地線盡可能粗一些;輸入音頻信號通路盡可能平行走線,輸出亦如此。但未實現(xiàn)液晶顯示、遠(yuǎn)程報警等擴(kuò)展功能,有待進(jìn)一步完善。 smoke detectors are used for sleeping areas, infrared or ultraviolet radiation are used when flammable liquids are being hand電機(jī), heat detectors are used for fire suppression or extinguishing systems. In general, life and property protection have different approaches.Alarm devices, apart from the usual audible or visible alarms, may incorporate solid state sound reproduction and emergency voice munication or printers that record time, date, location and other information required by the standard code of practice for fire protection for plex plants. Heaviside [4] has an excellent review of all types of detectors and extinguisher systems. Control philosophy and division of labourOur control philosophy is implemented hierarchically. Three levels of system hierarchy are implemented, with two levels of decision making. There is no munication between equipment on the same level. Interaction between levels occurs by upwards transfer of information regarding the status of the subsystems and downwards transfer of mands. This is shown in Fig. 1 where at level 1 is the central station microputer and is the ultimate decision maker (when not in manual mode). At level 2 are the local controllers, which reside in the local stations. At level 3 are the actual detectors and actuators. A manual mode of operation is provided at all levels.Information regarding the status of all detectors is transmitted on a per area basis to the local controllers. Their information is condensed and transmitted upward to the central microputer. Transfer of status is always unidirectional and upwards. Transfer of mands is always unidirectional and downwards, with expansion at the local control level. This approach preserves the strict rules of the hierarchy for exact monitoring detection and alarm systems associated with high risk plants. Control philosophyIEE PROCEEDINGS,Pt,G,FEBRUARY 1988The classification of the two layers of controls is based upon layers of decision making, with respect to the facts that(a) When the decision time es, the making and implementation of a decision cannot be postponed(b) The decisions have uncertainty(c) It will isolate local decisions (. locally we might have an alarm although there may be a fault with the system)3 General hardwareI :Fig. 2 depicts our design in the simplest of forms. The system uses an open party line approach with four conductor cables going in a loop shared by all the remote devices and the control panel. This approach is simple in concept and is economically feasible. However, one major disadvantage is the dependency on a single cable for power and signaling. In cases where reliability is of extreme importance, two or even three cables taking different routes throughout the system may be connected in parallel. Fig. 3 gives the driver circuitry required to derive an expandable bus. This design takes advantage of recent advances in the single chip microputer technology to reduce the interface between the central station and the local stations. System schematic open line connection Block diagram of remote stationIEE PROCEEDINGS,VOL,135,Pt,G,No,1,FEBRU ARY 19883. 1 Central control taskA central unit provides a centralized point to monitor and control the system activities. Remote station circuit diagramIn the system to be described the central control unit serves a fivefold purpose.(i) It receives information from the local stations and operates the alarms and other output devices.(ii) It notifies the operator in case of system malfunction.(iii) It provides an overall system control manual and automatic.(iv) It provides a system test point of local stations and itself.(v) It provides a central point for observation, learning and adaptation. Local stationsThe local stations can take local decisions regarding recognition of a risk situation, and act independently on local affairs. In this technique we depend on ‘loadtype coordination’, . the lower level units recognize the existence of other decision units on the same level。 this reduces power consumption.(b) It has a UART on board。 this eliminates an external A/D.(d) It has 4K of ROM, 256 bytes of RAM, 512 bytes of EERROM with 40 1/0 lines and a 16 bit tim