25
WSN Programming Course Introduction to Wireless Sensor Networks Manuel Fernández UAH, 18th September 2013

TinyOS Course 00: Introduction to WSN

Embed Size (px)

DESCRIPTION

Lesson 00 slides for one day introductory course on wireless sensor networks and TinyOS, that took place at the University of Alcalá de Henares in Madrid Spain the 18th of September 2013. This course was jointly designed by the Electronics Department of the university and Advanticsys. Find source code for the lessons here: http://www.advanticsys.com/wiki/index.php?title=TinyOS%C2%AE_Course_at_UAH_18th_September_2013

Citation preview

Page 1: TinyOS Course 00: Introduction to WSN

WSN Programming Course

Introduction to Wireless Sensor Networks

Manuel Fernández

UAH, 18th September 2013

Page 2: TinyOS Course 00: Introduction to WSN

Contents

• What are Wireless Sensor Networks? • WSN Advantages & Challenges • Applications • Future of WSN • 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 to TinyOS 2.x

2

Page 3: TinyOS Course 00: Introduction to WSN

• 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

Page 4: TinyOS Course 00: Introduction to WSN

• 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

Page 5: TinyOS Course 00: Introduction to WSN

• Monitoring of objects • Monitoring of areas • Monitoring of objects and areas

Applications

5

Page 6: TinyOS Course 00: Introduction to WSN

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

Page 7: TinyOS Course 00: Introduction to WSN

Monitoring of areas • Environmental and Habitat Monitoring • Precision Agriculture • Indoor Climate Control • Military Surveillance • Treaty Verification • Intelligent Alarms

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

Page 8: TinyOS Course 00: Introduction to WSN

Monitoring of objects and areas • Wildlife Habitats • Disaster Management • Emergency Response • Ubiquitous Computing • Asset Tracking • Health Care • Manufacturing Process Flows • …

Applications

8

Page 9: TinyOS Course 00: Introduction to WSN

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

Page 10: TinyOS Course 00: Introduction to WSN

• Low cost and power computer • Sensors • Radio module • Storage • Power unit

What are Motes?

CONTROL

SENSOR 3

10

Page 11: TinyOS Course 00: Introduction to WSN

• CM5000

What are Motes?

11

Page 12: TinyOS Course 00: Introduction to WSN

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

Page 13: TinyOS Course 00: Introduction to WSN

• 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

Page 14: TinyOS Course 00: Introduction to WSN

IEEE 802.15.4

Page 15: TinyOS Course 00: Introduction to WSN

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

Page 16: TinyOS Course 00: Introduction to WSN

IEEE 802.15.4 vs. ZigBee

IEEE 802.15.4 IS NOT THE SAME AS ZIGBEE!!!

16

Page 17: TinyOS Course 00: Introduction to WSN

• 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

Page 18: TinyOS Course 00: Introduction to WSN

• 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

Page 19: TinyOS Course 00: Introduction to WSN

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

Page 20: TinyOS Course 00: Introduction to WSN

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

Page 21: TinyOS Course 00: Introduction to WSN

• 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

Page 22: TinyOS Course 00: Introduction to WSN

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

Page 23: TinyOS Course 00: Introduction to WSN

TinyOS Architecture

Sensing Comms Other Libraries

Application

Main (scheduler)

Hardware Abstractions (ADC, CLOCK, I2C, LEDS, PHOTO, UART, SPI)

23

Introduction to TinyOS-2.x

Page 24: TinyOS Course 00: Introduction to WSN

Compiling

24

Introduction to TinyOS-2.x

Page 25: TinyOS Course 00: Introduction to WSN

Contact Info: Manuel Fernández

[email protected]

25