【正文】
89S52單片機上,經 AT89S52處理,將把溫度在顯示電路上顯示,除了顯示溫度 以外還可以設置一個報警溫度,對所測溫度進行監(jiān)控。因此,利用新型溫度傳感器取代舊式的溫度傳感器是必然的趨勢,新型的溫度傳感器的優(yōu)勢越來越得到體現,越來越普及。無論是在工業(yè)方面,農業(yè)方面或者是平民大眾 的生活當中,我們都能看到溫度計的身影。 溫度傳感器的發(fā)展經歷了三個發(fā)展階段:傳統(tǒng)的分立式溫度傳感器 、 模擬集成溫度傳感器 、 智能集成溫度傳感器。今天,我們的生活環(huán)境和工作環(huán)境有越來越多稱之為單片機的小電腦在為我們服務。 關鍵字 :單片機;溫度傳感器;溫度計;報警 基于單片機的溫度測量系統(tǒng) 【 Abstract】 .In this design using the AT89S52 microcontroller as the main control device, DS18B20 as an LED digital temperature sensor tube to achieve temperature display. The key circuit sed the temperature to set the alarm on the lower temperature. And the temperature reaching the alarm, the system will automatically alarm. This design is from the temperature measurement circuit, main control circuit, alarm circuit, and several other aspects of the note. The system uses DS18B20 temperature measurement range, high temperature measurement resolution and peripheral circuit is simple, low power consumption, pared with AT89S52 devices constitute a simple temperature measurement circuit. The system design of flexible, antiinterference performance is good, can be in the poor working environment for temperature measurement. Keywords: AT89S52; DS18B20; thermometer; alarm 基于單片機的溫度測量系統(tǒng) 目錄 1 引言 .......................................................................................................................... 1 選題的背景 ..................................................................................................... 1 選題的目的及意義 ......................................................................................... 1 2 系統(tǒng)設計的整體方案 ......................................................................................... 3 設計的主要內容 ............................................................................................. 3 設計性能要求 ................................................................................................. 3 3 器件的選擇 ............................................................................................................ 4 單片機的選擇 ................................................................................................. 4 AT89S52 的基本組成及特征 ...................................................................... 4 AT89S52 的引腳功能 ................................................................................ 5 AT89S52 的工作模式及注意事項 ............................................................... 8 溫度傳感器的選擇 ......................................................................................... 9 DS18B20 的特點及選擇原因 ...................................................................... 9 DS18B20 的測溫原理 .............................................................................. 11 顯示器的選擇 ............................................................................................... 11 蜂鳴器 ........................................................................................................... 12 排阻 ............................................................................................................... 13 4 電路原理 .............................................................................................................. 14 單片機電路 .................................................................................................... 14 晶振電路 ............................................................................................... 14 基于單片機的溫度測量系統(tǒng) 復位電路 ............................................................................................... 16 溫度采集電路 ............................................................................................... 16 溫度顯示電路 ............................................................................................... 17 溫度上下限設置電路 ................................................................................... 17 溫度過限報警電路 ....................................................................................... 18 系統(tǒng)總電路圖電路 ....................................................................................... 19 5 系統(tǒng)流程圖 .......................................................................................................... 20 主程序 ........................................................................................................... 20 讀出溫度子程序 ........................................................................................... 21 溫度轉換命令子程序 ................................................................................... 21 計算溫度子程序 ........................................................................................... 22 顯示數據刷新子程序 .................................................................................... 22 6 軟件仿真 .............................................................................................................. 24 6. 1 軟件設計流程 ............................................................................................ 24 原理圖的繪制 ............................................................................................... 24 單片機程序的調試與編譯 ........................................................................... 26 仿真過程 ....................................................................................................... 27 7 總結 ........................................................................................................................ 28 設計總結 ....................................................................................................... 28 設計前景 ....................................................................................................... 28 8 致謝 .............................................................................................. 30 參考文獻 ........................................................................................... 31 基于單片機的溫度測量系統(tǒng) 附 錄 .