【正文】
s Day. More and more young Chinese people begin to celebrate this day in a very similar way as that in western countries. Fewer people than ever will gaze at the heavens on Saturday to pick out the two stars shining bright on either side of the Milky Way, that is, if people even know on which day Qixi falls. There are ready reminders dotted about, in the form of big ads saying Sales on Chinese Valentine39。s time for the wild fruits to ripe. The picturesque Arxan in Autumn is indeed a fairyland only exists in a dream that satisfies all your fantasies. If it rains heavily on Saturday night, some elderly Chinese will say it is because Zhinu, or the Weaving Maid, is crying on the day she met her husband Niulang, or the Cowherd, on the Milky Way. Most Chinese remember being told this romantic tragedy when they were children on Qixi, or the Seventh Night Festival, which falls on the seventh day of the seventh lunar month, which is usually in early August. This year it falls on 24 Saturday, August 2. Folklore Story As the story goes, once there was a cowherd, Niulang, who lived with his elder brother and sisterinlaw. But she disliked and abused him, and the boy was forced to leave home with only an old cow for pany. The cow, however, was a former god who had violated imperial rules and was sent to earth in bovine form. One day the cow led Niulang to a lake where fairies took a bath on earth. Among them was Zhinu, the most beautiful fairy and a skilled seamstress. The two fell in love at first sight and were soon married. They had a son and daughter and their happy life was held up as an example for hundreds of years in China. Yet in the eyes of the Jade Emperor, the Supreme Deity in Taoism, marriage between a mortal and fairy was strictly forbidden. He ordered the heaven troop to catch Zhinu back. Niulang grew desperate when he discovered Zhinu had been taken back to heaven. Driven by Niulang39。 delay_1ms(1000)。 sta=SPI_Read(READ_REG + STATUS)。 Tx_Buf[1] = temperature / 256。 temperature = read_temp()。 //返回讀出的溫度 帶小數(shù) } /******************主程序 **********************/ void main() { CE=0。 value = 8。 //發(fā)出讀取暫存器命令 EA = 0。 //啟動(dòng)一次溫度轉(zhuǎn)換命令 delay_uint(50)。 uchar low。 //釋放總線 if(dq == 1) //開(kāi)始讀寫(xiě)數(shù)據(jù) value |= 0x80。i8。 // 60us dq = 1。i++) { //寫(xiě)數(shù)據(jù)是低位開(kāi)始 dq = 0。 //200us dq = 1。 //750us 20 dq = 1。 dq = 1。j120。 /***********************1ms 延時(shí)函數(shù) *****************************/ void delay_1ms(uint q) { uint i,j。在同學(xué)的幫助下,老師不厭其煩的修改中,使我順利完全了本次畢業(yè)設(shè)計(jì)。在對(duì)溫度監(jiān)測(cè)系統(tǒng)總體認(rèn)識(shí)的基礎(chǔ)上,利用所學(xué)的基本理論和查閱的相關(guān)資料,實(shí)現(xiàn)對(duì)其的硬件電路和軟件程序的設(shè)計(jì),做到與實(shí)際相結(jié)合。 基于 DS18B20數(shù)字溫度傳感器構(gòu)成的實(shí)時(shí)監(jiān)控系統(tǒng)確實(shí)具有精度高、抗干擾能力強(qiáng)、電路簡(jiǎn)單等諸多優(yōu)點(diǎn) 。 15 圖 52 溫度超過(guò)上下值報(bào)警器報(bào)警 6 總結(jié) 本文中無(wú)線溫度采集系統(tǒng)的設(shè)計(jì),在智能控的制方面,應(yīng)用了單片機(jī) STC89C52 作為系統(tǒng)控制的核心,最大限度的將具備的資源采用到設(shè)計(jì)中,既體現(xiàn)了單片機(jī)最小系統(tǒng)的應(yīng)用的靈活性, 又實(shí)現(xiàn)功能多樣智能控制。當(dāng)采集端傳輸數(shù)據(jù)時(shí),信號(hào)指示燈閃爍。然后將 nRF24L01 的收發(fā)部分分別與兩片 STC89C52 相連,寫(xiě)入發(fā)射一個(gè)常數(shù)的程序,檢測(cè)收發(fā)模塊及程序是否好使。 5 硬件 功能實(shí)現(xiàn) 系統(tǒng)調(diào)試 在完成硬件電路的焊接后。 初始化開(kāi)始返回值為 1跳過(guò)讀取 ID發(fā)送溫度轉(zhuǎn)換延時(shí) 800 ms復(fù)位跳過(guò)讀取 IDScratchpad 命令讀取溫度轉(zhuǎn)換結(jié)果轉(zhuǎn)換為十進(jìn)制數(shù)碼管顯示 13 圖 44 無(wú)線發(fā)射軟件流程圖 無(wú)線接收模塊軟件設(shè)計(jì) 接收數(shù)據(jù)的時(shí)后,先將 nRF24L01 配置成接收模式。 圖 43 溫度檢測(cè)軟件流程圖 無(wú)線發(fā)射模塊軟件設(shè)計(jì) 首先將進(jìn)行初始化的操作,初始化包含設(shè)置單片機(jī) I/ O 與 SPI 相關(guān)寄存器兩部分內(nèi)容,其可以與 nRF24L01 進(jìn)行通 信。然后經(jīng)過(guò)溫度處理后通過(guò)調(diào)用無(wú)線發(fā)送程序?qū)囟葦?shù)據(jù)發(fā)送給接收端。 發(fā)送部分 發(fā)送部分的一個(gè)循環(huán)的總體思路是這樣的,先初始化 nRF24L01,從 DS18B20 讀出溫度( DS18B20 采用默認(rèn)的 12 位精度),將得到的溫度值的反碼轉(zhuǎn)化成十進(jìn)制,取溫度數(shù)組的高兩位(即整數(shù)部分)寫(xiě)入發(fā)送數(shù)據(jù)數(shù)組,然后初始化 nRF24L01,將溫度發(fā)送,其流程圖如圖 41 所示。 (3)在 程序存儲(chǔ)區(qū),數(shù)據(jù)存儲(chǔ)區(qū) 需 要合理 的 規(guī)劃,既能 夠 節(jié)約內(nèi)存 的 容量,又 能操作方便 [9]。 圖 38 電源接口電路 4 系統(tǒng) 軟件設(shè)計(jì) 軟件設(shè)計(jì)思路 應(yīng)用系統(tǒng)中的應(yīng)用軟件是根據(jù)系統(tǒng)功能要求設(shè)計(jì)的,應(yīng)穩(wěn)定正確的實(shí)現(xiàn)系統(tǒng)的各種功能。 圖 36 按鍵連接電路圖 溫度采集模塊 溫度傳感器 DS18B20 可直接與單片機(jī)相連完成數(shù)據(jù)的采集與處理, 本 設(shè)計(jì)中與發(fā)送端單片機(jī)的 P26 連接 [8],接口電路如圖 37 所示。電路如圖 35 所示。如圖 32 與圖 33。本設(shè)計(jì)由 STC89C52 作為主控 CPU, DS18B20溫度采集模塊、 nRF24L0l 無(wú)線收發(fā)模塊和顯示模塊組成整個(gè)系統(tǒng),如圖 31 所示。 3 硬件系統(tǒng)設(shè)計(jì) 硬件系統(tǒng)總體結(jié)構(gòu) 隨著生活水平的不斷提高和科學(xué)技術(shù)的逐漸進(jìn)步,人們對(duì)溫度監(jiān)測(cè)數(shù)據(jù)的精度要求也越來(lái)越嚴(yán)格。用于存放 DS18B20ID 編碼的 ROM 只讀存儲(chǔ)器,它共有 64 位 ROM。C~+125176。 nRF24L01 概述 nRF24L01 是一款功耗低的新型單片射頻收發(fā)器件,工作 ~ ISM頻段。因?yàn)橐粋€(gè)機(jī)器周期含有六個(gè)狀態(tài)周期,而每個(gè)狀態(tài)周期為兩個(gè)振蕩周期,所以一個(gè)機(jī)器周期共有十二個(gè)振蕩周期,如果外接石英晶體振蕩器的振蕩頻率為 12MHZ,那么一個(gè)振蕩周期是 1/12us。 時(shí)鐘電路就相當(dāng)于單片機(jī)的一個(gè)心臟,掌握著單片機(jī)的整個(gè)工作節(jié)奏。單片機(jī)在接通電源時(shí)會(huì)產(chǎn)生復(fù)位信號(hào),完成單片機(jī)的啟動(dòng)這一過(guò)程確定單片機(jī)的起始工作狀態(tài)。要使單片機(jī)工作起來(lái)最基本的電路構(gòu)成為單片機(jī)最小系統(tǒng)如圖 21 示。在 CPU 工作停止,允許 RAM、定時(shí)器 /計(jì)數(shù)器、串口、中斷繼續(xù)工作的空閑模式。 STC89C52 主 控 制 器 發(fā)射 DS18B20 接收 STC89C52 主 控 制 器 顯示電路 報(bào)警電路 5 圖 11 溫度無(wú)線采集報(bào)警系統(tǒng)結(jié)構(gòu)框圖 2 主要元器件介紹 AT89S52 單片機(jī)簡(jiǎn)介 STC89C52 是一種低功耗、高性能具有 8K 可編 Flash 使用高密度存儲(chǔ)技術(shù)存儲(chǔ)器。 本文設(shè)計(jì)一從機(jī)與一主機(jī)。發(fā)射端端電路圖見(jiàn)附錄一圖 1。 ( 6)電源模塊:提供電源。 ( 2)發(fā)送電路和接收電路:由 nRF24L01 來(lái)完成無(wú)線數(shù)據(jù)的傳輸。 在顯示模塊的選擇上, LED7 段數(shù)碼顯示管,成本低,容易顯示控制,但不能夠顯示字符。所以選擇價(jià)格便宜、操作 簡(jiǎn)便,低功耗的傳統(tǒng)的 AT89S52 單片機(jī)。由 美國(guó) DALLAS 半導(dǎo)體公司生產(chǎn)的 可編 程 DS18B20 溫度傳感器作為溫度檢測(cè)元件,測(cè)溫范圍為 55~ 125℃。 無(wú)論在工業(yè)、農(nóng)業(yè)還是日常生活中, 凡是布線復(fù)雜或不能布線的地方都希望可以通過(guò) 無(wú)線溫度監(jiān)測(cè)系統(tǒng) 來(lái)解決。而且, 當(dāng) 數(shù)據(jù)采集點(diǎn) 在 運(yùn)動(dòng)狀態(tài) 時(shí) ,環(huán)境不能鋪設(shè)電纜,數(shù)據(jù)不得轉(zhuǎn)讓,這個(gè)時(shí)候需要使用 溫度 采集無(wú)線傳輸 。在人類社會(huì)中,無(wú)論工業(yè)、農(nóng)業(yè)、醫(yī)學(xué)及環(huán)保等部門都與溫度有著密切的關(guān)系。用戶可以通過(guò)按鍵來(lái)自定義報(bào)警上、下限值,一旦溫度超過(guò)所設(shè)定的極限值,接收端單片機(jī)便啟動(dòng)報(bào)警系統(tǒng)。 武漢長(zhǎng)江工商學(xué)院 畢業(yè)論文 (設(shè)計(jì) ) 學(xué)院 : 工學(xué)院 專業(yè) : 通信工程 年級(jí) : 2022 級(jí) 題目 :基于單片機(jī)的無(wú)線溫度采集監(jiān)測(cè)報(bào)警器的設(shè)計(jì) 學(xué)生 : 學(xué)號(hào) : 指導(dǎo)教師 : 職稱 : 2022 年 5 月 8 日 目 錄 摘 要 .............................................................. 1 關(guān)鍵詞 .............................................................. 1 Abstract............................................................ 2 Key wards........................................................... 2 前言 ................................................................ 3 1 系統(tǒng)總體設(shè)計(jì)方案 ................................................. 3 2 主要元器件介紹 ................................................... 5 AT89S52 單片機(jī)簡(jiǎn)介 .............