Arduino Uno r3 + TMP 102 Problem

I have a problem with the Arduino Uno R3 and the TMP102 sensors at the moment of Address Pin and Slave Addresses, when according to polarize the sensor specifications listed on the datasheet, the Arduino is blocked.

The TMP102 sensor datasheet: https://www.sparkfun.com/datasheets/Sen … tmp102.pdf On page 10, Table 12 is the setting for 4 sensors

The code that I use for the Arduino Uno R3 is:

#include <Wire.h>

int tmp102Address = 0x49;

void setup(){
  
  Serial.begin(9600);
  Wire.begin();
  
}

void loop(){

  float celsius = getTemperature();
  Serial.print("Celsius: ");
  Serial.println(celsius);
  
  delay(200);
  
}

float getTemperature(){
  Wire.requestFrom(tmp102Address,2); 

  byte MSB = Wire.read();
  byte LSB = Wire.read();

  //it's a 12bit int, using two's compliment for negative
  int TemperatureSum = ((MSB << 8) | LSB) >> 4; 

  float celsius = TemperatureSum*0.0625;
  return celsius;
}

Thanks in advance for the solution.

Jhon C.:
I have a problem with the Arduino Uno R3 and the TMP102 sensors at the moment of Address Pin and Slave Addresses, when according to polarize the sensor specifications listed on the datasheet, the Arduino is blocked.

Please rephrase that, because it does not sound like english, and certainly does not make sense.

The TMP102 sensor datasheet: https://www.sparkfun.com/datasheets/Sen … tmp102.pdf On page 10, Table 12 is the setting for 4 sensors

The code that I use for the Arduino Uno R3 is:

int tmp102Address = 0x49;

How did you have pin A0 connected? To Ground, V+, SDA or SCL, or left unconnected?

EDIT: on the board the (solder) jumper only allows to connect to Ground or V+.

I followed the instruction on the datasheet, but the sensor isn’t working. If I connect the Pin A0 to V+ “Arduino” is blocked.

Comments:

Binary to hex

1001001 = 0x49

With the address 0x49 (hex), I have pin A0 connected to V+

If you look at this thread:

https://forum.sparkfun.com/viewtopic.php?f=14&t=41095

you’ll see my recommendation to remove the solder bridge connecting A0 to ground and bridge the A0 to V+ there on the board. Attempting to connect A0 to V+ at the board’s header connections along the edge of the board will only cause a short circuit since the connection to GND is already done on the board.

Subsequently, the OP reported that they tried it without success (but also indicated that they damaged the center pad).

I maintain that this is the correct way to connect A0 to V+.

Jhon C.:
I followed the instruction on the datasheet, but the sensor isn’t working. If I connect the Pin A0 to V+ “Arduino” is blocked.

Comments:

Binary to hex

1001001 = 0x49

With the address 0x49 (hex), I have pin A0 connected to V+

Ok, V+ then. 1001001 binary does translate to 0x49. Except, it is wrong as an address! You see, that binary number must be preceded with the R/W bit, which is the least significant bit of the entire address. So you need to shift that binary number 1001001 to the left (multiply by 2), and add 1 if it is read, and not if it is written. You can see this in figure 13 of the datasheet. It shows the Read/Write bit on the right of the bit-train.

So if you connected the ADD0 pin to V+ then the actual address to use to write would be 2x 0x49 = 0x92. And 0x93 if you want to read from it.

Additionally, you can find this in the example code shown on the product page:

in the tmp102.zip-file in tmp102.c:

#define TMP_RD	 	0x93
#define TMP_WR	 	0x92 //Assume ADR0 is tied to VCC