Upload
kerry-cooper
View
220
Download
0
Embed Size (px)
Citation preview
12/5/2006 - updated12/5/2006 - updated WSN Mote- MCU & Sensor HardwareWSN Mote- MCU & Sensor Hardware 11
ECET 581ECET 581 Wireless Sensor NetworksWireless Sensor Networks
Infrastructure EstablishmentInfrastructure EstablishmentNovember 28, 2006November 28, 2006
Fall 2006Fall 2006http://www.etcs.ipfw.edu/~linhttp://www.etcs.ipfw.edu/~lin
References: References: **Ch 4 Infrastructure Establishment of the book: "Wireless Sensor Networks **Ch 4 Infrastructure Establishment of the book: "Wireless Sensor Networks
- An Information Processing Approach," by Feng Zhao and Leonidas - An Information Processing Approach," by Feng Zhao and Leonidas Guibas, from Morgan Kaufmann/Elsevier inc, 2004Guibas, from Morgan Kaufmann/Elsevier inc, 2004
** Ch 9 Network Position and Synchronization Services and Ch 10 Energy ** Ch 9 Network Position and Synchronization Services and Ch 10 Energy Management of the book: Principles of Embedded Networked System Management of the book: Principles of Embedded Networked System Design, by Gregory and William Kaiser, from Cambridge University Design, by Gregory and William Kaiser, from Cambridge University PressPress
**TMote Sky Web site: **TMote Sky Web site: www.moteiv.comwww.moteiv.com
12/5/2006 - updated12/5/2006 - updated WSN Mote- MCU & Sensor HardwareWSN Mote- MCU & Sensor Hardware 22
Infrastructure EstablishmentInfrastructure Establishment
Topology ControlTopology Control ClusteringClustering Time SynchronizationTime Synchronization
• Clock and Communication DelaysClock and Communication Delays• Interval MethodsInterval Methods• Reference BroadcastsReference Broadcasts
Localization and Localization ServicesLocalization and Localization Services• Ranging TechniquesRanging Techniques• Range-based Localization Algorithms Range-based Localization Algorithms • Location ServicesLocation Services
12/5/2006 - updated12/5/2006 - updated WSN Mote- MCU & Sensor HardwareWSN Mote- MCU & Sensor Hardware 33
Topology ControlTopology Control
ApplicationsApplications• Military surveillanceMilitary surveillance• Emergency responseEmergency response• Scientific explorationScientific exploration
Neighborhood DiscoveryNeighborhood Discovery• Execute a neighbor-nodes discovering protocolExecute a neighbor-nodes discovering protocol
Topology Discovery – build routing pathTopology Discovery – build routing path Radio power of the nodesRadio power of the nodes Local topographyLocal topography Other conditionsOther conditions IssuesIssues
• Setup radio range to minimize energy usageSetup radio range to minimize energy usage• Remains connected and satisfies other desirable Remains connected and satisfies other desirable
communication propertiescommunication properties• Determines CTR (critical transmitting range)Determines CTR (critical transmitting range)
12/5/2006 - updated12/5/2006 - updated WSN Mote- MCU & Sensor HardwareWSN Mote- MCU & Sensor Hardware 44
Topology ControlTopology Control
Determines CTR (critical transmitting range)Determines CTR (critical transmitting range)• Geometric Random Graph (GRM) TheoryGeometric Random Graph (GRM) Theory
Related Issues Related Issues • Link Quality Indicator – LQI (packet reception ratio)Link Quality Indicator – LQI (packet reception ratio)• Received Signal Strength Indicator - RSSIReceived Signal Strength Indicator - RSSI• Coverage rangeCoverage range• Optimal transmit power adjustment (transmission power Optimal transmit power adjustment (transmission power
control)control)• Adaptive transmitting range control (models, temporal Adaptive transmitting range control (models, temporal
and LQI, RSSI)and LQI, RSSI)• CC1000/CC2420 RF Radio Hardware: CC1000/CC2420 RF Radio Hardware:
Transmitter/Receiver, dBm)Transmitter/Receiver, dBm)
12/5/2006 - updated12/5/2006 - updated WSN Mote- MCU & Sensor HardwareWSN Mote- MCU & Sensor Hardware 55
RF TransceiversRF Transceivers TI-ChipconTI-Chipcon
• CC1000CC1000• CC2420CC2420
12/5/2006 - updated12/5/2006 - updated WSN Mote- MCU & Sensor HardwareWSN Mote- MCU & Sensor Hardware 66
Tmote Sky - RSSI valuesTmote Sky - RSSI values
Ref: Ref: http://www.moteiv.com/community/Reading_RSSIhttp://www.moteiv.com/community/Reading_RSSI_values_from_Tmote_Sky_values_from_Tmote_Sky
Read a incoming packet and store the Read a incoming packet and store the signal strength in thesignal strength in the• TOS_Msg structureTOS_Msg structure
Read the signal in the absence of the Read the signal in the absence of the incoming packetsincoming packets• NoiseNoise• Source interference : 802.11 networks, Source interference : 802.11 networks,
Microwave ovensMicrowave ovens
12/5/2006 - updated12/5/2006 - updated WSN Mote- MCU & Sensor HardwareWSN Mote- MCU & Sensor Hardware 77
Tmote Sky - RSSI valuesTmote Sky - RSSI values
• Modifying CC2420RadioC.ncModifying CC2420RadioC.nc
implementation { ... components new CC2420ResourceC() as CmdRSSI; ... CC2420ControlM.CmdRSSI -> CmdRSSI; }
12/5/2006 - updated12/5/2006 - updated WSN Mote- MCU & Sensor HardwareWSN Mote- MCU & Sensor Hardware 88
Tmote Sky - RSSI valuesTmote Sky - RSSI values
• Modifying CC2420ControlM.nc to provide extra Modifying CC2420ControlM.nc to provide extra ADC interfaceADC interface
• Use an additional ResourceUse an additional Resource
provides { provides { ... ... interface ADC as RSSI; interface ADC as RSSI; ... } ... } uses { uses { ... ... interface ResourceCmd as CmdRSSI; interface ResourceCmd as CmdRSSI; ... ... } }
12/5/2006 - updated12/5/2006 - updated WSN Mote- MCU & Sensor HardwareWSN Mote- MCU & Sensor Hardware 99
Tmote Sky - RSSI valuesTmote Sky - RSSI valuesimplementation { implementation { ... ... async command result_t RSSI.getData() { async command result_t RSSI.getData() { call CmdRSSI.deferRequest();call CmdRSSI.deferRequest(); return SUCCESS; return SUCCESS; } } event void CmdRSSI.granted(uint8_t rh) { event void CmdRSSI.granted(uint8_t rh) { uint16_t data; uint16_t data; data = call HPLChipcon.read(rh, CC2420_RSSI); data = call HPLChipcon.read(rh, CC2420_RSSI); call CmdRSSI.release(); call CmdRSSI.release(); data += 0x7f; data &= 0x00ff; data += 0x7f; data &= 0x00ff; signal RSSI.dataReady(data); signal RSSI.dataReady(data); } } async command result_t RSSI.getContinuousData() async command result_t RSSI.getContinuousData()
{ return FALSE; { return FALSE; }}
12/5/2006 - updated12/5/2006 - updated WSN Mote- MCU & Sensor HardwareWSN Mote- MCU & Sensor Hardware 1010
Power Management IssuesPower Management Issues TMote Sky Typical Operating ConditionsTMote Sky Typical Operating Conditions
12/5/2006 - updated12/5/2006 - updated WSN Mote- MCU & Sensor HardwareWSN Mote- MCU & Sensor Hardware 1111
Power Management IssuesPower Management Issues A pair of AA batteries – 2400 mA-hours of A pair of AA batteries – 2400 mA-hours of
capacitycapacity Mote’s Current:Mote’s Current:
• Sleeping – 21 µASleeping – 21 µA• Active – 23 mAActive – 23 mA
Sampling period Td = 30 sec, 4 sec active Sampling period Td = 30 sec, 4 sec active timetime
Battery Life Battery Life Life = 2400/(4/Td)*23 +((Td-4)/Td)*0.21) Life = 2400/(4/Td)*23 +((Td-4)/Td)*0.21)
= 738 hr, or 30 days= 738 hr, or 30 days
12/5/2006 - updated12/5/2006 - updated WSN Mote- MCU & Sensor HardwareWSN Mote- MCU & Sensor Hardware 1212
Radio Transmit Power and Radio Transmit Power and Frequency – CC2420Frequency – CC2420
Ref: Ref: http://www.moteiv.com/community/Change_radio_transmit_http://www.moteiv.com/community/Change_radio_transmit_power_and_frequencypower_and_frequency
Change frequency at compile timeChange frequency at compile time • Valid channels - 11 to 26Valid channels - 11 to 26• Default channel – 11Default channel – 11• Env Variable setup: Export CC2420_CHANNEL=12Env Variable setup: Export CC2420_CHANNEL=12• Makefile inclusion: CC2420_CHANNEL=12Makefile inclusion: CC2420_CHANNEL=12
Change transmit power at compile timeChange transmit power at compile time• Preprocessor Directive: CC2420_DEF_RFPOWERPreprocessor Directive: CC2420_DEF_RFPOWER• CFLAGS = -DCC2420_DEF_RFPOWER=x make moteCFLAGS = -DCC2420_DEF_RFPOWER=x make mote• Power Index x: 1 through 31Power Index x: 1 through 31• 1 == -25 dBm1 == -25 dBm• 31 == 0 dBm31 == 0 dBm
12/5/2006 - updated12/5/2006 - updated WSN Mote- MCU & Sensor HardwareWSN Mote- MCU & Sensor Hardware 1313
Radio Transmit Power and Radio Transmit Power and Frequency – CC2420Frequency – CC2420
Change power or frequency at run timeChange power or frequency at run time• Command result_t TunePreset(uint8_t rh, Command result_t TunePreset(uint8_t rh,
uint8_t channel);uint8_t channel);• Command result_t TSetRFPower(uint8_t rh, Command result_t TSetRFPower(uint8_t rh,
uint8_t power);uint8_t power);• rh optionsrh options
RESOURCE_NONE: for automatic resource schedulingRESOURCE_NONE: for automatic resource scheduling CC2420ResourceC componentCC2420ResourceC component
• channelchannel One of the valid 802.15.4 present channel: 11 – 26One of the valid 802.15.4 present channel: 11 – 26 Freq = 2405 + 5(k-11) MHz, k = 11, 12, .., 26Freq = 2405 + 5(k-11) MHz, k = 11, 12, .., 26
• Power: 1 to 31Power: 1 to 31
12/5/2006 - updated12/5/2006 - updated WSN Mote- MCU & Sensor HardwareWSN Mote- MCU & Sensor Hardware 1414
ClusteringClustering
Manual/Self-organizingManual/Self-organizing Support routing and data aggregationSupport routing and data aggregation Hierarchical structures Hierarchical structures
• Multiple clustersMultiple clusters• Cluster heads (higher ID nodes – Unique ID)Cluster heads (higher ID nodes – Unique ID)• Gateways – cluster nodesGateways – cluster nodes• Long range communication – Cluster headsLong range communication – Cluster heads• Fault toleranceFault tolerance
Within a ClusterWithin a Cluster• Simple protocol for Simple protocol for
BroadcastingBroadcasting RoutingRouting
• Time or frequency division multiplexing can be reused across Time or frequency division multiplexing can be reused across the non-overlapping clustersthe non-overlapping clusters
• Monitoring nodes healthMonitoring nodes health
12/5/2006 - updated12/5/2006 - updated WSN Mote- MCU & Sensor HardwareWSN Mote- MCU & Sensor Hardware 1515
Time SynchronizationTime Synchronization
Time SynchronizationTime Synchronization• Issues: Issues:
Time-based sensor reading (moving objects)Time-based sensor reading (moving objects) Ultrasonic, radio signalsUltrasonic, radio signals Detection time comparison? Accuracy, sync.Detection time comparison? Accuracy, sync. Inter-node distance estimation Inter-node distance estimation Local/global clock synchronization methodsLocal/global clock synchronization methods
12/5/2006 - updated12/5/2006 - updated WSN Mote- MCU & Sensor HardwareWSN Mote- MCU & Sensor Hardware 1616
Time Synchronization Time Synchronization (cont.)(cont.)
Clock and Communication DelaysClock and Communication Delays• Hardware clock Hardware clock
Perfect clock - dC(t)/dt = 1Perfect clock - dC(t)/dt = 1 Skewed clock – drifted due to temperature, humidity, Skewed clock – drifted due to temperature, humidity,
etc [ 1- etc [ 1- δδ ≤ dC(t)/dt ≤ 1+ ≤ dC(t)/dt ≤ 1+ δδ; ; δ≈δ≈1010-6-6]]
• Latency in the ChannelLatency in the Channel Send timeSend time Access timeAccess time Propagation timePropagation time Receive timeReceive time
12/5/2006 - updated12/5/2006 - updated WSN Mote- MCU & Sensor HardwareWSN Mote- MCU & Sensor Hardware 1717
Time Synchronization Time Synchronization (cont.)(cont.)
Move clock reading around the network Move clock reading around the network and perform temporal comparisonsand perform temporal comparisons
Intervals between events durationIntervals between events duration• Event times -> Time Intervals (mapping) Event times -> Time Intervals (mapping) • Time stamps – real timeTime stamps – real time• Time differencesTime differences• Temporal reasoning (more important than the Temporal reasoning (more important than the
exact time)exact time)• 1- 1- δδi ≤ i ≤ ΔΔCi/Ci/ΔΔt ≤ 1+ t ≤ 1+ δδii
ΔΔCi – local durationCi – local duration Time in senderTime in sender Time in receiverTime in receiver
12/5/2006 - updated12/5/2006 - updated WSN Mote- MCU & Sensor HardwareWSN Mote- MCU & Sensor Hardware 1818
Time Synchronization Time Synchronization (cont.)(cont.)
Interval Methods – Time Sync Interval Methods – Time Sync ProtocolProtocol• Low-overheadLow-overhead• Scalable with network size changesScalable with network size changes• Can accommodate topology changesCan accommodate topology changes• Short-lived connectionShort-lived connection
12/5/2006 - updated12/5/2006 - updated WSN Mote- MCU & Sensor HardwareWSN Mote- MCU & Sensor Hardware 1919
Tmote Sky – Measure Elapse TimeTmote Sky – Measure Elapse Time
Elapse time: time between eventsElapse time: time between events• LocalTime interfaceLocalTime interface• 3 basic time precisions: Components3 basic time precisions: Components
CounterMilliC - MillisecondCounterMilliC - Millisecond Counter32khzC - 30 µs (32 kHz)Counter32khzC - 30 µs (32 kHz) CounterMicroC - MicrosecondCounterMicroC - Microsecond
12/5/2006 - updated12/5/2006 - updated WSN Mote- MCU & Sensor HardwareWSN Mote- MCU & Sensor Hardware 2020
Tmote Sky – Measure Elapse TimeTmote Sky – Measure Elapse Time
LocalTime interfaceLocalTime interfaceinterface LocalTime<precision_tag> { interface LocalTime<precision_tag> {
async command uint32_t get(); }async command uint32_t get(); } Example Code:Example Code:configuration MyAppC { configuration MyAppC {
{ {
implementation { implementation {
components MyAppP; components MyAppP;
components CounterMilliC; components CounterMilliC;
MyAppP.LocalTime -> CounterMilliC; MyAppP.LocalTime -> CounterMilliC;
} }
12/5/2006 - updated12/5/2006 - updated WSN Mote- MCU & Sensor HardwareWSN Mote- MCU & Sensor Hardware 2121
Tmote Sky – Measure Elapse TimeTmote Sky – Measure Elapse Time
Example Code:Example Code: module MyAppP { module MyAppP { uses interface LocalTime<TMilli>; uses interface LocalTime<TMilli>; } } implementation { implementation { task void some_task() { task void some_task() { // ... // ... t = call LocalTime.get(); t = call LocalTime.get(); // ... // ... } } } }
12/5/2006 - updated12/5/2006 - updated WSN Mote- MCU & Sensor HardwareWSN Mote- MCU & Sensor Hardware 2222
Time Synchronization – Reference Time Synchronization – Reference Broadcast System (RBS)Broadcast System (RBS)
Major Sources of Time Sync. ErrorsMajor Sources of Time Sync. Errors• Send timeSend time – clock propagation through node – clock propagation through node
OS and radio transmitterOS and radio transmitter• Access timeAccess time – due to multiple access protocol – due to multiple access protocol• Propagation timePropagation time - due to transmission through - due to transmission through
the multihop physical medium, queuing delays the multihop physical medium, queuing delays caused by congestioncaused by congestion
• Receive timeReceive time – receive path in the radio and – receive path in the radio and variable delays in interrupting the OSvariable delays in interrupting the OS
12/5/2006 - updated12/5/2006 - updated WSN Mote- MCU & Sensor HardwareWSN Mote- MCU & Sensor Hardware 2323
Time Synchronization – Reference Time Synchronization – Reference Broadcast System (RBS)Broadcast System (RBS)
Problems with time comparison protocolsProblems with time comparison protocols• Long delays/Multihop routesLong delays/Multihop routes• Mapping time become uselessMapping time become useless
Assume that all radios are within range of Assume that all radios are within range of a single transmitter, many of these delays a single transmitter, many of these delays are mitigatedare mitigated
Reference Broadcasts Protocol – Reference Broadcasts Protocol – Objectives of Tim SyncObjectives of Tim Sync• Reduce delays and delay uncertaintyReduce delays and delay uncertainty• Establish the relative time among different Establish the relative time among different
clocks, while allowing the individual clocks to clocks, while allowing the individual clocks to run freelyrun freely
12/5/2006 - updated12/5/2006 - updated WSN Mote- MCU & Sensor HardwareWSN Mote- MCU & Sensor Hardware 2424
Time Synchronization – Reference Time Synchronization – Reference Broadcast System (RBS)Broadcast System (RBS)
SenderSender• Send a sync reference packet (message)Send a sync reference packet (message)• The send and access times – unknown and variable, but The send and access times – unknown and variable, but
are the same for every radio that hears any particular are the same for every radio that hears any particular message broadcastmessage broadcast
• Negligible propagation time for single radio hopNegligible propagation time for single radio hop ReceiversReceivers
• Receive the same the packet Receive the same the packet • Record TOA in their own time frame Record TOA in their own time frame • Receive time Receive time
The only significant source of errorThe only significant source of error Due to the variability among the receiversDue to the variability among the receivers A sequence of broadcasts – reduce error A sequence of broadcasts – reduce error
• Exchange info among themselvesExchange info among themselves Receiver know the relative to each other, rather than to the Receiver know the relative to each other, rather than to the
broadcasting nodebroadcasting node
12/5/2006 - updated12/5/2006 - updated WSN Mote- MCU & Sensor HardwareWSN Mote- MCU & Sensor Hardware 2525
Time Synchronization – Reference Time Synchronization – Reference Broadcast System (RBS)Broadcast System (RBS)
SenderSender• Send a sync reference packet (message)Send a sync reference packet (message)• The send and access times – unknown and variable, but The send and access times – unknown and variable, but
are the same for every radio that hears any particular are the same for every radio that hears any particular message broadcastmessage broadcast
• Negligible propagation time for single radio hopNegligible propagation time for single radio hop ReceiversReceivers
• Receive the same the packet Receive the same the packet • Record TOA in their own time frame Record TOA in their own time frame • Receive time Receive time
The only significant source of errorThe only significant source of error Due to the variability among the receiversDue to the variability among the receivers A sequence of broadcasts – reduce error A sequence of broadcasts – reduce error
• Exchange info among themselvesExchange info among themselves Receiver know the relative to each other, rather than to the Receiver know the relative to each other, rather than to the
broadcasting nodebroadcasting node
12/5/2006 - updated12/5/2006 - updated WSN Mote- MCU & Sensor HardwareWSN Mote- MCU & Sensor Hardware 2626
Localization and Localization Localization and Localization ServicesServices
Provide info about the world – highly Provide info about the world – highly localized in space and/or timelocalized in space and/or time
ApplicationsApplications• Static nodesStatic nodes• Mobile nodesMobile nodes• Location and time infoLocation and time info
Target trackingTarget tracking Habitat monitoringHabitat monitoring
How about the addition of GPS?How about the addition of GPS?• Landmark nodesLandmark nodes• Outside onlyOutside only
12/5/2006 - updated12/5/2006 - updated WSN Mote- MCU & Sensor HardwareWSN Mote- MCU & Sensor Hardware 2727
Localization and Localization Localization and Localization Services Services (cont.)(cont.)
Ranging TechniquesRanging Techniques• Received Signal Strength (RSS) – RF signal Received Signal Strength (RSS) – RF signal
estimationestimation• Distance estimation Distance estimation
Send/Receive Power calculationSend/Receive Power calculation• Source signal strength, attenuated laws, RSSSource signal strength, attenuated laws, RSS• Square law (not linear) – received power and distance Square law (not linear) – received power and distance
relationshiprelationship TOA (Time of Arrival)TOA (Time of Arrival)
• Time measurement (sender -> receiver)Time measurement (sender -> receiver)• Synchronized sender and receiver timeSynchronized sender and receiver time
TDOA (Time Difference of Arrival) at two receiversTDOA (Time Difference of Arrival) at two receivers• Estimate the difference in distances between the two Estimate the difference in distances between the two
receivers and the senderreceivers and the sender
12/5/2006 - updated12/5/2006 - updated WSN Mote- MCU & Sensor HardwareWSN Mote- MCU & Sensor Hardware 2828
Localization and Localization Localization and Localization Services Services (cont.)(cont.)
Range-based Localization Algorithms Range-based Localization Algorithms Location ServicesLocation Services