Project 3 - Duty Cycling

Due - Wednesday, October 1, 2008

The goal of this assignment is to give you experience with coordination in a sensor environment. For this assignment, you will extend your Movement Detection program from Project 2 such that the sensors duty cycle. The sensors will be on, communicating and detecting movement, for 5 seconds. followed by a deep sleeping period of 15 seconds. In order for the sensors to communicate and route messages for one another, the on periods will need to be synchronized.

The basic operation of the SPOTs will be to deep sleep for 15 seconds, wake, idle for 5 seconds, and return to deep sleep. During the idle period, a SPOT may detect movement. Whenever movement is detected during the idle period, the SPOT will send a movement detected message to the base station.  During the idle period the SPOT may also gather and report neighbor information to the base station.

To enable this, the base station program from Project 2 will be modified to facilitate coordination in the network. The base station will also follow the 5 seconds active/15 seconds idle cycle. During the active 5 seconds, the base station will send 5 synchronization messages, spaced 1 second apart. The synchronization messages will contain an integer to represent the message type followed by an integer to represent the relative time before the base station will return to idle state (recall: the base station will not go into deep sleep mode since it is connected to the USB interface).  Use 53 as the message type.

Upon receipt of a synchronization message, a SPOT can determine whether it is synchronized with the rest of the network. It should adjust the length of its awake cycle to ensure that it returns to deep sleep, and subsequently wakes again, at the same time as the base station.   It is strongly recommended that you read the paper An Energy-Efficient MAC Protocol for Wireless Sensor Networks as you implement your algorithm.

Additional Requirements and Details

  1. A SPOT should be able to join the network at any time and eventually synchronize with the remaining SPOTs. You will likely want to modify the SPOT startup procedure such that it does not begin the duty cycle until it has synchronized.
  2. The SPOTs may need to adjust their sleep/wake times every cycle to stay synchronized.
  3. The SPOTs are very picky about when the decide to go into deep sleep. You will likely need to use the ISleepManager to enable and disable deep sleep appropriately. You may also need to change the radio policy appropriately; please see the developer's guide regarding the on/off/automatic policy for the radio. Finally, you can set the RadiogramConnection to timeout if it does not receive a message after a given period of time.
Grad Students: In addition, grad students are responsible for designing, executing, and documenting an experiment to determine the amount of network traffic in the first iteration of your movement detection program (Project 1) versus the second iteration (Project 2).    This experiment will provide some insight into the number of collisions the network sees and the tradeoff of using unicast versus broadcast communication.  It is recommended that you use the I802_15_4_PHY interface and implement a data collection program to be run on a single SPOT in your network.  For the data collection, continuously sample the channel to determine whether it is clear (see plmeCCARequest()).  Compare the results in the broadcast network from project 1 to the unicast network from project 2.  In addition, vary the network configuration.  For example, you might try two configurations: one where all SPOTs are within range of all other SPOTs and one where some SPOTs only hear a subset of the others.

There are certainly better (yet, more complex) ways to design this experiment.  If you wish to execute a different experiment, see me first!  I would be happy to discuss it with you.

Due 3:30PM - Wednesday, October 1, 2008

  1. Complete and submit your working code. 
  2. Grad students: submit a 1-page document detailing the results of your experiment.  Include graphs where appropriate.
Note: No portion of your code may be copied from any other source including another text book, a web page, or another student (current or former). You must provide citations for any sources you have used in designing and implementing your program.
Sami Rollins