【正文】
sbit RW=P2^2。// 發(fā)光 sbit ganzao =P1^5。 ifndef LCD_CHAR_1604 define LCD_CHAR_1604 include sbit LcdRs = P3^5。 GotoXY(28,1)。 GotoXY(23,0)。 //檢測濕度是否超限 DS1302_GetTime(amp。 //濕度轉換 caculation_SHT(amp。 GotoXY(0,1)。 //定義時間日期結構體 SHT_dat aa。在此向所有在畢業(yè)設計的過程中給予過我?guī)椭睦蠋熀屯瑢W致以最誠摯的謝意。為了準確反映糧倉環(huán)境中的溫濕度,本文對露點做出了分析,并對露點進行了計算。接下來對控制系統的軟件設計加以介紹,內容包括軟件開發(fā)平臺介紹,主程序流程設計,溫濕度采集及處理流程設計,LCD顯示流程設計和超限處理流程設計。鼠標在屏幕左側的 Source Group1文件夾圖標上右擊彈出菜單,在這里可以進行在項目中增加減少文件等操作。最新版支持非常豐富仿真元件共7000多種,還有很多第三方模型。 其功能模塊包含—個易用而又功能強大的ISIS原理布圖工具;PROSPICE混合模型SPICE仿真;ARES PCB設計。 LCD顯示流程圖 超限處理流程設計溫濕度值的判斷及相應的報警是超限處理流程的核心。軟件編制的好壞對系統的可靠性和穩(wěn)定性等性能也有很大的影響。連接定位器支持的代碼區(qū)可達32個,這就允許用戶在原有64K ROM 的8015基礎上擴展程序。C51已被完全集成到uVision4的集成開發(fā)環(huán)境中,這個集成開發(fā)環(huán)境包含:編譯器,匯編器,實時操作系統,項目管理器,調試器。地線、電源線、信號線之間的寬度關系是:地線電源線信號線。D0、DDDD5 分別代表著發(fā)光、降溫、加熱、干燥和加濕,一旦傳感器測定的溫濕度超過設定的限額,就會產生不同的發(fā)光反應,起警示作用,同時蜂鳴報警器連續(xù)發(fā)出“滴”的聲音。 指令 5:光標或顯示移位,S/C:高電平時移動顯示的文字,低電平時移動光標。1604 液晶模塊內部的字符發(fā)生存儲器(CGROM)已經存儲了160個不同的點陣字符圖形,[6]所示,每一個字符都有一個固定代碼,比如大寫的英文字母“A”的代碼是 01000001B(41H),顯示時模塊把地址41H中的點陣字符圖形顯示出來,我們就能看到字母“A”。 第5腳:RW為讀寫信號線,高電平時進行讀操作,低電平時進行寫操作。 顯示電路設計此模塊分為兩個顯示部分,一個部分是由LCD1604芯片組成的日期時間和實時溫濕度顯示的電路部分。由于相對濕度數字輸出特性呈一定的非線性,因此為了補償濕度傳感器的非線性,要對濕度值加以修正,: ()式中:RHlinear為經過線性補償后的濕度值,SORH為相對濕度測量值,CCC3 為線性補償系數。在高濕(95%RH)環(huán)境中,加熱傳感器可預防傳感器結露,同時縮短響應時間,提高精度。該芯片已經廣泛應用于暖通空調、汽車、消費電子、自動控制等領域。實時時鐘/日歷電路提供秒分時日、日期月年的信息。該器件采用ATMEL高密度非易失存儲器制造技術制造,與工業(yè)標準的MCS51指令集和輸出管腳相兼容。其他組成部分為實時時鐘發(fā)生電路,產生同現在相同的時間和具體日期,通過LCD1604液晶模塊顯示。首先我們必須了解溫濕度控制對于家庭和現在社會的重要性,其次我們才能夠對此做出更好的判斷,以求更好地滿足用戶的需要。伴隨著電子科學技術的進一步發(fā)展,數據采集系統也發(fā)生了日新月異的變化,其整體的性能、實用性方面都有所改進。實驗在一個儲量500噸、高16米的中型倉中進行。 國內外現狀糧倉測控技術的研究始于20世紀70年代,它是科學保糧的重要技術之一,隨著國家農業(yè)產業(yè)政策的不斷完善,以及現代科學技術在農業(yè)生產中的應用和推廣,國家糧食總產量不斷創(chuàng)造歷史新高。主要存在問題有如何隨時掌握每個倉內糧食的質量變化情況,保證入庫的糧食在較長時間的保存期內不變質。 關鍵詞:單片機;SHT11;LCD;DS1302;溫濕度控制 I AbstractIn the process of grain storage, grain deteriorates due to the abnormal of the barn’s temperature and humidity, and the economic losses which brought about are amazing. At present many grain storage units in our country use the traditional methods which is bined of thermometer device, artificial transcription and artificial management, consuming a lot of manpower and financial resources, and the results are poor, the phenomena of mildewing and metamorphism exists in large quantities. Therefore, designing the temperature and humidity monitor system on barn, improving efficiency and achieving realtime monitoring of barn’s temperature and humidity, is an important problem demanding prompt solution by storage units. The temperature and humidity is an important physical quantity, is the most mon and important technical parameters in grain storages. With the progress of the times, the development of society, science and technology unceasing renewal, the temperature and humidity measurement accuracy requirements continue to increase, so the temperature and humidity detection has bee an important research topic.The design and implementation of measurement and control temperature and humidity is MCU system, through which the temperature and humidity measurement liquid crystal displays (LCD). System adopts set temperature and humidity sensor and A/D converter for SHT11 chip microcontroller processing, through that other modules including realtime clock/date produce circuit and the offgauge alarm circuit, the value of measurement for realtime display and alarm. The paper introduces the ATMEL pany based on AT89C51 singlechip series of temperature and humidity measurement and control system and realtime display system design, including the hardware structure and principle, and the corresponding software design, including the design of the software and its key process and procedure. System structure is simple, practical, and improve the measuring precision and efficiency. Key Words: MCU, SHT11, LCD, DS1302, Temperature and humidity control III 目 錄摘 要 IAbstract II目 錄 III1 緒論 1 問題的提出背景及研究意義 1 國內外現狀 2 課題的研究目的及內容 32 控制系統的硬件電路設計 4 整體設計方案 4 微控制器模塊 4 復位電路設計 4 時鐘電路設計 5 傳感電路設計 6 顯示電路設計 9 超限處理電路設計 12 硬件電路PCB版圖設計 123 控制系統的軟件設計 14 軟件開發(fā)平臺介紹 14 主程序流程設計 15 溫濕度采集及處理流程設計