隨著網(wǎng)絡(luò)技術(shù)和通信技術(shù)的不斷發(fā)展以及人們對生活要求的不斷提高,實現(xiàn)家庭智能的遠程監(jiān)控已經(jīng)成為必然的趨勢。國家建設(shè)部住宅產(chǎn)業(yè)化促進中心提出住宅小區(qū)要實現(xiàn)六項智能化要求,其中包括實行安全防范自動化監(jiān)控管理:對住宅的火災(zāi)、有害氣體的泄漏實行自動報警;防盜報警系統(tǒng)應(yīng)安裝紅外或微波等各種類型報警探測器;系統(tǒng)應(yīng)能與計算機安全綜合管理系統(tǒng)聯(lián)網(wǎng);計算機系統(tǒng)能對防盜報警系統(tǒng)進行集中管理和控制。隨著GPRS遠程通信技術(shù)和短距離無線網(wǎng)絡(luò)通信技術(shù)的不斷發(fā)展和成熟,智能家居的監(jiān)控技術(shù)也逐步成熟。GPRS網(wǎng)絡(luò)通信業(yè)務(wù)是通信公司推出的一項數(shù)據(jù)傳輸通信業(yè)務(wù),在GPRS網(wǎng)絡(luò)覆蓋區(qū)域內(nèi),傳輸距離不受限制,通信費用相對低廉,傳輸速率較快。Zig-Bee短距離無線通信技術(shù)是一種近距離、低復(fù)雜度、低功耗、低速率、低成本的雙向無線通信技術(shù),主要用于距離短、功耗低且傳輸速率不高的各種電子設(shè)備之間進行數(shù)據(jù)傳輸以及典型的有周期性數(shù)據(jù)、間歇性數(shù)據(jù)和低反應(yīng)時間數(shù)據(jù)傳輸?shù)膽?yīng)用。本文解決了家庭智能嵌入式系統(tǒng)、GPRS遠程通信、ZigBee" title="ZigBee">ZigBee" title="ZigBee">ZigBee" title="ZigBee">ZigBee" title="ZigBee">ZigBee" title="ZigBee">ZigBee" title="ZigBee">ZigBee" title="ZigBee">ZigBee" title="ZigBee">ZigBee" title="ZigBee">ZigBee" title="ZigBee">ZigBee" title="ZigBee">ZigBee" title="ZigBee">ZigBee" title="ZigBee">ZigBee" title="ZigBee">ZigBee" title="ZigBee">ZigBee" title="ZigBee">ZigBee" title="ZigBee">ZigBee" title="ZigBee">ZigBee" title="ZigBee">ZigBee" title="ZigBee">ZigBee" title="ZigBee">ZigBee" title="ZigBee">ZigBee" title="ZigBee">ZigBee" title="ZigBee">ZigBee" title="ZigBee">ZigBee" title="ZigBee">ZigBee" title="ZigBee">ZigBee" title="ZigBee">ZigBee" title="ZigBee">ZigBee" title="ZigBee">ZigBee" title="ZigBee">ZigBee" title="ZigBee">ZigBee" title="ZigBee">ZigBee" title="ZigBee">ZigBee" title="ZigBee">ZigBee" title="ZigBee">ZigBee" title="ZigBee">ZigBee" title="ZigBee">ZigBee" title="ZigBee">ZigBee" title="ZigBee">ZigBee" title="ZigBee">ZigBee" title="ZigBee">ZigBee" title="ZigBee">ZigBee" title="ZigBee">ZigBee" title="ZigBee">ZigBee" title="ZigBee">ZigBee" title="ZigBee">ZigBee" title="ZigBee">ZigBee" title="ZigBee">ZigBee" title="ZigBee">ZigBee" title="ZigBee">ZigBee" title="ZigBee">ZigBee" title="ZigBee">ZigBee" title="ZigBee">ZigBee" title="ZigBee">ZigBee" title="ZigBee">ZigBee" title="ZigBee">ZigBee" title="ZigBee">ZigBee" title="ZigBee">ZigBee" title="ZigBee">ZigBee" title="ZigBee">ZigBee" title="ZigBee">ZigBee" title="ZigBee">ZigBee" title="ZigBee">ZigBee" title="ZigBee">ZigBee" title="ZigBee">ZigBee" title="ZigBee">ZigBee" title="ZigBee">ZigBee" title="ZigBee">ZigBee" title="ZigBee">ZigBee" title="ZigBee">ZigBee" title="ZigBee">ZigBee" title="ZigBee">ZigBee" title="ZigBee">ZigBee" title="ZigBee">ZigBee" title="ZigBee">ZigBee" title="ZigBee">ZigBee" title="ZigBee">ZigBee" title="ZigBee">ZigBee" title="ZigBee">ZigBee" title="ZigBee">ZigBee" title="ZigBee">ZigBee" title="ZigBee">ZigBee" title="ZigBee">ZigBee" title="ZigBee">ZigBee" title="ZigBee">ZigBee" title="ZigBee">ZigBee" title="ZigBee">ZigBee" title="ZigBee">ZigBee" title="ZigBee">ZigBee" title="ZigBee">ZigBee" title="ZigBee">ZigBee" title="ZigBee">ZigBee" title="ZigBee">ZigBee" title="ZigBee">ZigBee" title="ZigBee">ZigBee" title="ZigBee">ZigBee" title="ZigBee">ZigBee" title="ZigBee">ZigBee" title="ZigBee">ZigBee" title="ZigBee">ZigBee" title="ZigBee">ZigBee" title="ZigBee">ZigBee" title="ZigBee">ZigBee" title="ZigBee">ZigBee" title="ZigBee">ZigBee" title="ZigBee">ZigBee" title="ZigBee">ZigBee" title="ZigBee">ZigBee" title="ZigBee">ZigBee" title="ZigBee">ZigBee" title="ZigBee">ZigBee" title="ZigBee">ZigBee" title="ZigBee">ZigBee" title="ZigBee">ZigBee" title="ZigBee">ZigBee" title="ZigBee">ZigBee" title="ZigBee">ZigBee" title="ZigBee">ZigBee" title="ZigBee">ZigBee" title="ZigBee">ZigBee" title="ZigBee">ZigBee" title="ZigBee">ZigBee" title="ZigBee">ZigBee" title="ZigBee">ZigBee" title="ZigBee">ZigBee" title="ZigBee">ZigBee" title="ZigBee">ZigBee" title="ZigBee">ZigBee" title="ZigBee">ZigBee" title="ZigBee">ZigBee" title="ZigBee">ZigBee" title="ZigBee">ZigBee" title="ZigBee">ZigBee" title="ZigBee">ZigBee" title="ZigBee">ZigBee" title="ZigBee">ZigBee" title="ZigBee">ZigBee" title="ZigBee">ZigBee" title="ZigBee">ZigBee" title="ZigBee">ZigBee" title="ZigBee">ZigBee" title="ZigBee">ZigBee" title="ZigBee">ZigBee" title="ZigBee">ZigBee" title="ZigBee">ZigBee" title="ZigBee">ZigBee" title="ZigBee">ZigBee" title="ZigBee">ZigBee" title="ZigBee">ZigBee" title="ZigBee">ZigBee" title="ZigBee">ZigBee" title="ZigBee">ZigBee" title="ZigBee">ZigBee" title="ZigBee">ZigBee" title="ZigBee">ZigBee" title="ZigBee">ZigBee" title="ZigBee">ZigBee" title="ZigBee">ZigBee" title="ZigBee">ZigBee" title="ZigBee">ZigBee" title="ZigBee">ZigBee" title="ZigBee">ZigBee" title="ZigBee">ZigBee" title="ZigBee">ZigBee" title="ZigBee">ZigBee" title="ZigBee">ZigBee" title="ZigBee">ZigBee" title="ZigBee">ZigBee" title="ZigBee">ZigBee" title="ZigBee">ZigBee" title="ZigBee">ZigBee" title="ZigBee">ZigBee" title="ZigBee">ZigBee" title="ZigBee">ZigBee" title="ZigBee">ZigBee" title="ZigBee">ZigBee" title="ZigBee">ZigBee" title="ZigBee">ZigBee" title="ZigBee">ZigBee" title="ZigBee">ZigBee" title="ZigBee">ZigBee" title="ZigBee">ZigBee" title="ZigBee">ZigBee" title="ZigBee">ZigBee" title="ZigBee">ZigBee" title="ZigBee">ZigBee" title="ZigBee">ZigBee" title="ZigBee">ZigBee" title="ZigBee">ZigBee" title="ZigBee">ZigBee" title="ZigBee">ZigBee" title="ZigBee">ZigBee" title="ZigBee">ZigBee" title="ZigBee">ZigBee" title="ZigBee">ZigBee" title="ZigBee">ZigBee" title="ZigBee">ZigBee" title="ZigBee">ZigBee" title="ZigBee">ZigBee" title="ZigBee">ZigBee" title="ZigBee">ZigBee" title="ZigBee">ZigBee" title="ZigBee">ZigBee" title="ZigBee">ZigBee" title="ZigBee">ZigBee" title="ZigBee">ZigBee" title="ZigBee">ZigBee" title="ZigBee">ZigBee" title="ZigBee">ZigBee" title="ZigBee">ZigBee" title="ZigBee">ZigBee" title="ZigBee">ZigBee" title="ZigBee">ZigBee" title="ZigBee">ZigBee" title="ZigBee">ZigBee" title="ZigBee">ZigBee" title="ZigBee">ZigBee" title="ZigBee">ZigBee" title="ZigBee">ZigBee" title="ZigBee">ZigBee" title="ZigBee">ZigBee" title="ZigBee">ZigBee" title="ZigBee">ZigBee" title="ZigBee">ZigBee" title="ZigBee">ZigBee" title="ZigBee">ZigBee" title="ZigBee">ZigBee" title="ZigBee">ZigBee" title="ZigBee">ZigBee" title="ZigBee">ZigBee" title="ZigBee">ZigBee" title="ZigBee">ZigBee" title="ZigBee">ZigBee" title="ZigBee">ZigBee" title="ZigBee">ZigBee" title="ZigBee">ZigBee" title="ZigBee">ZigBee" title="ZigBee">ZigBee" title="ZigBee">ZigBee" title="ZigBee">ZigBee" title="ZigBee">ZigBee" title="ZigBee">ZigBee" title="ZigBee">ZigBee" title="ZigBee">ZigBee" title="ZigBee">ZigBee" title="ZigBee">ZigBee" title="ZigBee">ZigBee" title="ZigBee">ZigBee" title="ZigBee">ZigBee" title="ZigBee">ZigBee" title="ZigBee">ZigBee" title="ZigBee">ZigBee" title="ZigBee">ZigBee" title="ZigBee">ZigBee" title="ZigBee">ZigBee" title="ZigBee">ZigBee" title="ZigBee">ZigBee" title="ZigBee">ZigBee" title="ZigBee">ZigBee" title="ZigBee">ZigBee" title="ZigBee">ZigBee" title="ZigBee">ZigBee" title="ZigBee">ZigBee" title="ZigBee">ZigBee" title="ZigBee">ZigBee" title="ZigBee">ZigBee" title="ZigBee">ZigBee" title="ZigBee">ZigBee" title="ZigBee">ZigBee" title="ZigBee">ZigBee" title="ZigBee">ZigBee" title="ZigBee">ZigBee" title="ZigBee">ZigBee" title="ZigBee">ZigBee" title="ZigBee">ZigBee" title="ZigBee">ZigBee" title="ZigBee">ZigBee" title="ZigBee">ZigBee" title="ZigBee">ZigBee" title="ZigBee">ZigBee" title="ZigBee">ZigBee" title="ZigBee">ZigBee" title="ZigBee">ZigBee" title="ZigBee">ZigBee" title="ZigBee">ZigBee" title="ZigBee">ZigBee" title="ZigBee">ZigBee" title="ZigBee">ZigBee" title="ZigBee">ZigBee" title="ZigBee">ZigBee" title="ZigBee">ZigBee" title="ZigBee">ZigBee" title="ZigBee">ZigBee" title="ZigBee">ZigBee" title="ZigBee">ZigBee" title="ZigBee">ZigBee" title="ZigBee">ZigBee" title="ZigBee">ZigBee" title="ZigBee">ZigBee" title="ZigBee">ZigBee" title="ZigBee">ZigBee" title="ZigBee">ZigBee" title="ZigBee">ZigBee" title="ZigBee">ZigBee" title="ZigBee">ZigBee" title="ZigBee">ZigBee" title="ZigBee">ZigBee" title="ZigBee">ZigBee" title="ZigBee">ZigBee" title="ZigBee">ZigBee" title="ZigBee">ZigBee" title="ZigBee">ZigBee" title="ZigBee">ZigBee" title="ZigBee">ZigBee" title="ZigBee">ZigBee" title="ZigBee">ZigBee" title="ZigBee">ZigBee" title="ZigBee">ZigBee" title="ZigBee">ZigBee" title="ZigBee">ZigBee" title="ZigBee">ZigBee" title="ZigBee">ZigBee" title="ZigBee">ZigBee" title="ZigBee">ZigBee" title="ZigBee">ZigBee" title="ZigBee">ZigBee" title="ZigBee">ZigBee" title="ZigBee">ZigBee" title="ZigBee">ZigBee" title="ZigBee">ZigBee" title="ZigBee">ZigBee" title="ZigBee">ZigBee" title="ZigBee">ZigBee" title="ZigBee">ZigBee" title="ZigBee">ZigBee" title="ZigBee">ZigBee" title="ZigBee">ZigBee" title="ZigBee">ZigBee" title="ZigBee">ZigBee" title="ZigBee">ZigBee" title="ZigBee">ZigBee" title="ZigBee">ZigBee" title="ZigBee">ZigBee" title="ZigBee">ZigBee" title="ZigBee">ZigBee" title="ZigBee">ZigBee" title="ZigBee">ZigBee" title="ZigBee">ZigBee" title="ZigBee">ZigBee" title="ZigBee">ZigBee" title="ZigBee">ZigBee" title="ZigBee">ZigBee" title="ZigBee">ZigBee" title="ZigBee">ZigBee" title="ZigBee">ZigBee" title="ZigBee">ZigBee" title="ZigBee">ZigBee" title="ZigBee">ZigBee" title="ZigBee">ZigBee" title="ZigBee">ZigBee" title="ZigBee">ZigBee" title="ZigBee">ZigBee" title="ZigBee">ZigBee" title="ZigBee">ZigBee" title="ZigBee">ZigBee" title="ZigBee">ZigBee" title="ZigBee">ZigBee" title="ZigBee">ZigBee" title="ZigBee">ZigBee" title="ZigBee">ZigBee" title="ZigBee">ZigBee" title="ZigBee">ZigBee" title="ZigBee">ZigBee" title="ZigBee">ZigBee" title="ZigBee">ZigBee" title="ZigBee">ZigBee" title="ZigBee">ZigBee" title="ZigBee">ZigBee" title="ZigBee">ZigBee" title="ZigBee">ZigBee" title="ZigBee">ZigBee" title="ZigBee">ZigBee" title="ZigBee">ZigBee" title="ZigBee">ZigBee" title="ZigBee">ZigBee" title="ZigBee">ZigBee" title="ZigBee">ZigBee" title="ZigBee">ZigBee" title="ZigBee">ZigBee" title="ZigBee">ZigBee" title="ZigBee">ZigBee" title="ZigBee">ZigBee" title="ZigBee">ZigBee" title="ZigBee">ZigBee" title="ZigBee">ZigBee" title="ZigBee">ZigBee" title="ZigBee">ZigBee" title="ZigBee">ZigBee" title="ZigBee">ZigBee" title="ZigBee">ZigBee" title="ZigBee">ZigBee" title="ZigBee">ZigBee" title="ZigBee">ZigBee" title="ZigBee">ZigBee" title="ZigBee">ZigBee" title="ZigBee">ZigBee" title="ZigBee">ZigBee" title="ZigBee">ZigBee" title="ZigBee">ZigBee" title="ZigBee">ZigBee" title="ZigBee">ZigBee" title="ZigBee">ZigBee" title="ZigBee">ZigBee" title="ZigBee">ZigBee" title="ZigBee">ZigBee" title="ZigBee">ZigBee" title="ZigBee">ZigBee" title="ZigBee">ZigBee" title="ZigBee">ZigBee" title="ZigBee">ZigBee" title="ZigBee">ZigBee" title="ZigBee">ZigBee" title="ZigBee">ZigBee" title="ZigBee">ZigBee" title="ZigBee">ZigBee" title="ZigBee">ZigBee" title="ZigBee">ZigBee" title="ZigBee">ZigBee" title="ZigBee">ZigBee" title="ZigBee">ZigBee" title="ZigBee">ZigBee" title="ZigBee">ZigBee" title="ZigBee">ZigBee" title="ZigBee">ZigBee" title="ZigBee">ZigBee" title="ZigBee">ZigBee" title="ZigBee">ZigBee" title="ZigBee">ZigBee" title="ZigBee">ZigBee" title="ZigBee">ZigBee" title="ZigBee">ZigBee" title="ZigBee">ZigBee" title="ZigBee">ZigBee" title="ZigBee">ZigBee" title="ZigBee">ZigBee" title="ZigBee">ZigBee" title="ZigBee">ZigBee" title="ZigBee">ZigBee" title="ZigBee">ZigBee" title="ZigBee">ZigBee" title="ZigBee">ZigBee" title="ZigBee">ZigBee" title="ZigBee">ZigBee" title="ZigBee">ZigBee" title="ZigBee">ZigBee" title="ZigBee">ZigBee" title="ZigBee">ZigBee" title="ZigBee">ZigBee" title="ZigBee">ZigBee" title="ZigBee">ZigBee" title="ZigBee">ZigBee" title="ZigBee">ZigBee" title="ZigBee">ZigBee" title="ZigBee">ZigBee" title="ZigBee">ZigBee" title="ZigBee">ZigBee" title="ZigBee">ZigBee" title="ZigBee">ZigBee" title="ZigBee">ZigBee" title="ZigBee">ZigBee" title="ZigBee">ZigBee" title="ZigBee">ZigBee" title="ZigBee">ZigBee" title="ZigBee">ZigBee" title="ZigBee">ZigBee" title="ZigBee">ZigBee" title="ZigBee">ZigBee" title="ZigBee">ZigBee" title="ZigBee">ZigBee" title="ZigBee">ZigBee" title="ZigBee">ZigBee" title="ZigBee">ZigBee" title="ZigBee">ZigBee" title="ZigBee">ZigBee" title="ZigBee">ZigBee" title="ZigBee">ZigBee" title="ZigBee">ZigBee" title="ZigBee">ZigBee" title="ZigBee">ZigBee" title="ZigBee">ZigBee" title="ZigBee">ZigBee" title="ZigBee">ZigBee" title="ZigBee">ZigBee" title="ZigBee">ZigBee" title="ZigBee">ZigBee" title="ZigBee">ZigBee" title="ZigBee">ZigBee" title="ZigBee">ZigBee" title="ZigBee">ZigBee" title="ZigBee">ZigBee" title="ZigBee">ZigBee" title="ZigBee">ZigBee" title="ZigBee">ZigBee" title="ZigBee">ZigBee" title="ZigBee">ZigBee" title="ZigBee">ZigBee" title="ZigBee">ZigBee" title="ZigBee">ZigBee" title="ZigBee">ZigBee" title="ZigBee">ZigBee" title="ZigBee">ZigBee" title="ZigBee">ZigBee" title="ZigBee">ZigBee" title="ZigBee">ZigBee" title="ZigBee">ZigBee" title="ZigBee">ZigBee" title="ZigBee">ZigBee" title="ZigBee">ZigBee" title="ZigBee">ZigBee" title="ZigBee">ZigBee" title="ZigBee">ZigBee" title="ZigBee">ZigBee" title="ZigBee">ZigBee" title="ZigBee">ZigBee" title="ZigBee">ZigBee" title="ZigBee">ZigBee" title="ZigBee">ZigBee" title="ZigBee">ZigBee" title="ZigBee">ZigBee" title="ZigBee">ZigBee" title="ZigBee">ZigBee" title="ZigBee">ZigBee無線通信、家電解碼及編碼、家居控制協(xié)議等相關(guān)技術(shù)難點,分析了其各自基本特點和所要實現(xiàn)的基本功能,并在此基礎(chǔ)上提出了基于Linux嵌入式系統(tǒng)和ZigBee網(wǎng)絡(luò)及GPRS無線通信的智能家居系統(tǒng)的總體解決方案。
1 系統(tǒng)整體設(shè)計方案
智能家居網(wǎng)絡(luò)指的是在一個家居中建立一個通信網(wǎng)絡(luò),將各種家電設(shè)備互相連接起來,實現(xiàn)對所有智能家居網(wǎng)絡(luò)上設(shè)備的遠程使用和控制及任何要求的信息交換,如音樂、門窗、電源、電視或數(shù)據(jù)等等。智能家居網(wǎng)絡(luò)的構(gòu)架包括家庭內(nèi)部網(wǎng)絡(luò)系統(tǒng)、智能家居控制器以及智能家居網(wǎng)絡(luò)與外部網(wǎng)絡(luò)之間的數(shù)據(jù)通信。其中,智能家居控制器是智能家庭網(wǎng)絡(luò)的一個重要組成部分,起到核心的管理、控制和與外部網(wǎng)絡(luò)通信的作用。它是通過家庭管理平臺與家居生活有關(guān)的各種子系統(tǒng)有機結(jié)合的一個系統(tǒng),也是連接家庭智能內(nèi)部和外部網(wǎng)絡(luò)的物理接口,完成家庭內(nèi)部同外部通信網(wǎng)絡(luò)之間的數(shù)據(jù)交換功能,同時還負責(zé)家庭設(shè)備的管理和控制。智能家居控制器一方面需要為家庭內(nèi)部布線提供通信接口,采集家庭設(shè)備的信息,并進行處理、自動控制和調(diào)節(jié);另一方面智能家居控制器作為家庭網(wǎng)關(guān),也為外部提供網(wǎng)絡(luò)接口,連通家庭內(nèi)部網(wǎng)絡(luò)和外部網(wǎng)絡(luò),使得用戶可以通過GPRS網(wǎng)絡(luò)等方式訪問家庭內(nèi)部網(wǎng)絡(luò),實現(xiàn)監(jiān)視和控制。系統(tǒng)控制方案如圖1所示。
圖1 系統(tǒng)整體控制框圖
本系統(tǒng)采用三星公司最新推出的ARM11 S3C6410控制芯片為核心控制器,完成所有家庭內(nèi)部數(shù)據(jù)的處理,包括數(shù)據(jù)的采集與控制命令的發(fā)出,是整個智能家居控制的核心,采用Linux嵌入式系統(tǒng)為家居總中心監(jiān)控系統(tǒng),能夠自動運行、處理數(shù)據(jù),通過串口管理、無線網(wǎng)絡(luò)來控制各控制終端,并且中心控制器通過GPRS模塊實現(xiàn)家庭系統(tǒng)與手機的通信,使用戶可以通過短信方式實現(xiàn)家庭系統(tǒng)的遠程控制,同時,控制器還采用10.3寸觸摸屏為用戶提供命令輸入端,采用Linux Qt完成人機界面的編寫,通過ZigBee無線通信協(xié)議完成家庭內(nèi)部數(shù)據(jù)的傳輸,方便用戶實現(xiàn)本地控制??刂平K端為單片機組成的若干小的控制系統(tǒng)控制各家用設(shè)備,并通過控制總線將這些小的控制系統(tǒng)組成網(wǎng)絡(luò),連接到智能家居控制器,受智能家居控制器控制。
2 基于ZigBee無線網(wǎng)絡(luò)和統(tǒng)一家電協(xié)議的家居網(wǎng)絡(luò)系統(tǒng)
2.1 整體設(shè)計
整個智能家居系統(tǒng)全部采用無線網(wǎng)絡(luò)進行數(shù)據(jù)傳輸和監(jiān)控,以無線網(wǎng)絡(luò)技術(shù)為通信平臺,將家庭的安防系統(tǒng)、門窗控制系統(tǒng)、家電照明系統(tǒng)和能源計量系統(tǒng)等這些分立子系統(tǒng)融合成為一個真正意義上的綜合智能家居網(wǎng)絡(luò)系統(tǒng)。既可以使用智能手機或者終端實現(xiàn)本地集中控制,也可以通過使用遠程接入Internet網(wǎng)絡(luò)的智能手機或計算機實現(xiàn)遠程監(jiān)控。智能家居網(wǎng)絡(luò)系統(tǒng)由分散智能終端層和上端總控制層組成。
上端總控制層主要是以ARM6410中控系統(tǒng)為核心、利用無線通信結(jié)構(gòu)形成的中控網(wǎng)絡(luò)完成對各種不同智能終端的管理控制。中控系統(tǒng)配置有觸摸屏方便用戶使用。使用GPRS通信技術(shù),將家庭內(nèi)部信息及時與主人手機終端進行通信聯(lián)系,并可以通過手機控制上端總控制層,達到遠程控制的效果。
分散智能終端層是由具有智能終端特性(即信號采集處理、輸出控制和數(shù)據(jù)通信功能)的各種不同安防系統(tǒng)、家電控制、家庭照明、家庭安防、溫濕度數(shù)據(jù)采集和通信系統(tǒng)等模塊組成。
{$Page$}
智能終端層以AT89C51為核心處理器,使用多個I/O口進行傳感器檢測陣列的信號采集,其中包括紅外人體探測信號、火警探測信號、有毒氣體探測信號、門窗開閉信號等信號的檢測;使用紅外發(fā)射芯片IR6721C芯片進行家電設(shè)備控制信號的發(fā)射,可以完成家庭內(nèi)部控制和GPRS遠程控制;使用通信串口1連接無線數(shù)據(jù)傳輸芯片XL02-232AP1,XL02-232AP1是UART 接口半雙工無線傳輸模塊。本文采用了加強型的ZigBee無線技術(shù),符合工業(yè)標準應(yīng)用的無線數(shù)據(jù)通信設(shè)備,可實現(xiàn)多設(shè)備間的數(shù)據(jù)透明傳輸;通過無線ZigBee進行組網(wǎng)通信;無線功能強大;具備中繼路由和終端設(shè)備功能。單個終端硬件結(jié)構(gòu)框圖如圖2所示。
圖2 終端硬件結(jié)構(gòu)框圖
智能終端與中心控制器通過基于ZigBee的無線網(wǎng)絡(luò)完成通信,傳輸一個指令的數(shù)據(jù)包由以下幾部分組成:起始編碼bite[0][1],地址編碼bite[2],數(shù)據(jù)類型編碼bite[4],功能編碼bite[5],效驗編碼bite[6],結(jié)束編碼bite[7].每個編碼1個字節(jié),發(fā)送數(shù)據(jù)范圍在0~255之間,不同家庭內(nèi)部的起始編碼都是惟一的,防止相互信號的干擾,每個接收終端在接收到數(shù)據(jù)后,都進行地址碼判斷是否為自己接收的數(shù)據(jù)包,是則接收,否則不接收,接收到數(shù)據(jù)包后,對數(shù)據(jù)要執(zhí)行的功能進行校驗,校驗正確,則進行解碼,并且在解碼成功后通過ZigBee的無線網(wǎng)絡(luò)發(fā)出一個確認接受碼,中心控制器在接收到確認接收碼后停止再次發(fā)生控制指令,否則間隔100ms再次發(fā)生相同指令,確保整個ZigBee的無線網(wǎng)絡(luò)數(shù)據(jù)通信的準確性和完整性。每個智能終端在正確接收到中心控制器的控制信號后,必須根據(jù)信號完成相應(yīng)家庭內(nèi)部的控制工作,所以家電設(shè)備的控制信號都是由統(tǒng)一的紅外編碼完成的,不同家電的紅外編碼各不相同,必須進行紅外編碼的解碼和重新的編碼,解碼工作利用400MHz的具有存儲功能的高精度示波器采集完成,編碼采用AT89C51芯片的兩個定時器交互中斷進行,中斷程序控制相應(yīng)的I/O口產(chǎn)生對應(yīng)的脈沖,脈沖輸出測試結(jié)果如圖3所示。
圖3 AT89C51產(chǎn)生的紅外解碼脈沖
2.2 GPRS遠程通信設(shè)計
以ARM11S3C6410為總控制核心,通過GPRS進行遠程數(shù)據(jù)的發(fā)送與處理,使用6410串口2與GPRS進行數(shù)據(jù)通信,可以將家庭內(nèi)部數(shù)據(jù)信息發(fā)送給遠離房間的主人手機,并可以通過主人手機發(fā)送的控制信息控制房間內(nèi)家電設(shè)備,包含攝像頭的攝像處理、空調(diào)溫度設(shè)置等。GPRS通信模塊安裝在智能家居控制器中,主要功能為通過GPRS網(wǎng)絡(luò)連接到Internet網(wǎng)絡(luò),并主動與監(jiān)控中心建立通信鏈路,進行雙向數(shù)據(jù)通信。GPRS通信模塊設(shè)計采用了Freescale公司生產(chǎn)的內(nèi)嵌TCP/IP協(xié)議的G24GPRSOEM[8].該模塊尺寸小,功耗低,便于集成。GPRS通信終端收發(fā)模塊主要由G24模塊、天線、SIM 卡、相關(guān)的電平轉(zhuǎn)換電路和RS 232串口組成。其供電電壓為5V,可采用USB端口供電;通過RS 232串行口與智能家居控制器ARM 進行通信。
G24收發(fā)模塊采用AT指令操作,通過RS 232串行口進行數(shù)據(jù)通信。
GPRS網(wǎng)絡(luò)通信原理如下:首先通過SGSN節(jié)點使通信終端模塊附在GPRS網(wǎng)絡(luò)上;然后通過GGSN 節(jié)點由PPP(Point to Point Protocol)協(xié)議獲得一個隨機分配的IP地址,連接到Internet上;最后通信終端模塊通過Internet,按照監(jiān)控中心設(shè)定的端口號與監(jiān)控中心建立通信鏈路。
2.3 系統(tǒng)軟件
系統(tǒng)采用Linux操作系統(tǒng),Linux內(nèi)核是一種源碼開放的操作系統(tǒng),采用模塊化的設(shè)計。在此只保留了必需的功能模塊,刪除了冗余的功能模塊,并對內(nèi)核重新編譯,從而使系統(tǒng)運行所需的硬件資源顯著減少。
Linux系統(tǒng)內(nèi)核集成了大量的網(wǎng)絡(luò)應(yīng)用程序,支持全部的標準因特網(wǎng)協(xié)議和幾乎所有的聯(lián)網(wǎng)技術(shù),因此將其應(yīng)用于智能家居控制器的設(shè)計,具有代碼量小、運行消耗系統(tǒng)資源少、可靠性高、開發(fā)周期短等優(yōu)點,適應(yīng)智能家庭數(shù)據(jù)采集控制器對于操作系統(tǒng)的要求。Qt作為一種跨平臺的基于C++ 的GUI系統(tǒng),能夠提供給用戶構(gòu)造圖形用戶界面的強大功能。本文選用移植性強的Qt軟件設(shè)計圖形用戶界面,所設(shè)計的GUI實用、簡潔、實現(xiàn)了人機交互,可通過鍵盤或面板對程序進行輸入、保存、修改和編譯,信息和臨時信息及時輸出、顯示,通過GUI達到了整合系統(tǒng)的目的。在Qt系統(tǒng)中,不僅有著構(gòu)造完善的系統(tǒng)結(jié)構(gòu),而且為了滿足用戶對編寫圖形用戶界面應(yīng)用的種種需求,還創(chuàng)建了許多新的系統(tǒng)機制,其中Qt所特有的內(nèi)部進程通信機制具有獨特的反應(yīng)速度,本文采用的Qt應(yīng)用進程之間通信機制是Signal-Slot機制和FIFO 機制。Linux 系統(tǒng)不斷偵查本地GUI消息,任何一個Qt消息被觸發(fā),系統(tǒng)都會立即執(zhí)行相應(yīng)程序,提高了整個系統(tǒng)的反應(yīng)速度和穩(wěn)定性,系統(tǒng)軟件設(shè)計流程如圖4所示。
圖4 系統(tǒng)軟件設(shè)計流程
3 結(jié) 語
整套系統(tǒng)的設(shè)計充分利用了ARM11 S3C6410的硬件功能和處理速度,成功移植了以S3C6410為硬件核心的Linux嵌入式系統(tǒng),并完成了基于Linux Qt的控制程序的開發(fā),解決了多項技術(shù)難點,其中包括構(gòu)建基于ZigBee通信協(xié)議的無線網(wǎng)絡(luò)、基于AT89C51的統(tǒng)一家電控制協(xié)議、基于S3C6410的GPRS遠程通信、家電控制的直接解碼與編碼等,實驗產(chǎn)品的控制結(jié)果效果令人滿意,驗證了該系統(tǒng)的先進性、穩(wěn)定性和實用性,具有廣泛的推廣和應(yīng)用價值。