Bad SEN-18521 ?

Hi All,

I purchased the Qwiik digital temperature sensor (SEN-18521), and have recently hooked it up to a raspberry pi 4 using the tutorial. The code runs and it outputs a temperature. I’m using this sparkfun tutorial <LINK_TEXT text="https://learn.sparkfun.com/tutorials/py … re-sensor
">https://learn.sparkfun.com/tutorials/python-programming-tutorial-getting-started-with-the-raspberry-pi/experiment-4-i2c-temperature-sensor
</LINK_TEXT>

My issue is that the temperature is clearly wrong. It consistently outputs a temperature that is low by ~10 degrees C. (testing in a well controlled indoor environment). The temperature does change if I heat or cool the sensor.

Reading the tmp102.pdf (linked in the item description, and I’ve attached to this post) shows that there is a specific read-only configuration register that should be set to 0b01100000. On my device it is set to 0b01000000, but because it is a read only value I cannot change it. I’m thinking this may be the issue for two reasons.

  1. the documentation says “The converter resolution bits, R1 and R0, are read-only bits. The TMP102 converter resolution is set at device start-up to 11 which sets the temperature register to a 12 bit-resolution.”

  2. in the example, there is a screenshot in the tutorial I linked that shows a the first byte of the config register being set to 96 (which would be 0b01100000, and matches the documentation)

Has anyone else seen this issue? I’m hoping that either I made a mistake that someone can point me to the solution, or that someone knows how I calibrate this sensor with R1 being set to 1 and R0 being set to 0.

Thanks!

tmp102.pdf (639 KB)

The tutorial you’re following looks like it’s for a different sensor than you have, that might be part of your problem. I’m actually surprised the sensor works at all with the code you’re using.

Have you tried connecting the sensor to an arduino and using the library written for it to see if it reports the correct temperature that way?

Have you tried the examples here?

https://learn.sparkfun.com/tutorials/di … n-examples

Thank you both!

The example code worked flawlessly. So now i’m working through the code differences to see where my breakdown in understanding is.

Thanks again!