WSN Programming Course
Introduction to Wireless Sensor
Networks
Manuel Fernández
UAH, 18th September 2013
Contents
•What areWireless Sensor Networks?
•WSN Advantages & Challenges
•Applications
• Future ofWSN
•What are Motes?
•WSN Evolution
• IEEE 802.15.4
• IEEE 802.15.4 vs. ZigBee
• Future of IEEE 802.15.4
• Embedded Operating Systems
• Introduction toTinyOS 2.x
2
• A Wireless Sensor Network (WSN) is a wireless network of small
autonomous devices spatially distributed over a certain area that
cooperatively monitor physical or environmental variables through
their attached sensors, and transmit this information to a main
location.
What are WSNs?
3
• Advantages:
• Low cost devices
• Low power
• Easy and quick to deploy
• Scalability (increase network robustness)
• Challenges:
• Energy constrained
• Limited memory and computation
• Low Bandwidth
WSN Advantages &Challenges
4
• Monitoring of objects
• Monitoring of areas
• Monitoring of objects and areas
Applications
5
Monitoring of objects
• Structural Monitoring
• Condition-based Maintenance
• Medical Diagnostics
• Urban terrain mapping
Example:Condition-based Maintenance
Fabrication plants:
• Sensors collect vibration data, monitor wear and tear; report data
in real-time
• Reduces need for a team of engineers; cutting costs by several
orders of magnitude
Applications
6
Monitoring of areas
• Environmental and Habitat Monitoring
• PrecisionAgriculture
• Indoor Climate Control
• Military Surveillance
•TreatyVerification
• IntelligentAlarms
Example: Precision agriculture
• Precision agriculture aims at making agricultural operations more
efficient and cost effective, while reducing environmental impact.
• The information collected from sensors is used to evaluate
optimum sowing density, estimate fertilizers and other inputs
needs, and to more accurately predict crop yields.
Applications
7
Monitoring of objects and areas
•Wildlife Habitats
• Disaster Management
• Emergency Response
• Ubiquitous Computing
•AssetTracking
• Health Care
• Manufacturing Process Flows
• …
Applications
8
Smart Home/Smart Office
• Sensors controlling appliances and electrical devices in the house
• Better lighting and heating in office buildings.
Biomedical/Medical
• Health Monitors:Glucose /Heart rate
• Chronic disease: artificial retina/ cochlear implants
• Hospital sensors: monitor vital signs/ record anomalies
Traffic management & monitoring
•Traffic flow
• Real time routing update
Industrial & Commercial
•Agricultural crop conditions
•Inventory tracking
•Plant equipment maintenance monitoring
•Automated problem monitoring
Future of WSN
9
• Low cost and power computer
• Sensors
• Radio module
• Storage
• Power unit
What are Motes?
CONTROL
SENSOR 3
10
• CM5000
What are Motes?
11
WSN Evolution
• First developments for military
applications
• At the end of the 90’s, the possibilities
of this technology were very evident for
researches & the industry across the
globe.
• In 2003 the IEEE 802.15.4 standard was
formulated. The first embedded
operating systems are developed
• First WSN designs are distributed
systems
• Newest designs focus on in-node
processing and actuation, and
multipoint communication
12
• In 2003 the IEEE 802.15.4 standard was formulated, as
an answer to the industry needs for a common
communication stack among small devices
• This stack is aimed towards low power consumption,
and low data transfer rates
• The communication stack focuses on the definition of
the frequencies of operation, and how they physically
access the medium
IEEE 802.15.4
13
IEEE 802.15.4
802.15.4
802.11
(Wi-Fi)
Bluetooth
UWB (Ultra
Wide Band)
Wireless USB IR Wireless
Data Rate
20, 40, and 250
Kbits/s
11 & 54
Mbits/sec
1 Mbits/s 100-500 Mbits/s 62.5 Kbits/s
20-40 Kbits/s
115 Kbits/s
4 & 16 Mbits/s
Range 10-800 meters 50-100 meters 10 meters <10 meters 10 meters
<10 meters (line
of sight)
Networking Topology
Ad-hoc, peer to
peer, star, or
mesh Point to hub
Ad-hoc, very
small networks
Point to point Point to point Point to point
Operating Frequency
868 MHz
(Europe)
900-928 MHz
(NA), 2.4 GHz
(worldwide)
2.4 and 5 GHz 2.4 GHz 3.1-10.6 GHz 2.4 GHz 800-900 nm
Complexity (Device
and application
impact)
Low High High Medium Low Low
Power Consumption
(Battery option and
life)
Very low (low
power is a design
goal)
High Medium Low Low Low
IEEE 802.15.4
Tech comparison:
15
IEEE 802.15.4 vs. ZigBee
IEEE 802.15.4 IS NOTTHE SAME AS ZIGBEE!!!
16
• IPv6 over 802.15.4
• 6LoWPAN
• Blip
• RPL (IETF )
• ….
• Industrial Automation with IEEE 802.15.4
• WirelessHART
• ISA100
• …
Future of IEEE 802.15.4
17
• Embedded OS run inside the mote and take care of most of most of
the operations, always focusing on achieving a low power state
• This allows the programmer to focus on developing applications,
and staying away from low power tinkering
• Among the most popular, TinyOS and Contiki lead the research
Embedded Operating Systems
18
Introduction to TinyOS-2.x
19
Overview
•One of the first OSs to target WSNs
– currently the most widespread
• Emphasis is on memory consumption
– both program and data memory
• Open-source w/ rich component library
• Memory efficient
• Rich tool-chain
• Large code-base and user community
TinyOS Features:
•TinyOS is programmed in nesC
• nesC is a C-style language
• nesC provides the programming abstractions
– component based
• Split-phase execution
– return values arrive asynchronously through events
• Tasks provide the unit of concurrency
– typically spawned by events
– can be pre-empted by asynchronous events
– FIFO scheduling
• Pre-emptive threaded model with TOSThreads
Introduction to TinyOS-2.x
20
• TinyOS abstracts everything as a component:
– Components can be reused
– Components can be replaced
– Components can be hardware or software
21
Introduction to TinyOS-2.x
Component-oriented Programming
• Object-Oriented Programming:
– Focuses on the relationships between classes that are
combined into one large binary executable
• Component-Oriented Programming:
– Focuses on interchangeable code modules that work
independently and don't require you to be familiar
with their inner workings to use them.
22
Introduction to TinyOS-2.x
TinyOS Architecture
Sensing Comms Other Libraries
Application
Main (scheduler)
Hardware Abstractions (ADC, CLOCK, I2C, LEDS, PHOTO, UART, SPI)
23
Introduction to TinyOS-2.x
Compiling
24
Introduction to TinyOS-2.x
Contact Info:
Manuel Fernández
manuel.fernandez@advanticsys.com
25

