基于单片机的电容测量仪设计摘要:本设计详细介绍了一种基于单片机的数字式电容测量仪设计方案及实现方法。设计的主要方法是由LM393组成的LC振荡器,由单片机测量LC振荡回路的频率,根据已知的电容值,通过单片机的运算功能,计算出电容容量,最后,再通过单片机的普通I/O口控制液晶屏显示出电容容量的计算结果。系统的测量范围为1pF~12000μF,具有多个量程,可根据用户需要由用户选择,与用户的交互是通过按键实现,不同量程的实现是通过开关的闭合与断开来选择不同的R值,从而实现不同的量程,系统具有一定的实用价值。关键词:电容;LM393;LC振荡;单片机;LCDDesignofcapacitancemeasuringinstrumentIbasedonsinglechipmicrocomputerAbstract:ThisdesignintroducesadesignschemeofdigitalcapacitancemeasuringinstrumentbasedonMCUandtherealizationmethod.ThedesignmethodoftheLCoscillatoriscomposedbyLM393,measuredbysinglechipmicrocomputerLCoscillatingcircuitfrequency,accordingtotheknowncapacitancevalue,throughthesingle-chipcomputingfunction,calculatecapacity,finally,throughthemicrocontrollerI/OportcontrolLCDscreenshowsthecalculationresultsoftheelectricalcapacitance.Themeasurementrangeof1pF~12000μF,havingapluralityofrange,accordingtouserneedscanbeselectedbytheuser,theinteractionwiththeuserisachievedthroughthekey,toachievedifferentrangeisthroughtheon-offoftheopenselectionofdifferentRvalue,soastoachievedifferentrange,Systemhascertainpracticalvalue.Keywords:capacitance;LM393;LCshocks;MCU;LCDII目录1前言..............................................................................................................................................11.1电容测试仪的发展历史及现状................................................................................11.2电容测量手段ﻩ22系统方案设计ﻩ32.1设计要求ﻩ32.2方案论证...................................................................................................................33硬件设计ﻩ73.1电容原理.........................................................................................................................73.1.1电容测量原理ﻩ73.1.2电容测量电路.....................................................................................................83.2单片机最小系统.......................................................................................................93.3按键电路....................................................................................................................103.4显示电路ﻩ114软件设计..................................................................................................................................135系统测试...................................................................................................................................135.1测量小电容............................................................................................................145.2测量电解电容ﻩ165.3测量结果.....................................................................................................................175.4误差分析ﻩ186结束语ﻩ81参考文献......................................................................................................................................19附录A..........................................