【正文】
68000)/256。 TL1=(655368000)%256。 EA=1。 ET1=1。 TR1=0。}void warm_control()//判斷控制報(bào)警{ if((temp/1010||temp/1030)||(hum/1020||hum/1060) )//判斷溫濕度值是否符合要求 { TR1=1。 } else { TR1=0。 redled=1。 greedled=0。 } /**********控制模塊待加入***********if(temp/1010) hot=0。 //加熱器加熱 if(temp/1030) fine=0。 //風(fēng)扇降溫 if(hum/1020) pwq=0。 //噴霧器增濕 if(hum/1060) ccq=0。 //除潮器除潮****************************************/}void Display(){ write_(0x8c)。 write_data(bai)。 write_data(shi)。 write_data(39。.39。)。 write_data(ge)。 write_data(39。C39。)。 write_(0x80+0x49)。 write_data(bai1)。 write_data(shi1)。 write_data(39。.39。)。 write_data(ge1)。 write_data(39。%39。)。 write_data(39。H39。)。}void main(){ Init_LCD1602()。 interrupt_init()。 // w_string(0x80,word1)。// w_string(0xC0,word2)。 write_(0x80)。 for(num=0。num16。num++) { write_data(table[num])。 } write_(0x80+0x40)。 for(num1=0。num116。num1++) { write_data(table1[num1])。 } while (1) { read_hum_temp()。 delay(3000)。 //此處的時(shí)間不能小于3000,否則讀不出! zhuanhuan()。 warm_control()。 // hum_h=hum_l=temp_h=temp_l=check=temp=hum=0。 Display()。 }} void timer0() interrupt 1{ TH0=(6553650000)/256。 TL0=(6553650000)%256。 t++。 if(t==10) { t=0。 } }void timer1() interrupt 3{ TH1=(65536100)/256。 TL1=(65536100)%256。 beef=~beef。 redled=0。 greedled=1。}總 結(jié):雖然這個(gè)設(shè)計(jì)做的比較簡單,但能完成給定的設(shè)計(jì)內(nèi)容。很多東西考慮的不是很細(xì),也有一些特別情況沒有做,但是用了很多精力用來完成這個(gè)論文,鑒于個(gè)人水平和時(shí)間的關(guān)系,所以并沒有把自己當(dāng)初設(shè)想的所有情況都考慮進(jìn)去。這此設(shè)計(jì)讓我學(xué)會(huì)的很多,覺得自己學(xué)的太少還有很多需要認(rèn)真學(xué)習(xí),學(xué)無止境,所以要更努力。參考文獻(xiàn):[1][J].微計(jì)算機(jī)信息,2009(25): 21~24[2][J].現(xiàn)代電子技術(shù),2011 (7):7~15[3][M].北京:~106[4] Atmel. Atmel 89C51 Microcontrollers Hardware Manual,2010. 35~98[5]陳桂友,[M].北京:機(jī)械工業(yè)出版社,~88[6][M].:機(jī)械工業(yè)出版社,2008. 60~102 [7][J].工業(yè)控制計(jì)算機(jī),2010(7):13~21[8][J].現(xiàn)代電子技術(shù),2008 (5):6~12[9][M].:高等教育出版社,~80[10][J].微計(jì)算機(jī)信息,2008(17):5~18[11][M].:清華大學(xué)出版社, ~95The design of temperature and humidity measurement and control system based on singlechip microputerLi Ruitao(Mechanical and Electronic Engineering Department of Dezhou University,Dezhou Shandong,253023)Abstract: In this paper, using 89C51 MCU to design a greenhouse temperature and humidity measurement and control system. Detection and control the indoor temperature and humidity and realtime display. The temperature and humidity sensor using AM2301digital temperature and humidity sensor, The temperature and humidity are displayed in the 1602 LCD through the 89 C51 single chip puter processing. And the realtime temperature and humidity value judgment whether meet the set the humidity and temperature of the range. If it exceeds the setting range, through the 89C51 start the temperature and humidity control system, to achieve the purpose of constant temperature and humidity.Key Word: 89C51 MCU, AM2301 temperature and humidity sensor, 1602LCD, temperature and humidity control system謝辭此次設(shè)計(jì)是在我的指導(dǎo)老師倪云峰老師的精心指導(dǎo)及全力支持下完成的。本系統(tǒng)的設(shè)計(jì)成功與倪老師的幫助是密不可分的,再加上小組成員的努力和合作才能圓滿地完成預(yù)期的目標(biāo)。倪老師對新知識,新事物都有自己獨(dú)到的理解,這深深的影響了我們對學(xué)習(xí)的態(tài)度。他一絲不茍的工作態(tài)度和認(rèn)真負(fù)責(zé)的敬業(yè)精神同樣給了我們巨大的收益和鼓舞。這些都將使我受益匪淺,給位組員的精誠合作也是本設(shè)計(jì)成功的關(guān)鍵所在,感謝老師感謝隊(duì)友我相信通過我們不斷的努力學(xué)習(xí),明天將會(huì)更加美