2011613411ModernElectronicsTechniqueJun.2011Vol.34No.11基于无线传感器网络的智能大棚控制系统姜源1,2,郑玉丽3(1.,212003;2.,226007;3.,471023):给出了一种基于嵌入式系统和无线传感器网络的智能大棚控制系统的设计方法,该方法通过传感器对系统内的各种环境参数进行采集,并由无线通信网络将数据传回控制终端控制终端由Qt编写,能完成图形界面绘制数据处理数据库管理和PID控制计算,以及整个智能大棚系统的运行运行结果表明,该系统人机界面良好操作简便自动化程度高,具有良好的应用前景和推广价值:智能大棚;无线传感器网络;无线数据采集;ARM:TN919.7234:A:1004373X(2011)11013504IntelligentGreenhouseControlSystemBasedonWSNJIANGYuan1,2,ZHENGYuli3(1.JiangsuUniversityofScienceandTechnology,Zhenjiang212003,China;2.NantongVocationalCollege,Nantong226007,China;3.LuoyangInstituteofScienceandTechnology,Luoyang471023,China)Abstract:AnintelligentgreenhousecontrolsystembasedonembeddedsystemandWSNisdesignedinthisarticle.Itcollectsdifferentkindsofenvironmentalparametersinthegreenhousebysensors,andthensendsthedatabacktocontrolterminalthroughwirelesscommunicationnetwork.ThecontrolprograminterminaliscompiledinQttofulfilthegraphicalinterfacedrawing,dataprocessing,databasemanaging,PIDcontrolcalculation,andcontrolofthewholegreenhouse.Testingresultshowsthatthesystemwithfriendlyinterfaceiseasytooperateandhighlyautomatic,andwillsurelybringarosyapplicationprospectandhighpromotionalvalue.Keywords:intelligentgreenhouse;WSN;wirelessdataacquisition;ARM:201012150,GUI,,,PID,1,,,,,,(CO2),,,PID,,,,,,,,,1图1系统结构框图2PC,PC,,,PC,,,,PC2.1基站控制系统32,,,,,,,(),,2图2大棚基站结构原理框图2.2无线数据采集系统的设计32EasyARM1138,nRF24L01,nRF24L01,2.4~2.5GHzISM,ShockBurst,3图3无线传感器网络节点原理图1362011342.3外围控制电路的设计EasyARM1138,nRF24L01EasyARM1138I/ODAC0832,,3NokiaQtQtC++,6,PID4图4控制中心软件框架结构图3.1数据库的设计,,MySQLMySQL/SQL,mysqld,,,,,,,MySQLQtQtSql::QSqlDatabaseGHDB=QSqlDatabase::addDatabase(GHDB);GHDB.setHostName(Nantong);GHDB.setUserName(greenHouse1);GHDB.setPassword(123456);If(!GHDB.open()){qDebug()CannotopentheDataBase!!!;return;}GHDB.exec();,QtSqlAPI3.2PID控制计算,,PID,,,,,PIDeSP()PV(,)PIDM(t):M(t)=KCe+KC10edt+KCdedt+Minitial:M(t)PID,;KCPID;ePID,;MinitialPIDPID,PID,PID,:Mn=KC(SPn-PVn)+KCTS/T1(SPn-PVn)+MX+KC(TD/TS)(PVn-PVn-1),Mnn;KC;SPnn;PVnn;TS;T1;MXn-1();TD;PVn-1n-1PID:doublePIDCalculate(PID*pp,doubleNextPoint){doubledError,Error;Error=pp-SetPoint-NextPoint;//pp-SumError+=Error;//dError=pp-LastError-pp-PrevError;//pp-PrevError=pp-LastError;13711:pp-LastError=Error;return(pp-Proportion*Error//+pp-Integral*pp-SumError//+pp-Derivative*dError);//}4,,,,,,,,,,参考文献[1],.[J].,2010(9):8284.[2],,.[J].,2000(6):1920.[3].[J].,2003(1):1516.[4],.[J].,2004(2):5354.[5],.nRF[J].,2006,4(2):57,11.[6],.[J].,2003(7):2123.[7],,,.[J].,2005(4):1013.[8].[J].,2000(1):5.[9]MITOLAJ.Thesoftwareradioarchitecture[J].IEEECommunicationMagazine,1995(5):2638.[10]SALKIntzisAK.ADCandDSPchallengesinthedevelopmentofsoftwareradiobasestations[J].IEEEPersonalCommunication,1999(8):4755.[11],.ZigBee[J].,2008,31(15):98100.[12].RF[J].,2010,33(13):117119.:姜源1982年出生,硕士在读,讲师现从事电子测量单片机控制方面的研究(上接第134页),PID,,,PWM,,,,,,,参考文献[1].[EB/OL].[20061201].[2],.Researchonthedevelopmentconditionsofmilitaryrobotsabroad[C]//.:,2007:28502852.[3].[D].:,2010.[4],.[M].:,1997.[5].[D].:,2008.[6].[D].:,2010.[7],,,.X_(20)[J].:,2007(4):4244.[8],,.DSP[J].:,2009,27(3):101105.:余嘉傲男,1988年出生主要从事机电一体化方面的研究工作138201134