基于51单片机的电容测量仪 下载本文

内容发布更新时间 : 2024/6/24 20:19:16星期一 下面是文章的全部内容请认真阅读。

基于单片机的电容测量仪设计

摘要:本设计详细介绍了一种基于单片机的数字式电容测量仪设计方案及实现方法。设计的主要方法是由LM393组成的LC 振荡器,由单片机测量LC 震荡回路的频率, 根据已知的电容值,通过单片机的运算功能,计算出电容容量,最后,再通过单片机的普通I/O口控制液晶屏显示出电容容量的计算结果。系统的测量范围为1pF~12000μF, 具有多个量程,可根据用户需要由用户选择,与用户的交互是通过按键实现,不同量程的实现是通过开关的闭合与断开来选择不同的R值,从而实现不同的量程。同时,本设计注重设计方法及流程,首先根据原理设计电路,再通过protues仿真,利用keil编程,最后到焊接元器件,调试直至成功。

关键词:电容测量;LM393;LC震荡;单片机;LCD显示

I

Design of capacitance measuring instrument based on single chip microcomputer

Abstract: This design introduces a design scheme of digital capacitance measuring

instrument based on MCU and the realization method. The design method of the LC oscillator is composed by LM393, measured by single chip microcomputer LC oscillating circuit frequency, according to the known capacitance value, through the single-chip computing function, calculate capacity, finally, through the microcontroller I/O port control LCD screen shows the calculation results of the electrical capacitance. The measurement range of 1pF~12000 μF, having a plurality of range, according to user needs can be selected by the user, the interaction with the user is achieved through the key, to achieve different range is through the on-off of the open selection of different R value, so as to achieve different range. At the same time, the design focus on the design method and process, according to the principle of circuit design, through the Protues simulation, using keil programming, and finally to the welding components, debugging until success.

Keywords: capacitance measurement; LM393; MCU; LCD display LC shocks;

II

目 录

1前言............................................................................................................................. 1

1.1电容测试仪的发展历史及现状 ....................................................................... 1 1.2电容测量技术手段 ........................................................................................... 2 2系统方案设计 ............................................................................................................ 3

2.1设计方案 ........................................................................................................... 3 3 单元电路设计 ........................................................................................................... 6

3.1 测量原理 .......................................................................................................... 6

3.1.1 小电容测量原理 .................................................................................... 6 3.1.2 电解电容测量原理 ................................................................................ 7 3.2 硬件电路设计 .................................................................................................. 8

3.2.1 单片机电路设计 .................................................................................... 8 3.2.2 LM393芯片电路设计 ............................................................................ 9 3.2.3 按键电路设计 ...................................................................................... 10 3.2.3 显示电路设计 ...................................................................................... 11 3.3 软件设计 ........................................................................................................ 12 3.4 量程范围设置 ................................................................................................ 13 3.5 原理图设计及设计结果 ................................................................................ 14

3.5.1 原理图设计 .......................................................................................... 14 3.5.2 设计结果 .............................................................................................. 15

3 系统测试 ................................................................................................................. 16

3.1 测量小电容 .................................................................................................... 16 3.2 测量电解电容 ................................................................................................ 18 3.3 测量结果 ........................................................................................................ 19 3.4 误差分析 ........................................................................................................ 20 4 结论与心得体会 ..................................................................................................... 20 参考文献 ..................................................................................................................... 21 附 录.......................................................................................................................... 21 致 谢.......................................................................................................................... 40

III