I基于单片机的电容测量仪设计摘要:本设计详细介绍了一种基于单片机的数字式电容测量仪设计方案及实现方法。设计的主要方法是由LM393组成的LC振荡器,由单片机测量LC振荡回路的频率,根据已知的电容值,通过单片机的运算功能,计算出电容容量,最后,再通过单片机的普通I/O口控制液晶屏显示出电容容量的计算结果。系统的测量范围为1pF~12000μF,具有多个量程,可根据用户需要由用户选择,与用户的交互是通过按键实现,不同量程的实现是通过开关的闭合与断开来选择不同的R值,从而实现不同的量程,系统具有一定的实用价值。关键词:电容;LM393;LC振荡;单片机;LCDDesignofcapacitancemeasuringinstrumentIIbasedonsinglechipmicrocomputerAbstract: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;LCDIII目录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测量电解电容............................................................................................................155.3测量结果.....................................................................................................................175.4误差分析.....................................................................................................................186结束语......................................................................................................................................18参考文献......................................................................................................................................19附录A......................................................................................................................................21附录B......................................................................................................................................22附录C......................................................................................................................................23谢辞............................................................................................................................................27IV11前言1.1电容测试仪的发展历史及现状当今电子测试领域,电容的测量已经在测量技术和产品研发中应用的十分广泛。电容通常以传感器形式出现,因此,电容测量技术的发展归根结底就是电容传感器的发展。由最初的用交流不平衡电桥就能测量基本的电容传感器。最初的电容传感器有变面积型,变介质介电常数型和变极板间型。现在的电容式传感器越做越先进,现在用的比较多的有容栅式电容传感器,陶瓷电容压力传感器等。电容测量技术发展也很快现在的电容测量技术也由单一化发展为多元化。现在国内外做传感器的厂商也比较多,在世界范围内做电容传感器做的比较好的公司有:日本figaro、德国tecsis、美国alphasense。中国本土测量仪器设备发展的主要瓶颈。尽管本土测试测量产业得到了快速发展,但客观地说中国开发测试测量仪器还普遍比较落后。每当提起中国测试仪器落后的原因,就会有许多不同的说法,诸如精度不高,外观不好,可靠性差等。实际上,这些都还是表面现象,真正影响中国测量仪器发展的瓶颈为:1.测试在整个产品流程中的地位偏低。由于人们的传统观念的影响,在产品的制造流程中,研发始终处于核心位置,而测试则处于从属和辅助位置。关于这一点,在几乎所有的研究机构部门配置上即可窥其一斑。这种错误观念上的原因,造成整个社会对测试的重视度不够,从而造成测试仪器方面人才的严重匮乏,造成相关的基础科学研究比较薄弱,这是中国测量仪器发展的一个主要瓶颈。实际上,即便是研发队伍本身,对测试的重视度以及对仪器本身的研究也明显不够。2.面向应用和现代市