基于 at89s51 单片机的微型土壤湿度检测仪设计.docx

上传人:b****5 文档编号:7254901 上传时间:2023-01-22 格式:DOCX 页数:14 大小:125.85KB
下载 相关 举报
基于 at89s51 单片机的微型土壤湿度检测仪设计.docx_第1页
第1页 / 共14页
基于 at89s51 单片机的微型土壤湿度检测仪设计.docx_第2页
第2页 / 共14页
基于 at89s51 单片机的微型土壤湿度检测仪设计.docx_第3页
第3页 / 共14页
基于 at89s51 单片机的微型土壤湿度检测仪设计.docx_第4页
第4页 / 共14页
基于 at89s51 单片机的微型土壤湿度检测仪设计.docx_第5页
第5页 / 共14页
点击查看更多>>
下载资源
资源描述

基于 at89s51 单片机的微型土壤湿度检测仪设计.docx

《基于 at89s51 单片机的微型土壤湿度检测仪设计.docx》由会员分享,可在线阅读,更多相关《基于 at89s51 单片机的微型土壤湿度检测仪设计.docx(14页珍藏版)》请在冰豆网上搜索。

基于 at89s51 单片机的微型土壤湿度检测仪设计.docx

基于at89s51单片机的微型土壤湿度检测仪设计

山东理工大学

毕业设计

(外文翻译材料)

2011年6月

 

ThedesignBasedonAT89S51miniaturesoilhumiditydetectordesign

Abstract:

facilitatemastersoilmoistureconditions,designtheminiaturesoilhumiditydetector.Itshardwaresystemincludessignalamplifiercircuit,A/Dcircuit,SCM,microLCDdisplayandalarmcircuit,etc.;SoftwaresystemincludesA/Dconversiondriver,LCDdrivertwomodules.Proteussoftwareplatformbasedonthedesignofthesystemissimulated,andtheresultsshowthatthesystemhardwareandsoftwaredesigncorrectandreliableoperation.

Keywords:

soilhumidity;Detector;SCM;A/Dconversion;simulation

TP202classificationnumber:

Chinese

Literatureidentificationcode:

A

Section1Introduction

Agriculturalproductionintheeconomicdevelopmentofourcountryhasimportantposition,forfarmersIndustryproductiontoprovidetimelyandreliabllytechnicalservicehasbecometheheavilymeteorologicaldepartmentToresponseone.Alongwiththenationalgovernmentsatalllevelsofagriculturalproductionincreasinglyheavier

Dependeontheservice,myunitalsoserveforagriculture,promoteforincreasingfarmers'income

Manystudies,thevariousproblemsinagriculturalproductionalsowidelyadjustable

Inquiry.Researchfoundthatgardeningcultivation,greenhouseflowers,awningvegetablesone

Somevaluablevarietiesofsoilmoisture,soilhasahighrequirement,humidity

Atthetime,notonlyseriouslyaffectingitsnormalgrowth,andevencauseplantingproductdeathWu,causingseriousdamage.FarmersTherefore,engagedinthiskindofagriculturalproduction.Farmersveryneedalowcost,smallvolumeanddetectionreliablesoil.Soilhumiditydetectorforwatersupply,providesthebasis.Inordertosolvetheaboveasked.Ourproblem,Iunitcombinedwithactualconditionsofagriculturalproduction,andtherelatedunitsdesigned

Homeofhighprecision,todesignthelowcostofminiaturesoilmoisturedetectioninstrument.

Alongwiththesociallifeprogress,people'squalityoflifeisgettingmuchmorebetter,flowershasbecomeafashion.Flowerscannotonlyenrichpeople'sculturallifeandisgoodformentalandbodilyhealth,butalsocanimproveandpurifyair,improvehealth.Waterisnecessaryforflower’sgrowth,itinfluencesthegrowthofflowersgreatly.Toomuchwaterortoolittle,willaffectthenormalgrowthandthekindofflowerisverious,Differentflowersneeddifferentamountofwater.Theneedfulwater,mostlyfromthesoil,inordertocontrolflowersmoistureinthesoilproperly,usingPRO-Fsoilhumiditysensordesignanautomaticwateringtheflowerssystem,itmay,automaticallysetforflowerswateringaccordingtothehumiditylimit,inordertomeettheneedofimperativewater.

 

