单片机毕业设计外文翻译基于 AT89S51 单片机的微型土壤湿度检测仪设计.docx
《单片机毕业设计外文翻译基于 AT89S51 单片机的微型土壤湿度检测仪设计.docx》由会员分享,可在线阅读,更多相关《单片机毕业设计外文翻译基于 AT89S51 单片机的微型土壤湿度检测仪设计.docx(14页珍藏版)》请在冰豆网上搜索。
单片机毕业设计外文翻译基于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
w