[Tinyos-help] problems with temperature readings

Daniel Villón daniel.villon at gmail.com
Wed Jun 7 09:44:09 PDT 2006


Hi,

I am using a MICAz with an MDA300 to do temperature and light readings. I've
seen the posts about the problem of using the temperature sensor and the
radio because they share one pin. I also have seen the modified
PhotoTempM.nc module which is supposed to resolve the problem (look
../platform/micaz), I included in my project.
Now that I have done those changes, I'm trying to receive the the data and
this is what I get:

  01 BE 03 88 00

where 01 is the mote number, 03BE is the light reading and 0088 is the
temperature reading... I have more readings but they are almost the same.
The problem is that when I do the conversion for the temperature sensor, I
get a -10 C which is impossible because I'm into a room and it is very far
from the 30 C that we have now. Now I don't know if it is a problem of the
shared pin, or if it is a problem of the formula (Which I don't think it
is), or what is it?, there is something strange going on too, when I put my
hand over the light sensor, the light and the temperature reading
changes...both.
I attach a part of the program when I do the readings of the light and
temperature, maybe I need to change the way I do it in order to get a
correct temperature reading.

event result_t Timer.fired(){            // every time the timer fires it
has to make a reading of both sensors

        if (cont < 59) cont++;
        else cont=0;

        if (cont == 59) return call ADC2.getData();

        return SUCCESS;
    }

    async event result_t ADC2.dataReady(uint16_t data){         // reading
of temperature sensor as it is done in the tutorial


            atomic{
            data2 = data;
            }

       return  call ADC1.getData();

        }


    async event result_t ADC1.dataReady(uint16_t data) {    // reading of
the light sensor as it is done in the tutorial

            atomic{
            data1 = data;
            }


            atomic{
            //current
data                                                         // here I do
the arrengement of the data to send it
            ptrmsg->actual.nodo = TOS_LOCAL_ADDRESS;
            ptrmsg->actual.sensor1 = data1;
            ptrmsg->actual.sensor2 = data2;
            dada1++;
            ptrmsg->dada1 = dada1;
            }


        post envio
();                                                          // envio = send
, it goes to a post where the data is sended

        return SUCCESS;
    }

task void envio () {
        ptrmsg =  call SendMHopMsg.getBuffer(msgptr, &len);

        call SendMHopMsg.sendTTL(0x00,sizeof(datos), msgptr,0);

    }

I hope I was clear enough and somebody can help me


Daniel Villón V.
-----------------------------------------------------------
Departamento de Ingeniería Telemática.
Universitat Politècnica de Catalunya
-----------------------------------------------------------
C/. Jordi Girona 1-3
Modulo C3 Laboratorio 003
Barcelona CP 08034, España
Teléfono: +34 93 289 36 71
Celular:   +34 697 91 43 53
e-mail: dvil1541 at alu-etsetb.upc.edu
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.millennium.berkeley.edu/pipermail/tinyos-help/attachments/20060607/e76a1935/attachment.htm


More information about the Tinyos-help mailing list