Section2compositionofthesystem

ThewholesystemconsistsofSCM,circuitofDAQ,keyboardinputanddigitaldisplaycircuit,outputcontrollingcircuitetc.circuitofCAQismadeof4SRHandadc,SRHmakesflower’ssoilhumidityconvertintoanalogvoltageoutput,adcmakestheoutputofanalogvoltageconvertintodigitalquantityandsendtomicrocontroller.AT89S52isadopted,thecollecttedvalueofsoilhumidityiscomparedwithapresetlimitsoilmoisture,anditmakescorrespondingjudgementaccordingtothecomparedresults,tocontroltheoutputcontrollingcircuit’saction.Key-inisusedtosetthevalueofsoilhumidity’slimit,LEDisusedtodisplaythecurrentsoilhumidity’svalue.

Miniaturesoildetectorsignalprocessingsystemincludingsoilhumiditysensor

Device,A/Dacquisitioncircuit,SCMandmicroLCD.ItsworkAfterchengis:

soilsoilwetdegreespreachsensor,willwetdegreeslettersenttoA/Dadoptsetelectricity

Road,theA/Dconversion,incomedatadigitalsignalintoSCMProcessing,finallywillprocessingresultssenttomicroLCDdisplay.

Section3thehardwaredesignofsystem

3.1thecircuit’sworkingprinciple

Thehardthingtheoriginalreasonsystemgraphasfigure2shows.ThisarticleselectsKSC-6Vintegratedrelativehumiditysensor,waitforafterinsertingthesoilabout5smakesensor

Implementfullycontactwiththesoil,signalbyintegratedampLM324Vinthesamephase

Inputterminal.Thesensor'srelativehumidity0%~100%RH,itscorresponding

Outputis0~100mV[1].Accordingtotheintegratedampwithphaseratioamplificationgain:

Kf=R1+Rf=1+47=48

 

ThentheoutputamplificationV0=48analogsignalvoltage,sooutputanalog,Vi,electricpressurefanlettersurroundedis0~4.8v.Thismode,turnintoA/DCH0sliceofreplacecoregeneralwayintolinechangeoverplace,havecuttoseveralwordsAT89S51single-chipletterNumbersagainintodataprocessingandtheLCD.

3.2A/Dconversionchipchoiceandcontrollingprinciple

ThisarticlechoosesA/DconversionchipsforADC0832,thischipis8

PindoublerowstraightinsertdualchannelA/Dconverter,canseparatelyforbothroadsimulationNorealnowbelieved/achange,canuseintheoclloseintomodeandbadpointstolose

UnderthewayofDIserverchannelselectedchoose,severalaccordingtoadoptsetsandDatatransfer[2].

TheworkofADC0832dosequenceasshowninfigure3.Rootaccordingtoourwebsite,whencovariance.ADC0832didnotwork,mustthepieceselectedinthehighlevel,theCS

Whenchipdisabled.WhenshouldundertakeA/DconversionshallbepieceselectedendCSoffsets

Inlowlevelandmaintainstoconvertover.Chipbegantowork,stillneedtomake

Monolithicmachinetocorechips,whentheclockCLKlosefaithintheclockpulsebluntwhenlose,

InthefirstclockpulsebeforethesinkingDIendmustbehighelectricflat,tables

Andstartsignal.Inthefirst2,3pulsesinkingDIendbeforeshouldbelost

Intotwodatausedtoselectchannelsfunction.Channelsareasfollows:

(1)thecontrolledconditions

InaccordancewithTheTimeswhenDIlostwith1,0,theonlywaytodoCH0tonggeneralturnedintosinglewordChange;

(2)whenDIordinalinput1,1,onlyforsingleCH1channelonTaotransformation;

(3)whenDIordinal0,0,willCH0asis,willCH0input0asitsnegativeinputINCH1-,asaretheinputIN+

 

3.3microcontroller’schoice

