多路溫度采集系統(tǒng)畢業(yè)實(shí)習(xí)_第1頁(yè)
多路溫度采集系統(tǒng)畢業(yè)實(shí)習(xí)_第2頁(yè)
多路溫度采集系統(tǒng)畢業(yè)實(shí)習(xí)_第3頁(yè)
多路溫度采集系統(tǒng)畢業(yè)實(shí)習(xí)_第4頁(yè)
多路溫度采集系統(tǒng)畢業(yè)實(shí)習(xí)_第5頁(yè)
已閱讀5頁(yè),還剩9頁(yè)未讀, 繼續(xù)免費(fèi)閱讀

下載本文檔

版權(quán)說(shuō)明:本文檔由用戶(hù)提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權(quán),請(qǐng)進(jìn)行舉報(bào)或認(rèn)領(lǐng)

文檔簡(jiǎn)介

1、 畢業(yè)實(shí)習(xí)報(bào)告題目:多路溫度采集系統(tǒng)學(xué) 院 電子與信息工程專(zhuān) 業(yè) 電子信息工程班級(jí)學(xué)號(hào) 0910910114姓 名 指導(dǎo)教師 完成時(shí)間 2013-3-6 成 績(jī)2013年 3 月一、摘要:本次設(shè)計(jì)介紹了基于單片機(jī)at89c51控制ds18b20的智能溫度顯示,給出了該顯示儀的硬件電路及詳細(xì)說(shuō)明,重點(diǎn)介紹了ds18b20與單片機(jī)的接口設(shè)計(jì)以及數(shù)字溫度計(jì)的軟件的主程序、ds18b20讀寫(xiě)程序和顯示程序,并給出了基于proteus軟件的電路仿真圖。該儀表具有簡(jiǎn)單、穩(wěn)定、實(shí)用、精度高等優(yōu)點(diǎn)二、實(shí)習(xí)的內(nèi)容、安排本次實(shí)習(xí)分5次實(shí)驗(yàn)室時(shí)間第一次:查閱資料,為確定方案建立基礎(chǔ)。第二次:整理資料,確立方案。第三

2、次:畫(huà)原理圖,寫(xiě)仿真。最后兩次:查漏補(bǔ)缺,完善成果。三、實(shí)習(xí)的具體實(shí)現(xiàn)本系統(tǒng)中溫度傳感器獲取較高精確度的溫度值并將其傳至單片機(jī)中處理并能將測(cè)得的溫度在數(shù)碼管中顯示。還從鍵盤(pán)上輸入需要設(shè)定的溫度范圍。當(dāng)高與上限溫度時(shí)定時(shí)觸發(fā)蜂鳴器報(bào)警。需用戶(hù)手動(dòng)停止報(bào)警或者當(dāng)溫度回落至用戶(hù)設(shè)定的上下限溫度范圍內(nèi)時(shí)能自動(dòng)停止報(bào)警。根據(jù)系統(tǒng)的設(shè)計(jì)要求,當(dāng)溫度傳感器ds18b20把所測(cè)得的溫度發(fā)送到at89c51單片機(jī)上,經(jīng)at89c51處理,將把溫度在顯示電路上顯示。當(dāng)開(kāi)機(jī)后,顯示屏和計(jì)時(shí)器進(jìn)行初始化設(shè)置。 利用at89c51芯片控制溫度傳感器ds18b20進(jìn)行實(shí)時(shí)溫度檢測(cè)并顯示,能夠?qū)崿F(xiàn)快速測(cè)量環(huán)境溫度。 系統(tǒng)框

