Tuesday, July 1, 2008

Battery Remaining Monitor

Task Description:
"Implement an application that collects energy information about the network. Periodically, each sensor collects its own battery remaining and reports this number to an application running on the host computer."[1]

Analysis:
This task is similar to Task 5 but much easier than Task 5. I just need to collect battery remaining information for each sensor and report it to the base station. The free-range spots use a thread to take battery remaining reading and broadcast the result each 20 seconds. The bast station also uses a endless thread to receive the report information and print it out.

Implementation:
1. How to get battery remaining
IPowerController ipc = Spot.getInstance().getPowerController();
... ipc.getVbatt();

Difficulty and Challenge:
The function "getVbatt()" can just get supply voltage that can roughly indicate the battery remaining so that I need more parameters to make the remaining information accurate. But due to using the green spots, there are some limitations to get them. For the blue spots, we can get much more information about battery by IBattery(com.sun.spot.peripheral.IBattery).

Time Distribution:

Task

Description

Deadline

End Date

Total Time (hrs)

6

Battery Information Monitor

07/18/2008

07/01/2008

12

Sub Task

Time

Read documents and new Sun Spot APIs

3

Finish the host application

1

Finish the spot application

2

Debug two applications and add some new functionalities

4.5

Miscellaneous Task (updating the blog, documents and so on)

1.5



[1]Quoted from the section "Task 6" of Class Requirement Document
Written by Professor Sami Rollins