【正文】
基于 單片機(jī)的電容測(cè)量?jī)x 的設(shè)計(jì)與實(shí)現(xiàn) 專業(yè):電子信息工程 學(xué)號(hào): XXX 學(xué)生姓名: XXX 指導(dǎo)老師: XXX 【內(nèi)容摘要】 隨著科技的不斷發(fā)展,人類的不斷進(jìn)步,在電子技術(shù)領(lǐng)域的發(fā)展可謂突飛猛進(jìn),然而 電容器在電子線路中得到廣泛的應(yīng)用 , 它的容量大小對(duì)電路的性能有著重要的作用。因此,電容量的測(cè)量在日常使用中就不可避免。 本設(shè)計(jì) 采用 STC89C52 單片機(jī) 和繼電器控制電容充放電主要電路測(cè)量電容電路,電容測(cè)量是采用 RC 充放電的基本原理實(shí)現(xiàn)的。測(cè)量電容元器件的儀表種類較多,方法也各有不同,但都有其優(yōu)缺點(diǎn)。一般的測(cè) 量方法都存在計(jì)算復(fù)雜、不易實(shí)現(xiàn)自動(dòng)測(cè)量。 在這里是把電容元件參數(shù) C轉(zhuǎn)換成時(shí)充電時(shí)間的長(zhǎng)短,用時(shí)間繼電器定時(shí),單片機(jī)定時(shí)器 0計(jì)算充電時(shí)間,當(dāng)電容充電到預(yù)設(shè)好的電壓后 LM393 反轉(zhuǎn)輸出低電平。 LM393 的輸出端接到STC89C52 單片機(jī) 的 INT0 口,當(dāng)?shù)碗娖綍r(shí)單片機(jī)產(chǎn)生外部中斷,單片機(jī)計(jì)數(shù)后再運(yùn)算求出C,最后通過(guò) LCD1602 顯示器顯示被測(cè)電容容值。 在軟件設(shè)計(jì)中,該設(shè)計(jì) 使用 C 語(yǔ)言來(lái)編寫(xiě)程序 。 【 關(guān)鍵詞 】 STC89C52 單片機(jī) 繼電器 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)的性能要求及特點(diǎn) ............................................................................................... 4 電容測(cè)量?jī)x 設(shè)計(jì)的意義 ............................................................................................... 4 2 系統(tǒng)分析及硬件設(shè)計(jì) ............................................................................................................. 4 系統(tǒng)設(shè)計(jì)思路與方案比較論證 ................................................................................... 5 系統(tǒng)設(shè)計(jì)思路 ..................................................................................................... 5 系統(tǒng)設(shè)計(jì)原理 ..................................................................................................... 5 方案論證與確立 ................................................................................................. 5 各個(gè)模塊的硬件電路設(shè)計(jì) ........................................................................................... 6 中央控制模塊設(shè)計(jì) ............................................................................................. 6 顯示模塊設(shè)計(jì) ..................................................................................................... 7 被測(cè)電路 模塊設(shè)計(jì) ............................................................................................. 9 3 軟件設(shè)計(jì) .................................................................................................................................... 10 軟件設(shè)計(jì)功能 ............................................................................................................. 12 電容測(cè)量?jī)x 主程序設(shè)計(jì)流程圖 ..................................................................... 12 2 液晶顯示頁(yè)面 ....................................................................................................... 12 4 整體系統(tǒng)的軟件調(diào)試 ................................................................................................................ 13 系統(tǒng)測(cè)試及分析 .............................................................................................................. 14 測(cè)試儀器及測(cè)試功能 ...............................................................................