You are on page 1of 4

1686

IEEE LATIN AMERICA TRANSACTIONS, VOL. 10, NO. 3, APRIL 2012

Controlling Physical Objects via the Internet using the Arduino Platform over 802.15.4 Networks
V. Georgitzikis, O. Akribopoulos and I. Chatzigiannakis
1 Abstract In this work, we expanded the Arduino's capabilities by adding an 802.15.4 wireless module, in order to expose its functionality as a Web of Things node. The second contribution of our work is a careful description of the necessary steps to make a heterogeneous network interoperate and the implementation of a network stack for the 4 most representative hardware platforms, as used by the relevant research community (Arduino, SunSPOT, TelosB, iSense), in the form of a software library, named mkSense, which enables their intercommunication. Moreover, we describe the design and implementation of a software library which can be used for building intelligent software for the Web of Things.

Arduino [1] is an open-source electronics prototyping platform. The Arduino Uno is a microcontroller board based on the ATmega328. It has 14 digital input/output pins, 6 analog inputs, a 16 MHz crystal oscillator, a USB connection, a power jack, an ICSP header, and a reset button. The core libraries of Arduino are written in C and C++ and compiled using avr-gcc and AVR Libc. Arduino hardware is programmed using a Wiring [3] based language, similar to

Keywords wireless communication, arduino, open source hardware, wireless sensor network, network stack.

EXTENDED ABSTRACT

WIRELESS sensor network (WSN) is a network consisting of distributed devices that provide sensing features such as temperature, sound, vibration, pressure, motion etc. The last few years systems applied on WSN are becoming more and more noticeable. Arduino[1], which is one of the most common hardware prototyping platforms and is used globally (not only for prototyping but also for creating interactive objects or environments as well) would make the perfect wireless sensor network node, due to its small size, low cost and modularity. However, Arduino lacks any wireless connectivity whatsoever which makes it impossible to use it in a WSN. Therefore, we have expanded its capabilities by connecting an IEEE 802.15.4[12]compliant module named XBee[2] to the Arduino, in order to add wireless intercommunication support. This way, the Arduino can operate as a Smart Object and expose its functionality in the Web of Things. Some of the fundamental problems rising are hardware and software heterogeneity, which results on non-existent or intermittent connectivity at best between different WSN platforms due to the partial implementation of the 802.15.4 protocol on each. We designed a network stack and propose a network architecture which alleviates the aforementioned problems and enables the intercommunication between different hardware and software platforms.
1

Figure 1. Arduino Uno.

C++ with some simplifications and modifications, and a Processing [4] based IDE. The Arduino does not have built-in 802.15.4 connectivity. Instead, this is added by connecting an XBee module and configuring it to accept commands from the Arduino in API mode. More specifically, the Arduino is connected with the XBee [2] Series 1 Chip Antenna, which provides IEEE 802.15.4 network connectivity to the Arduino. The XBee module is connected to the Arduino via a serial port, and adds wireless capabilities by forwarding any data received from the Arduino to the wireless network and

forwarding received wireless to the Arduino respectively. By


Figure 2. XBee Series 1.

V. Georgitzikis, Computer Technology Institute and Press and CEID, University of Patras, Patras, Greece, tzikis@cti.gr O. Akribopoulos, Computer Technology Institute and Press and CEID, University of Patras, Patras, Greece, akribopo@cti.gr I. Chatzigiannakis, Computer Technology Institute and Press and CEID, University of Patras, Patras, Greece, ichatz@cti.gr

default, any data received by the Arduino is broadcasted, which is an issue when working with WSNs. Therefore, we use the XBee in API mode, which allows us to use the XBee

GEORGITZIKIS et al.: CONTROLLING PHYSICAL OBJECTS

1687

