Sensor Graphing via Wireless Sensor Network to a Mobile Internet Device by David Drager

Document Sample
Sensor Graphing via Wireless Sensor Network to a Mobile Internet Device by David Drager
Shared by: Dave Drager
Stats
views:
1397
posted:
9/10/2009
language:
English
pages:
0
Sensor Graphing via Wireless Sensor Network to a Mobile Internet Device

David Drager, Afrand Agah and Mehran Asadi Department of Computer Science West Chester University of Pennsylvania {dd685492, aagah, masadi}@wcupa.edu



Abstract

Mobile devices are rapidly gaining popularity due to their small size and their wide range of functionality. Also they are vital for rapid decision making in emergencies when combined with appropriate analysis tools. This project aims to set up a wireless sensor network which collects temperature and then transmit this data over a wireless sensor network to a base node attached to a computer, which acts as a server. This server will then store the information in a database, where the data can be retrieved and presented in a human readable format. This information can be retrieved wirelessly to a mobile computing device.



power. The mica platform and specifically the MTS310 sensor board can sense a number of these factors. Traditional data center environmental monitoring devices are wire based which limits sensor placement. Using this wireless sensor network we can place nodes which would be difficult using a traditional wire based sensor network. The mica platform with some tweaking would be ideal for this purpose.



2. Problem Description

The mica platform with the MTS310 sensor provides a method for gathering large amounts of raw data. Our challenge is to store this data in a meaningful manner so that a user can later pull it out and display in human readable format. There are several database packages which would be able to store our information. For this project, we selected the Round Robin Database (RRD) [4]. The architecture of the RRD is such that the file size will remain the same over time. The second part of the RRD is the use of “Round Robin Archives” (RRA). These archives store the average, minimums, maximums and other over-time statistics in the same file. Since the time-period of these RRAs are defined at creation time, the file size remains the same, which makes it very efficient to retrieve data from this archive.



1. Introduction

Sensor networks can be considered as a special type of ad hoc networks, and there are already some proposals addressing security in general ad hoc networks, but sensor networks have some additional concerns that limit the applicability of those traditional security measures. Sensor networks are very limited in local memory and calculation capacity [1], and so security mechanism for sensor networks cannot require each sensor node to store long-sized key to run very complex cryptology protocols. They have low power consumption and so sensor network protocols must focus on power conservation. Along with the many tasks of running a large datacenter, one of the most important ones involves environment monitoring. If servers, networking equipment, and other computer resources exceed manufacturing specifications, it may malfunction or cause an increase in system failures. Some of the environmental factors which are important to data centers specifically are humidity, temperature, light and Page 1



Figure 1.



This brings up the issue of getting the data of the sensors to a database file. To do so, we will run a “server” on the computer which will remain turned on and “listening” for packets of data to arrive.



3. Related Work

The majority of visual analytics applications for mobile devices come in the form of either mapping tools [9], sometimes enhanced with GPS capabilities, or convenience utilities [10]. There have been efforts to use mobile devices in emergency response situations [11], and for location aware services.



$ xlisten -r -p -c -s=com13 xlisten Ver:$Id: xlisten.c,v 1.2 2005/06/21 01:36:06 pipeng Exp $ Using params: [raw] [parsed] [cooked] com13 input stream opened 7e42ffff007d5d1d84010100b8011c02a202ef0 19100480018031803000000000000000000a1 9e [ 39] mts310 id=0001 vref= 1b8 thrm=021c light=02a2 mic=01ef accelX=0091 accelY=0048 magX=0318 magY=0318 MTS310 [sensor data converted to engineering units]: health: node id=1 parent=0 battery: = 2846 mv temperature=27.36 degC light: = 1875 mv mic: = 495 ADC counts AccelX: = -6100.000000 mg, AccelY: = 7560.000000 mg MagX: = 106.96 mgauss, MagY: =106.96 mgauss

Figure 2.



4. Implementation

We use the TOSBase application which is deployed by Crossbow company [3]. This is installed to the base mote which will then translates the packets sent over the wireless radio to the server. For each sensor node, we used a modified version of the SensorRF package. We disabled audible beep when a sensor reading took place, and send the sensor reading every 10 seconds instead of every second. This is an effort to save available battery at the node. In a real datacenter setting, the sleep time of the sensor nodes could be extended even further, allowing each node to last longer on one pair of batteries. These sensors then transmit over their RF modem the sensor data they collect. This data is in a raw binary mode which can then be read by the system.The cygwin shell can read these data packets using the Serial Forwarder. To get the information from the TOSBase mote, we set up the shell to ready it for java: export MOTECOM=serial@COM13:57600



The main data read by a service on the server is the following packet:

7e 42 ff ff 00 7d 5d 1d 84 01 01 00 b8 01 1c 02 a2 02 ef 01 91 00 48 00 18 03 18 03 00 00 00 00 00 00 00 00 00 a1 9e.



This is stored in little-endian format, meaning that the most important byte is the 2nd one. It is stored as an unsigned 16 byte integer. Java cannot do the byte conversion, so we need to ‘shift’ them using the code depicted in figure 3.