MCUisthecontrolofcore,comparedwiththeothers,wechoseAT89S51single-chipmicrocomputer.Theadvantagesofthistypeofsingle-chipmicrocomputeris[3]:

(1)Thesingle-chipmicrocomputerandthe8051seriesmicrocontrollerisfullycompatible,makeituseeasily,andintothetenpointsCheap;

(2)InternalmemorycanberepeatedCaXiebytheEEPRROM,behelpfulforrepeattingmodifytheprogram;

(3)hasthelowconsumptionworkingmethodsandtobeachievedOffelectricalautomaticprotection;

(4)hasstronganti-jamming,greatlyimprovingtheworthRoyalexternalelectromagneticinterferenceability,soitisespeciallysuitableforrelativelytoughinconditionsUnderthepoorconditionsofthejob.

3.4TheuseofLCD

UsingmicroLCDdisplaydevice,1602LCD,itsperformancepointis:

workingvoltageonly4.5~5.5V;Verylowpowerconsumption(workcurrent

Only2.0mA);Andreliablework;Smallvolume(canshow16x2words

Operators).ItscharactersaredisplayedbyinternalspecialdisplacementfunctionofHD44780dynamiccoreslice[4]

QuasiASCIIputintotheirnumberwithindepartmentsetintoreservoirwithdepositaccordingtoshowandeditor(DDRAM),insidetheministryaccusedoflineofroadwillmovewillwordfromshebaoperatorspreachsendtoshow,Implement.Monolithicmachineandthenumberof1602LCDbetweengeneralP0intochangehadtoenterline,resistanceforP0mouthR9R2~thepull-upresistors

Section4Thesoftwaredesignofthecontrolofsystem

Thisrecordercontrollingsoftwaredesignadoptsmodularthought.

Accordingtothefunction,wemakethecontrollingsystemsoftwaredevideintotwobigmodules:

(1)ADC0832drivermodule,tocontrolthecollectionofvoltagesignal;

(2)1602LCDdrivermodule,showsoilhumidity.ThissystemdriverusingC

Languagedesign,itsmainprogramisasfollows

Main(void)

{

unsignedintAD_val;

Convertthevalueafterthe

unsignedintInt,Dec;

Theconvertedtheintegerpartandthedecimalpart

//storagesaveA/D

//pointsdon'tstoreinexistence

change

LcdInitiate();

//tobeliquidcrystalearlybeginning

}

2)theproductionofclock

Whentheclockpointsfrequencydevice(afteritcanhaveto4.5MHzinturnwhenthechangeinA/Dclock)turnchangewhenidleisempty,theholdafterAstateinADCRiswrittentotheSTARTfieldimmediatelySTART01(conversion)ortheselectededgeappearinchoiceofsignalsamplingclockcanimmediatelySTART.Thisfeaturecansavepowerconsumption.ADCconversionclockcomputationformulaisasfollows

FADC=FPCK/(CLKDIV+1)

Type:

Fpclk-coreslice;whentheclocksetAfterCLKDIV-pointsofADCconversionclockfrequency.

3)interrupted.

WhenDONEbitsis1,A/Dconversionmoduletovectorinterruptcontroller(VIC)issuedaninterruptrequestintheVICIntEnableVIC,ifBit8(A/Dconversioninterruptsenabledbits)makecan,thencanproducetheinterruption.ReadADDRwillresetDONEbits.ThispapermainlyA/DacquisitionClanguagedriversectiondesignisasfollows:

/***********************************

Function:

A/Dacquisition

Entranceparameters:

CH_i

/***********************************

voidAD_Change(unsignedcharCH_i)

{

ADC0R=(1<

(0<<16)

(0<<19)

|//BURST=0,softwarecontrolconversionoperations

|//normalA/Dacquisitionmodes

(0<<27);|//decreasealongthestartupconversion

AD0DR;DO=//readtakeADCandfruit,andclearexcept

DONEmarkbits

while

(1)

展开阅读全文
相关资源
猜你喜欢
相关搜索

当前位置:首页 > 农林牧渔 > 林学

copyright@ 2008-2022 冰豆网网站版权所有

经营许可证编号:鄂ICP备2022015515号-1