3、圖如下圖: 圖1.1 系統(tǒng)框圖 選擇ds18b20作為本系統(tǒng)的溫度傳感器,選擇單片機(jī)at89c51為測(cè)控系統(tǒng)的核心來(lái)完成數(shù)據(jù)采集、處理、顯示、報(bào)警等功能。選用數(shù)字溫度傳感器ds18b20,輸出信號(hào)全數(shù)字化。便于單片機(jī)處理及控制,省去傳統(tǒng)的測(cè)溫方法的很多外圍電路,省卻了采樣保持電路、運(yùn)放、數(shù)模轉(zhuǎn)換電路以及進(jìn)行長(zhǎng)距離傳輸時(shí)的串并轉(zhuǎn)換電路,簡(jiǎn)化了電路,縮短了系統(tǒng)的工作時(shí)間,降低了系統(tǒng)的硬件成本。 當(dāng)lcd液晶顯示器接收到來(lái)自at89c51單片機(jī)傳送來(lái)的溫度信息后,分別顯示了當(dāng)前的溫度 詞系統(tǒng)采用數(shù)碼管顯示,是考慮到其簡(jiǎn)單易實(shí)現(xiàn),單片機(jī)選擇89c51.電路連接圖與仿真圖如下。五、附錄單片機(jī)(at89c

4、51),數(shù)碼管,溫度傳感器18b20 (12個(gè)),鍵盤(pán)(2),蜂鳴器1個(gè)鎖存器(2個(gè))6、 心得體會(huì)本次課程設(shè)計(jì)中,本人就采用了這種已經(jīng)相當(dāng)普及的方法設(shè)計(jì)了一個(gè)基于單片機(jī)和溫度傳感器的多路溫度采集系統(tǒng),并通過(guò)了軟件仿真,最后得出了設(shè)計(jì)結(jié)果的可行性,設(shè)計(jì)過(guò)程中,首先,要對(duì)ds18b20做一個(gè)詳細(xì)的了解,作為設(shè)計(jì)中一個(gè)重要的元件,要知道它的一般流程:初始化rom操作指令存儲(chǔ)器操作指令數(shù)據(jù)傳輸。然后必須掌握它的每個(gè)端口的作用,并用單片機(jī)通過(guò)高低電平來(lái)控制它的工作過(guò)程,不一樣的模塊它的工作時(shí)序是不同,這里要通過(guò)軟件正確的編寫(xiě)出讀寫(xiě)時(shí)序,才能確保在測(cè)量溫度的環(huán)節(jié)中不出問(wèn)題。一個(gè)完整的系統(tǒng)同樣也需要一個(gè)人

5、機(jī)界面才能便于使用者讀出數(shù)據(jù),所以這里用到了lcd1602液晶屏,這個(gè)液晶屏的優(yōu)點(diǎn)在于自帶字庫(kù),且易于控制顯示位置,基本上達(dá)到了設(shè)計(jì)的要求。 同時(shí),在做整個(gè)課程論文的過(guò)程中,也遇到了諸多問(wèn)題: 第一,不能靈活自如的運(yùn)用c51語(yǔ)言。 第二,對(duì)某些硬件的功能不太熟悉。 第三,缺乏一定的理論基礎(chǔ)。 但是,通過(guò)老師和同學(xué)們的幫助,最終還是取得了一個(gè)令人滿(mǎn)意的結(jié)果,再次對(duì)幫助過(guò)我的老師和同學(xué)們表示感謝,我也會(huì)在以后的學(xué)習(xí)工作中,逐步彌補(bǔ)自己的不足。7 程序代碼#include lcd1602.h#include ds18b20.h#include unsigned char temp5;extern c

6、har xiaoshu_temp5,zhen_temp4;extern bit flag;extern bit dot_dis;/uchar ds18b20_num18=0x25,0x00,0x00,0x00,0xb8,0xc5,0x45,0x28;code uchar ds18b20_num18=0xfd,0x00,0x00,0x00,0xb8,0xc5,0x45,0x28;code uchar ds18b20_num28=0x8e,0x00,0x00,0x00,0xb8,0xc5,0x30,0x28;code uchar ds18b20_num38=0xb9,0x00,0x00,0x00,

7、0xb8,0xc5,0x31,0x28;code uchar ds18b20_num48=0xe0,0x00,0x00,0x00,0xb8,0xc5,0x32,0x28;code uchar ds18b20_num58=0xd7,0x00,0x00,0x00,0xb8,0xc5,0x33,0x28;code uchar ds18b20_num68=0x52,0x00,0x00,0x00,0xb8,0xc5,0x34,0x28;code uchar ds18b20_num78=0x65,0x00,0x00,0x00,0xb8,0xc5,0x35,0x28; code uchar ds18b20_

