Integrated Sensor Network - 3rd sem.

dr hab. inż. M. Wójcikowski

TinyOS – light sensor

     Read General Information to learn the basics of TinyOS and sensor network hardware from Crossbow.

1) Copy the folder tinyos-main\apps\Sense to your home directory. This is a simple application running on MicaMote node which reads the sensor.

2) Attach sensor board mda100 to the node iris and install is at docking station without the batteries.

3) Basing on the module SenseC and PhotoC from /home/student/tinyos-main/tos/sensorboards/mda100, write the application which will read the light sensor mda100. Instantiate PhotoC in SenseC application and use printf to display the measured values.

To use PhotoC module, you need to add a path in your Makefile :

CFLAGS += -I$(TOSDIR)/sensorboards/mda100

and include the header in each file (module *C.nc and configuration *AppC.nc):

#include "mda100.h"

4) Change the LEDs to present:

Led1 (yellow): light too low

Led2 (green): light in the range

Led3 (red): light too strong

Adjust the thresholds of the LEDs according to your situation.

5) Modify your project to simultaneously read both sensors (light and temperature):

-     Light: present readings using LEDs and print on the terminal.

-     Temperature: only print on the terminal.

 

Hints: use the module TempC for temperature sensor, the board in the lab has version cb.