基于51单片机多点温度检测系统

整理文档很辛苦,赏杯茶钱您下走!

免费阅读已结束,点击下载阅读编辑剩下 ...

阅读已结束,您可以下载文档离线阅读编辑

资源描述

多点温度检测系统设计第1页共29页摘要DS18B20是一种可组网的高精度数字式温度传感器,由于其具有单总线的独特优点,可以使用户轻松地组建起传感器网络,并可使多点温度测量电路变得简单、可靠。本文结合实际使用经验,介绍了DS18B20数字温度传感器在单片机下的硬件连接及软件编程,并给出了软件流程图。该系统由上位机和下位机两大部分组成。下位机实现温度的检测并提供标准RS232通信接口,芯片使用了ATMEL公司的AT89C51单片机和DALLAS公司的DS18B20数字温度传感器。上位机部分使用了通用PC。该系统可应用于仓库测温、楼宇空调控制和生产过程监控等领域。关键字:温度测量;单总线;数字温度传感器;单片机多点温度检测系统设计第2页共29页AbstractAsakindofhigh-accuracydigitalnettemperaturesensor,DS18B20canbeusedbuildingasensorneteasily.Itcanalsomakethenetsimpleandreliablewithit'sspecial1-wireinterface.ThispaperintroducestheapplicationofDS18B20withsinglechipprocessor.Thesystemisconstitutedbytwopartsthetemperaturemeasuredpartanddisplayedpart.ThetemperaturemeasuredparthasaRS232interface.ItusedAT89C51ofATMELcompanyandDS18B20ofDALLAScompany.ThedisplayedpartusesPC.Thissystemisappliedinsuchdomainsaswarehousedetectingtemperature;air-conditionercontrollingsysteminbuildingandsupervisoryproductiveprocessetc.Keywords:temperaturemeasure;singlebus;digitalthermometer;singlechipprocessor;多点温度检测系统设计第3页共29页目录摘要··········································································································1ABSTRACT···································································································2第一章绪论································································································4§1.1系统背景····························································································4§1.2系统概述····························································································4第二章方案论证···························································································4§2.1传感器部分·························································································5§2.2主控制部分·························································································6§2.3系统方案···························································································6第三章硬件电路设计·····················································································7§3.1单片机STC89C51介绍············································································7§3.2电源以及看门狗电路·············································································9§3.3温度采集电路·····················································································10§3.4键盘以及显示电路···············································································15§3.5串口通讯电路·····················································································17§3.6整体电路···························································································18第三章软件设计··························································································19§4.1概述·································································································19§4.2主程序方案························································································19§4.3各模块子程序设计···············································································20第四章系统调试··························································································25§5.1分步调试···························································································25§5.2统一调试···························································································25总结······················································································错误!未定义书签。参考文献······································································································27附录一:电路原理图·······················································································29多点温度检测系统设计第4页共29页第一章绪论§1.1系统背景在工、农业生产和日常生活中,对温度的测量及控制占据着极其重要地位。首先让我们了解一下多点温度检测系统在各个方面的应用领域:消防电气的非破坏性温度检测,电力、电讯设备之过热故障预知检测,空调系统的温度检测,各类运输工具之组件的过热检测,保全与监视系统之应用,医疗与健诊的温度测试,化工、机械等设备温度过热检测。温度检测系统应用十分广阔。§1.2系统概述本设计运用主从分布式思想,由一台上位机(PC微型计算机),下位机(单片机)多点温度数据采集,组成两级分布式多点温度测量的巡回检测系统。该系统采用RS-232串行通讯标准,通过上位机(PC)控制下位机(单片机)进行现场温度采集。温度值既可以送回主控PC进行数据处理,由显示器显示。也可以由下位机单独工作,实时显示当前各点的温度值,对各点进行控制。下位机采用的是单片机基于数字温度传感器DS18B20的系统。DS18B20利用单总线的特点可以方便的实现多点温度的测量,轻松的组建传感器网络,系统的抗干扰性好、设计灵活、方便,而且适合于在恶劣的环境下进行现场温度测量。本系统可以应用在大型工业及民用常温多点监测场合。如粮食仓储系统、楼宇自动化系统、温控制程生产线之温度影像检测、医疗与健诊的温度测试、空调系统的温度检测、石化、机械等。第二章方案论证温度检测系统有着共同的特点:测量点多、环境复杂、布线分散、现场离监控多点温度检测系统设计第5页共29页室远等。若采用一般温度传感器采集温度信号,则需要设计信号调理电路、A/D转换及相应的接口电路,才能把传感器输出的模拟信号转换成数字信号送到计算机去处理。这样,由于各种因素会造成检测系统较大的偏差;又因为检测环境复杂、测量点多、信号传输距离远及各种干扰的影响,会使检测系统的稳定性和可靠性下降。所以多点温度检测系统的设计的关键在于两部分:温度传感器的选择和主控单元的设计。温度传感器应用范围广泛、使用数量庞大,也高居各类传感器之首。§2.1传感器部分方案一:采用热敏电阻,可满足40摄氏度至90摄氏度测量范围,但热敏电阻精度、重复性、可靠性较差,对于检测1摄氏度的信号是不适用的。而且在温度测量系统中,采用单片温度传感器,比如AD590,LM35等.但这些芯片输出的都是模拟信号,必须经过A/D转换后才能送给计算机,这样就使得测温装置的结构较复杂.另外,这种测温装置的一根线上只能挂一个传感器,不能进行多点测量.即使能实现,也要用到复杂的算法,一定程度上也增加了软件实现的难度。方案二:在多点测温系统中,传统的测温方法是将模拟信号远距离采样进行AD转换,而为了获得较高的测温精度,就必须采用措施解决由长线传输,多点测量切换及放大电路零点漂移等造成的误差补偿问题。采用数字温度芯片DS18B20测量温度,输出信号全数字化。便于单片机处理及控制,省去传统的测温方法的很多外围电路。且该芯片的物理化学性很稳定,它能用做工业测温元件,此元件线形较好。在0—100摄氏度时,最大线形偏差小于1摄氏度。DS18B20的最大特点之一采用了单总线的数据传输,由数字温度计DS1820和微控制器AT89C51构成的温度测量装置,它直接输出温度的数字信号,可直接与计算机连接。这样,测温系统的结构就比较简单,体积也不大,且由于AT89C51可以带多个DS18B20,因此可以非常容易实现多点测量.轻松的组建传感器网络。采

1 / 29
下载文档,编辑使用

©2015-2020 m.777doc.com 三七文档.

备案号:鲁ICP备2024069028号-1 客服联系 QQ:2149211541

×
保存成功