【正文】
In this paper, design a temperature control system, with the microcontroller as the microcontroller the choice of digital temperature sensors, temperature control, a GPRSbased technology solutions for remote temperature monitoring system, using AT89C51 microcontroller and digital temperature sensor for field DS18B20 Temperature data acquisition and processing, and through the GPRS module TC39i remote data transmission and reception, with high accuracy, good stability. Hardware design of a microcontrollerbased smart temperature control system to AT89C51 microcontroller as the core, using a temperature sensor DS18B20, the GPRSbased wireless munication module, based on AT mands and data acquisition, to build a remote temperature data acquisition system For temperature control The results show the good effect of the system and have broad application prospects. Key Words:Temperature acquisition system, monitoring software, Microcontrolle 鹽城工學(xué)院本科生畢業(yè)說(shuō)明書(shū) ( 2020) 4 目 錄 1. 概 述 ..........................................................................................................................5 課題設(shè)計(jì)背景 .........................................................................................................5 課題設(shè)計(jì)意義 .........................................................................................................5 2. 系統(tǒng)的總體結(jié)構(gòu)與硬件電路設(shè)計(jì) ..................................................................................6 系統(tǒng)總體結(jié)構(gòu)設(shè)計(jì) .................................................................................................6 溫度采集模塊設(shè)計(jì) .................................................................................................6 單片機(jī)電路設(shè)計(jì) .....................................................................................................8 通信電路設(shè)計(jì) .....................................................................................................13 ..............................................................................................................15 下位機(jī)總體軟件的設(shè)計(jì) .......................................................................................15 溫度采集程序設(shè)計(jì) ................................................................................................17 通信模塊設(shè)計(jì) ........................................................................................................19 ..............................................................................................................23 GPRS 通信網(wǎng)絡(luò) ..................................................................................................23 遠(yuǎn)程溫度檢測(cè)的實(shí)現(xiàn)原理 .................................................................................24 GPRS DTU 遠(yuǎn)程溫度監(jiān)測(cè)界面 ........................................................................25 ..............................................................................................................26 ..............................................................................................................................28 致 謝 .............................................................................................................................30 附錄 1:采集系統(tǒng)接線(xiàn)圖 ...........................................................................................32 附錄 2:元器件表 .......................................................................................................33 鹽城工學(xué)院本科生畢業(yè)說(shuō)明書(shū) ( 2020) 5 1. 概 述 課題設(shè)計(jì)背景 溫度與人們的生產(chǎn)生活密切相關(guān) , 需要對(duì)溫度監(jiān)測(cè)的場(chǎng)合非常多。因而設(shè)計(jì)一種較為理想的溫度控制系統(tǒng)是非常有價(jià)值的。例如:在冶金工業(yè) 、 化工生產(chǎn) 、 電力工程 、 造紙行業(yè) 、 機(jī)械制造和食品加工等諸多領(lǐng)域中 , 人們都需要對(duì)各類(lèi)加熱爐 、 熱處理爐 、 反應(yīng)爐和鍋爐中的溫度進(jìn)行檢測(cè)和控制 ; 在農(nóng)業(yè)生產(chǎn)、糧食儲(chǔ)備、計(jì)算機(jī)機(jī)房等都需要對(duì)溫度進(jìn)行控制。 關(guān)鍵詞: 溫度采集系統(tǒng);監(jiān)控軟件;單片機(jī) 3 GPRSbased remote temperature monitoring system Abstract:Temperature is the main accused in the industrial production one of the parameters, associated with a variety of temperature control systems are widely used in metallurgy, chemical Ding, machinery, food and other control is the small business often encountered in production process on the temperature control process directly influences the quality of example: in the metallurgical industry, chemical production, power engineering, paper industry, machinery manufacturing and food processing and many other areas, people need all kinds of furnace, heat treatment furnace, the temperature in the reactor and boiler testing and control。這些特點(diǎn)適合于提高企業(yè)計(jì)量信息的及時(shí)性、可靠性、準(zhǔn)確性和實(shí)現(xiàn)企業(yè)生產(chǎn)管理的信息化。溫度檢測(cè)采用 DS18B20, 非常適用于多點(diǎn) 、 惡劣環(huán)境下的溫度監(jiān)測(cè)系統(tǒng)。 DS18B20 簡(jiǎn)介 DS18B20 為單總線(xiàn)數(shù)字化溫度傳感器,由其組成的測(cè)溫系統(tǒng)精度較高,能達(dá)到小數(shù)點(diǎn)后 3 位,而且具有連接方便,占用接口線(xiàn)少等優(yōu)點(diǎn)。圖中的頻率累加器用于補(bǔ)償和修正測(cè)溫過(guò)程中的非線(xiàn)性,其輸出用于修正減法計(jì)數(shù)器的預(yù)置值,只要計(jì)數(shù)門(mén)仍未關(guān)閉就重復(fù)上述過(guò)程,直至溫度寄存器值達(dá)到被測(cè)溫度值。由于將多功能 8 位 CPU 和閃爍存儲(chǔ)器組合在單個(gè)芯片中, ATMEL 的AT89C51 是一種高效微控制器。 P0 能夠用于外部程序數(shù)據(jù)存儲(chǔ)器,它可以被定義為數(shù)據(jù) /地址的第八位。 P2 口當(dāng)用于外部程序存儲(chǔ)器或 16 位地址外部數(shù)據(jù)存儲(chǔ)器進(jìn)行存取時(shí), P2 口輸出地址的高八位。當(dāng)振蕩器復(fù)位器件時(shí),要保持 RST 腳兩個(gè)機(jī)器周期的高電平時(shí)間。另外,該引腳被略微拉高。 XTAL1:反向振蕩放大器的輸入及內(nèi)部時(shí)鐘工作電路的輸入。本次設(shè)計(jì)中采用按鍵復(fù)位的方法進(jìn)行復(fù)位操作。 Y11 2 M H ZC83 3 p FC93 3 p FA T 8 9 C 5 1X 2X 1 圖 26 時(shí)鐘電路 基于 GPRS 的遠(yuǎn)程溫度監(jiān)測(cè)系統(tǒng)設(shè)計(jì) 12 單片機(jī)外圍電路設(shè)計(jì) 圖 27 是單片機(jī)的外圍電路,主要包括晶振電路、復(fù)位電路、采集電路。 GPRS DTU 的選型 ZWG23A 是一款基于 GPRS 網(wǎng)絡(luò)的無(wú)線(xiàn)數(shù)據(jù)傳輸終端設(shè)備,提供全透明數(shù)據(jù)通道,可以方便的實(shí)現(xiàn)遠(yuǎn)程、無(wú)線(xiàn)、網(wǎng)絡(luò)化的通信方式。由于 TTL 電平和 RS232C 電平互不兼容,所以?xún)烧呓涌跁r(shí),必須進(jìn)行電平轉(zhuǎn)換。 開(kāi) 始采 集 數(shù) 據(jù)溫 度 采 集 設(shè) 定 溫 度 上 限溫 度 采 集 設(shè) 定 溫 度 上 限中 斷 入 口A單 片 機(jī) 自 身 初始 化 , T C 3 9 I 初始 化中 斷 入 口B開(kāi) 始采 集 數(shù) 據(jù)溫 度 采 集 設(shè) 定 溫 度 上 限溫 度 采 集 設(shè) 定 溫 度 上 限中 斷 入 口A單 片 機(jī) 自 身 初始 化 , T C 3 9 I 初始 化中 斷 入 口B 基于 GPRS 的遠(yuǎn)程溫度監(jiān)測(cè)系統(tǒng)設(shè)計(jì) 16 開(kāi) 始采 集 數(shù) 據(jù)溫 度 采 集 設(shè) 定 溫 度 上 限溫 度 采 集 設(shè) 定 溫 度 上 限中 斷 入 口A單 片 機(jī) 自 身 初始 化 , T C 3 9 I 初始 化中 斷 入 口B 鹽城工學(xué)院本科生畢業(yè)說(shuō)明書(shū) ( 2020) 17 發(fā) 送 成 功 ?向 T C 3 9 i 發(fā) 送 指 令 , 發(fā) 送 信息讀 取 發(fā) 送 數(shù) 據(jù) , 用 戶(hù) 賬 號(hào) , 發(fā) 送 內(nèi)容 , 短 信 息 中 心 號(hào) 碼 單 片 機(jī) 自 身 初 化 , 初 始 化T C 3 9 i結(jié) 束開(kāi) 始延 遲 1 秒NY 圖 31 下 位機(jī)軟件主流程圖 溫度采集方面,首先初始化溫度傳感器,等待單片機(jī)的應(yīng)答,一旦單片機(jī)檢測(cè)到應(yīng)答脈沖,便執(zhí)行跳過(guò) ROM 匹配操作命令,就可以使用內(nèi)存操作命令,啟動(dòng)溫度轉(zhuǎn)換,延時(shí)一段時(shí)間后,等待溫度轉(zhuǎn)換完成。 //DQ