12.07.2015 Views

Networked Embedded Greenhouse Monitoring and ... - LaRIS - FESB

Networked Embedded Greenhouse Monitoring and ... - LaRIS - FESB

Networked Embedded Greenhouse Monitoring and ... - LaRIS - FESB

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

<strong>Networked</strong> <strong>Embedded</strong> <strong>Greenhouse</strong> <strong>Monitoring</strong><strong>and</strong> ControlDarko Stipanièev, Member, IEEE, Maja Èiæ <strong>and</strong> Jadranka Marasoviæ, Member, IEEEAbstract— <strong>Networked</strong> embedded systems have become quiteimportant nowdays, especially for monitoring <strong>and</strong> control ofdistance <strong>and</strong> dislocated objects. Small greenhouses are typicalexamples. First, they are usually located far away from theowners house, <strong>and</strong> second, the plant grow is an example of theprocess which need constant 24 hours monitoring.In this paper networked embedded greenhouse monitoring <strong>and</strong>control based on simple embeded web servers <strong>and</strong> 1-wireprotocol for conecting sensors <strong>and</strong> actuators is described.Hardware <strong>and</strong> software architecture of embedded web servers isanalysed <strong>and</strong> the experimental results of monitoring <strong>and</strong> controlof laboratory greenhouse is presented.Index Terms — <strong>Embedded</strong> web server, <strong>Greenhouse</strong> <strong>Monitoring</strong><strong>and</strong> Control, Internet, <strong>Networked</strong> <strong>Embedded</strong> Systems, TINI, 1-Wire protocolTI. INTRODUCTIONoday, advances in sensors, actuators <strong>and</strong>microprocessor technology, both on hardware <strong>and</strong>software level, have enabled distributed implementation ofsensor <strong>and</strong> control actions over sensor/actuators networks.If we connect such local sensor/actuators, private networksto global network (Internet) additional features could beexhibit. The monitored <strong>and</strong> controled system could becomeaccessible from almoust anywhere. The process parametersdata display, remote control, system testing <strong>and</strong> systemreconfiguration could be done using st<strong>and</strong>ard browsers onworkstation computers. That alows us to use large screens,menus, buttons, on-line helps, instead of simple alpha –numeric displays usually connected to such embeddeddevices.The bridge between distributed sensors <strong>and</strong> actuators onThis work was supported in by the Ministry of Science <strong>and</strong>Technology of Republic Croatia under Grant TP-01/0023-02"Embeded Web servers in <strong>Monitoring</strong> <strong>and</strong> Control of dislocatedsystems" <strong>and</strong> in part under Grant 0023008 "Intelligent Agents inModeling <strong>and</strong> Control of Complex Systems".Authors are with Laboratory for Modelling <strong>and</strong> Inteligent Systems(http://laris.fesb.hr), Faculty of Electrical Engineering, MachineEngineering <strong>and</strong> Naval Architecture, UNIVERSITY OF SPLIT,R.Boškoviæa bb, 21000 Split, C r o a t i a. D.Stipanièev (e-mail:dstip@fesb.hr ), M.Èiæ (e-mail: maja.cic@fesb.hr), J.Marasoviæ(e-mail: jadranka.marasovic@fesb.hr ).one side <strong>and</strong> Internet on the other side could be embeddedWeb servers. They are low cost devices which allow us touse st<strong>and</strong>ars network protocols like TCP/IP <strong>and</strong> HTTP.In this paper greenhouse monitoring <strong>and</strong> control systembased on simple 1-wire sensor/actuators local privatenetwork <strong>and</strong> embedded Web servers for connecting thisnetwork to Internet is described.Sysem design, protocols, software <strong>and</strong> hardwarerequirements for embedded Web servers are presented,detail description of greenhouse monitoring <strong>and</strong> controlsysstem is given together with experimental results oflaboratory greenhouse model monitoring <strong>and</strong> temperaturecontrol.II. EMBEDDED WEB SERVERS SYSTEM DESIGN<strong>Embedded</strong> systems require web server software thatenhance their networking functionality without taking upvital system resources. Web enabling of devices is possibleby adding web server software to existing embeddedsystem. Requirements for embedded Web servers are:- Small memory footprint: Server must use very littlememory <strong>and</strong> it must not fragment memory. Manyembedded devices use simple memory allocators thatcannot manage memory effectively. This problem isusually solved by using statically allocated or preallocatedmemory blocks.- Dynamic page generation: Since the content of the pagesserved will be status information <strong>and</strong> sensor readingspart or all of the web pages will have to be generated onthe fly.- ROMable web pages: Since embedded systems do nothave disk drives or any other memory storage units, webpages <strong>and</strong> other web content have to be stored in ROMor flash.Reducing embedded web server capabilities to minimalset of necessary functions makes hardware requirements aswell as energy consumption very small. Thereforedimensions <strong>and</strong> the price of the device are miniaturecompared to the desktop PC with full functionalitypreserved at the same time.


A. ProtocolsAlthough TCP/IP (Transmission ControlProtocol/Internet Protocol) is the main communicationprotocol that enables connection of different devices innetworks, it is not implemented in full. Only the necessaryparts are used <strong>and</strong> parts that are not needed for this sort ofcommunication are excluded. Furthermore, TCP/IPprotocol is basis for upper level network protocols whichwill be used in embedded systems. If the system uses RS-232C or modem link then point-to-point (PPP) or serial-lineInternet protocol (SLIP) is needed. File transfer protocol(FTP) is used for uploading new files <strong>and</strong> programs to thesystem. Opposite to the receiver-driven information flowthrough Web browser, information flow could be devicedriven.Using Simple Mail Transfer Protocol (SMTP)application can periodically send information via e-mail.B. SoftwareA minimal set of software for embedded Internet systemincludes an operating system <strong>and</strong> application software, ahttp server, a TCP/IP stack, <strong>and</strong> drivers for communicationhardware. The use of Internet allows the embedded systemto offer substantial online capabilities without using systemresources. With HTML pages pointing to other networklocations, the system can offer more online documentation<strong>and</strong> richer graphics than the system hardware couldotherwise support. In addition, supplying the raw data tomore powerful “partner” on the network <strong>and</strong> presenting theresults of “partner” calculations can virtually increase thesystems processing power. As we can see with cleverprogramming <strong>and</strong> the use of Internet, systems capabilitiescan be virtually increased to a higher level. The presence ofembedded web server must not obstruct the systemsprimary real-time operation in any way <strong>and</strong> thereforesystem response must be compromised to main function.The Internet software should not be the limiting factor forthe speed of data flow between the server <strong>and</strong> the browser.The HTML pages should not be burdened with extensivegraphics. The presence of too many graphical elementsconsumes much more memory than text <strong>and</strong> therefore takesmuch more time to download to browser. The pagedownload time should be acceptable for the user, not longerthan couple of seconds. [1].C. HardwareHardware requirements result from the given selection ofrequirements <strong>and</strong> a set of software to resolve thoserequirements. The minimal setup for network enabling ofembedded systems includes 8-bit microprocessor, Ethernet<strong>and</strong>/or serial interface <strong>and</strong> enough memory to store <strong>and</strong> runapplications. No I/O devices are needed since all thisoperations are managed through Internet.Further system improvements depend on desired systemprice <strong>and</strong> capabilities. These 8-bit devices can address up to16MB memory <strong>and</strong> often include hardware-acceleratedinterpreters for higher-level languages, which make themadequate for this purpose. Memory storage devices such ashard disk drives are definitely optional <strong>and</strong> most of thesedevices will run software directly out of ROM or flashinstead of loading it into RAM memory. This enables thesystem to boot in just a second or two as opposed to theminutes that a desktop Windows system can take.D. System DesignIn a new system design, system hardware will be chosenaccording to the overall requirements of the system.Application software needs to be developed in order toachieve the required system functionality. System designermust compromise between hardware <strong>and</strong> software solutionsfor each problem. Hardware solutions are easier to design,faster <strong>and</strong> more accurate in operation. Software solutionresults in smaller production cost <strong>and</strong> system modificationsare simpler. Particularly, connection to Internet must beconsidered. When embedded processor is located in thevicinity of local network installation, 10Mbps Ethernetinterface is chosen. Otherwise, serial port is used to transferdata over telephone or radio channel.For the program development any software developmentkit can be used, with the additional libraries supplied by thehardware manufacturer. Since the software will bedeveloped on a different platform, portability is veryimportant for the embedded systems. Java, as objectoriented, platform independent programming language,eliminates the need to recompile applications when movingto a different processor. Since a complete set of st<strong>and</strong>ardclass libraries is available, there is less code to write <strong>and</strong>maintain. HTTP <strong>and</strong> FTP client support is built in alongwith support for h<strong>and</strong>ling URLs, IP addresses <strong>and</strong> nameresolution.To put a web server on a device, the server must be ableto generate dynamic web content based on data from thedevice. Although it is not necessary to support a largenumber of users, the Web server must process multiple,simultaneous browser requests.III. NETWORK EMBEDDED GREENHOUSE MONITORING ANDCONTROLNetwork embedded greenhouse monitoring <strong>and</strong> controlsystem is a small-size network of tightly coupledphysical/information system components (sensors,actuators, processing <strong>and</strong> communication resources) withlimited reliability <strong>and</strong> changing physical topology. Thesystem core is <strong>Embedded</strong> Web Control Unit connected onone side to sensor/actuator local network <strong>and</strong> on the otherside to Internet.Between existing interface devices, minimalconfiguration suitable as a working interface needed forlow-cost networking is TINI TM [2], so we have choose himas a central part of our <strong>Embedded</strong> Web Control Unit.


The TINI board is a Java TM computer that uses a TINIchip set plus 512 Kbytes commodity SRAM <strong>and</strong> interfacecircuitry in a 68-pin SIMM stick form factor. TINI’s threechipchip set consists of a DS80C390 processor, 512Kbytes Flash ROM containing the firmware <strong>and</strong> anEthernet controller.Optimised for the embedded Java environment, theprocessor supports 24-bit addressing, an 8/32-bitCPU/ALU, <strong>and</strong> high clock rates (~60 MHz <strong>and</strong> beyond),<strong>and</strong> other Java enhancements. One of the most interestingTINI features is its I/O ports. TINI has Ethernet 10Base-Tinterface, 1-Wire® net interface <strong>and</strong> dual serial (RS-232)ports. Ethernet interface is used for permanent Internetconnection, serial port for dial-up modem Internetconnection <strong>and</strong> 1-Wire net interface for sensors <strong>and</strong>actuators connection.TINI software is divided into categories: run-time codein Flash ROM (the RTOS, TCP/IP stack, Java VM <strong>and</strong>API packages) <strong>and</strong> high-level networking protocols (FTP,TELNET, DHCP, DNS), development tools (JDK) <strong>and</strong>Java applications.TINI OS is very small <strong>and</strong> provides basic services suchas task scheduling, a file system, <strong>and</strong> memory <strong>and</strong> I/Omanagers. Unlike most small, embedded controlleroperating systems, TINI OS is designed to switchheavyweight tasks. Specifically, it is optimised to switchbetween multiple executing instances of a Java byte codeinterpreter. This provides the foundation required forrunning multiple Java applications. Multiple native/kernelprocesses are managed through cooperative multitasking<strong>and</strong> are therefore subject to tight execution timerequirements.All sensors <strong>and</strong> actuators are connected to DallasSemiconductor 1-Wire Net [3]. 1-Wire Net uses one signalfor both, power <strong>and</strong> network connection. Each sensor oractuator has its own 1-Wire chip with a unique ROMregistration number that contains a family code, serialnumber <strong>and</strong> a CRC for checking the correct delivery of theregistration number.The sensors used inside our experimental greenhousemodel were temperature <strong>and</strong> humidity sensors, but parallelywe have monitored the weather conditions outside thegreenhouse (temperature, wind speed <strong>and</strong> wind direction)having im mind future predictice control algorithms. Insidetemperature were measured in the air, on the groundsurface <strong>and</strong> 5 cm inside the ground. Other type of sensors,like barometric preasure or lighting sensors can beconnected too.The temperature <strong>and</strong> humidity inside the greenhousecould be controlled using heaters, overheat protectiondevices (ventilators) <strong>and</strong> water wetting system.Laboratory, experimental greenhouse is shematicallyshown on Fig.1. <strong>and</strong> Fig.2. shows the laboratorygreenhouse model.Fig. 1. T0, T11, T12, T13, T21, T22, T23 are temperature sensors <strong>and</strong> H0is the humidity sensor. Actuators are heater, wetting system <strong>and</strong> vent1 <strong>and</strong>vent2 for overheat protection.Fig. 2. Laboratory greenhouse model used in our experimentsEmbeded Web Control Unit is shown in Fig.3.1-wire sensors could be parallely connected, so almoustunlimited number of sensors could be used. Of course,practically, there are some limitations because the processorhas limited capacity. We have succesfuly worked with 30sensors, <strong>and</strong> that is more than enough for any greenhouseapplication.<strong>Embedded</strong> Web Controller software is conceived as acollection of servlets – software agents, runing parallely,each of them performing one specific task. The central oneis <strong>Monitoring</strong>Servlet responsible for reading 1-Wiresensors <strong>and</strong> displaying data in the form of dynamic HTML


Fig. 3. <strong>Embedded</strong> Web Controller based on TINI embedded Web serverpage. Fig.4. shows typical monitoring screen layout.file. The third servlete is ArchiveServlet which isresponsible for process data archive. All proces variablesvalues are stored in predefined intervals to process.xml file:3A0008000F51401021.012:39:131< sample >720008000F469810< value >21.5< time >12:39:17< no >1…As the <strong>Embedded</strong> Web Server memory is not big enough tostore archive files, they are stored to another st<strong>and</strong>ard Webserver. JavaScript/JavaApplet program was writen todisplay the archive data. Fig.5. shows one example ofdisplaying archive temperature data.Fig. 4. <strong>Monitoring</strong> HTML page created by <strong>Monitoring</strong>ServletThe important feature of the designed system is thepossibility of 1-Wire topology changing without anyinfluence to system funcionality. The special software agentDefineServlet check the 1-Wire network, detect the actualsensor/actuator network configuration <strong>and</strong> writeidentification numbers in xml file address.xml Detailsensor description (min, max values, units) could beinserted in the same file using special Web form.Temp. T03A0008000F514010-1045°C. . .Fig. 5. Displaying archive temperature data using JavaScript/JavaAppletapplicationFor control purpose, four control servlets weredeveloped, each of them responsible for its type of control.Fig.5 shows the control dynamic HTML page created bycentral ControlServlet . The ControlServlet is activatedfrom the main monitoring page <strong>and</strong> it is protected byUserID <strong>and</strong> Password.Before displaying process parameter valuesDefineServlet read the sensor identifacion date from xml


Fig. 5. Control HTML page created by ControlServletFour types of control procedures were applied:a) Simple switch on – switch off control of all actuatorsusing output relays. Any actuator could be remotely switchon <strong>and</strong> switch clicking in the appropriate checkbox inControl Web page (OnOffServlet).b) Feedback on – off control. The user chose thecontrolled variable (for example temoerature T0 fromFig.2) <strong>and</strong> its referent value (FeedbeckOnOfServlet).c) Feedback discrete PID <strong>and</strong> DDC control based ondifference equation:u n =k 0 *u n-1 +k 1 *e n +k 2 *e n-1 +k 3 *e n-2where u n <strong>and</strong> u n-1 are controle signals in nT <strong>and</strong> (n-1)*Ttime instant, e n , e n-1 <strong>and</strong> e n-2 are error signals in nT, (n-1)*T <strong>and</strong> (n-2)*T time instant <strong>and</strong> k 0 , k 1 , k 2 <strong>and</strong> k 3 areregulator constants defined by user through st<strong>and</strong>ard Webform (DDCServlet).d) The time on – off control. This type of control isespecially important for wetting system but it could be usedfor any actuator. The user choose the time moments whenone of actuators would be swiched on <strong>and</strong> time duration ofits activ state, For example the wetting system could beswitched on at 6:00 , 12:00 <strong>and</strong> 18:00 for 20 seconds(TimeOnOffServlet).Fig.6. shows two control examples. The first one, shownin Fig.6a) is temperature control using heater <strong>and</strong> thesecond one, shown in Fig.6b) is temperature control usingcooling devices (ventilators).Fig. 6. Temperature control using a) heater <strong>and</strong> b) ventilatorsIV. CONCLUSIONIn this paper we have presented network embeddedgreenhouse monitoring <strong>and</strong> control based on embeddedWeb server unit which gather <strong>and</strong> route data from localsensor/actuator network to global network - Internet.The developed experimental system, based on TINIembedded Web server, collect data from distributed sensors<strong>and</strong> activate connected actuators using simple 1-wire localnetwork. On the other side Web server is connected toInternet through Ethernet or dial-up network. Thedeveloped system shows all advantages of NetworkEmbeddes System Tecnology (NEST), like the possibilityof changing physical topology <strong>and</strong> low dimensions <strong>and</strong> costin comparison with PC based system, preserving the fullfuncionality at the same time.REFERENCES[1] R.A.Quinnell: “Web servers in embedded systems enhance userinteraction”, EDN Magazine, April 10. 1997.[2] Tiny InetrNet Interface, www.ibutton.com/TINI[3] D. Awtrey: “Transmitting Data <strong>and</strong> Power Over a One-Wire Bus”,Sensors, February 1997, pp. 48-51[4] J. Turley: "Microprocessors for Consumer Electronics, PDA's <strong>and</strong>Communications", <strong>Embedded</strong> Systems Conference, September 26.-30. 1999.[5] M. O’Brien: “<strong>Embedded</strong> Web Servers“, <strong>Embedded</strong> SystemsProgramming, November 1999.www.embedded.com/internet/9911/9911ia2.htm

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!