【正文】
桂林電子科技大學(xué)畢業(yè)設(shè)計(論文)報告用紙 第 1 頁 共 2 頁 摘 要 針對目前高校教室照明管理不到位而造成電能嚴(yán)重浪費這一現(xiàn)狀,以提高教室照明水平和節(jié)約能源為目的,設(shè)計了該 單片機(jī)控制的照明系統(tǒng)。 本文闡述了教室照明系統(tǒng)自動、手動控制的設(shè)計原理與實現(xiàn)方法。以設(shè)計過程為主線,分別從硬件和軟件兩方面描述設(shè)計過程 。 本文設(shè)計了一個基于 AT89S52 單片機(jī)的教室照明控制器系統(tǒng)。系統(tǒng)組成包括人體檢測電路、環(huán)境光采集電路、時鐘電路、聲光報警電路等。文中采用 HP208 人體傳感器檢測人體信號的存在, 光敏電阻 采集環(huán)境光的強(qiáng)度, DS1302 時鐘芯片定時,蜂鳴器報警,并通過 LED 顯示教室 燈光的狀態(tài)。 軟件部分采用 C 語言程序編制,模塊化結(jié)構(gòu)設(shè)計,并通過仿真工具進(jìn)行系統(tǒng)仿真和調(diào)試。依據(jù)流程圖思路條理,編制控制程序,從而實現(xiàn)教室照明回路的控制。 此外,本文還考慮了保證教室照明控制系統(tǒng)穩(wěn)定運行所采取的抗干擾措施。 該系統(tǒng)控制方便,具有體積小,專用性強(qiáng),性價比合理等優(yōu)點,可以滿足大、中專院校教室燈光控制的要求。 關(guān)鍵詞: AT89S52;人體傳感器;光敏電阻;時鐘;穩(wěn)定措施 桂林電子科技大學(xué)畢業(yè)設(shè)計(論文)報告用紙 第 2 頁 共 2 頁 Abstract According to the unsatisfactory lighting management in current university classroom that cause power waste seriously situation, the light control system is designed aim at improving the light level of classroom and saving energy. This paper describes the design principles and implementation methods of classroom lighting system with automatic and manual control. Taking the design processes as mainline, it describes the design processes from two aspects hardware and software. This paper designs a classroom lighting controller system based on the singlechip microputer AT89S52. The system consists of the detection circuit of human body, the collection circuit of ambient light, clock circuit, the alarm circuits with sound and light ,etc. In this paper, HP208 Human sensor is used to detect the body signals of human presence, the intensity of ambient light is collected by Photoresistor , time is set by DS1302 clock chip, the alarm is from the buzzer, and the condition of classroom is indicated through the LED lights. The software is designed with C language to program and separate module, and the system is tested and debugged with simulation tools. According to the flow chart, the programme is programmed to control the classroom lighting circuit. In addition, this paper also takes antiinterference measures to guarantee the classroom lighting control system operate stably . The system can be control easily. Besides there are many advantages such as small volume, strong specificity , reasonable price. It can satisfy the control mand of light in college classroom. Key words: AT89S52。 Human sensor。 Photoresistor。 Clock。 Stable measures 桂林電子科技大學(xué)畢業(yè)設(shè)計(論文)報告用紙 第 1 頁 共 2 頁 目 錄 1 引言 ................................................................................................................................................................................ 1 課題的背景及意義 .................................................................................................................................................. 1 教室照明現(xiàn)狀及存在問題 .................................................................................................................................. 1 設(shè)計的內(nèi)容 .................................................................................................................................................................. 2 本章小結(jié) ....................................................................................................................................................................... 2 2 教室照明系統(tǒng)的設(shè)計 ..................................................................................................................................... 3 系統(tǒng)整體設(shè)計方案 .................................................................................................................................................. 3 教室照明系統(tǒng)的硬件設(shè)計 .................................................................................................................................. 4 教室照明控制器的選擇 ................................................................................................................................... 4 下載線接口模塊 ................................................................................................................................................... 6 單片機(jī)最小系統(tǒng) ................................................................................................................................................... 6 數(shù)據(jù)采集模塊 ......................................................................................................................................................... 7 時鐘電路模塊 ...................................................................................................................................................... 13 聲光報警模塊 ...................................................................................................................................................... 17 人機(jī)交互模塊 ...................................................................................................................................................... 18 教室照明系統(tǒng)的軟件設(shè)計 ............................................................................................................................... 19 系統(tǒng)監(jiān)控主程序設(shè)計 ...................................................................................................................................... 19 按鍵掃描程序設(shè)計 ........................................................................................................................................... 20 數(shù)據(jù)采集控制程序設(shè)計 ................................................................................................................................. 21 時鐘控制程序設(shè)計 ........................................................................................................................................... 23 控制子程序設(shè)計 ................................................................................................................................................ 24 本章小結(jié) ............................................................