您好,欢迎访问三七文档
当前位置:首页 > 电子/通信 > 电子设计/PCB > 基于单片机的数字万用表的设计
本科毕业设计基于单片机的数字万用表的设计摘要本设计是基于51单片机的数字万用表,可用于测量直流电压、直流电压及电阻,并使用1602液晶进行显示。本系统由分压电阻、分流电阻、电阻-电压变换电路、单片机最小系统、液晶显示器、报警器、模数转换器及等部分组成。本系统采用STC公司的89C52单片机作为主控芯片,PCF8591作为模数转换芯片。主控芯片与模数转换芯片之间使用I2C总线进行数据通讯,大大地简化了硬件线路,提高系统的稳定性及测量准确度。从电源获取的电压或电流信号,通过衰减电阻进行衰减后,进入模数转换器的模拟输入端,而待测电阻则通过电阻-电压变换电路,把阻值转化为电压值进行测量。模数转换器进行转换之后,得到的数字编码通过I2C总线送回单片机。单片机对数据进行一定的处理后,测量结果由1602液晶显示器负责输出。本次设计的数字万用表共分为6个档位,分别是2V电压、20V电压、200mA电流、2A电流、2kΩ电阻、20kΩ电阻,超出量程时会自动使用蜂鸣器进行报警提示。本系统程序执行周期耗时较短,保证了系统的响应速度。经过初步调试,本系统能较准确的测量量程范围内的电压及电流值,误差范围均在8%以内,而电阻值测量的误差值稍大,误差范围在8.2%以内。另外,本文详细地介绍了89C52型单片机及PCF8591模数转换芯片的基本功能及性能特征,并叙述了数字万用表测量电压、电流及电阻的基本原理。关键词:数字万用表89C52单片机模数转换DigitalMulti-meterBasedonSCMLuoJiawei(CollegeofEngineering,SouthChinaAgriculturalUniversity,Guangzhou510642,China)Abstract:Thisdesignisadigitalmulti-meterbasedon51SCM(Single-ChipComputer),whichcanbeusedtomeasureDC(DirectCurrent)voltage,DCvoltageandresistanceanddisplayswitha1602LCD(LiquidCrystalDisplay).Thesystemconsistsofdividingresistors,shuntresistors,theresistor-to-voltageconvertingcircuit,thesmallestSCMsystem,LCD,alarm,analog-to-digitalconverterandothercomponents.ThesystemusesSTC's89C52SCMasthemasterchipandPCF8591astheanalog-to-digitalconversionchip.TheyusetheI2Cbustocommunicatewitheachother,whichcanlargelysimplifyhardwarecircuitsandimprovethestabilityandaccuracyofmeasurement.Thesystemcapturesthevoltageorcurrentsignalfromapowersupplyandthesignalwillbeattenuatedbydividingresistorsorshuntresistors,beforeitenteringtotheanaloginputterminaloftheanalog-to-digitalconverter.Still,thevalueofresistorsismeasurediscarriedoutbytheresistor-to-voltageconvertingcircuitwhereresistors'valuewillbetransformingtovoltage.Aftertheanalog-to-digitalconverterfinishingtransformation,itsendsbackthedigitalencodingdatatoSCMthroughI2Cbus.Then,theSCMwillprocessthedataandoutputtheresultsofmeasurementbya1602LCD.Thedesignofdigitalmulti-meterisdividedintosixstallswhichare2Vvoltage,20Vvoltage,200mAcurrent,2Acurrent,2kresistorand20kresistor.Theresultsofmeasurementwillbeoutputtedby1602LCDandthebuzzerwillautomaticallyalarmwhensomethingoutofrangehappened.Theprogramexecutioncycleofthissystemtakeslesstimetoensurethattheresponsespeedofthesystem.Afterinitialdebugging,thesystemcanbeaccuratelymeasurevoltageandcurrentvalueintherange,withtheerrorrangelessthan8%,whilemeasurementofresistancehasaslightlylargererrorrange,lessthan8.2%.Inaddition,thispaperalsodescribesthebasicfunctionsandperformancecharacteristicsofthe89C52SCMandthePCF8591analog-to-digitalconversionchip,aswellasadescriptionofthebasicprinciplesofdigitalmulti-metertomeasurevoltage,currentandresistors.Keywords:DigitalMulti-meter89C52SCMA/DconversionI目录1前言..........................................................................................................................................11.1课题的提出...........................................................................................................................11.2研究的意义...........................................................................................................................11.3设计的任务...........................................................................................................................12总体方案确定..........................................................................................................................12.1方案比较及选择...................................................................................................................12.1.1模数转换芯片方案............................................................................................................12.1.2显示器方案........................................................................................................................42.2确定设计方案.......................................................................................................................53系统硬件分析及设计..............................................................................................................53.1数字万用表的基本原理.......................................................................................................53.1.1模数转换及显示电路原理................................................................................................53.1.2多量程数字电压表原理....................................................................................................63.1.3多量程数字电流表原理....................................................................................................63.1.4电阻测量原理....................................................................................................................73.2硬件系统总体设计框图.......................................................................................................83.3硬件电路所用芯片及元件介绍...........................................................................................83.3.1STC的89C52型单片机....................................................................................................83.3.2PCF8591模数及数模转换芯片.......................................................................................123.3.3LCD1602液晶显示器.......................
本文标题:基于单片机的数字万用表的设计
链接地址:https://www.777doc.com/doc-5859683 .html