in an advanced way, and enables the transmission of unicast messages. Another important feature of the XBee modules is I/O line passthrough. By configuring the XBee modules properly, they can be set to wirelessly transmit the state of their Digital Input/Output pins periodically or on-change. It's also possible to configure an XBee module to capture those special packets which describe the state of an XBee's pins, and set its own pins to that state. This way, it is possible to configure wireless I/O passthrough, which can be used to program the Arduino wirelessly using an Arduino with an XBee module connected to it, and a computer with an attached XBee module. We start by completing the connections needed in order to wirelessly control the Arduino's reset pin from the computer, which is necessary for programming it. The rest of the programming process stays as is, due to the fact that the programming protocol used by Arduino makes use of the serial connection between the programming computer and the Arduino, which is already being wirelessly passed through by the XBee modules. One of the problems with this approach is that the XBee modules use extra headers for I/O line passthrough, which makes them incompatible with the pure 802.15.4 standard, and therefore unable to communicate with other 802.15.4 devices out of the box. The network stack we propose, which will be discussed later on, addresses this issue by adding interoperability between 802.15.4 devices, yet implementing a way to use the XBee's inherent I/O line passthrough without the need to use the extra proprietary headers at all times. This is done by enabling the headers on-demand, only when we program the Arduino. Our second contribution was the design of a heterogeneous wireless sensor network which consists of four different hardware platforms (Arduino, SunSPOT[5], TelosB[16], iSense[17]). These hardware platforms are the most representative ones, as used by the relevant research community. Our heterogeneous network combines these four different hardware platforms combing the characteristics of each one: Arduino with XBee module for controlling custom electric circuits (HVAC, lighting), SunSPOT due to its great computational power, and iSense and TelosB for limited power consumption. The hardware devices we chose for our heterogeneous wireless sensor network are shown in Fig. 3.

communicate out of the box. We started by making a careful description of the necessary steps to make such a heterogeneous network interoperate. Our software code is available online[18]. We deploy a heterogeneous network testbed and conduct a thorough evaluation by assessing the capabilities of each device and their intercommunication. Each of the considered sensor devices is equipped with an IEEE std. 802.15.4 - 2003 [12] compliant radio to perform wireless communication. However, each one of them provides only partial implementations of the IEEE 802.15.4, which are not compatible with each other. Therefore the communication between the 4 different devices is not possible out of the box. IEEE 802.15.4 provides two different addressing modes, the 16-bit addressing and the 64-bit. The SunSPOT radio stack supports only the 64-bit addressing mode, while TelosB supports only the 16-bit. Radio stacks of XBee and iSense provide both the 64-bit and the 16-bit addressing modes. The first step on our Heterogeneous Sensor Network was to set all the devices to the 16-bit addressing mode. XBee was set on the 802.15.4 Mac mode with auto-ACKs. We also implemented a new radio stack on SunSPOT which supports the 16-bit addressing mode. Based on the LowPAN specification, the Sun SPOT library provides routing, meshing and fragmentation using the LowPAN, on the network layer. LowPAN adds some extra headers on the 802.15.4 packets. In particular, after the 802.15.4 headers, two extra bytes are added by the LowPAN which define whether the packet is LowPAN compliant, whether it is fragmented, whether it is meshed etc. Our network stack does not support fragmentation and mesh routing. So on each radio stack, two constant bytes at the beginning of the payload of each packet had to be added, in order to define that each packet is not fragmented or meshed. In this way, the LowPAN on the network layer of the SunSPOT is bypassed and the communication between the 4 different sensor nodes is possible. The differences of the 4 platforms are summarized in the following table, TABLE I.
TABLE I. Comparison of platforms.

Figure 3. Hardware Devices.

All hardware platforms use 802.15.4 compliant radios. Due to partial implementation of the standard, they do not

The customized radio stack for SunSPOT was implemented in Java J2ME, while the library, which enables the communication on iSense and Arduino, was implemented in C++. TelosB motes were running the TinyOS version 2.1.0 [20], so the component for the Telosb was written in nesC. A similar work, is the TinySPOTComm [19] library. In contrast to our work, TinySPOTComm enables the communication between only 2 devices, SunSPOT and

1688

IEEE LATIN AMERICA TRANSACTIONS, VOL. 10, NO. 3, APRIL 2012

TelosB. There are two discrete categories of Smart Objects, passive, which sense and observe the environment, and active, which take individual decisions and act accordingly. Those two behaviors are respectively implemented by different devices, each with its own technology. In order to use them together to create an interactive system, we need to design and use an architecture like the one depicted in Fig. 4.

