3 years, 8 months ago.

Connecting two TMP102 to mbed1768

When I connect two TMP102 to mbed 1768, with one address pin to ground and the other to 3.3 V. Both sensor read the same, even when they are at different temperatures. I have attached the image of the code. The SCL and SDA are pulled up to 3.3V with 2.2 KOhm resistors. What is the problem? /media/uploads/atehrani/hw5_program2.pdf

1 Answer

3 years, 8 months ago.

The slaveaddress for the TMP102 device is either 0x90, 0x92, 0x94 or 0x96. See table 4 in the TMP102 datasheet.

In your case you have defined the addresses as 0x90 and 0x91. The mbed I2C libs use the 8bit address convention, meaning that the least significant bit should always be 0 as it will be used to select the I2C read or write operation. This means that both addresses end up being used as 0x90 and thus the code always selects the same TMP102 device. Change your code to use addresses as 0x90 and 0x92.

Accepted Answer

Thank you, yes that was the problem, I used the addresses 0x90 and 0x92; both sensors work fine now.

posted by Atoussa Tehrani 11 Oct 2017