重庆科技学院《智能仪器仪表的设计与调试》课程设计报告学院:_电气与信息工程学院_专业班级:学生姓名:学号:设计地点(单位)___逸夫科技大楼I506__________设计题目:__基于单片机的温度控制器设计_______________完成日期:2012年6月29日指导教师评语:___________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________成绩(五级记分制):________________指导教师(签字):________________重庆科技学院基于单片机的温度控制器设计2摘要随着社会的进步和工业技术的发展,人们越来越重视温度对产品的影响,许多产品对温度范围要求严格,目前市场上普遍存在的问题有温度信息传递不及时、精度不够的缺点,不利于工业控制者根据温度变化及时做出决定。在这样的形式下,开发一种实时性高、精度高的温度采集系统就很有必要。本课题用一种基于单片机的数据采集系统方案,该方案根据热敏电阻随温度变化而变化的特性,采用串联分压电路。单片机采集热敏电阻的电压,通过A/D转换将模拟量电压信号转换成数字量电压信号,经过查表转换得到温度值,控制数码管实时显示温度值。本系统中所用到的器件是STC12C5A60S2单片机、NTC热敏电阻和数码管。关键词:温度控制器SC12C5A60S2单片机A/D转换对半查表法PID算法重庆科技学院基于单片机的温度控制器设计3ABSTRACTWiththesocialprogressanddevelopmentofindustrialtechnology,moreandmoreattentiontotheimpactoftemperatureontheproducts,manyproductsonthecriticaltemperaturerange,temperatureinformationtransmissionisnottimely,notenoughprecisionshortcomingsofacommonproblemonthemarkettoday,donotconducivetoindustrialcontrolbasedontemperaturechangesandmaketimelydecisions.Inthisform,todevelopareal-time,highprecisiontemperatureacquisitionsystemisnecessary.Thistopicwithamicrocontroller-baseddataacquisitionsystemprogram,whichaccordingtothecharacteristicsofthethermistorvarieswithtemperaturechanges,theseriesvoltagedividercircuit.Themicrocontrollercollectionthermistorvoltage,theanalogvoltagesignalbytheA/Dconvertertoconvertthevoltagesignalofthedigitalconversiontemperaturecontroldigitaltubetemperaturevalueisdisplayedinrealtimeafterthelook-uptable.ThedevicesusedinthissystemisSTC12C5A60S2microcontroller,NTCthermistoranddigitaltube.Keywords:Temperaturecontroller;SC12C5A60S2microcontroller;A/Dconverter;Halflook-uptablemethod;PIDalgorithm重庆科技学院基于单片机的温度控制器设计4目录摘要........................................................................................................................................2ABSTRACT...............................................................................................................................31绪论........................................................................................................................................51.1研究温度控制系统的背景、目的及意义.................................................................51.2设计的主要内容及技术指标.....................................................................................61.3数据采集系统简单介绍.............................................................................................62温度控制系统总体设计........................................................................................................82.1总体需求.....................................................................................................................82.2总体方案设计.............................................................................................................83硬件电路设计及分析............................................................................................................93.1单片机最小系统.........................................................................................................93.2温度控制模块...........................................................................................................123.3显示器.......................................................................................................................133.4按键电路...................................................................................................................143.5LED指示灯报警模块................................................................................................144软件设计与分析..................................................................................................................154.1软件总体设计...........................................................................................................154.2A/D转换模块原理....................................................................................................154.3室温补偿及查表程序设计.......................................................................................164.4按键设计...................................................................................................................174.5PID算法....................................................................................................................184.6系统调试...................................................................................................................205总结......................................................................................................................................21参考文献..................................................................................................................................22致谢..........................................................................................................................................23附录1系统电路图..........................................................................................................