【正文】
基于 STC89C52RC 單片機的大棚溫濕度自動控制系統(tǒng) 基于 STC89C52RC 單片機的大棚溫濕度自動控制系統(tǒng) 大棚溫濕度自動控制系統(tǒng)設計 摘 要 :本設計是基于 STC89C52RC 單片機的大棚溫濕度自動控制系統(tǒng),采用 SHT10作為溫濕度傳感器, LCD1602 液晶屏進行顯示。 SHT10 使用類似于 I2C 總線的時序與單片機進行通信,由于它高度集成,已經(jīng)包括 A/D 轉(zhuǎn)換電路,所以使用方便,而且準確、耐用。 LCD1602 能夠分兩行顯示數(shù)據(jù),第一行顯示溫度,第二行顯示濕度。這個控制系統(tǒng)能夠測量溫室大棚中的溫度和濕度,將其顯示在液晶屏 LCD1602 上,同時將其與設定值進行 對比,如果超出上下限,將進行報警并啟動溫濕度調(diào)節(jié)設備。此外,還可以通過獨立式鍵盤對設定的溫濕度進行修改。通過設計系統(tǒng)原理圖、用 Proteus 軟件進行仿真,證明了該系統(tǒng)的可行性。 關鍵詞 : STC89C52RC, SHT10, I2C 總線,獨立式鍵盤,溫濕度自動控制 Abstract: This design is an automatic temperature and humidity controller for greenhouses, with the STC89C52RC MCU being its main controller. It uses the SHT10 as the temperature and humidity sensor, and the LCD1602 to display the messages. The SHT10 uses a timing sequence much like the I2C to municate with the microcontroller. Because it’s a highly integrated chip, it already includes an analog to digital converter. Therefore, it’s quite convenient to use, and also accurate and durable. The LCD1602 can display two lines of messages, with the first line for temperature and the second line for humidity. The design can measure the temperature and humidity in a greenhouse, and then display it on a LCD1602. Meanwhile, it pares the data with the set limit. If the limit is exceeded, then the system will send out a warning using a buzzer and activate the temperature and humidity controlling equipment. Besides, the set limit can be modified with the independent keyboard. Through schematic design and Proteus simulation, the feasibility of this design has been proved. Keywords: STC89C52RC, SHT10, I2C bus, independent keyboard, temperature and humidity control基于 STC89C52RC 單片機的大棚溫濕度自動控制系統(tǒng) 目 錄 1 前言 ............................................................................................................................... 1 2 總體方案設計 ............................................................................................................... 3 溫濕度控制系統(tǒng)的設計指標要求 .................................................................... 3 系統(tǒng)設計的原則 ................................................................................................ 3 可靠性 ..................................................................................................... 3 性價比 ..................................................................................................... 3 方案比較 ............................................................................................................ 4 方案一 ..................................................................................................... 4 方案二 ..................................................................................................... 4 方案論證 ............................................................................................................ 5 方案選擇 ............................................................................................................ 5 3 單元模塊設計 ............................................................................................................... 6 各單元模塊功能介紹及電路設計 .................................................................... 6 單片機最小系統(tǒng) ..................................................................................... 6 液晶顯示模塊 ......................................................................................... 8 溫濕度傳感器模塊 ................................................................................. 8 報警電路的設計 ................................................................................... 9 輸出電路設計 ....................................................................................... 10 電源的設計 ........................................................................................... 12 按鍵電路設計 ..................................................................................... 13 串口通信電路 ....................................................................................... 14 元件清單 .......................................................................................................... 15 關鍵器件的介紹 .............................................................................................. 17 STC89C52RC ......................................................................................... 17 SHT10 溫濕度傳感器 ............................................................................ 19 4 系統(tǒng) 軟件設計 ............................................................................................................. 22 軟件設計的總體結(jié)構(gòu) ...................................................................................... 22 主要模塊的設計流程框圖 .............................................................................. 24 主程序流程圖 ....................................................................................... 24 SHT10 子程序流程圖 ............................................................................ 25 基于 STC89C52RC 單片機的大棚溫濕度自動控制系統(tǒng) LCD1602 子程序流程圖 ....................................................................... 27 輸出控制子程序流程圖 ....................................................................... 28 鍵盤掃描子程序流程圖 ....................................................................... 29 軟件設計所用工具 .......................................................................................... 31 Keil uVision4 .......................................................................................... 31 Proteus .................................................................................................... 31 5 系統(tǒng)調(diào)試 .....................................