【正文】
S18B20作為檢測(cè)元件,其測(cè)溫范圍為55~125。DS18B20的程序流程圖如圖8所示讀出溫度子程序的主要功能是讀取RAM中的9字節(jié),在讀出時(shí)必須進(jìn)行CRC校驗(yàn),校驗(yàn)有錯(cuò)時(shí)不進(jìn)行溫度數(shù)據(jù)的改寫。符合設(shè)計(jì)要求??梢?,還是可以達(dá)到設(shè)計(jì)要求。但是由于時(shí)間關(guān)系,沒(méi)有實(shí)施。 //input enable。uchar shi,ge。 while(1) { for(。 if(P1_4==1) { m++。 if(count1==3) { LCM_WriteString(有光)。)。 while(1) { for(。 if(P1_4==1) {m++。 if(count1==3) { LCM_WriteString(有光)。)。 else LCM_WriteDatOrCom(1,count1+39。)。 count1++。 LCM_WriteString(液晶顯示)。 else LCM_WriteDatOrCom(1,count1+39。)。 count1++。 LCM_WriteString(液晶顯示)。sbit P1_7=P1^7。 L=write。經(jīng)過(guò),反復(fù)的調(diào)試,整個(gè)系統(tǒng)穩(wěn)定,誤差在設(shè)計(jì)要求的范圍以內(nèi)。但是,通信速度比較慢,延時(shí)在23秒之間。其流程圖如圖9所示。圖6 溫度傳感電路圖 圖7光電傳感電路圖3 DS18B20無(wú)線收發(fā)模塊程序流程圖讀取光電傳感的數(shù)據(jù)和溫度數(shù)據(jù)數(shù)據(jù)存取把數(shù)據(jù)發(fā)送到無(wú)線發(fā)射器對(duì)數(shù)據(jù)進(jìn)行編碼數(shù)據(jù)接收數(shù)據(jù)處理數(shù)據(jù)正確?NY結(jié)束DS18B20程序分為三個(gè)部分。無(wú)線發(fā)射電路圖及SM6136芯片引腳圖如圖2所示。處理芯片對(duì)數(shù)據(jù)進(jìn)行相關(guān)的處理以后再把信息傳遞給無(wú)線發(fā)射模塊,在監(jiān)測(cè)終端利用無(wú)線接收模塊接收探測(cè)點(diǎn)發(fā)射過(guò)來(lái)的信息。不能很好的顯示出相關(guān)的信息。所以,利用光敏電阻自制的光電傳感完全符合設(shè)計(jì)要求。方案2:采用美國(guó)DALLAS公司推出的智能溫度傳感器DS18B20作為檢測(cè)元件,其測(cè)溫范圍為55~125。SM6136/SM6135制作的無(wú)線收發(fā)模塊傳輸頻率為27MHZ。并且,價(jià)格要昂貴很多。在監(jiān)測(cè)終端把探測(cè)點(diǎn)的溫度和光照情況進(jìn)行實(shí)時(shí)顯示。溫度數(shù)據(jù)經(jīng)過(guò)編碼后通過(guò)無(wú)線傳輸?shù)木瓤刂圃?攝氏度以內(nèi)。把DS18B20采集回的當(dāng)前環(huán)境下的溫度數(shù)據(jù)和光電傳感器采集回來(lái)的光照情況的數(shù)據(jù)傳送給探測(cè)點(diǎn)的AT89C52,進(jìn)行相關(guān)的數(shù)據(jù)處理。Abstact:This system uses the AT89C52 microcontroller as the master chip, chosing DS18B20 as the environmental temperature collecting chips and using the photoelectric sensors to detect the ambient light. The temperature data from DS18B20 and the data from the optical sensors, about the current environment, are transmitted to the the associated data is processed. And the processed data is transmited to the control terminal of the wireless receiver module through the wireless transmitter the control terminal, the received data is processed by the master chip AT89C52 and then send it to LCD12864. Lastly the detection point temperature and light conditions in