8、num88=0x3c,0x00,0x00,0x00,0xb8,0xc5,0x36,0x28; uchar my_temp9;void get1_ds18b20(void);void get2_ds18b20(void);void get3_ds18b20(void);void get4_ds18b20(void);void get5_ds18b20(void);void get6_ds18b20(void);void get7_ds18b20(void);void get8_ds18b20(void);void es_isr (void) ; uchar i; / uchar *ds18b20

9、_rom; char *str1=1:;char *str2=2:;char *str3=3:; char *str4=4:;char *str5=5:;char *str6=6:;char *str7=7:;char *str8=8:;void delay(unsigned int time)unsigned int i,j;for(i=0;itime;i+)for(j=0;j200;j+);void main(void) scon = 0x50; /串口方式1,允許接收tmod = 0x20; /定時(shí)器1定時(shí)方式2 pcon=0x00;th1 = 0xfd; /11.0592mhz 480

10、0波特率tl1 = 0xfd;et1=0;es=1;ea=1; /4800*2=9600波特率tr1 = 1; /* while(1)sbuf=1;while(!ti);ti=0;delay(1000); */serial_set(); lcd_init(); clrscreen();/gotoxy(0,0); /dot_dis=1;/ds18b20_rom=read_rom(); /讀序列號(hào)/for(i=0;i8;i+) /ds18b20_num2i=*ds18b20_rom;/ds18b20_rom+;/gotoxy(0,1);/for(i=0;i8;i+) /顯示序列號(hào)/print_ch

11、ar(ds18b20_num2i/16);/print_char(ds18b20_num2i%16);/while(1)get1_ds18b20();get2_ds18b20(); get3_ds18b20(); get4_ds18b20(); delay(1000); clrscreen(); get5_ds18b20(); get6_ds18b20();get7_ds18b20();get8_ds18b20();delay(1000); clrscreen(); void get1_ds18b20(void)ds18b20_init(); ds18b20_writecommand(0xcc

12、); ds18b20_writecommand(0x44); /轉(zhuǎn)換delay(500);match_rom(ds18b20_num1); /匹配第一路 ds18b20_writecommand(0xbe); /讀 for(i=0;i2;i+) tempi=ds18b20_readdata(); my_temp1= (temp1&0x7)*0x10+(temp0&0xf0)/0x10;temperature_process(temp0,temp1);screen_home();print(str1);if(!flag) /正print(zhen_temp);if(dot_dis)print(.

13、);print(xiaoshu_temp);else /負(fù)print(-);print(zhen_temp);if(dot_dis)print(.);print(xiaoshu_temp); print( );void get2_ds18b20(void)ds18b20_init(); ds18b20_writecommand(0xcc); ds18b20_writecommand(0x44); /轉(zhuǎn)換delay(500);match_rom(ds18b20_num2); /匹配第二路 ds18b20_writecommand(0xbe); /讀 for(i=0;i2;i+) tempi=ds

14、18b20_readdata(); my_temp2= (temp1&0x7)*0x10+(temp0&0xf0)/0x10;temperature_process(temp0,temp1);gotoxy(9,0);print(str2);if(!flag) /正print(zhen_temp);if(dot_dis)print(.);print(xiaoshu_temp);else /負(fù)print(-);print(zhen_temp);if(dot_dis)print(.);print(xiaoshu_temp);print( );void get3_ds18b20(void)ds18b2

15、0_init(); ds18b20_writecommand(0xcc); ds18b20_writecommand(0x44); /轉(zhuǎn)換delay(500);match_rom(ds18b20_num3); /匹配第三路 ds18b20_writecommand(0xbe); /讀for(i=0;i2;i+) tempi=ds18b20_readdata(); my_temp3= (temp1&0x7)*0x10+(temp0&0xf0)/0x10;temperature_process(temp0,temp1);gotoxy(0,1);print(str3);if(!flag) /正pri