middle-man and coordinate the communication between a sensor and an actuator object, by deploying the radio stack presented in section III. As a bonus, we also eliminated the number of gateways needed to one. Last but not least, we developed a software component for the Controller which simplifies programming and controlling the heterogeneous network by providing an abstraction layer. Therefore, we created a concrete and simple interface which can be easily used by programmers and hobbyists alike. The main services provided by our interface are: Registration: Smart Objects register by providing their Mac-Address. Data collection: the Controller directly requests for specific data from the sensors in the network. Service request: the Controller requests to be notified when special events occur on the network, for example temperature outreached a specified threshold. Action request: the Controller orders the devices to per- form some kind of action. The network stack implementation and the above system architecture are contained in our software library, named mkSense. The main technology that has been used to implement our proposal is the Processing.org environment, which is a great tool for interactive creations and a favored tool by Arduino users for Arduino-Computer communication. To demonstrate the applicability of our platform we present three representative use cases scenarios that illustrate how our infrastructure can be used for building intelligent software for the Web of Things. A. Building Automation In this case, we check the presence of one or more persons in a room, the presence of a sitting person on a desk inside that room, as well as the current light levels, in order to control the lights. If the light level is below a certain threshold, we turn on the lights on top of every desk with a sitting person, unless there is no-one sitting. If there is someone standing in the room, we turn on some of the lights to evenly lit the room. We use different devices for lights automation in order to take advantage of their unique hardware characteristics, i.e., we use iSense modules because of their easy to use PIR sensor, SunSPOTs for decisionmaking and manually controlling the lights, and Arduinos for physically controlling the lights via added relays, and for the proximity sensors used in each desk to determine the presence of a sitting person. B. Portable Testbed The Portable testbed consists of 37 iSense wireless sensor nodes responsible for reading the light and temperature conditions. In addition, there are 3 Arduino Xbee nodes, two of which control a small fan and an LED lamp respectively (actuators). The third Arduino issues wireless commands to

Figure 4. System Architecture of a Heterogenous Network.

As shown in Fig. 4, the architecture consists of two or more main elements, which are networks of the same device, either passive or active, isolated to each other. In order for the network to communicate with each other, there is also a gateway for each network that connects to other networks through a Controller, which, by collecting and analyzing data, coordinates them in a transparent unified way. However, there are some notable limitations in this architecture. First of all, in order for the Controller to have access to each network, we need to connect a gateway for that network due to hardware incompatibility. Furthermore we need extra software components, in order to collect and process the data from each sensing network, take decisions, act, and control the actuators. The most notable and tiresome problem, however is the limitation and difficulty to program and maintain a complicated system like this, which makes it difficult to design, deploy, and extend such a system. Not to mention debugging. Due to the limitations above, we propose a new architecture as depicted in Fig. 5. The main element of our proposal is a heterogeneous network, consisting of both passive and active components regardless of the technology. There is also the need for a unique gateway for each network in order for the Controller to interact with the devices. In more

Figure 5. Our proposed System Architecture.

detail, we eliminated the need for the Controller to act as a

GEORGITZIKIS et al.: CONTROLLING PHYSICAL OBJECTS

1689

the other two, using pressure buttons and switches. Three SunSPOTs connected to three Moway robots are also part of the testbed. The communication between all this different

[8]

[9]

[10]

[11]

[12]

Figure 6. Portable Testbed.

[13]

hardware is enabled using mkSense library. In the portable testbed, we are able to run experiments and algorithms as well as to visualize the experiments that are currently running on the surface of the testbed. In this paper, we have described how to expand the Arduino's capabilities by adding an 802.15.4-compliant module, in order to use it as a Web of Things node. We also show how to use it in order to build a platform-agnostic heterogeneous wireless sensor network. We have described all of the necessary steps to make a heterogeneous network interoperate and the implementation of a network stack. In addition, we have described the design and implementation of software library which can be used for building intelligent software for the Web of Things. To demonstrate the applicability of our platform we have presented two representative use cases scenarios that illustrate how our infrastructure can be used. Our future work includes the implementation of additional applications, the refinement of our implementation, especially with regard to communication and possibly porting our network stack to other platforms. This work has been partially supported by the European Union under contract numbers ICT-258885 (SPITFIRE). REFERENCES
[1] [2] [3] [4] [5] [6] Arduino website, http://www.arduino.cc/ Xbee module website, http://www.digi.com/ Wiring website, http://wiring.org.co/ Processing website, http://processing.org/ SunSPOT website, http://www.sunspotworld.com/ Baumgartner, T., Chatzigiannakis, I., Danckwardt, M., Koninis, C., Kro ller, A., Mylonas, G., Pfisterer, D., and Porter, B.: Virtualising Testbeds to Support Large-Scale Reconfigurable Experimental Facilities. In Proc. 7th European Conference on Wireless Sensor Networks (EWSN 2010), Coimbra, Portugal, 2010. Lecture Notes in Computer Science, Volume 5970, pp. 210-223 (Springer-Verlag). Botts, M. and Robin, A.. OpenGIS: Sensor Model Language (SensorML) Implementation Specification,2007.

