Certificate

合集下载
  1. 1、下载文档前请自行甄别文档内容的完整性,平台不提供额外的编辑、内容补充、找答案等附加服务。
  2. 2、"仅部分预览"的文档,不可在线预览部分如存在完整性等问题,可反馈申请退款(可完整预览的文档不适用该条件!)。
  3. 3、如文档侵犯您的权益,请联系客服反馈,我们会尽快为您处理(人工客服工作时间:9:00-18:30)。

Environmental Monitoring Using Sensor
Networks
A thesis submitted in partial fulfillment of
the requirements for the degree of
Bachelor of Technology
and
Master of Technology
in
Computer Science and Engineering
by
Atish Dipankar
2001417
under the guidance of
Prof.B.N.Jain
Department of Computer Science and Engineering
Indian Institute of Technology Delhi
May,2006
Certificate
This is to certify that the dissertation titled Environmental Monitor-ing Using Sensor Networks being submitted by Atish Dipankar for the award of Bachelor of Technology and Master of Technology in Computer Science and Engineering is a record of bonafide work car-ried out by him under my guidance and supervision at the Department of Computer Science and Engineering,Indian Institute of Technology Delhi.The work presented in this thesis has not been submitted elsewhere, either in part or full,for the award of any other degree or diploma.
Prof.B.N.Jain
Department of Computer Science and Engineering
Indian Institute of Technology Delhi
1
Acknowledgements
I take this opportunity to express my sincere gratitude to my guide Prof.
B.N.Jain for being supportive of my work.Without his encouragement and guidance,this project would not have taken its present shape.
I would like to thank Prof.Huzur Saran for his suggestions on mak-ing the report better during the earlier presentations.
I would also take this opportunity to thank Ms.Vaishali P.Sadaphal for helping me out whenever I approached her.
Lastly,I would like to thank Mr.Surendra Negi who was always there to help out with all the resources.
Atish Dipankar
2
Abstract
Environmental monitoring is an area of significant research in thefield of Wireless Sensor Networks.It has the potential to revealfine grained,dy-namic changes in monitored variables of an outdoor landscape.A network of sensor nodes spread across afield has the capacity to provide temporal and spatial data regarding the properties of the environment.For example,sen-sor networks could provide precise information about crops with respect to the soil quality and water content,enabling better irrigation schedules,pesticide usage and enhancing environment protection.
This project aims at incorporating data compression and aggregation tech-niques to a sensor network which can be deployed to monitor vital properties like temperature,relative humidity and soil moisture and then report them through a routing tree to a base station for further analysis.The fact that environmental data generally do not show rapid changes and can be approx-imated by linear graphs over certain periods of time has been exploited.As with all other sensor networks,the pressing issue would be to minimize com-munication between the nodes.For nodes belonging to a cluster with one cluster head or collator,a probabilistic scheme has been implemented for sen-sor nodes to send data to the collator with a given probability in less than a certain number of attempts.This would reduce the time for which the radio of the nodes is awake which in turn would prolong the network lifetime.
Contents
1Introduction5
1.1Motivation (5)
1.2Objective (6)
1.3Report Layout (7)
2Preliminaries8
2.1Related Work (8)
2.1.1Great Duck Island Project(UCB) (8)
2.1.2Habitat Sensing at James Reserve(UCLA) (9)
2.1.3Impact of Dryland Salinity in saline and waterlogged
land(UWA and CWR) (10)
2.2Key Concepts (10)
2.2.1Reactivity (10)
2.2.2S-MAC (11)
2.2.3Hardware Used (13)
2.2.4Software Used (13)
2.2.5TinyOS Message Structure (15)
2.2.6Data Aggregation and Compression (16)
3Design and Implementation19
3.1Network Architecture (19)
3.2Software Architecture (20)
1
CONTENTS
3.3InterNode Communication (24)
3.4Lightweight Temporal Compression (28)
4Results31
4.1Data Sensing (31)
4.2Compression and Aggregation (31)
4.3Sleep-Wake schedule between collator and sensor node (35)
5Conclusion38
5.1Summary (38)
5.2Future Work (39)
2
List of Figures
3.1Network Architecture (20)
3.2Wiring of Components for Collator/Base Node (22)
3.3Wiring of Components for Sensor Node (23)
3.4Timing Diagram (24)
3.5Graph of k Vs p for different P[5] (27)
3.6Lightweight Temporal Compression[6] (29)
4.1Light Readings(lux)Vs Time(mins)with e=2lux (33)
4.2Test network with1Base,2Collators and5Sensor Nodes..36
3
List of Tables
2.1Power consumption for sensor node operations (12)
2.2Sensor Specifications of MTS400CA Sensor Board (14)
2.3Message Structure (15)
4.1Sensing Data displayed on the PC (32)
4.2Collator sending aggregated readings after30min intervals..34
4.3No.of attempts of each Sensor Node (35)
4.4No.of attempts of each Sensor Node (36)
4
Chapter1
Introduction
A Wireless Sensor Network(WSN)consists of group of nodes called sensor nodes or motes.Each one of these has an embedded processor,a non volatile memory,a radio and one or more sensors.Data gathered by these sen-sor nodes can be utilized by a top level application like habitat monitoring, surveillance systems and systems monitoring various natural phenomenon. The use of these sensor networks has provided scientists and end users with the means to extract more detailed data,in terms of time and space,from field studies.
1.1Motivation
Traditional efforts at monitoring environmental parameters such as soil mois-ture,temperature and humidity have seen remote sensing(from aircraft and satellites)and personnel using hand-held instrumentation as the main meth-ods of data collecting.Deploying a WSN to replace these methods will im-prove current data acquisition techniques by providing considerably more localised measurements,thus overcoming the limitations in scope,detail and frequency of monitoring with previous sensing technologies.This will also reduce the monetary and ecological cost of personnel in monitoring areas.
5
1.2.OBJECTIVE
Sensor nodes have limited battery life and in most applications are placed in remote areas which make manual intervention to replace batteries etc. very diffiing years could see the cost of such nodes go down to such a level so that they would be treated as disposable,to be used only till their battery drains off.Such power constraints require any application that is built to cut down on redundant transmission and employ power saving techniques.
1.2Objective
The objective of this project is to develop a reactive sensor network ap-plication which can be used to monitor spatial and temporal variation in environmental parameters like soil moisture,temperature and relative hu-midity over time.Reactivity is the ability of the network to detect changes in its environment and react accordingly.For example a rainfall should lead to increased sampling rates while on the other hand long dry periods should decrease the sampling rates of the nodes so as to conserve power.
A data compression technique,namely Lightweight Temporal Compres-sion has been incorporated to cut down on transmission costs by sending less number of data samples but at the same time maintaining a minimum level of accuracy.
Furthermore,simple aggregation schemes like Sum,Average,Min and Max have been implemented on collators so as to sieve out useless or redun-dant data as per the needs of the particular application.
The network itself would consist of clusters with collators as the cluster heads.So,there would be motes with different functionalities.Some would be leaf nodes,simply engaged at data acquisition and transferring them to the nearest gatherer,others would act as collators of such data which can double up as routers to transfer the data to the base station to be centrally analyzed and stored.To conserve power,all nodes in the network undergo
6
1.3.REPORT LAYOUT
sleep-wake schedules.A probabilistic sensor node-collator communication protocol has been implemented which guarantees an expected delay infinding the collator awake when the sensor node wants to send data.
1.3Report Layout
The rest of the report is organised as follows:
Section2deals with similar environmental monitoring work that has been done in other universities.It also discusses the key concepts like S-MAC, Hardware,Software etc.that have been used in the project gnd gives an overview of two Data Compression techniques.
The3rd Section mentions the design and implementation of the compression algorithm and the inter node communication protocol.It also describes the network and the software architecture.
Section4enumerates the results of the project.It shows the graphs,outputs and analysis of the programs implemented on the motes as well as the simu-lations done.
Finally Section5concludes the report and gives suggestion for future work.
7
Chapter2
Preliminaries
2.1Related Work
2.1.1Great Duck Island Project(UCB)
A Wireless Sensor Network was designed for Great Duck Island[10]to pro-vide a long-term,non-intrusive,habitat sustaining study of the microclimate in and around nesting burrows of the Leach Storm Petrel.The initial de-ployment of32sensor nodes using UC Berkeley’s Mica motes concentrated on sensor sampling,data collection and communication.Sensors were chosen based on functionality,high interchangeability,accuracy and start-up time. Initial results showed the choice of sensors(temperature,barometric pres-sure,humidity and infrared)provided the necessary end-user data.A simple communication scheme was employed where sensor nodes broadcasted data to a gateway during scheduled communication periods.This proved efficient for the small-scale network.The motes self-organize into an ad hoc wireless network and pass their data from one to another,bucket-brigade style,until the information reaches a gateway sensor above ground.Eventually,all the data makes its way to a laptop computer tucked inside the lighthouse where it is relayed to a Web site via satellite.Currently there are about150nodes
8
2.1.RELATED WORK
and25weather station nodes with different functionalities forming a multi hop network.
2.1.2Habitat Sensing at James Reserve(UCLA)
The Centre for Embedded Networked Sensing(CENS)[11]has been develop-ing both the hardware and software for Embedded Networked Sensing Sys-tems as well as designing projects to apply this technology.The Extensible Sensing System(EES)at the University of California’s James Reserve in the San Jacinto Mountains of southern California continuously monitors ambient microclimate below and above ground,avian nest-box interior microclimates, and animal presence in more than100locations within a25-hectare study area.Individual nodes,each with up to eight sensors,are deployed along a straight line along which ecological measurements are taken,and in dense patches,crossing all major ecosystems and environments on the Reserve. Sensor data includes temperature,humidity,photo synthetically active radi-ation(PAR),and infrared thermopiles for detecting animal proximity.ESS is built on a Tiny Diffusion routing substrate running across the hierarchy of nodes.Micro nodes collect low-bandwidth data and perform simple pro-cessing.Macro sensors organize the patches,initiate tasking,and further process the sensor-patch data.They usually perform functions of both clus-ter heads and patch gateways.In case of a macro sensor failure,the routing layer automatically associates macro sensors with the nearest available clus-ter head.The entire system is time-synchronized and uses S-MAC medium access control for low-power operation.Data and timestamps are normalized and forwarded to an Internet publish-and-subscribe middleware subsystem called the subject server bus(SSB),through which data is multicast to a heterogeneous set of clients(such as Oracle,MatLab,and LabVIEW)for processing and analyzing both historical and live data streams.
9
2.2.KEY CONCEPTS
2.1.3Impact of Dryland Salinity in saline and water-
logged land(UW A and CWR)
University of Western Australia(UWA)has been collaborating with the Centre for Water Research(CWR)to prototype the use of Wireless Sen-sor Networks in the measurement of soil moisture for research on dry land salinity[1,3]and its management in remote areas.Such networks will be used for monitoring the effectiveness of salinity management strategies,irri-gated crops,urban irrigation,and water movement in forest soils.They have deployed a prototype sensor network for soil moisture monitoring at Pinjar, just north of Perth.The network is based on Mica2motes and MDA300CA sensor boards and uses the following components:soil moisture sampling motes,each attached to2x echo-20soil moisture sensors;a rainfall monitor-ing mote using Decagon Echo-20ECRN tipping bucket rain gauge;a data delivery mote,linked to a Superlite E IT GSM gateway;routing and gath-ering nodes for transporting soil moisture readings from the sampling nodes to the data delivery point,and rainfall information to the sampling nodes.
2.2Key Concepts
2.2.1Reactivity
In an application such as this there would be times when changes in the environmental parameters would be negligible.Then again there might be periods of hectic activities like a heavy rainfall which can drastically change temperature,humidity and soil moisture values.The network can be made more efficient if it can react to such occurrences and increase/decrease its sampling rates depending on the conditions.There are two ways in which to implement such a scheme.
The centralised approach is to have the Base station send out signals(rate message)to the sampling nodes either on an individual or on a collective
10
2.2.KEY CONCEPTS
basis,to increase their sampling rates in the event of(say)a rainfall and continue doing so till the occurrence lasts.This method however would not only add to the network traffic but will also be prone to delay especially for sensor nodes far offfrom the Base in terms of number of hops.
The distributed or local approach is the one I have used in this project.This causes sensor nodes to change their sampling rate if successive readings show a variation more than some predefined threshold and revert back to their normal rates once the event ceases to occur.This would add no extra traffic to the network and is easy to implement.
2.2.2S-MAC
S-MAC[2]is a MAC protocol designed to address the issue of energy efficient, coordinated sleeping and so is well suitable for this application.S-MAC tries to reduce power consumption in a sensor network by cutting down on the following things:-
Collision,which causes retransmission.
Overhearing,meaning nodes pick up packets destined for other nodes.
Control packet overhead.
Idle listening,that is listening to receive possible traffic that is not sent.
The protocol includes four major components:periodic listen and sleep, collision avoidance by using RTS/CTS,overhearing avoidance by switching offradio and message passing to reduce control overhead.Some per hop fairness is sacrificed in turn.
The power management approach designed for Berkeley mote hardware is for motes to alternate between activity and sleep states and synchronize their cycle with their neighbors.Power draw during the active period will be typically from5to20milliamps and during sleep the draw is5micro
11
2.2.KEY CONCEPTS
amps.But since the S-MAC does not put the CPU to sleep(only the radio is put to sleep)therefore the actual power consumption during sleep state is around8milliamps.As far as transmission is concerned,it is not feasible to acknowledge every packet that a sensor node sends,as it would effectively double the transmission.However,if no ACK’s are used,or nodes always transmit multiple times,then significant energy may be wasted in useless transmissions.So there is a need tofind a trade offlike sending one feedback for(say)five packets.This ACK could contain information about the number of packets received so that on receiving the ACK the sensor node can decide on the quality of transmission and whether to send more packets in the same time slot or not.
Operation Power(mV)
Sensing0.5
CPU1
Transmitting15
Receiving12
Listening(Idle)12
Sleeping0.5
Table2.1:Power consumption for sensor node operations
Transmitting a packet requires approximately5times more energy than taking a sensor reading and storing it locally.Thus,minimizing the number of transmissions required is a critical step for extending the lifetime of battery powered nodes.
All nodes in the network go through sleep-wake cycles in order to conserve energy.Sensing nodes wake each cycle and listen for a synchronization signal from the base.At the beginning of each waking cycle,any node which has sufficient data to report contends for a transmission path to the base station. After a few packet times,any nodes not required for data delivery return to sleep until the next global reporting round.If more than one node tries to
12
2.2.KEY CONCEPTS
transmit in the same slot,thefirst requestor is chosen and the rest defer to one of the following slots.
A durationfield in each transmitted packet indicates how long the re-maining transmission will be.So if a node receives a packet destined to another node,it knows how long it has to keep silent.The node records this value in network allocation vector(NAV)and sets a timer.In this way it avoids overhearing.S-MAC thus is a protocol suited for sensor network applications and parts of it have been integrated into this project to allow application development on top of it.
2.2.3Hardware Used
The motes used for this project are the Crossbow[14,15]MICA2Motes along with the MTS400data acquisition board and MIB510programming board.
MICA2Mote(MPR410CB):It has a7MHz ATmega128L micropro-cessor with a10bit ADC,128KByte Flash Memory and a CC1000 transceiver operating at433MHz and a maximum data rate of38.4 Kbps.It is powered by2AA batteries of1850mAh each.
MTS400CA:It isfitted with temperature,humidity,barometric pres-sure,light sensor and a dual axis accelerometer.Additionally the MTS420CA has a GPS module attached to it.
MIB510:It is provided with a RS-232serial cable interface and a volt-age regulator capable of accepting5-7Volt DC and supplying3V DC to the motes.
2.2.4Software Used
TinyOS[13]and NesC form the core all the applications developed for the motes.The TinyOS operating system,libraries,and applications are all
13
2.2.KEY CONCEPTS
Sensor Range Accuracy/Resolution Dual Axis Accelerometer-2g to+2g2mg at60Hz Ambient Light0to1000lux Similar to Human Eye
Relative Humidity0to100% 3.5RH
Temperature-40to1250.5at25 Barometric Pressure300to1100mbar 1.5%at25 Table2.2:Sensor Specifications of MTS400CA Sensor Board
written in NesC,a structured component-based language which is an exten-sion of C.TinyOS is an event driven operating system designed specifically for the mica mote platform.It architecture is component based and pro-vides a library as a set of reusable system software components which are organized in to layers,with lower layers closer to hardware and higher layers closer to the application.NesC applications are built of components with well defined interfaces.A component could be either a module or a config-uration.A module implements interfaces and the configuration wires them together.Thus a TinyOS application is implemented by wiring the reusable components and also the newer ones implemented,together,as specified in a top level configurationfile.TinyOS has nofile system,its supports only static memory allocation,and has simple FIFO based task model.
The main programs that were looked into and modified were the TOS-Base,Surge and XSensorMTS400applications.Specifically speaking TOS-Base is an application that acts as a simple bridge between the serial and wire-less channel,receiving packets from nodes and transmitting them through the UART to the PC.The XSensorMTS400is a data acquisition module that periodically collects sensor data and sends them through the UART or the radio.The Surge is a self configuring multi hop network application which is supported by a set of java front end tools called Surge-View.
TOSSIM[12]is a discrete event simulator for TinyOS sensor networks. It allows TinyOS applications to be compiled,run and debugged in a PC
14
2.2.KEY CONCEPTS
environment which allows introducing breakpoints and running the code as many times as needed without fear of hardware damage.Besides the default debug modes like clock,route,packet,radio,adc,uart,time etc which print out a lot of information when the code is run,TOSSIM also provides3 user defined modes,usr1,usr2and usr3which can be used like normal cout statements as in C++.A typical TOSSIM application is run as follows:
./build/pc/main.exe[options]num-nodes
Where num-nodes is the number of nodes for which the simulation is being done and the options typically deal with running the code for a particular time,at a particular speed,introducing errors between links,radio models etc.
TOSSIM can run only one code at a time.So in my simulations of sensor nodes and a collator,the entire code had to be written as one and based on the Local Address of the motes,which is assigned by TOSSIM,they were either designated as sensor nodes or collators and then appropriate tasks were executed.
2.2.5TinyOS Message Structure
The basic message structure of a TinyOS packet(Table2.3)is36bytes by default.This includes7bytes of generic Active Message(AM)fields and a maximum of29bytes for the payload.The payload is determined by the application.The complete message structure is as shown below:
211122210*22
Dest Address Handler
ID Group
ID
Message
Length
Source
Ad-
dress
Counter ADC
Chan-
nel
Sensor
Read-
ing
CRC
Table2.3:Message Structure
msg->data[0]:sensor id,MTS400=0x85,MTS420=0x86
15
2.2.KEY CONCEPTS
msg->data[1]:packet id=1
msg->data[2]:node id
msg->data[3]:reserved
msg->data[4,5]:battery ADC data
msg->data[6,7]:humidity data
msg->data[8,9]:temperature data
msg->data[10,11]:calword1
msg->data[12,13]:calword2
msg->data[14,15]:calword3
msg->data[16,17]:calword4
msg->data[18,19]:intersematemp
msg->data[20,21]:pressure
msg->data[22,23]:taosch0
msg->data[24,25]:taosch1
msg->data[26,27]:accelx
msg->data[28,29]:accely
Where calword1-calword4are used for callibration of the temperature and pressure sensors,taosch0and taosch1are the2channels for the light(taos) sensor and accelx and accely are the accelerometers.
2.2.6Data Aggregation and Compression
In-Network and In-Node data processing can significantly reduce radio com-munication between nodes in a sensor network in which communication is the overriding consumer of energy.There are3methods which reduce data sets in-network:in-network aggregation to extract important data,compression by spatial correlation,and compression by temporal correlation.Therefore, data reduction before transmission,either by compression or feature extrac-tion,will directly and significantly increase network lifetime.Sending every bit of data up the routing tree is not a practical solution in a bandwidth
16
2.2.KEY CONCEPTS
and energy constrained sensor network and is also not scalable as the num-ber of nodes increase.Any compression algorithm that can be implemented on MICA motes must be simple,consume little CPU and require very lit-tle storage.Piecewise Linear Representation and Haar Wavelets are2such approaches that can successfully operate within the given constraints.Haar Wavelets are superior to other wavelets techniques in this scenario due to their low computational complexity.
Haar Wavelet Compression
Wavelet based compression algorithms are commonly used in image pro-cessing.Chen,Li and Mohapatra[7]employ a Haar Wavelet transformation whereby,given a sequence of readings,neighbouring elements are averaged and stored along with their differences in an array.The resulting array is called the wavelet coefficient matrix,which can be reconstructed to form the original time series.The Haar Wavelet technique,unlike the Piecewise Lin-ear Representaion Algorithm discussed below is not a greedy one.It requires all or some set of the data series before it can begin computation.More precisely,it requires2n readings for processing.It begins by taking every pair of neighbouring readings and calculating their average.This value is stored along with the pair’s second reading and the average.This continues for the subsequently formed arrays.The process ends when only one average remains.Example:
A series(2,6,5,11)transforms to(4,8,-2,-3)
Neighbouring Readings:(2,6)and(5,11)
The second iteration:
(4,8,-2,-3)transforms to(6,-2,-2,-3)
Thefinal array(6,-2,-2,-3)is called the wavelet coefficient matrix.From here we create the Gradient Error Tree which represents the difference between the actual readings and the computed averages.The number in each leaf
17
2.2.KEY CONCEPTS
of the error tree represents the greatest error between the average and the readings it ing this tree we can eliminate elements of the coefficient matrix if its corresponding error gradient is less than some thresh-old value.
Lightweight Temporal Compression
Lightweight Temporal Compression(LTC)[6]is a Piecewise Linear Represen-taion algorithm which can be easily implemented on the mote hardware as is also not very computationally exhaustive.Essentially a Sliding Window algorithm,it makes use of the observation that over a small enough window of time,samples of microclimate data are linear.Itfinds such windows and generates a series of line segments that accurately represent the data.So it approximates the entire dataset by piecewise linear representations.It can compress data up to20-to-1while introducing error on the order of the sensor hardware’s specified margin of error.Being a Greedy Algorithm,it can begin computation as soon as it receives data from the sensor.Environmental data such as temperature and humidity have the nice property that they are usu-ally continuous in the temporal dimension and at small enough time windows are approximately linear.Hence this algorithm is particularly suited for use in such a scenario.
18
Chapter3
Design and Implementation
3.1Network Architecture
The architecture for this application comprises of the following:-
1.Sensor Nodes capable of sensing soil moisture,relative humidity and
temperature
2.Routing and Gathering nodes for transporting sensor readings from the
sensor nodes to the base node,and rainfall information to the sampling nodes
3.A Base node linked to a GSM Gateway/PC
The entire network(Fig3.1)has a hierarchical model formed of clusters[9] with the routers being the cluster heads responsible for dissemination of data from the cluster to the network.The leaf nodes are the ones responsible for the basic sensing operations.A cluster head exchanges its schedule with all other1hop neighbors(sensor nodes)by broadcasting.As shown in the next section,this minimises the awake time of the Sensor Node radios.If multiple neighbors want to talk to a node,they need to contend for the medium when the head node is listening.The contention mechanism uses RTS and CTS
19
3.2.SOFTWARE ARCHITECTURE
Figure3.1:Network Architecture
packets.The node whofirst sends out the RTS packet wins the medium,and the receiver will reply with a CTS packet.After they start data transmission, they do not follow their sleep schedules until theyfinish transmission.
3.2Software Architecture
TinyOS[13]and NesC allows a very modular,interface based development of the application which supports a high degree of interaction between its com-ponents.NesC applications are built out of components with well-defined, bidirectional interfaces.Accordingly this application could be divided into the following three components:-
Sensing Activities
–Light,Temperature and Relative Humidity
20。

相关文档
最新文档