int templight = 0; templight |= rawlight[0] & 0xFF; templight <<= 8; templight |= rawlight[1] & 0xFF; double reallight = templight;



The language we wrote our program in is Java. Xlisten is a C program that is included in the TinyOS distribution. We can use this to see the raw output of the TOSBase mote. The output of the sensor motes depicted in figure 2. According to Xlisten:



Figure 3.



The main challenge when writing this program was getting java to read the data in the proper format from the Serial Forwarder. Page 2



Now the data is in the correct format, to collect this information, we need to do two things: 4.1 Data Collection Using Java, we can now execute the correct system commands to create the RRD file. After creating the file for each mote in the network we then listen for data packets to come in. Each data packet is then faithfully written to the RRD file. The RRD Package will convert and store the RRA values. 4.2 Graph Creation This program runs in the background continuously; and at specified intervals, it will issue the commands to RRDTool which will create the graphs which will be used in the web interface. This class could also be used to do a trigger of notifications if the temperature or other value reaches a threshold. It is best to do it here as you can use the averages from the data store to compute trending of the data.



a. Generate the individual graphs pages. This step generates the code that will display the graphs with the 10-minute, hourly and weekly temperature trends. b. Generates the index page with a listing of all available motes. c. Display the individual data points depending on what we wish to display on each page. We can grab the latest data from the RRD files. We could also grab the latest averages, minimums and much of the other data available from the database.



5. Web Interface

The final part of the project is the web interface. This part is platform dependent. Our development system was a Windows XP system, we used a “WAMP” system which stands for “Windows Apache MySQL and PHP”. This installs and runs a web server with PHP running the code of the frontend. PHP excels at outputting html which can be read by a mobile device, or for that matter, any web browser. To display the graphs that are generated by RRDGraph we wrote a PHP program which can read and display graphs, as well as retrieve data from the RRD file. To display the data on a mobile device, we picked the iWebKit framework [6]. The iWebKit stylesheet classes make it easy to develop a web interface for the iPhone mobile computing platform [5]. The PHP code serves several purposes:



Figure 4: Graphs as viewed on the iPhone



Page 3



6. Evaluation

The most difficult part of this project was converting the MTS310 sensor reading to a human readable format. Using the source code from the Xlisten C program that was included within the Xbow distribution files, the following formula used to convert the number to degrees Kelvin. ADC is the float from the raw binary:

Rthr = 10000 * (1023-adc) / adc; TmpK = 1 / (a + b * log(Rthr) + c * pow(log(Rthr),3));



a solar platform, the life of a mica node could be increased greatly.



8. Future Work

The final missing piece to the puzzle is alerting users to alarms in temperature or any other data value. This can be built onto the existing platform, or a “plugin” could be programmed for existing monitoring software. One promising open source platform for data graphing and monitoring is called Zabbix [7]. For future work we would consider writing a mica platform, which would integrate with the Zabbix server, which has built in monitoring, graphing and alerting.



This formula gives us the value in degrees Kelvin. From there, we simply subtract 273.15 to convert it into degrees Celsius. After this key information was extracted from the raw data stream, normal procedures can be taken to input the data into the RRD file. The system worked as planned with data points being plotted on the graph. Some further work could be done to get better resolution on the 10 minute graph; however this is likely dependent on the final result that are desired.



References

[1] I.F. Akyldiz, W. Su, Y. Sankarasubramaniam, and E.Cayirci, “Wireless Sensor Networks: a Survey”, Computer Networks, vol. 38, 2002, pp: 393-422. [2] I. F. Akyldiz, W .Su, Y. Sankarasubramaniam, and E. Cayirci, “A Survey on Sensor Networks”, IEEE Communications Magazine, vol. 40, no. 8, pp: 102-113, 2002. [3] Xbow Corporation, http://www.xbow.com/ [4] RRDTool, http://oss.oetiker.ch/rrdtool/ [5] Apple iPhone, http://www.apple.com/iphone/ [6] iWebKit, http://iwebkit.net/ [7] zabbix, http://www.zabbix.com/ [8] Tiny OS, http://www.tinyos.net [9]L. Chittaro, “Visualizing information on mobile devices”, IEEE Computer, 39(3). [10] B. Bederson, A. Clamage and G. Robertson, “A fisheye calendar interface for pdas: providing overviews for small displays”, CHI 2003, ACM press. [11]Synthetic Environment for Analysis and Simulation, http://www.mgmt.purdue.ed/centers/perc



7. Conclusions

The framework put into place is extremely flexible. The only restriction in place is the data that we can get out of the sensor board that are attached to the mica platform. Xbow provides a number of boards that can supply just about any data to the mica platform. As Xbow and other companies further work to increase the number of sensors available, and also to bring the price of the sensor boards and mica platform down, sensors will be used ever increasingly in datacenters and other environments where wireless transmission of data will be used for environmental monitoring. Since wires can be impossible to place in some locations, the mica platform is perfect for placement. One concern that needs to be addressed is the battery usage of the mica platform. Using a rechargeable battery pack, and Page 4




Share This Document


Related docs
Other docs by Dave Drager
by registering with docstoc.com you agree to our
privacy policy

You are almost ready to download!

You are almost ready to download!