1、基于 at89s51 单片机的微型土壤湿度检测仪设计山东理工大学 毕业设计(外文翻译材料)2011年 6 月 The design Based on AT89S51 miniature soil humidity detector designAbstract: facilitate master soil moisture conditions, design the miniature soil humidity detector. Its hardware system includes signal amplifier circuit, A/D circuit, SCM, micro
2、LCD display and alarm circuit, etc.; Software system includes A/D conversion driver, LCD driver two modules. Proteus software platform based on the design of the system is simulated, and the results show that the system hardware and software design correct and reliable operation.Keywords: soil humid
3、ity; Detector; SCM; A/D conversion; simulationTP202 classification number: ChineseLiterature identification code: ASection 1 IntroductionAgricultural production in the economic development of our country has important position, for farmers Industry production to provide timely and reliablly technica
4、l service has become the heavily meteorological department To response one. Along with the national governments at all levels of agricultural production increasingly heavierDepende on the service, my unit also serve for agriculture, promote for increasing farmers incomeMany studies, the various prob
5、lems in agricultural production also widely adjustableInquiry. Research found that gardening cultivation, greenhouse flowers, awning vegetables oneSome valuable varieties of soil moisture, soil has a high requirement, humidityAt the time, not only seriously affecting its normal growth, and even caus
6、e planting product death Wu, causing serious damage. Farmers Therefore, engaged in this kind of agricultural production.Farmers very need a low cost, small volume and detection reliable soil .Soil humidity detector for water supply, provides the basis. In order to solve the above asked .Our problem,
7、 I unit combined with actual conditions of agricultural production, and the related units designedHome of high precision, to design the low cost of miniature soil moisture detection instrument.Along with the social life progress, peoples quality of life is getting much more better, flowers has becom
8、e a fashion. Flowers can not only enrich peoples cultural life and is good for mental and bodily health ,but also can improve and purify air, improve health. Water is necessary for flowers growth ,it influences the growth of flowers greatly. Too much water or too little, will affect the normal growt
9、h and the kind of flower is verious, Different flowers need different amount of water. The needful water, mostly from the soil, in order to control flowers moisture in the soil properly, using PRO - F soil humidity sensor design an automatic watering the flowers system, it may, automatically set for
10、 flowers watering according to the humidity limit, in order to meet the need of imperative water.Section 2 composition of the system The whole system consists of SCM, circuit of DAQ, keyboard input and digital display circuit, output controlling circuit etc. circuit of CAQ is made of 4 SRH and adc ,
11、 SRH makes flowers soil humidity convert into analog voltage output, adc makes the output of analog voltage convert into digital quantity and send to microcontroller. AT89S52 is adopted, the collectted value of soil humidity is compared with a preset limit soil moisture, and it makes corresponding j
12、udgement according to the compared results, to control the output controlling circuits action. Key-in is used to set the value of soil humiditys limit, LED is used to display the current soil humiditys value.Miniature soil detector signal processing system including soil humidity sensorDevice, A/D a
13、cquisition circuit, SCM and micro LCD. Its work After cheng is: soil soil wet degrees preach sensor, will wet degrees letter sent to A/D adopt set electricityRoad, the A/D conversion, income data digital signal into SCM Processing, finally will processing results sent to micro LCD display.Section 3
14、the hardware design of system 3.1 the circuits working principle The hard thing the original reason system graph as figure 2 shows. This article selects KSC -6V integrated relative humidity sensor, wait for after inserting the soil about 5s make sensorImplement fully contact with the soil, signal by
15、 integrated amp LM324 Vin the same phaseInput terminal. The sensors relative humidity 0% 100% RH, its correspondingOutput is 0 100mV 1. According to the integrated amp with phase ratio amplification gain: Kf=R1+ Rf =1+ 47 =48Then the output amplification V0 = 48 analog signal voltage, so output anal
16、og, Vi, electric pressure fan letter surrounded is 0 4.8v. This mode, turn into A/D CH0 slice of replace core general way into line changeover place, have cut to several words AT89S51 single-chip letter Numbers again into data processing and the LCD.3.2 A/D conversion chip choice and controlling pri
17、ncipleThis article chooses A/D conversion chips for ADC0832, this chip is 8Pin double row straight insert dual channel A/D converter, can separately for both road simulation No real now believe d/a change, can use in the ocl lose into mode and bad points to loseUnder the way of DI server channel sel
18、ected choose, several according to adopt sets and Data transfer 2.The work of ADC0832 do sequence as shown in figure 3. Root according to our web site, when covariance .ADC0832 did not work, must the piece selected in the high level, the CSWhen chip disabled. When should undertake A/D conversion sha
19、ll be piece selected end CS offsetsIn low level and maintains to convert over. Chip began to work, still need to makeMonolithic machine to core chips, when the clock CLK lose faith in the clock pulse blunt when lose,In the first clock pulse before the sinking DI end must be high electric flat, table
20、sAnd start signal. In the first 2, 3 pulse sinking DI end before should be lostInto two data used to select channels function. Channels are as follows:(1) the controlled conditionsIn accordance with The Times when DI lost with 1, 0, the only way to do CH0 tong general turned into single wordChange;
21、(2) when DI ordinal input 1, 1, only for single CH1 channel onTao transformation;(3) when DI ordinal 0, 0, will CH0 as is, will CH0 input 0 as its negative input IN CH1 -, as are the input IN +3.3 microcontrollers choiceMCU is the control of core, compared with the others ,we chose AT89S51 single-ch
22、ip microcomputer. The advantages of this type of single-chip microcomputer is 3 : (1) The single-chip microcomputer and the 8051 series microcontroller is fully compatible, make it use easily, and into the ten points Cheap; (2) Internal memory can be repeated CaXie by the EEPRROM, be helpful for rep
23、eatting modify the program;(3) has the low consumption working methods and to be achieved Off electrical automatic protection; (4) has strong anti-jamming, greatly improving the worthRoyal external electromagnetic interference ability, so it is especially suitable for relatively tough in conditions
24、Under the poor conditions of the job.3.4 The use of LCDUsing micro LCD display device, 1602LCD, its performance point is: working voltage only 4.5 5.5 V; Very low power consumption (work currentOnly 2.0 mA); And reliable work; Small volume (can show 16 x 2 wordsOperators). Its characters are display
25、ed by internal special displacement function of HD44780 dynamic core slice 4Quasi ASCII put into their number within department set into reservoir with deposit according to show and editor (DDRAM), inside the ministry accused of line of road will move will word from sheba operators preach send to sh
26、ow, Implement. Monolithic machine and the number of 1602LCD between general P0 into change had to enter line, resistance for P0 mouth R9 R2 the pull-up resistorsSection 4 The software design of the control of systemThis recorder controlling software design adopts modular thought. According to the fu
27、nction,w emake the controlling system software devide into two big modules: (1) ADC0832 driver module, to control the collection of voltage signal;(2) 1602LCD driver module, show soil humidity. This system driver using CLanguage design, its main program is as followsMain (void)unsigned int AD_val;Co
28、nvert the value after theunsigned int Int, Dec;The converted the integer part and the decimal part/ / storage save A/D/ / points dont store in existencechangeLcdInitiate ();/ / to be liquid crystal early beginning2)the production of clock When the clock points frequency device (after it can have to
29、4.5 MHz in turn when the change in A/D clock) turn change when idle is empty, the hold after A state in ADCR is written to the START field immediately START 01 (conversion) or the selected edge appear in choice of signal sampling clock can immediately START. This feature can save power consumption.
30、ADC conversion clock computation formula is as followsFADC=FPCK/(CLKDIV+1)Type: Fpclk - core slice; when the clock set After CLKDIV - points of ADC conversion clock frequency.3) interrupted. When DONE bits is 1, A/D conversion module to vector interrupt controller (VIC) issued an interrupt request i
31、n the VICIntEnable VIC, if Bit8 (A/D conversion interrupts enabled bits) make can, then can produce the interruption. Read ADDR will reset DONE bits. This paper mainly A/D acquisition C language driver section design is as follows:/* Function: A/D acquisitionEntrance parameters: CH_i/*void AD_Change
32、(unsigned char CH_i)ADC0R = (1 CH_i) | / / choose channels I carry A/D acquisition (Fpclk / 1,000, 000-1) 8 | / / set convert clock(0 16)(0 19)| / / BURST = 0, software control conversion operations| / / normal A/D acquisition modes(0 27);| / / decrease along the startup conversionAD0DR; DO = / / read take ADC and fruit, and clear exceptDONE mark bitswhile (1)
copyright@ 2008-2022 冰豆网网站版权所有
经营许可证编号:鄂ICP备2022015515号-1