基于单片机的大棚蔬菜温度采集系统开题报告Word格式.docx
《基于单片机的大棚蔬菜温度采集系统开题报告Word格式.docx》由会员分享,可在线阅读,更多相关《基于单片机的大棚蔬菜温度采集系统开题报告Word格式.docx(14页珍藏版)》请在冰豆网上搜索。
国外的温室设施己经发展到比较完备的程度,并形成了一定的标准,但是价格非常昂贵,缺乏与我国气候特点相适应的测控软件。
而当今大多数对大棚温度、湿度、二氧化碳含量的检测与控制都采用人工管理,这样不可避免的有测控精度低、劳动强度大及由于测控不及时等弊端,容易造成不可弥补的损失,结果不但大大增加了成本,浪费了人力资源,而且很难达到预期的效果。
因此,为了实现高效农业生产的科学化并提高农业研究的准确性,推动我国农业的发展,必须大力发展农业设施与相应的农业工程,科学合理地调节大棚内温度、湿度以及二氧化碳的含量,使大棚内形成有利于蔬菜、水果生长的环境,是大棚蔬菜和水果早熟、优质、高效益的重要环节。
目前,随着蔬菜大棚的迅速增多,人们对其性能要求也越来越高,特别是为了提高生产效率,对大棚的自动化程度要求也越来越高。
由于单片机及各种电子器件性价比的迅速提高,使得这种要求变为可能。
二、毕业设计(论文)研究现状和发展趋势。
温度是一种最基本的环境参数,对于我们来说,不仅仅是一个量的反映,更能直接影响作用到我们的生活中,人民的生活与环境的温度息息相关,在工业生产过程中需要实时测量温度,在农业生产中也离不开温度的测量,因此研究温度的测量方法和装置具有重要的意义。
测量温度的关键是温度传感器。
随着科技的发展,技术要求的重视,温度测量的精度也越来越被看重。
所以高精度温度测量系统的研究就非常有意义。
本文主要着重于对水温的测量和控制的研究,在工厂锅炉、农业生产中都可得到广泛的应用。
测量温度的方法很多,按照测量体是否与被测介质接触,可分为接触式测温法和非接触式测温法两大类。
温度测量应用中有多种类型的传感器,其中有热敏电阻、热电偶等。
热敏电阻由于体积小,重复性好,测量方法简单,所以在一般的测量系统中广泛应用,但是热敏电阻作为传感器的测温系统需要A/D转换,信号放大与处理,并且测量精度不高,这也是热敏电阻的缺点、不足。
另一种热电偶传感器,能够检测更宽的温度范围,还具有较高的性价比。
而且热电偶的鲁棒性、可靠性和快速响应时间使其成为各种工作环境下的首要考虑。
但是,热电偶传感器也存在一些缺陷,比如线性特性较差,信号电平很低,常常需要放大或高分辨率数据转换器进行处理。
随着科学技术的快速发展,特别是现代仪器的发展,微型化、集成化、数字化成为传感器发展的一个重要方向,本次设计是由89C51单片机温度传感器、模数转换器ADC0809、窜入并出移位寄存器74LS164、数码管、和LED显示电路等组成。
由热敏电阻温度传感器测量环境温度,将其电压值送入ADC0809的IN0通道进行模数转换,转换所得的数字量由数据端D7-D0输出到89C51的P0口,经软件处理后将测量的温度值经单片机的RXD端窜行输出到74LS164,经74LS164窜并转换后,输出到数码管的7个显示段,用数字形式显示出当前的温度值。
89C51的P2.0、P2.1、P2.2分别接入ADC0809通道地址选择端A、B、C,因此ADC0809的IN0通道的地址为F0FFH。
输出驱动控制信号由p1.0输出,4个LED为状态指示,其中,LED1为输出驱动指示,LED2为温度正常指示,LED3为高于上限温度指示,LED4为低于下限温度指示。
当温度高于上限温度值时,有p1.0输出驱动信号,驱动外设电路工作,同时LED1亮、LED2灭、LED3亮、LED4灭。
外设电路工作后,温度下降,当温度降到正常温度后,LED1亮、LED2亮、LED3灭、LED4灭。
温度继续下降,当温度降到下限温度值时,p1.0信号停止输出,外设电路停止工作,同时LED1灭、LED2灭、LED3灭、LED4亮。
当外设电路停止工作后,温度开始上升,接着进行下一工作周期。
三、毕业设计(论文)研究方案及工作计划
1.温度采集系统硬件设计
由于不同的传感器有不同的输出量,但是最终都需要
转换为0~10V的电压值,从而才能满足A/D转换器的转
换要求。
因此各个传感器需要不同的转换和放大电路。
电路原理图如图
(2)所示:
1.2PT100热电阻测温原理硬件电路
2.温度控制器程序设计
本软件系统有1个主程序,6个子程序组成。
6个子程序为定时/计数器0中断服务程序、温度采集及模数转换子程序ADCON、温度计算子程序CALCU、驱动控制子程序DRVCON、十进制转换子程序METRICCON及数码管显示子程序DISP。
部分程序设计流程图如图1-0至图1-4所示。
图1-0部分程序设计流程图的设计框架
图1-1主程序流程图
图1-2T0中断服务程序流程图
图1-3温度采样及模数转换子程序流程图
图1-4温度计算子程序流程图
四、主要参考文献
[1]曹巧媛.单片机原理及应用(第二版).电子工业出版社,2002
[2]全国大学生电子设计竞赛组委会编.第五届全国大学生电子设计竞赛获奖作品选编(2001),北京理工大学出版社,2003
[3]何力民.单片机高级教程.北京航空大学出版社,2000
[4]金发庆.传感器技术与应用.北京机械工业出版社,2002
[5]王锦标,方崇智.过程计算机控制.清华大学出版社,1997
[6]邵惠鹤.工业过程高级控制.上海交通大学出版社,1997
[7]胡寿松.自动控制原理.国防工业出版社,2000
[8]刘伯春.智能PID调节器的设计及应用.电子自动化,1995
[9]KatsuhikoOgata.ModenControlEngineering.Publishinghouseofelectronicsindustry,2000:
196—202
[10]周润景,张丽娜.基于PROTEUS的电路及单片机系统设计与仿真[M].航空航天大学出版社,2006
[11]王忠飞,胥芳.MCS-51单片机原理及嵌入式系统应用[M].西安电子科技大学出版社,2007
[12]刘国钧,陈绍业,王凤翥.图书馆目录.第1版,高等教育出版社,1957
外文文献:
Description
TheAT89C51isalow-power,high-performanceCMOS8-bitmicrocomputerwith4KbytesofFlashProgrammableandErasableReadOnlyMemory(PEROM)and128bytesRAM.ThedeviceismanufacturedusingAtmel’shighdensitynonvolatilememorytechnologyandiscompatiblewiththeindustrystandardMCS-51™instructionsetandpinout.Thechipcombinesaversatile8-bitCPUwithFlashonamonolithicchip,theAtmelat89s52isapowerfulmicrocomputerwhichprovidesahighlyflexibleandcosteffectivesolutiontomanyembeddedcontrolapplications.
Features:
•CompatiblewithMCS-51™Products
•4KBytesofIn-SystemReprogrammableFlashMemory
•Endurance:
1,000Write/EraseCycles
•FullyStaticOperation:
0Hzto24MHz
•Three-LevelProgramMemoryLock
•128x8-BitInternalRAM
•32ProgrammableI/OLines
•Two16-BitTimer/Counters
•SixInterruptSources
•ProgrammableSerialChannel
•LowPowerIdleandPowerDownModes
TheAT89C51providesthefollowingstandardfeatures:
4KbytesofFlash,128bytesofRAM,32I/Olines,two16-bittimer/counters,afivevectortwo-levelinterruptarchitecture,afullduplexserialport,on-chiposcillatorandclockcircuitry.Inaddition,theat89s52isdesignedwithstaticlogicforoperationdowntozerofrequencyandsupportstwosoftwareselectablepowersavingmodes.TheIdleModestopstheCPUwhileallowingtheRAM,timer/counters,serialportandinterruptsystemtocontinuefunctioning.ThePowerDownModesavestheRAMcontentsbutfreezestheoscillatordisablingallotherchipfunctionsuntilthenexthardwarereset.
PinDescription:
VCCSupplyvoltage.
GNDGround.
Port0
Port0isan8-bitopendrainbidirectionalI/Oport.AsanoutputporteachpincansinkeightTTLinputs.Whenisarewrittentoport0pins,thepinscanbeusedashighimpedanceinputs.
Port0mayalsobeconfiguredtobethemultiplexedloworderaddress/databusduringaccessestoexternalprogramanddatamemory.InthismodeP0hasinternalpullups.
Port0alsoreceivesthecodebytesduringFlashprogramming,andoutputsthecodebytesduringprogramverification.Externalpullupsarerequiredduringprogramverification.
Port1
Port1isan8-bitbidirectionalI/Oportwithinternalpullups.ThePort1outputbufferscansink/sourcefourTTLinputs.When1sarewrittentoPort1pinstheyarepulledhighbytheinternalpullupsandcanbeusedasinputs.Asinputs,Port1pinsthatareexternallybeingpulledlowwillsourcecurrent(IIL)becauseoftheinternalpullups.
Port1alsoreceivesthelow-orderaddressbytesduringFlashprogrammingandverification.
Port2
Port2isan8-bitbidirectionalI/Oportwithinternalpullups.ThePort2outputbufferscansink/sourcefourTTLinputs.When1sarewrittentoPort2pinstheyarepulledhighbytheinternalpullupsandcanbeusedasinputs.Asinputs,Port2pinsthatareexternallybeingpulledlowwillsourcecurrent(IIL)becauseoftheinternalpullups.
Port2emitsthehigh-orderaddressbyteduringfetchesfromexternalprogrammemoryandduringaccessestoexternaldatamemorythatuse16-bitaddresses(MOVX@DPTR).Inthisapplicationitusesstronginternalpull-upswhenemitting1s.Duringaccessestoexternaldatamemorythatuse8-bitaddresses(MOVX@RI),Port2emitsthecontentsoftheP2SpecialFunctionRegister.
Port2alsoreceivesthehigh-orderaddressbitsandsomecontrolsignalsduringFlashprogrammingandverification.
Port3
Port3isan8-bitbidirectionalI/Oportwithinternalpullups.ThePort3outputbufferscansink/sourcefourTTLinputs.When1sarewrittentoPort3pinstheyarepulledhighbytheinternalpullupsandcanbeusedasinputs.Asinputs,Port3pinsthatareexternallybeingpulledlowwillsourcecurrent(IIL)becauseofthepullups.
Port3alsoservesthefunctionsofvariousspecialfeaturesoftheat89s52aslistedbelow:
Portpin
alternatefunctions
P3.0
rxd(serialinputport)
P3.1
txd(serialoutputport)
P3.2
^int0(externalinterrupt0)
P3.3
^int1(externalinterrupt1)
P3.4
t0(timer0externalinput)
P3.5
t1(timer1externalinput)
P3.6
^WR(externaldatamemorywritestrobe)
P3.7
^rd(externaldatamemoryreadstrobe)
Port3alsoreceivessomecontrolsignalsforFlashprogrammingandverification.
RST
Resetinput.Ahighonthispinfortwomachinecycleswhiletheoscillatorisrunningresetsthedevice.
ALE/PROG
AddressLatchEnableoutputpulseforlatchingthelowbyteoftheaddressduringaccessestoexternalmemory.Thispinisalsotheprogrampulseinput(PROG)duringFlashprogramming.
InnormaloperationALEisemittedataconstantrateof1/6theoscillatorfrequency,andmaybeusedforexternaltimingorclockingpurposes.Note,however,thatoneALEpulseisskippedduringeachaccesstoexternalDataMemory.
Ifdesired,ALEoperationcanbedisabledbysettingbit0ofSFRlocation8EH.Withthebitset,ALEisactiveonlyduringaMOVXorMOVCinstruction.Otherwise,thepinisweaklypulledhigh.SettingtheALE-disablebithasnoeffectifthemicrocontrollerisinexternalexecutionmode.
PSEN
ProgramStoreEnableisthereadstrobetoexternalprogrammemory.
Whentheat89s52isexecutingcodefromexternalprogrammemory,PSENisactivatedtwiceeachmachinecycle,exceptthattwoPSENactivationsareskippedduringeachaccesstoexternaldatamemory.
EA/VPP
ExternalAccessEnable.EAmustbestrappedtoGNDinordertoenablethedevicetofetchcodefromexternalprogrammemorylocationsstartingat0000HuptoFFFFH.Note,however,thatiflockbit1isprogrammed,EAwillbeinternallylatchedonreset.
EAshouldbestrappedtoVCCforinternalprogramexecutions.
Thispinalsoreceivesthe12-voltprogrammingenablevoltage(VPP)duringFlashprogramming,forpartsthatrequire12-voltVPP.
XTAL1
Inputtotheinvertingoscillatoramplifierandinputtotheinternalclockoperatingcircuit.
XTAL2
Outputfromtheinvertingoscillatoramplifier.
OscillatorCharacteristics
XTAL1andXTAL2aretheinputandoutput,respectively,ofaninvertingamplifierwhichcanbeconfiguredforuseasanon-chiposcillator,asshowninFigure1.Eitheraquartzcrystalorceramicresonatormaybeused.Todrivethedevicefromanexternalclocksource,XTAL2shouldbeleftunconnectedwhileXTAL1isdrivenasshowninFigure2.Therearenorequirementsonthedutycycleoftheexternalclocksignal,sincetheinputtotheinternalclockingcircuitryisthroughadivide-by-twoflip-flop,butminimumandmaximumvoltagehighandlowtimespecificationsmustbeobserved.
IdleMode
Inidlemode,theCPUputsitselftosleepwhilealltheonchipperipheralsremainactive.Themodeisinvokedbysoftware.Thecontentoftheon-chipRAMandallthespecialfunctionsregistersremainunchangedduringthismode.Theidlemodecanbeterminatedbyanyenabledinterr