基于单片机的温度控制系统设计摘要:最近这些年,随着科学技术的不断发展和进步,单片机技术通过在各行各业中的应用也日臻完善。而温度测控系统也因单片机所特有的强大处理能力、功耗低以及体积小等优点向着小型化和智能化发展。本设计以STC89C52单片机为主控制芯片,外接温度传感器DS18B20以及外接加热制冷元件组成温度控制系统。通过该系统,人们可以加深对温度控制理论的理解和研究。本文对比了几种当前比较经常使用的温度控制系统的各自特点,决定通过程序设定温度上下限值,选择AT240C2芯片保存设置的温度值。并且详细讨论了该温度控制系统的硬件构成,软件的设计以及各串口电路设计。其中,硬件部分包括电源模块、温度采集模块、串行通信模块、测试模块以及外设控制模块,除外设控制模块外其余各模块均进行了原理图设计;软件部分主要针对各模块通信协议进行了程序编写。为了充分保证系统的稳定性,同时也采取了相应措施。配备了一组继电器来控制执行单元,使温度能在一定范围。该系统具有良好的稳定性,可行性和鲁棒性,可以进行使用和推广。关键词:单片机温度控制系统DS18B20IDesignofTemperatureControlSystemBasedonMicrocontrollerAbstract:Withthecontinuousdevelopmentandprogressofscienceandtechnologynearly,SCMtechnologythroughallwalksoflifeintheapplicationisalsoimproving.Thetemperaturemeasurementandcontrolsystemisalsoasmallandintelligentdevelopmentbecauseofitsuniquepowerfulprocessingability,lowpowerconsumptionandsmallsize.ThedesignofSTC89C52microcontrollerbasedcontrolchip,anexternaltemperaturesensorDS18B20temperaturemeasurementsystem.Throughthissystem,peoplecandeepentheunderstandingandresearchoftemperaturecontroltheory.Inthispaper,thecharacteristicsofseveralcurrenttemperaturecontrolsystemsarecompared,andthedigitalPIDtemperaturecontrollerisconsidered.Anddiscussedthetemperaturecontrolsystem'shardwareconstitution,thesoftwaredesignandeachserialportcircuitdesignindetail.Thehardwareincludesthepowersupplymodule,temperatureacquisitionmodule,serialcommunicationmodule,testmoduleandperipheralcontrolmodule,controlmoduleandotherperipheralsineachmoduleareprinciplediagramdesignandPCBproduction;inthepartofsoftwaremodulesofcommunicationprotocolandcontrolalgorithmfortheprogram.Inordertoensurethestabilityofthesystem,correspondingmeasureshavebeentaken.Asetofrelaysisprovidedtocontroltheexecutionunitsothatthetemperatureiswithinacertainrange.Thesystemhasgoodstability,feasibilityandrobustness,andcanbeusedandpopularized.Keywords:microcontrollertemperaturecontrolsystemDS18B20II目录第1章绪论..............................................11.1本课题研究的背景与意义.....................................11.2温度控制系统的发展与现状...................................11.2.1国内发展状况..........................................11.2.2国外发展状况..........................................21.3系统总体设计方案...........................................21.3.1系统性能及特点........................................21.3.2系统总体架构..........................................31.3.3主要器件的选用........................................41.4本文主要工作...............................................4第2章温度控制系统硬件设计..............................52.1主控芯片STC89C52简介......................................52.1.1STC89C52芯片特性.....................................52.1.2时钟模块..............................................52.1.3DigitalI/O模块......................................62.1.4USART模块............................................62.1.5JTAG模块.....................................