单片机控制DHT11传感器的课程设计报告

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

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

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

资源描述

大连海事大学自动化专业课程设计大连海事大学自动化课程设计基于单片机的温湿度检测控制系统2009届自动化学号2220093699学生姓名指导教师大连海事大学自动化专业课程设计I目录第1章总体设计概述............................................................................................................................11.1课题的背景和意义··························································································11.2系统实现的主要功能·······················································································11.3系统的工作原理简介·······················································································11.4总体设计简介·································································································21.4.1总体设计框图.........................................................................................................................21.4.2总体设计及工作进程............................................................................................................2第2章系统硬件设计..............................................................................................................................32.1主控模块设计································································································32.2DHT11传感器模块设计·····················································································32.2.1DHT11传感器简介...............................................................................................................32.2.2DHT11传感器模块电路设计...............................................................................................62.31602液晶显示模块设计···················································································62.3.11602液晶显示屏简介.........................................................................................................62.3.21602液晶显示模块.............................................................................................................72.4阈值设置模块································································································82.5报警模块······································································································8第3章系统软件设计............................................................................................................................93.11602液晶显示模块程序设计·············································································93.2传感器模块程序设计·····················································································10第4章系统分析与调试......................................................................................................................124.1程序下载软件说明·························································································124.2所遇问题及解决办法······················································································124.2.1硬件问题及解决方法...........................................................................................................124.2.2软件所遇问题及解决方法...................................................................................................13第5章结论与展望.............................................................................................................................14附录.........................................................................................................................................................15附录A硬件原理图·····························································································15附录B最终实物图及简介····················································································15附录C程序清单································································································16大连海事大学自动化专业课程设计1第1章总体设计概述1.1课题的背景和意义温度、湿度和人类的生产、生活有着密切的关系,同时也是工业生产中最常见最基本的工艺参数,例如机械、电子、石油、化工等各类工业中广泛需要对温度湿度的检测与控制。并且随着人们生活水平的提高,人们对自己的生存环境越来越关注。而空气中温湿度的变化与人体的舒适度和情绪都有直接的影响,所以对温度湿度的检测及控制就非常有必要了。8051单片机是常用于控制的芯片,在智能仪器仪表、工业检测控制、机电一体化等方面取得了令人瞩目的成果,用其作为温湿度控制系统的实力也很多。使用8051单片机能够实现温湿度全程的自动控制,而且8051单片机易于学习掌握,性价比高。使用8051型单片机设计温湿度控制系统,可以即时精确的反应温室内的温度以及适度的变化。完成诸如升温到特定的温度、降温到特定的温度。在温度上下限范围内保持恒温等多种控制方式,在湿度控制方面也是如此。将此系统应用到温室当中无疑为植被生长提供了更加适宜的环境。对于大棚种植和花圃、花卉栽培,必须在某些特定环境安装温湿度装置对其进行监控。本系统可以及时、精确的反映室内的温度以及湿度的变化,能够满足温湿度的控制要求。1.2系统实现的主要功能本系统所要实现的功能是:1.温湿度实时检测及显示。通过LCD1602实时地显示传感器DHT11检测到的温湿度值,并且固定时间(5s)检测更新显示一次。2.报警阈值的手动设置。通过三个按键实现温湿度阈值的设置,使得系统更加人性化、智能化,具有更高的实用价值。3.当温湿度超出阈值时能自动报警。通过蜂鸣器发出声音实现报警,以提醒用户做出相应的改进措施。1.3系统的工作原理简介总体来说,本次设计主要涉及了温湿度的测量、显示以及实现简单控制。硬件方面有五个模块,即AT89S52单片机主控模块、传感器模块、LCD1602液晶显示模块、报警模块以及阈值设置模块。其中主控模块已经给出,我们只需适当增加驱动电路即可。传感器模块使用的是DHT11数字温湿度传感器。通过DHT11检测出当前环境下的温湿度,将所测数据交给AT单片机进行分析和处理,并分别存入不同数组以便显示时候用。其中,为了显示稳定,本系统每间隔5s采集一次数据送入单片机。1602液晶显示模块就是实现温湿度检测值和阈值的显示。其分两行显示,上边一行显示湿度,下边显示温度值,两行的末尾两位是阈值显示位,正常工作的时候可以通过按键将其隐藏,需要调节阈值时,再显示出来方便调整,相对构建了比较友好的人机交互。蜂鸣器报警模块实现了检测值超过阈值的时候鸣响报警。本系统采用的是有源蜂鸣器,因此无论温度还是湿度超出范围蜂鸣器都是以相同频率的声音进行报警提示。提醒工作人员此时温度湿度数据出现异常、需及时调整,及时启用升温器、加湿器、降温风扇以及喷雾器来有效的调整实验室内温湿度。阈值设置模块通过三个按键来实现阈值设置功能的。使得在不同环境下设置阈值提供了极大的方便,不需要每次都在程序里改动然后再烧录,省去了复杂的过程。大连海事大学自动化专业课程设计21.4总体设计简介1.4.1总体设计框图按照系统功能的具体要求,在保证实现其功能的然础上,尽可能降低系统成本。总体设计方案围绕上述思想,初步确定系统的方案如图1-1所示。DTH11传感器模块AT89S51单片机1602液晶显示模块报警模块P2.4~P2.6P2.7P2.0阈值设置模块P2.1~P2.3图1—1系统总体设计从图中可以看出,系统有微处理器模块、DHT11传感器模块、阈值设置模块、

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

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

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

×
保存成功