【正文】
89S52 can drop to the static logic operation, support two software can choose power saving mode. Idle mode, the CPU to stop working, and allows the RAM, timer/counters, serial, continue to work. Protection mode, RAM by MCU, oscillator is frozen, all the work to stop until the next interruption or hardware reset. ( 2) The sensor DS18B20 5 In the traditional analog signal distance temperature measuring system, need good solve lead error pensation, multipoint measurement error and amplifying circuit switching technologies such as zero drift error problem, can achieve high measuring accuracy. Another general monitoring site of the electromagic environment is very bad, all kinds of jamming signal is stronger, the simulated temperature signal interference and vulnerable to produce measurement error and measuring precision [5]. Therefore, in temperature measuring system, the strong antijamming capability of the new digital temperature sensor is the most effective to solve these problems, pared with other temperature sensor DSl820 has the following features: (1) the unique singleline interface way. DSl820 in connection with the microprocessor only need one interface to implement line DSl820 microprocessors and twoway munication. (2) more function simplifies distributed temperature detection application. (3) DSl820 in use without any peripheral devices. (4) power, voltage range data available from V to V. (5) can measure temperature range from 55 degrees c + + to 125, incremental value 0. 5 176。本系統(tǒng)采用的是 DALLAS 公司推出的數(shù)字式 溫度傳感器DS18B20,無需外加 A/ D 即可輸出數(shù)字量,把溫度信號直接轉(zhuǎn)換成串行數(shù)字信號供微機(jī)處理。多功能溫度檢測顯示系統(tǒng)軟件主要包括:函數(shù)聲明、延遲時間函數(shù)、 DS18B20 初始化函數(shù)、讀出DS18B20 當(dāng)前的溫度、溫度數(shù)據(jù)轉(zhuǎn)化成液晶字符顯示等程序 。 風(fēng)扇電路 當(dāng)所測的溫度高于 80 攝氏度時,啟動風(fēng)扇電路。若要組成多點溫度檢測系統(tǒng),可在單片機(jī)的同一根 I/O 口線上,以相同的連接方法并聯(lián)多片 DS18B20 芯片。 外部電源供電方式:在外部電源供電方式下, DS18B20 工作電源由 VDD 引腳接入,此時 I/O 線不需要強(qiáng)上拉,不存在電源電流不足的問題,可以保證轉(zhuǎn)換精度,同時在總線上理論可以掛接任意多個 DS18B20 傳感器,組成多點測溫 3 系統(tǒng)。寄生電源方式有三個好處: 1)進(jìn)行遠(yuǎn)距離測溫時,無需本地電源。計數(shù)器 l 對低溫度系數(shù)晶振產(chǎn)生的脈沖信號進(jìn)行減法計數(shù),當(dāng)計數(shù)器 1 的預(yù)置值減到 O 時,溫度計數(shù)器的值將加 l,計數(shù)器 l 的預(yù)置值將被重新裝人,計數(shù)器 l 重新開始對低溫度系數(shù)晶振產(chǎn)生的脈沖信號進(jìn)行計數(shù),如此循環(huán)直到計數(shù)器 2 計數(shù)到 O 時,停止溫度寄存器的累加,此時溫度寄存器中的數(shù)值即為所測溫度。圖中低溫度系數(shù)品振的振蕩頻率受溫度影響很小,用于產(chǎn)生同定頻率的脈沖信號送給計數(shù)器l。測量結(jié)果以 9 位數(shù)字量方式串行傳送。 (5)可測量的溫度范圍從 55℃ 到 +125℃ ,增量值 0. 5℃ ;華氏溫度范圍從 67 到 +257,增量值 0. 9。 DSl820 在與微處理器連接時僅需要一條接口線即可實現(xiàn)微處理器與 DSl820 的雙向通訊。掉電保護(hù)方式下, RAM 內(nèi)容被保存,振蕩器被凍結(jié),單片機(jī)一切工作停止,直到下一個中斷或硬件復(fù)位為止。在單芯片上,擁有靈巧的 8 位 CPU 和在系統(tǒng)可編程 Flash,使 AT89S52 為眾多嵌入式控制應(yīng)用系統(tǒng)提供高靈活、超有效的解決方案 [5]。如果溫度小于所設(shè)定的最低溫度就啟動報警裝置。 二、 系統(tǒng)方案 本系統(tǒng)采用 AT89S52 作為該系統(tǒng)的單片機(jī)。 1 基于單片機(jī)的多功能溫度檢測系統(tǒng)的設(shè)計 一、 引言 隨著社會的發(fā)展和技術(shù)的進(jìn)步,人們越來越注重溫度檢測與顯示的重要性。本課題就是一個溫度檢測及狀態(tài)顯示的監(jiān)控系統(tǒng)。溫度 控制的基本原理為 :當(dāng) DSl8B20 采集到溫度信號后,將溫度信號送至 AT