16、nt(zhen_temp);if(dot_dis)print(.);print(xiaoshu_temp);else /負(fù)print(-);print(zhen_temp);if(dot_dis)print(.);print(xiaoshu_temp); print( );void get4_ds18b20(void)ds18b20_init(); ds18b20_writecommand(0xcc); ds18b20_writecommand(0x44); /轉(zhuǎn)換delay(500);match_rom(ds18b20_num4); /匹配第四路 ds18b20_writecommand(0

17、xbe); /讀for(i=0;i2;i+) tempi=ds18b20_readdata(); my_temp4= (temp1&0x7)*0x10+(temp0&0xf0)/0x10; temperature_process(temp0,temp1);gotoxy(9,1);print(str4);if(!flag) /正print(zhen_temp);if(dot_dis)print(.);print(xiaoshu_temp);else /負(fù)print(-);print(zhen_temp);if(dot_dis)print(.);print(xiaoshu_temp);print(

18、 );void get5_ds18b20(void)ds18b20_init(); ds18b20_writecommand(0xcc); ds18b20_writecommand(0x44); /轉(zhuǎn)換delay(500);match_rom(ds18b20_num5); /匹配第五路 ds18b20_writecommand(0xbe); /讀 for(i=0;i2;i+) tempi=ds18b20_readdata(); my_temp5= (temp1&0x7)*0x10+(temp0&0xf0)/0x10; temperature_process(temp0,temp1);scree

19、n_home();print(str5);if(!flag) /正print(zhen_temp);if(dot_dis)print(.);print(xiaoshu_temp);else /負(fù)print(-);print(zhen_temp);if(dot_dis)print(.);print(xiaoshu_temp); print( );void get6_ds18b20(void)ds18b20_init(); ds18b20_writecommand(0xcc); ds18b20_writecommand(0x44); /轉(zhuǎn)換delay(500);match_rom(ds18b20_

20、num6); /匹配第六路 ds18b20_writecommand(0xbe); /讀 for(i=0;i2;i+) tempi=ds18b20_readdata(); my_temp6= (temp1&0x7)*0x10+(temp0&0xf0)/0x10; temperature_process(temp0,temp1);gotoxy(9,0);print(str6);if(!flag) /正print(zhen_temp);if(dot_dis)print(.);print(xiaoshu_temp);else /負(fù)print(-);print(zhen_temp);if(dot_di

21、s)print(.);print(xiaoshu_temp); print( );void get7_ds18b20(void)ds18b20_init(); ds18b20_writecommand(0xcc); ds18b20_writecommand(0x44); /轉(zhuǎn)換delay(500);match_rom(ds18b20_num7); /匹配第七路 ds18b20_writecommand(0xbe); /讀 for(i=0;i2;i+) tempi=ds18b20_readdata(); my_temp7= (temp1&0x7)*0x10+(temp0&0xf0)/0x10; temperature_process(temp0,temp1);gotoxy(0,1);print(str7);if(!flag) /正print(zhen_temp);if(dot_dis)print(.);print(xiaoshu_temp);else /負(fù)print(-);print(zhen_temp);if(dot_dis)print(.);print(xiaoshu_temp); print( );void get8_ds18b20(void)ds18b20_init(); ds18b20_write

溫馨提示

  • 1. 本站所有資源如無(wú)特殊說(shuō)明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請(qǐng)下載最新的WinRAR軟件解壓。
  • 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請(qǐng)聯(lián)系上傳者。文件的所有權(quán)益歸上傳用戶(hù)所有。
  • 3. 本站RAR壓縮包中若帶圖紙,網(wǎng)頁(yè)內(nèi)容里面會(huì)有圖紙預(yù)覽,若沒(méi)有圖紙預(yù)覽就沒(méi)有圖紙。
  • 4. 未經(jīng)權(quán)益所有人同意不得將文件中的內(nèi)容挪作商業(yè)或盈利用途。
  • 5. 人人文庫(kù)網(wǎng)僅提供信息存儲(chǔ)空間,僅對(duì)用戶(hù)上傳內(nèi)容的表現(xiàn)方式做保護(hù)處理,對(duì)用戶(hù)上傳分享的文檔內(nèi)容本身不做任何修改或編輯,并不能對(duì)任何下載內(nèi)容負(fù)責(zé)。
  • 6. 下載文件中如有侵權(quán)或不適當(dāng)內(nèi)容,請(qǐng)與我們聯(lián)系,我們立即糾正。
  • 7. 本站不保證下載資源的準(zhǔn)確性、安全性和完整性, 同時(shí)也不承擔(dān)用戶(hù)因使用這些下載資源對(duì)自己和他人造成任何形式的傷害或損失。

最新文檔

評(píng)論

0/150

提交評(píng)論