【正文】
基于 單片機的電容測量儀 的設(shè)計與實現(xiàn) 專業(yè):電子信息工程 學(xué)號: XXX 學(xué)生姓名: XXX 指導(dǎo)老師: XXX 【內(nèi)容摘要】 隨著科技的不斷發(fā)展,人類的不斷進步,在電子技術(shù)領(lǐng)域的發(fā)展可謂突飛猛進,然而 電容器在電子線路中得到廣泛的應(yīng)用 , 它的容量大小對電路的性能有著重要的作用。因此,電容量的測量在日常使用中就不可避免。 本設(shè)計 采用 STC89C52 單片機 和繼電器控制電容充放電主要電路測量電容電路,電容測量是采用 RC 充放電的基本原理實現(xiàn)的。測量電容元器件的儀表種類較多,方法也各有不同,但都有其優(yōu)缺點。一般的測 量方法都存在計算復(fù)雜、不易實現(xiàn)自動測量。 在這里是把電容元件參數(shù) C轉(zhuǎn)換成時充電時間的長短,用時間繼電器定時,單片機定時器 0計算充電時間,當(dāng)電容充電到預(yù)設(shè)好的電壓后 LM393 反轉(zhuǎn)輸出低電平。 LM393 的輸出端接到STC89C52 單片機 的 INT0 口,當(dāng)?shù)碗娖綍r單片機產(chǎn)生外部中斷,單片機計數(shù)后再運算求出C,最后通過 LCD1602 顯示器顯示被測電容容值。 在軟件設(shè)計中,該設(shè)計 使用 C 語言來編寫程序 。 【 關(guān)鍵詞 】 STC89C52 單片機 繼電器 LM393 The capacitance meter Design and Implementation based on microcontroller 【 Abstract】 With the continuous development of science and technology, the continuous progress of human development in the field of electronic technology can be described by leaps and bounds, capacitor, however, has been widely used in electronic circuits, its size has an important role on the performance of the circuit. Therefore, the measurement of the capacitance in the daytoday use is inevitable. This design uses STC89C52 MCU and relay control capacitor charging and discharging the capacitor circuit of the main circuit measurement, capacitance measurement RC charge and discharge the basic realization of the principle. More kind of instrument for measuring capacitance ponents, the method is also different, but it has its advantages and disadvantages. The ships measuring method of putational plexity are present, is not easy to achieve automatic measurement. Here is convert the capacitive element parameters C charging time, time relay timing, SCM timer to calculate the charging time, when the capacitor is charged to the preset voltage LM393 inverted output low. LM393 output end to STC89C52 MCU INT0 mouth, external interrupt generated when the low singlechip, singlechip count and then puting the calculated C, and finally through the the LCD1602 display shows the measured capacitance value. In software design, the design uses the C language to write the program. 【 Key words 】 STC89C52 microcontroller relay LM393 2 目 錄 1 緒論 ......................................................................................................................................... 4 概述 ............................................................................................................................... 4 系統(tǒng)的性能要求及特點 ............................................................................................... 4 電容測量儀 設(shè)計的意義 ............................................................................................... 4 2 系統(tǒng)分析及硬件設(shè)計 ............................................................................................................. 4 系統(tǒng)設(shè)計思路與方案比較論證 ................................................................................... 5 系統(tǒng)設(shè)計思路 ..................................................................................................... 5 系統(tǒng)設(shè)計原理 ..................................................................................................... 5 方案論證與確立 ................................................................................................. 5 各個模塊的硬件電路設(shè)計 ........................................................................................... 6 中央控制模塊設(shè)計 ............................................................................................. 6 顯示模塊設(shè)計 ..................................................................................................... 7 被測電路 模塊設(shè)計 ............................................................................................. 9 3 軟件設(shè)計 .................................................................................................................................... 10 軟件設(shè)計功能 ............................................................................................................. 12 電容測量儀 主程序設(shè)計流程圖 ..................................................................... 12 2 液晶顯示頁面 ....................................................................................................... 12 4 整體系統(tǒng)的軟件調(diào)試 ................................................................................................................ 13 系統(tǒng)測試及分析 .............................................................................................................. 14 測試儀器及測試功能 ...............................................................................