【正文】
1 摘要 本研究針對(duì)教室燈光的控制方法,尤其是教室燈光的智能控制方面的發(fā)展現(xiàn)狀,分析了教室燈光智能控制的原理和實(shí)現(xiàn)方法,提出了基于單片機(jī)的教室燈光智能控制系統(tǒng)的設(shè)計(jì)思路,并在此基礎(chǔ)上開發(fā)了智能控制系統(tǒng)的硬件裝置和相應(yīng)軟件。 該系統(tǒng)以 AT89C52 單片機(jī)作為控制裝置的智能部件,采用熱釋紅外人體傳感器檢測(cè)人體的存在,采用光敏三極管構(gòu)成的電路檢測(cè)環(huán)境光的強(qiáng)度 。根據(jù)教室合理開燈的條件,系統(tǒng)通過(guò)對(duì)人體的存在信號(hào)和環(huán)境光信號(hào)的識(shí)別和智能判斷,完成對(duì)教室照明回路的智能控制,避免了教室用電的大量浪費(fèi)。系統(tǒng)還具有多種報(bào)警 功能 。同時(shí)還采用了軟 /硬件的“看門狗”技術(shù)等抗干擾措施。單片機(jī)軟件采用匯編語(yǔ)言編制,采用模塊化結(jié)構(gòu)設(shè)計(jì)、條理清晰、通用性好,便于改進(jìn)和擴(kuò)充。 該系統(tǒng)具有體積小,控制方便,可靠性高,專用性強(qiáng),性價(jià)比合理等優(yōu)點(diǎn),可以滿足各類大、中專院校教室燈光控制的要求,很大程度的達(dá)到節(jié)能目的。 關(guān)鍵詞 :人體 ; 紅外線 ; 傳感器 ; 自動(dòng)控制 ; 熱釋電 2 Abstract Currently light intelligent control systems are not efficiently used in the classroom. In order to improve the system, based on control and current methods of how to keep control, developing intelligent classroom light control system and developed the hardware and software system. This classroom light intelligent control system the theory of the light put forward methods ofon the basis of AT89C52 is developed, which machine of AT89C52 is a major part, and the environment of development is better than before. This system can satisfy the following functions, such as controlling the circuit of illumination, testing and processing daylight signal, testing and processing the signal of human body that illuminates the back track exists, reporting to the warning devices, order to satisfy these functions, the system adopted the homologous methods respectively, and to the gearing of the system, analyzing how to install, test and run the system. The microcontroller software was developed based on assemble language. Assemble language is one kind of structured program languages, it has more advantages than other highlevel languages. Assemble language adopts building block design. Its monality is very good and easy to improve and expand. It could be used to develop larger 一 scale system with more perfect performance. At the same time, the antijamming technologies, such as watchdog, are necessary when developing hardware and software. This system had many advantages. For example, the physical volume was small,the system was conveniently controlled, the credibility was hi gh, the appropriation was strong, and its price proportion was ideal,etc. The experiment proved that the system can satisfy the control mand of the classroom39。 s light device, so it could largely reduce the consuming of energy resources. Key words: Human body, infrared ray, sensor, automatic control, heat to release the electricity1. 3 目錄 摘要 1 ABSTRACT2 5 本課題研究的意義 5 國(guó)內(nèi)外教室燈光控制器研究的現(xiàn)狀及其存在的問(wèn)題 5 本課題研究的內(nèi)容和目標(biāo) 7 研究?jī)?nèi)容 7 研究目標(biāo) 7 本課題擬解決的關(guān)鍵問(wèn) 8 8 教室燈光控制器簡(jiǎn)介 8 系統(tǒng)控制方案的分析 8 9 控制模塊的硬件構(gòu)成 9 控制系統(tǒng)的主要硬件電路 9 系統(tǒng)主控電路 10 在線編程模塊電路 10 系統(tǒng)供電電路 11 數(shù)據(jù)采集電路 12 系統(tǒng)時(shí)鐘電路 16 系統(tǒng)看門狗電路 19 繼電器驅(qū)動(dòng)接口電路 21 超時(shí)報(bào)警電路 21 4 控制模塊軟件設(shè)計(jì)與開發(fā) 22 系統(tǒng)監(jiān)控主程序模塊 23 系統(tǒng)自檢初始化 23 定時(shí)中斷處理 24 多任務(wù)操作系統(tǒng)的構(gòu)建 24 數(shù)據(jù)采集模塊 25 人體存在傳感器的優(yōu)缺點(diǎn) 25 數(shù)據(jù)采集軟件設(shè)計(jì)的實(shí)現(xiàn) 25 人體存在傳感器的抗干擾措施 26 人體 存在傳感器的安裝要求 27 時(shí)鐘模塊 27 數(shù)據(jù)輸入輸出 27 時(shí)鐘內(nèi)部寄存器的使用 28 4 時(shí)鐘自檢初始化 29 時(shí)鐘程序設(shè)計(jì) 30 顯示驅(qū)動(dòng)模塊 30 ULN2803 驅(qū)動(dòng)器的應(yīng)用 32 顯示程序設(shè)計(jì) 32 系統(tǒng)鍵功能 33 鍵功能處理程序 33 5 系統(tǒng)調(diào)試運(yùn)行及問(wèn)題分析 34 單片機(jī)系統(tǒng)調(diào)試 方法及步驟 34 出現(xiàn)的主要問(wèn)題及分析解決 35 36 結(jié)論 36 建議 37 38 參考文獻(xiàn) 39 附圖 A40 附圖 B 41 5 本課題研究的意義 隨著社會(huì)經(jīng)濟(jì)和科學(xué)技術(shù)的發(fā)展,人們的生活水平也不斷提高,導(dǎo)致用電負(fù)荷的加劇,又由于世界性的能源危機(jī),能源缺乏已成為世界所面臨的嚴(yán)峻 問(wèn)題。而此問(wèn)題對(duì)我國(guó)來(lái)說(shuō)尤為嚴(yán)重。隨著各類大、中專院校的擴(kuò)招,教室的擴(kuò)建,教室照明的需求也越來(lái)越多,而教室照明的管理不到位,往往造成電能的巨大浪費(fèi),這樣,提高教室用電效率就成為首要考慮的問(wèn)題。 目前對(duì)燈光的智能控制,國(guó)內(nèi)外己經(jīng)開始采用,但對(duì)教室燈光的控制,尤其是我國(guó)教室燈光的智能控制尤為缺乏和不完善,依然是傳統(tǒng)式的人工管理。各類大、中專院校不斷擴(kuò)招,教室不斷擴(kuò)建,教室的用電負(fù)荷不斷加大,教室用電管理不善,造成學(xué)校電能浪費(fèi),經(jīng)濟(jì)損失,這種的浪費(fèi)與當(dāng)今的節(jié)約能源理念相違背。再者,現(xiàn)代自動(dòng)化程度不斷提 高,計(jì)算機(jī)技術(shù)的普及,燈光的管理也在朝著自動(dòng)化、智能化方向發(fā)展。例如樓道燈光的自動(dòng)控制等等。所有這些使得教室燈光控制也應(yīng)該朝著智能的方向發(fā)展。于是,開發(fā)簡(jiǎn)便、實(shí)用的教室燈光自動(dòng)控制