Technical report on Distributed Data Collection in WSN.pdf

12
Technical report on Distributed Data Collection in WSN Prepared by : Professor : Cihan Dorken (IMCNE) Dr. Paolo Pagano Valerija Kamchevska (MAPNET) Project coordinators : Andrea Azzarà Stefano Bocchino Pisa, July 2012

Transcript of Technical report on Distributed Data Collection in WSN.pdf

Technical report on Distributed

Data Collection in WSN

Prepared by: Professor:

Cihan Dorken (IMCNE) Dr. Paolo Pagano

Valerija Kamchevska (MAPNET) Project coordinators:

Andrea Azzarà

Stefano Bocchino

Pisa, July 2012

Technical Report on Distributed data collection in WSN

1

CONTENT

Аbstract........................................................................................................................2

1. Introduction..............................................................................................................2

1.1. Simple WSN…………..…...........................................................................2

1.2. Hardware and software used…………………............................................3

1.3. 802.15.4 MAC protocol with GTS feature……………………………………4

2. Behaviour of the WSN……..…………………………………………..........................5

References……………………………….………………………………………….……..11

Technical Report on Distributed data collection in WSN

2

Abstract

This report is dedicated to the implementation of a distributed data collection

in WSN (Wireless Sensor Networks). We will build a simple wireless sensor data

acquisition system organized in a star topology (one coordinator, two or more

devices). The devices should periodically sample sensor data (temperature, light,

acceleration) and send the data to the network coordinator by using 802.15.4 MAC

protocol and the GTS (Guaranteed Time Slot) feature. The coordinator compares the

measured values with a threshold and sends a message to the corresponding device

to take an action. The coordinator also sends the data to a PC using a serial

connection (RS232) and live plotting is used to represent the collected data.

1. Introduction

WSN consists of spatially distributed autonomous sensors to monitor physical

or environmental conditions, such as temperature, light, acceleration, sound,

pressure, humidity or pollutants and to cooperatively pass their data through the

network to a main location.[1] The modern networks are bi-directional, also

enabling control of sensor activity. The WSN is built of "nodes" – from a few to

several hundreds or even thousands, where each node has one or more sensors.

Each such sensor network node has typically several parts: a radio transceiver,

a microcontroller, an electronic circuit for interfacing with the sensors and an energy

source, usually a battery. Size and cost constraints on sensor nodes result in

corresponding constraints on resources such as energy, memory, computational

speed and communications bandwidth.

1.1. Simple WSN

The network we built is a simple wireless sensor network organized in a star

topology (one coordinator, two or more devices) as shown on figure 1.1.1.

Figure 1.1.1 Star topology

Technical Report on Distributed data collection in WSN

3

1.2. Hardware and software used

We used for both the coordinator and devices the FLEX Demo board as

shown on figure 1.2.1, which is a daughter board that can be plugged on top of

the FLEX Light and FLEX Full. It provides buttons, leds, a 16x2 LCD, 3 axis

accelerometer, IR TX/RX, 802.15.4 slot (for Microchip transceivers), 2 DAC,

potentiometer, light sensor, temperature sensor, plus a serial line slot. [2]

Figure 1.2.1 FLEX Demo Board

We used Eclipse RT-Druid templates for FLEX Demo Board: Console Demo,

Basic Devices Demo, IEEE 802154 Demo – Device and IEEE 802154 Demo –

Coordinator under ERIKA RTOS. For programming the devices with the written code

we used MPLAB ICD 3 In-Circuit Debugger as shown on figure 1.2.2.

Figure 1.2.2 MPLAB ICD 3

For sending the data to a PC from the coordinator we used serial connection

(RS232) and for displaying the received data on the PC we used Moserial program.

For real time plotting we used the Matplotlib which works under Python.

Technical Report on Distributed data collection in WSN

4

1.3. 802.15.4 MAC protocol with GTS feature

The MAC protocol in IEEE 802.15.4 can operate on both beacon enabled and

