Stalker V2.0 - TMP102 negative temps

Hi, The TMP102 library doesn’t produce output correctly for negative temperatures… instead it starts from 0=265 and works backwards… so -1 is reported as 255, -3.25 as 252.25 etc

Any clues how to fix the library so as to report the values correctly? Thanks.

Dear customer,

I’m not sure what is TMP102 you used with.
So better could you give a name?
If you show me a photo it could be more helpful.

Best regards,

Yuri

Hi Yuri,

The Stalker V2.0 has an onboard temperature sensor - the TMP102 - the code for the Stalker V2.0 is on the SeeedStudio Wiki and contains a Library for the TMP102 which is where I believe the problem lies. I am hoping you may be able to advise some changes to the TMP102 library code to solve this issue?

Thanks.

Hi customer,

This code is not compatible with Arduino 1.0 IDE please use Arduino 0023 IDE.
The following code had to be added for negative temperatures to work properly.

temperature = (MSB << 8 ) | LSB;
temperature >>= 4 ; // Value is left shifted in above table. Hence Right shift.
temperature = temperature & 0xFFF;

Also, a new library is uploaded to seeedstudio.com/wiki/Seeeduino_S … #Resources. Please test this.

Best regards,

Yuri

Hi Yuriq,

That works great - thank you.