TinyOS Course 00: Introduction to WSN

  • 1.
    WSN Programming Course Introductionto Wireless Sensor Networks Manuel Fernández UAH, 18th September 2013
  • 2.
    Contents •What areWireless SensorNetworks? •WSN Advantages & Challenges •Applications • Future ofWSN •What are Motes? •WSN Evolution • IEEE 802.15.4 • IEEE 802.15.4 vs. ZigBee • Future of IEEE 802.15.4 • Embedded Operating Systems • Introduction toTinyOS 2.x 2
  • 3.
    • A WirelessSensor Network (WSN) is a wireless network of small autonomous devices spatially distributed over a certain area that cooperatively monitor physical or environmental variables through their attached sensors, and transmit this information to a main location. What are WSNs? 3
  • 4.
    • Advantages: • Lowcost devices • Low power • Easy and quick to deploy • Scalability (increase network robustness) • Challenges: • Energy constrained • Limited memory and computation • Low Bandwidth WSN Advantages &Challenges 4
  • 5.
    • Monitoring ofobjects • Monitoring of areas • Monitoring of objects and areas Applications 5
  • 6.
    Monitoring of objects •Structural Monitoring • Condition-based Maintenance • Medical Diagnostics • Urban terrain mapping Example:Condition-based Maintenance Fabrication plants: • Sensors collect vibration data, monitor wear and tear; report data in real-time • Reduces need for a team of engineers; cutting costs by several orders of magnitude Applications 6
  • 7.
    Monitoring of areas •Environmental and Habitat Monitoring • PrecisionAgriculture • Indoor Climate Control • Military Surveillance •TreatyVerification • IntelligentAlarms Example: Precision agriculture • Precision agriculture aims at making agricultural operations more efficient and cost effective, while reducing environmental impact. • The information collected from sensors is used to evaluate optimum sowing density, estimate fertilizers and other inputs needs, and to more accurately predict crop yields. Applications 7
  • 8.
    Monitoring of objectsand areas •Wildlife Habitats • Disaster Management • Emergency Response • Ubiquitous Computing •AssetTracking • Health Care • Manufacturing Process Flows • … Applications 8
  • 9.
    Smart Home/Smart Office •Sensors controlling appliances and electrical devices in the house • Better lighting and heating in office buildings. Biomedical/Medical • Health Monitors:Glucose /Heart rate • Chronic disease: artificial retina/ cochlear implants • Hospital sensors: monitor vital signs/ record anomalies Traffic management & monitoring •Traffic flow • Real time routing update Industrial & Commercial •Agricultural crop conditions •Inventory tracking •Plant equipment maintenance monitoring •Automated problem monitoring Future of WSN 9
  • 10.
    • Low costand power computer • Sensors • Radio module • Storage • Power unit What are Motes? CONTROL SENSOR 3 10
  • 11.
  • 12.
    WSN Evolution • Firstdevelopments for military applications • At the end of the 90’s, the possibilities of this technology were very evident for researches & the industry across the globe. • In 2003 the IEEE 802.15.4 standard was formulated. The first embedded operating systems are developed • First WSN designs are distributed systems • Newest designs focus on in-node processing and actuation, and multipoint communication 12
  • 13.
    • In 2003the IEEE 802.15.4 standard was formulated, as an answer to the industry needs for a common communication stack among small devices • This stack is aimed towards low power consumption, and low data transfer rates • The communication stack focuses on the definition of the frequencies of operation, and how they physically access the medium IEEE 802.15.4 13
  • 14.
  • 15.
    802.15.4 802.11 (Wi-Fi) Bluetooth UWB (Ultra Wide Band) WirelessUSB IR Wireless Data Rate 20, 40, and 250 Kbits/s 11 & 54 Mbits/sec 1 Mbits/s 100-500 Mbits/s 62.5 Kbits/s 20-40 Kbits/s 115 Kbits/s 4 & 16 Mbits/s Range 10-800 meters 50-100 meters 10 meters <10 meters 10 meters <10 meters (line of sight) Networking Topology Ad-hoc, peer to peer, star, or mesh Point to hub Ad-hoc, very small networks Point to point Point to point Point to point Operating Frequency 868 MHz (Europe) 900-928 MHz (NA), 2.4 GHz (worldwide) 2.4 and 5 GHz 2.4 GHz 3.1-10.6 GHz 2.4 GHz 800-900 nm Complexity (Device and application impact) Low High High Medium Low Low Power Consumption (Battery option and life) Very low (low power is a design goal) High Medium Low Low Low IEEE 802.15.4 Tech comparison: 15
  • 16.
    IEEE 802.15.4 vs.ZigBee IEEE 802.15.4 IS NOTTHE SAME AS ZIGBEE!!! 16
  • 17.
    • IPv6 over802.15.4 • 6LoWPAN • Blip • RPL (IETF ) • …. • Industrial Automation with IEEE 802.15.4 • WirelessHART • ISA100 • … Future of IEEE 802.15.4 17
  • 18.
    • Embedded OSrun inside the mote and take care of most of most of the operations, always focusing on achieving a low power state • This allows the programmer to focus on developing applications, and staying away from low power tinkering • Among the most popular, TinyOS and Contiki lead the research Embedded Operating Systems 18
  • 19.
    Introduction to TinyOS-2.x 19 Overview •Oneof the first OSs to target WSNs – currently the most widespread • Emphasis is on memory consumption – both program and data memory • Open-source w/ rich component library • Memory efficient • Rich tool-chain • Large code-base and user community
  • 20.
    TinyOS Features: •TinyOS isprogrammed in nesC • nesC is a C-style language • nesC provides the programming abstractions – component based • Split-phase execution – return values arrive asynchronously through events • Tasks provide the unit of concurrency – typically spawned by events – can be pre-empted by asynchronous events – FIFO scheduling • Pre-emptive threaded model with TOSThreads Introduction to TinyOS-2.x 20
  • 21.
    • TinyOS abstractseverything as a component: – Components can be reused – Components can be replaced – Components can be hardware or software 21 Introduction to TinyOS-2.x
  • 22.
    Component-oriented Programming • Object-OrientedProgramming: – Focuses on the relationships between classes that are combined into one large binary executable • Component-Oriented Programming: – Focuses on interchangeable code modules that work independently and don't require you to be familiar with their inner workings to use them. 22 Introduction to TinyOS-2.x
  • 23.
    TinyOS Architecture Sensing CommsOther Libraries Application Main (scheduler) Hardware Abstractions (ADC, CLOCK, I2C, LEDS, PHOTO, UART, SPI) 23 Introduction to TinyOS-2.x
  • 24.
  • 25.