目录摘要........................................................................11总体设计概论..........................................................21.1温室控制系统设计目标..........................................21.1.1控制系统工作过程.........................................21.1.2温室温度测控系统的设计功能...........................21.2控制系统整体框架...............................................22硬件设备选型..........................................................32.1温度传感器方案选择.........................................32.28051微控制器................................................83控制系统电路设计...................................................153.1数据输入接口电路...............................................163.1.1DS18B20温度传感器测温原理...........................163.1.2温度传感器电路接口.....................................173.2控制量输出电路设计...........................................173.2.1制冷片降温工作原理.....................................173.2.2制冷片控制电路接口.....................................193.3.3声光报警电路.............................................193.4LCD1602液晶显示模块.........................................204程序设计..............................................................224.1系统主程序......................................................224.2按键识别子模块程序模块......................................234.3DS1820温度采集模块设计.....................................244.4PID算法设计....................................................25致谢.........................................................................29参考文献.....................................................................29摘要随着人们生活质量的提升,个性化定制盆栽使得小型化温室需求增多。温室是旨在为植物提供最佳的生长环境,降低生产成本和增加作物收入,温室环境可以通过添加加热,通风等措施为作物提供最佳的生长温度。许多温室使用常规控制,当温室温度达到设定温度后就停止加热或制冷,使温度波动过大。目前大多数低成本小型温室中常常采用但是这种控制策略,可能不适合保证所需的性能,近来控制工程的发展已经在人类知识的几乎领域中得到应用,所以设计一种基于pid算法控制的温室测控系统,用于低成本小型温室温度控制中。关键词:STC89C52;PID控制;半导体制冷片AbstractWiththeimprovementofpeople'squalityoflife,thedemandforsmall-sizedgreenhousesincreaseswiththecustomizationofpottedplants.Greenhouseisdesignedtoprovidethebestgrowthenvironmentfortheplant,reduceproductioncostsandincreasecropincome,greenhouseenvironmentcanbeaddedheating,ventilationandothermeasurestoprovidethebestgrowthtemperatureofcrops.Manygreenhousesuseconventionalcontroltostopheatingorcoolingwhenthegreenhousetemperaturereachesthesettemperature,causingthetemperaturetofluctuatetoomuch.Atpresent,mostofthelowcostsmallgreenhousesareoftenusedbutthiscontrolstrategymaynotbesuitabletoguaranteetherequiredperformance,therecentdevelopmentofcontrolengineeringhasbeeninthefieldofhumanknowledgealmostgetapplied,sothedesignofagreenhousecontrolsystembasedonPIDalgorithmcontrolsystemforlowcostsmallgreenhousetemperaturecontrol.Keywords:STC89C52;PIDautomationcontrol;thermoelectriccooler1总体设计概论1.1温室控制系统设计目标1:实时测量采集温室当前温度值,在家庭化超小型温室中仅需一组测量节点。2:可以设定温度上下限,且温度超过限度后自行报警。3:用PID算法实现温度的精确自动控制。1.1.1控制系统工作过程系统通电之后,传感器采集环境温度信...