non-beacon modes. In the beaconless mode, the protocol is essentially a simple

CSMA-CA protocol. Since most of the unique features of IEEE 802.15.4 are in the

beacon-enabled mode, we implemented this mode. In beacon mode, the IEEE

802.15.4 uses a superframe structure. Figure 1.3.1 illustrates this structure. A

superframe begins with beacon frames sent periodically by the coordinator at an

interval that can ranges from 15ms to 245s. There are both active and inactive

portion in the superframe. Devices communicate with their PAN only during the

active period and enter a low power mode during the inactive period. The active

portion of each superframe is further divided into 16 equal time slots and consists of

three parts: the beacon, a Contention Access Period (CAP) and a Collision Free

Period (CFP) (which is only present if guaranteed time slots (GTS) slots are

allocated by the PAN coordinator to some of the devices). Each GTS consists of

some integer multiple of CFP slots and up to 7 GTS are allowed in CFP.

Figure 1.3.1 IEEE 802.15.4 superframe structure

A node wishing to send data to the PAN coordinator needs to receive a

beacon to understand the current superframe structure. If it has been allocated a

GTS, it sends its data during the CFP, otherwise, it sends its data using CSMA-CA in

the CAP. For communications from the coordinator to the devices, in order to allow

devices to be in power saving mode at their own will to save energy, transaction

requests can be initiated from the devices themselves rather than from the

coordinator. A device sends a data request commands to the coordinator during the

CAP if its address is in the data pending list of the beacon. The coordinator sends an

acknowledgement frame with a flag indicating that data is forthcoming and sends the

packet afterwards. Once the data is received, the device sends an acknowledgement

back to the PAN coordinator.

A disadvantage of a device with GTS is that it has to track the beacon frames

from the coordinator periodically in order to transmit data during the GTS slot

assigned to it which can lead to higher energy consumption, but clearly, with GTS, a

device can get dedicated bandwidth which achieves 100% delivery ratio and low

latency regardless of the background traffic load in the network. [3]

Technical Report on Distributed data collection in WSN

5

2. Behaviour of the WSN

We built a simple wireless sensor data acquisition system organized in a star

topology where the devices periodically (each 3s) sample sensor data (temperature,

light, acceleration) and send the data to the network coordinator by using 802.15.4

MAC protocol with GTS feature. The coordinator compares the measured values

with a threshold for each and sends a message to the corresponding device to take

an action. Each device when receiving the coordinator feedback turns on a LED

associated to each sensor (temperature – LED0, light – LED1, x_level - LED2,

y_level – LED3, z_level – LED4). The thresholds are 25 degrees Celsius for

temperature, 30lux for light and 0.01 for accelerometer axis`. The coordinator also

sends the data to a PC using a serial connection (RS232) and live plotting is used to

represent the collected data. For executing these operations the code used is given

below. As a result from our project verification the screenshots of the live plotting are

also given below.

Code for the device sending task

Technical Report on Distributed data collection in WSN

6

Code for the coordinator receiving task

Code for the coordinator sending task

Technical Report on Distributed data collection in WSN

7

Code for the device receiving task

Figure 2.1 Temperature measurement

Technical Report on Distributed data collection in WSN

8

Figure 2.2 Light measurement

Figure 2.3 X-level measurement

Technical Report on Distributed data collection in WSN

9

Figure 2.4 Y-level measurement

Figure 2.5 Z-level measurement

Technical Report on Distributed data collection in WSN

10

Figure 2.6 Built WSN scenario

Technical Report on Distributed data collection in WSN

11

References

[1] http://en.wikipedia.org/wiki/Wsn

[2] http://erika.tuxfamily.org/flex.html

[3] Performance Evaluation of the IEEE 802.15.4 MAC for Low-Rate Low-Power

Wireless Networks, Gang Lu, Bhaskar Krishnamachari, Cauligi S. Raghavendra,

2004 IEEE