example distributed sensor network with tinyos motes rpi ecse – 6965/4694 daniel casner 2007 april...

18
Example Distributed Sensor Network with TinyOS Motes RPI ECSE – 6965/4694 Daniel Casner 2007 April 13th

Upload: lenard-richards

Post on 03-Jan-2016

218 views

Category:

Documents


1 download

TRANSCRIPT

Page 1: Example Distributed Sensor Network with TinyOS Motes RPI ECSE – 6965/4694 Daniel Casner 2007 April 13th

Example Distributed Sensor Network with TinyOS Motes

RPI ECSE – 6965/4694

Daniel Casner

2007 April 13th

Page 2: Example Distributed Sensor Network with TinyOS Motes RPI ECSE – 6965/4694 Daniel Casner 2007 April 13th

2007 April 13th Daniel Casner 2

Outline

• Hardware

• Applications

• Implementation (software)

Page 3: Example Distributed Sensor Network with TinyOS Motes RPI ECSE – 6965/4694 Daniel Casner 2007 April 13th

2007 April 13th Daniel Casner 3

Hardware

Page 4: Example Distributed Sensor Network with TinyOS Motes RPI ECSE – 6965/4694 Daniel Casner 2007 April 13th

2007 April 13th Daniel Casner 4

Hardware

• Processing– ATmega128L– 7MHz– 64Kb RAM

• Radio– 900 MHz– 38.4 Kbps

• Storage– Program: 128Kb flash– Data: 512Kb flash

• Sensors (10 bit ADC)– Magnetometer (x,y)– Microphone– Photo– Seismic– Temperature

• Actuators– Piezoelectric buzzer

Page 5: Example Distributed Sensor Network with TinyOS Motes RPI ECSE – 6965/4694 Daniel Casner 2007 April 13th

2007 April 13th Daniel Casner 5

Applications

• Temperature Estimation– Measure local temperature– Repeatedly average with neighbors– Converges to global average

• Event Notification– Detect an event– Notify whole network

Page 6: Example Distributed Sensor Network with TinyOS Motes RPI ECSE – 6965/4694 Daniel Casner 2007 April 13th

2007 April 13th Daniel Casner 6

Initializing the Network

Storeneighbor

information

Power OnWait to hear

from neighborsIs new?

No

Yes

Broadcastexistence Hear from

neighbor

Periodically rebroadcast our

existence

Page 7: Example Distributed Sensor Network with TinyOS Motes RPI ECSE – 6965/4694 Daniel Casner 2007 April 13th

2007 April 13th Daniel Casner 7

Source Code

Page 8: Example Distributed Sensor Network with TinyOS Motes RPI ECSE – 6965/4694 Daniel Casner 2007 April 13th

2007 April 13th Daniel Casner 8

Distributed averaging algorithm

1. Take a number

2. Pick a random person

3. Average your two numbers

4. Both of you store the new number• It should be between 1 and 100

5. Go to step 2 and repeat

6. When you see the same number several times in a row, sit down.

Page 9: Example Distributed Sensor Network with TinyOS Motes RPI ECSE – 6965/4694 Daniel Casner 2007 April 13th

2007 April 13th Daniel Casner 9

Even node j

On the MotesOdd node i

Send current estimate to random odd neighbor

Update local estimate

Measure local temperature

Measure local temperature

Receive message

Messagetype Returned

estimateNACK

Receive message

Average with local estimate

Send NACK

Send update

Is busy?NoYes

Page 10: Example Distributed Sensor Network with TinyOS Motes RPI ECSE – 6965/4694 Daniel Casner 2007 April 13th

2007 April 13th Daniel Casner 10

Deadlock

1

4 2

3

Now what?

Page 11: Example Distributed Sensor Network with TinyOS Motes RPI ECSE – 6965/4694 Daniel Casner 2007 April 13th

2007 April 13th Daniel Casner 11

With Even/Odd Roles

1

4 2

3

Page 12: Example Distributed Sensor Network with TinyOS Motes RPI ECSE – 6965/4694 Daniel Casner 2007 April 13th

2007 April 13th Daniel Casner 12

Source Code

Page 13: Example Distributed Sensor Network with TinyOS Motes RPI ECSE – 6965/4694 Daniel Casner 2007 April 13th

2007 April 13th Daniel Casner 13

Multi-hop event routingAt each node: Node i

Network initialization(identify all neighbors)

Initialize sensors

Send event notification to all

neighbors k ≠ j ≠ i

Node j

Detect eventReceive event

notification from neighbor

Page 14: Example Distributed Sensor Network with TinyOS Motes RPI ECSE – 6965/4694 Daniel Casner 2007 April 13th

2007 April 13th Daniel Casner 14

Source Code

Page 15: Example Distributed Sensor Network with TinyOS Motes RPI ECSE – 6965/4694 Daniel Casner 2007 April 13th

2007 April 13th Daniel Casner 15

References

• Source code on LMS• TinyOS – www.tinyos.net

– Download– Tutorials– Examples

• Crossbow – www.xbow.com– Mica2 Motes

• UC Berkeley – webs.cs.berkeley.edu– Original TinyOS and Mote development

Page 16: Example Distributed Sensor Network with TinyOS Motes RPI ECSE – 6965/4694 Daniel Casner 2007 April 13th

2007 April 13th Daniel Casner 16

Page 17: Example Distributed Sensor Network with TinyOS Motes RPI ECSE – 6965/4694 Daniel Casner 2007 April 13th

2007 April 13th Daniel Casner 17

Mica2 Specifications

Page 18: Example Distributed Sensor Network with TinyOS Motes RPI ECSE – 6965/4694 Daniel Casner 2007 April 13th

2007 April 13th Daniel Casner 18

Demonstrations

Off / Initializing

Neighbor discovery

Switching modes

Temp estimation

Photo event

detection

Event detected