CS
G250:Wireless Networks
Spring 2007
Sensor Network Project
|
Due
Date: Tuesday, March 27
|
In this project, you
will program a network of wireless sensor nodes. The code will be
developed over the TinyOS operating system and will run on a number of Tmote Sky sensors that we have
acquired recently. The assignment can be entirely
developed and simulated on your home
machine using the simulator TOSSIM, that is available with the TinyOS
distribution. You can work on this assignment in groups of
3. Each group will get 2 sensor
motes to play
around. These will not be enough for testing your code properly, but it
is enough to learn basic programming steps and be able to see simple
programs in action. For the project, you can simulate your code
on your home machine using
TOSSIM.
Once your code works well on the simulator, we can test it in the lab
with a larger collection of motes (10-12).
Here is some warm-up work to help
you prepare for your sensor programming project.
|
I. Installation
You can get Moteiv toolkit
installation CD from Tao Jin (@WVH208), or you could download it from
moteiv website. download
The installation guide could be downloaded from here.
Please note that we have limited number of motes and they are expensive,
so please take good care of your motes and make sure you return the
mote in working condition at the end of the semester.
|
II. Getting started
We strongly recommend you to test
your installation after you complete step 1. You could try installing
Blink application to your motes. Blink is a very simple nesC
application provided by TinyOS. You could install it by going through
the following steps.
connect 1 mote to the usb interface on your machine. (As to how to
install the driver, please refer the
quick start guide of moteiv)
$cd /opt/tinyos-1.x/apps/Blink
$make tmote
$make tmote reinstall,1
The LED blinking very quickly indicates that program is being written
to the mote. After the program is completely installed on the mote, the
Blink application will be automatically executed. The LED on the mote
will bink every 1 second.
Another application named Delta, is mentioned in the "Tmote Sky
Quick Start Guide".
Other tips:
Go to the TinyOS
tutorial, study Lesson 1 through 8. Pay attention to the sample
programs and programming model of NesC.
All the examples in the tutorial can be tried out on TOSSIM -
the
sensor network simulator. The command to compile a PC version of the
program is "make pc", and the program is stored under the build/pc
directory in your program directory.
|
III. Go through the
TinyOS tutorial
Go to the TinyOS
tutorial, study Lesson 1 through 8. Pay attention to the sample
programs and programming model of NesC.
All the examples in the tutorial can be tried out on TOSSIM -
the sensor network simulator. The command to compile a PC version of
the program is "Make pc", and the program is stored under the build/pc
directory in your program directory.
Read the TOSSIM tutorial
for issues in controlling the simulation.
Optional: Read the nesC Language
Reference Manual. (Lessons 1 through 8 of the TinyOS tutorial
should suffice for the assignment.)
|
IV. Toy project using
two motes
You have the first mote do light
sensing. If the light level is above a certain threshold, this mote
will notify the second mote via radio, so that the second mote will
turn on its LED. If the light sensed by the first mote is below some
threshold, it will send the notification to the second mote, and that
mote will turn off the LED.
This project is NOT required, thus won't
be graded. However, this would definitely help you prepare for the
final project, since you would know better about nesC, radio
communication, multihop, sensing data collection, etc. after you are
done with this toy project.
|
V. Sensor Programming
Project
Goal:
The goal of the sensor project is to set up a
shortest-path spanning tree over the nodes reachable from a central
node. After the whole network converges to the static topology,
the network should support the following features:
- Static Scenario:
Each mote in the network displays its hop-distance from the central
node on its LED. The LED would only allow a value up to 7 hops,
but we are not going to test it on networks of larger diameter.
- Dynamic Scenario:
Once you manually change the motes placement, say remove a certain
mote, the network should recover to static state within a short time,
say 1 minute. And the related motes should update their number of
hops on their LEDs.
- Path to the root:
Each mote is capable of sensing the TSR value. Once the value is below
a threshold predefined in your program, the mote sends an alarm back to
the central mote. And all motes along the route from this mote back to
the central mote should turn on an LED, so that the route could be
displayed.
- Network size: Your
code should work correctly on networks of up to 8 nodes and up to 4
hops.
Deliverables:
- A zip file containing the code, including a brief
description of the algorithm.
- A demo to the TA and instructor.
Extra Credit:
- Larger networks: If your code works correctly with larger
networks (say, 15 nodes or more), then some extra credit will be
given. One can demonstrate this using the simulator TOSSIM or a
real demo with our motes.
- Additional features: E.g., implementing a routing mechanism
over the spanning tree which can be demonstrated, displaying the
(potentially changing) spanning tree using a GUI, implementing a
broadcast or multicast protocol.
Hints:
- Collisions: One
problem you may have to deal with is collisions among transmissions,
especially in a dense neighborhood of sensors. A simple strategy
is to randomize the times at which nodes transmit. This may
prevent collisions to some extent, but would not guarantee reliable
delivery for large networks.
- Retransmissions:
For more reliable delivery, you can implement a simple retransmission
protocol in which the node
retransmits up to a MAX (say, 5) number of times, after
waiting a random period of time between retransmissions. You can set
up random waiting times using a timer. I would recommend trying
this approach only for large networks.
- Demo: When you work
with the actual sensors, you may notice that the default transmission
range is quite high (about 100 ms). You can use CC2420Control to
configure the transmission power. If you use the radio with
minimum transmission power,which has a range of around 0.5 meter.
This would make it easier to test and demonstrate your program in a
small area.
|
|