I have a couple of issues with the TMP102 (Qwiic) and am hoping that someone has some advice to offer.
First issue - the Sparkfun supplied example “Example2_One-Shot_Temperature_Reading” hangs in loop() during the call to ```
sensor0.oneShot(1);
void loop()
{
Serial.println(“1”);
sensor0.oneShot(1); // Set One-Shot bit
Serial.println(“2”);
Second issue - since there was another example script (Example1_Basic_Temperature_Readings) I moved on to that to try my luck. This time I am able to read the temperature but get back wildly varying results. Looking at degrees F I would get back either a high or low value varying by about 20 degrees F. The temperatures seem to toggle back and forth between the high and low values as time goes on:
03:26:39.692 → Temperature: 75.87 Alert Pin: 0 Alert Register: 1
03:26:40.709 → Temperature: 75.87 Alert Pin: 0 Alert Register: 1
03:26:41.685 → Temperature: 53.94 Alert Pin: 0 Alert Register: 1
03:26:42.703 → Temperature: 53.94 Alert Pin: 0 Alert Register: 1
This made me sad and confused; then I changed the sample to output degrees C and noticed that the two values are related - the lower being 1/2 of the higher.
03:30:52.892 → Temperature: 12.19 Alert Pin: 0 Alert Register: 1
03:30:53.907 → Temperature: 12.19 Alert Pin: 0 Alert Register: 1
03:30:54.924 → Temperature: 24.44 Alert Pin: 0 Alert Register: 1
03:30:55.907 → Temperature: 24.44 Alert Pin: 0 Alert Register: 1
I then downloaded a couple pieces of code from the internet that interface directly with the TMP102 (one from TI) and neither of them vary like the Sparkfun example but both report the lower value - current ambient temperature is at/around the higher value. So now I am multiplying the degrees C value by 2 in order to get a "sane" reading with the non Sparkfun code but this does not leave me feeling good about using this part.
Anybody else have similar experiences? Maybe I got a bad one? Is there some special configuration that I can push to correct the issue? If I place my thumb on the sensor I do see the temperature rise and, then, lower when my thumb is removed.
Thanks for reading my novella ;)