[14] [15]

[16] [17] [18] [19] [20]

Chatzigiannakis, I., Fischer, S., Koninis, C., Mylonas, G. and Pfisterer, D.. WISEBED: an Open Large-Scale Wireless Sensor Network Testbed. In Proc. 1st ICST International Conference on Sensor Networks Applications, Experimentation and Logistics (SENSAPPEAL 2009), Athens, Greece, September 24-25, 2009. Lecture Notes of the Institute for Computer Sciences, Social-Informatics and Telecommunications Engineering, (Springer-Verlag). Duquennoy,S.,Grimaud,G.,andVandewalle,J.2009.Servingembedded content via web applications: model, design and experimentation. In Proceedings of the Seventh ACM international Conference on Embedded Software (Grenoble, France, October 12 - 16, 2009). Glombitza, N., Pfisterer, D., and Fischer, S. 2009. Integrating wireless sensor networks into web service-based business processes. In Proceedings of the 4th international Workshop on Middleware Tools, Services and Run-Time Support For Sensor Networks. Oliveira, L. B., Kansal, A., Priyantha, B., Goraczko, M., and Zhao, F. 2009. Secure-TWS: Authenticating node to multi-user communication in shared sensor networks. In Proceedings of the 2009 international Conference on information Processing in Sensor Networks. IEEE std. 802.15.4 - 2003: Wireless Medium Access Control (MAC) and Physical Layer (PHY) specifications for Low Rate Wireless Personal Area Networks (LR-WPANs), http://standards.ieee.org/getieee802/download/802.15.4-2003.pdf Orestis Akribopoulos, Georgitzikis Vasileios, Koninis Christos, Papavasileiou Ioannis and Chatzigiannakis Ioannis, Deployment and Evaluation of a 802.15.4 Heterogeneous Network, 2011. Technical Report in ACM Computing Research Repository, arXiv:1102.0058v2, February, 2011. Orestis Akribopoulos, Ioannis Chatzigiannakis, Christos Koninis, Evangelos Theodoridis, A Web services-oriented Architecture for Integrating Small Programmable Objects in the Web Of Things. Orestis Akribopoulos, Vasileios Georgitzikis, Anastasia Protopapa, Ioannis Chatzigiannakis: Building a Platform-Agnostic Wireless Network of Interconnected Smart Objects. Panhellenic Conference on Informatics 2011:277-281. TelosB website, http://www.xbow.com iSense website, http://www.coalesenses.com/ mkSense website, https://github.com/ Daniel van den Akker, Kurt Smolderen, Peter De Cleyn, Bart Braem, and Chris Blondia: TinySPOTComm: Facilitating communication over IEEE 802.15.4 between Sun SPOTs and TinyOS-based motes.. The TinyOS website, http://www.tinyos.net Vasileios Georgitzikis is an undergraduate student in the Computer Engineering and Infor- matics Department, at the University of Patras, and a researcher in the Research Unit 1 of CTI since 2010. His research interests lie in distributed and high-performance computing, mobile computing and wireless sensor networks using low-cost open source hardware.

Orestis Akribopoulos is a masters student of the Computer Engineering and Informatics Department of the University of Patras, Greece. He received his Diploma in Computer Engineering and Informatics (2009) and he is working as a researcher at the Research Academic Computer Technology Institute, Patras since 2009. His research interests lie in the areas of wireless sensor networks and distributed systems and pervasive games. Ioannis Chatzigiannakis obtained his Ph.D. from the Department of Computer Engineering & Informatics of the University of Patras in 2003. He is the Director of the Research Unit 1 of RACTI (since July 2007) and Adjunct Faculty at the Computer Engineering & Informat- ics Department of the University of Patras (since October 2005). He has coauthored over 70 scientific publications. His main research interests include distributed and mobile comput- ing, wireless sensor networks, algorithm engineering and software systems. He has served as a consultant to major Greek computing industries. He is the Secretary of the European Association for Theoretical Computer Science since July 2008.

[7]