【正文】
,其輸出電壓與攝氏溫度成正比,線性度好,靈敏度高,精度適中。計數(shù)門的開啟時間由高溫度系數(shù)振蕩器來決定,每次測量前,首先將 55 ℃ 所對應(yīng)的基數(shù) 分別置入減法計數(shù)器 1和溫度寄存器中,減法計數(shù)器 1 和溫度寄存器被預(yù)置在 55 ℃ 所對應(yīng)的一個基數(shù)值。數(shù)據(jù)位數(shù)可設(shè)置成 1 12 位,其中七位為溫度整數(shù)部分, 1 位表示溫度正負 ,其余位數(shù)為小數(shù)。 DS18B20 工作時需要接受特定的指令來完成相應(yīng)的功能,它的指令可分為 ROM 指令和 RAM 指令 [8]。 FLASH 存儲器編程時,該引腳加上 12V的編程允許電源 Vpp,當然這必須是該器件是使用 12V編程電壓 Vpp。對 FLASH存儲器編程期間,該引腳還用于輸入編程脈沖( PROG)。 P3 口亦作為 STC12C5A60S2 特殊功能(第二功能)使用,如下所示。作為輸入使用時,被外部拉低的引腳由于內(nèi)部電阻的原因,將輸出電流( IIL)。在 flash 編程和校驗時, P1 口接收低 8 位地址字節(jié)。 當訪問外部程序和數(shù)據(jù)存儲器時, P0 口也被作為低 8 位地址 /數(shù)據(jù)復(fù)用。在單芯片上,擁有靈巧的 8 位 CPU和在線系統(tǒng)可編程Flash,使得 STC12C5A60S2 為眾多嵌入式控制應(yīng)用系統(tǒng)提供高靈活、超 級 有效的解決方案。整個電路才用9V開關(guān)電源供電。 研究 /設(shè)計的目標 本系統(tǒng)是一種安裝在以水為媒體的集中供熱系統(tǒng)中,用于對用戶的采暖熱量進行計算分配的裝置。 供熱公司充分認識到了這 些缺點 , 便 開始逐步的淘汰電話測溫系統(tǒng) 。有了一整套成熟的供熱系統(tǒng)運行模式。供熱計量產(chǎn)業(yè)格局也基本形成,表具產(chǎn)品、控制產(chǎn)品及系統(tǒng)服務(wù)、系統(tǒng)服務(wù)商等大量涌現(xiàn)。河北省承德市計量收費試點工作,在取得了顯著節(jié)能效果的同時還為河北省推廣 計量收費積累了豐富的經(jīng)驗;甘肅省榆中縣作為一個貧困縣,其成功的供熱體制改革經(jīng)驗 2 表明資金短缺并不能作為推進供熱計量工作的阻礙,為貧困地區(qū)開展供熱計量工作打開了一條新思路。第二個時期是消化吸收,我國供熱計量的發(fā)展受丹麥,德國和芬蘭三個國家的影響比較 大 。共同為節(jié)能減排做有效的保護措施。進一步加強節(jié)能減排工作,也是應(yīng)對全球氣候變化的迫切需要。 我國經(jīng)濟快速增長,各項建設(shè)取得巨大成就,但也付出了巨大的資源和環(huán)境代價,經(jīng)濟發(fā)展與資源環(huán)境的矛盾日趨尖銳,群眾對環(huán)境污染問題反應(yīng)強烈。設(shè)計本系統(tǒng)主要的目的是利用SIM300 將供熱戶的室內(nèi)溫度定時的發(fā)送到供熱中心,供熱中心可以及時的發(fā)現(xiàn)熱用戶是否在浪費熱源(如開窗戶,放熱水等)。s rapid economic growth, The construction has made great achievements, But also paid a huge resource and environmental costs, Economic development and resources and the environment bee increasingly acute contradictions, Masses reacted strongly to environmental pollution problems. This situation and the economic structure is irrational, Do not speed up the adjustment of economic structure, change the mode of growth, Resources can not support, the environment does not fit, can not afford the social and economic development is difficult to continue. Only by adhering to conservation development, clean development. Security and development in order to achieve sound and rapid economic development. Meanwhile, the room temperature gas emissions cause global warming, a subject of widespread concern. Further strengthen energy conservation work, but also respond to the urgent need for global climate change. Today heating energy conservation has bee an important goal. The system is designed to effectively control the unreasonable waste, but also to reduce energy waste. The main purpose of this system design is the use of the heating households SIM300 indoor temperature regularly sent to the central heating, heating center can be found in a timely manner whether the waste heat source heat users (such as opening the window, put hot water, etc.). And timely treatment heat III users, or to prevent such waste heat user behavior. The aim is to achieve energy conservation, but also for a reasonable charge heating costs, the true realization, temperature method heat metering and charging purposes. System extends the upper and lower temperature alarm, keyloggers current temperature value. Meanwhile heat users can put the problem of poor heating timely response to the heating center, doing so both sides can reach a valid certificate. Together for effective protection to energy saving measures. The system also increased the years, days, hours, minutes, seconds, weeks and other functions. Keywords: SIM300 LCD1602 DS18B20 Temperature acquisition Button IV 目 錄 摘 要 ......................................................... I ABSTRACT ..................................................... II 第 1 章 緒論 ................................................... 8 供熱計量器的發(fā)展歷程 .................................... 8 研究的目的和意義 ........................................ 3 研究 /設(shè)計的目標 ......................................... 3 第 2 章 系統(tǒng)的工作原理 ......................................... 5 系統(tǒng)的原理 .............................................. 5 CPU( STC12C5A60S2) 主要性能 ............................. 6 CPU 的主要性能 ...................................... 6 功能特性描述 ........................................ 6 第 3 章 系統(tǒng)的硬件選擇 ........................................ 10 本系統(tǒng)的構(gòu)成 ........................................... 10 本系統(tǒng)的硬件選擇 ....................................... 10 溫度傳感器的選擇 ................................... 11 AD 轉(zhuǎn)換芯片的選擇方案 .............................. 14 每戶終端向供熱公司數(shù)據(jù)傳輸選擇方案 ................. 19 DS1302 時鐘芯片 .................................... 25 EEPROM 的選擇方案 .................................. 30 顯示電路的選擇 ..................................... 35 V 蜂鳴器模塊設(shè)計 ..................................... 39 串口通信的設(shè)計 ..................................... 39 按鍵電路的設(shè)計 ..................................... 41 電源部分的設(shè)計 .................................... 42 單片機復(fù)位電路部分 ................................ 43 第 4 章 軟件設(shè)計 .............................................. 45 系統(tǒng)總流程圖 ........................................... 45 各模塊功能流程圖設(shè)計 ................................... 45 第 5 章 軟硬 件的調(diào)試過程 ...................................... 51 單片機最小系統(tǒng)的硬件設(shè)計 ............................... 51 單片機所有硬件電路的焊接過程 ........................... 51 軟件的調(diào)試過程 ......................................... 52 裝有 SIM300 模塊的硬件通信軟件調(diào)試過程 .................. 53 基本功能實現(xiàn) ........................................... 54 結(jié) 論 ....................................................... 55 致 謝 ....................................................... 57 參考文獻 ..................................................... 58 附錄 1 本設(shè)計的整體電路圖 .................................... 60 附錄 2 本設(shè)計的主要程序代碼 .................................. 61 VI Contents Abstract ...............................................................................................................I ABSTRACT ...................................................................................................... II Chapter 1 Introduction .....................................................................