【正文】
e base on MCU is widely used because of many characteristics such as high measurement accuracy, good repeatability, low power consumption and long useful time. When we study Scientific Outlook on Development thoroughly, the design of electronic aid should include the thought of sustainable development. So, beyond the liquid level measurement device based on MCU, expand the functions of realtime monitoring, data acquisition, serial munication. Through the new functions, the scientific method of the liquid level measurement could be bined with Statistical Science, be used to manage the water resources reasonable, reduce energy consumption. This thesis introduces the design process of the liquid level control system by several parts as system schema, the design of hardware circuit, the software of host puter and system software, ultimately achieved the level of realtime measurement and monitoring. Finally, the paper summarizes the problems and solutions of the design process, describes briefly the method of data processing, and leads to ideas of the further design and development. 安徽工程大學(xué)畢業(yè)設(shè)計(論文) III Keywords : MCU ; Liquid Level Measurement ; Realtime monitoring ; Serial Communication 金小龍:基于單片機(jī)的液位 控制系統(tǒng)的設(shè)計 IV 目 錄 引言 ..................................................................... 1 第 1 章 緒論 ............................................................. 3 課題背景與研究意義 ................................................. 3 國內(nèi)外研究現(xiàn)狀及發(fā)展 ............................................... 3 本課題主要研究內(nèi)容 ................................................. 5 第 2 章 系統(tǒng)總體方案 ..................................................... 7 系統(tǒng)設(shè)計要求 ....................................................... 7 系統(tǒng)框圖 ........................................................... 7 硬件設(shè)計方案 ....................................................... 8 主控模塊設(shè)計方案 ............................................... 8 鍵盤模塊設(shè)計方案 .............................................. 10 顯示模塊設(shè)計方案 .............................................. 10 數(shù)據(jù)存儲模塊設(shè)計方案 .......................................... 11 時間模塊設(shè)計方案 .............................................. 13 A/D 轉(zhuǎn)換模塊設(shè)計方案 .......................................... 14 通信模塊設(shè)計方案 .............................................. 17 電機(jī)控制模塊設(shè)計方案 .......................................... 18 第 3 章 硬件電路設(shè)計 .................................................... 20 AT89S52 硬件設(shè)計 .................................................. 20 按鍵設(shè)計 .......................................................... 24 安徽工程大學(xué)畢業(yè)設(shè)計(論文) V 顯示單元硬件設(shè)計 .................................................. 25 存儲單元硬件設(shè)計 .................................................. 27 時間單元硬件設(shè)計 .................................................. 29 A/D 轉(zhuǎn)換單元硬件設(shè)計 .............................................. 31 通信單元硬件設(shè)計 .................................................. 33 其他外圍電路的設(shè)計 ................................................ 34 第 4 章 系統(tǒng)軟件設(shè)計 .................................................... 37 系統(tǒng)軟件 .......................................................... 37 系統(tǒng)軟件編譯開發(fā)環(huán)境 .......................................... 37 系統(tǒng)主程序流程圖 .............................................. 37 系統(tǒng)初始化 .................................................... 38 顯示與 A/D 轉(zhuǎn)換的數(shù)據(jù)處理 ...................................... 40 按鍵部分軟件設(shè)計 .............................................. 42 顯示模塊的軟件設(shè)計 ............................................ 45 A/D 轉(zhuǎn)換模塊軟件設(shè)計 .......................................... 45 電機(jī)控制模塊軟件設(shè)計 .......................................... 46 通信協(xié)議及通信模塊軟件設(shè)計 .................................... 48 時間模塊軟件設(shè)計 ............................................. 50 上位機(jī)軟件設(shè)計 .................................................... 53 上 位機(jī)軟件開發(fā)編譯環(huán)境 ........................................ 53 上位機(jī)軟件的界面設(shè)計 .......................................... 54 上位機(jī)串口通信功能的實(shí)現(xiàn) ...................................... 57 金小龍:基于單片機(jī)的液位 控制系統(tǒng)的設(shè)計 VI 上位機(jī)軟件中的數(shù)據(jù)處理 ........................................ 60 結(jié)論與展望 .............................................................. 62 致謝 .................................................................... 66 參考文獻(xiàn) ................................................................ 67 附錄 A 系統(tǒng)電路原理圖 ................................................... 69 附錄 B 外文文獻(xiàn)及譯文 ................................................... 70 附錄 C 主要參考文獻(xiàn)的題錄及摘要 ......................................... 87 附錄 D 系統(tǒng)軟件源代碼 ................................................... 92 安徽工程大學(xué)畢業(yè)設(shè)計(論文) VII 插圖清單 圖 21 系統(tǒng)總體框圖 …………………………………………………… ………………… 1 圖 31 AT89S52引腳及網(wǎng)絡(luò)標(biāo)號………………………………… ……………………… 11 圖 32 復(fù)位電路及時鐘電路…………………………… ………………………………… 13 圖 33 系統(tǒng)按鍵電路…………………………………… ………………………………… 14 圖 34 74LS273及 74LS47引腳圖 …………………………………………………… … 14 圖 35 顯示部分電路圖 …………………………………………………… ……………… 15 圖 36 62256引腳圖 …………………………………………………… ………………… 16 圖 37 存儲的單元電路 …………………………………………………… ……………… 16 圖 38 DS1302引腳圖 …………………………………………………… ………………… 17 圖 39 時間單元電路…………………………………… ……………… ………………… 17 圖 310 ADC0804引腳圖 …………………………………………………… ……………… 18 圖 311 A/D轉(zhuǎn)換單元電路圖………………………………… …………………………… 19 圖 312 MAX485引腳圖 …………………………………………………… ……………… 19 圖 313 串行通信模塊電路圖…………………………… ……………………………… 20 圖 314 繼電器部分電路圖……………………………… ……………………………… 20 圖 315 電源指示燈電路圖……………………… ……………………………………… 21 圖 41 主程序流程圖…………………………………… ………………………………… 23 圖 42 鍵盤程序流程圖………………………………… ………………………………… 25 圖 43 液位檢測流程圖………………………………… ………………………………… 27 金小龍:基于單片機(jī)的液位 控制系統(tǒng)的設(shè)計 VIII 圖 44 通信檢測流程圖………………………………… ………………………………… 28 圖 45 上位機(jī)軟件界面效果圖………………………… ………………………………… 33 圖 46 水箱液位控制結(jié)構(gòu)圖…………………………… … ……………………………… 33 圖 51 MATLAB繪制圖形………………………………………… ………………………… 36 安徽工程大學(xué)畢業(yè)設(shè)計(論文) IX 表格清單 表 31 端口引腳第二功能 ……………………