Unable to connect tmp117 with arduino uno R3

I got TMP117 it uses I2C communication protocol. I tried interfacing it with arduino uno. I got output "sensor not found". I tried with no pull up resistors, with internal and external pull up resistor, with only external pull resistance and with only internal pull up resistor. none of them worked, all gave same output. I also connect each one of them to 3.3V and 5V each on arduino uno as the operating voltage on its datasheet was mentioned from 1.7V to 5V. All of these gave the same output i.e. "sensor not found".
The external pull resistor I used is of 4.69 kohm.
Can someone please help me to figure out the problem?
TMP117 datasheet

#include <Wire.h>            // Used to establish serial communication on the I2C bus
#include <SparkFun_TMP117.h> // Used to send and recieve specific information from our sensor

// The default address of the device is 0x48 = (GND)
TMP117 sensor; // Initalize sensor

void setup()
{
  pinMode(A4, INPUT_PULLUP);  // SDA on Arduino Uno (pin A4)
  pinMode(A5, INPUT_PULLUP);  // SCL on Arduino Uno (pin A5)
  Wire.begin();
  Serial.begin(9600);    // Start serial communication at 9600 baud
  while(!Serial);
  Wire.setClock(400000);   // Set clock speed to be the fastest for better communication (fast mode)
  Serial.print("Current Device Address: ");
  Serial.println(sensor.getAddress(), HEX); // Prints the current address of the device in Hex
  Serial.println("TMP117 Example 1: Basic Readings");
  if (sensor.begin() == true) // Function to check if the sensor will correctly self-identify with the proper Device ID/Address
  {
    Serial.println("Begin");
  }
  else
  {
    Serial.println("Device failed to setup- Freezing code.");
    while (1); // Runs forever
  }
}

void loop()
{
  // Data Ready is a flag for the conversion modes - in continous conversion the dataReady flag should always be high
  if (sensor.dataReady() == true) // Function to make sure that there is data ready to be printed, only prints temperature values when data is ready
  {
    float tempC = sensor.readTempC();
    float tempF = sensor.readTempF();
    // Print temperature in °C and °F
    Serial.println(); // Create a white space for easier viewing
    Serial.print("Temperature in Celsius: ");
    Serial.println(tempC);
    Serial.print("Temperature in Fahrenheit: ");
    Serial.println(tempF);
    delay(500); // Delay added for easier readings
  }
}

GND --> GND
Vin ---> 3.3V
SDA --> A4
SCL --> A5


Link to datasheet?
Sketch?
Schematic?
Picture of wiring?

See How to get the best out of this forum.

I suggest trying a known working library, such as the one from Sparkfun.

Try running example 1.

If that does not run, please provide a wiring diagram and your code.

Welcome to the forum

Have you tried an I2C scanner to ascertain the address of the sensor ?

Please post your sketch, using code tags when yo do, and a schematic of your circuit

I tried using both libraries adafruit and sparfun.In example 1 also I got the same error.

I included this in the question now.

Yes, I tried the I2C scanner. I got one output initially; the address was 0x49.
However, when I tried again with all the ways mentioned above, I got the message "I2C device not found."
I searched on web, they suggest using level shifter. Will it help?

A level shifter will not help with your problem since both devices can operate at the same voltage level (5V).

Do you have a link to the specific breakout board you have?

yes.
TMP117 board link

Hi vidhi, Were you able to solve the problem?
You mentioned that you got a 0x49 address...

The pin number four of your tmp117 is tied to GND or VCC? Because if the pin 4 (ADD0) is connected to GND, the address would be 0x48, and if the pin 4 is connected to VCC then the addres would be 0x49

In case it is the second option, what happens if you change the tmp117.h file, line 70 to

bool begin(uint8_t sensorAddress = 0x49, TwoWire &wirePort = Wire);

In my case, I have the tmp117 connected as follows:

I made this piece of code without using any library to read the device ID value and it worked

#include <Wire.h>


//device address
#define TMP117_DEFAULT_ADDRESS                  0x48

// Registers
#define TMP117_TEMP_RESULT_REGISTER             0x00
#define TMP117_CONFIGURATION_REGISTER           0x01
#define TMP117_THIGH_LIMIT_REGISTER             0x02
#define TMP117_TLOW_LIMIT_REGISTER              0x03
#define TMP117_EEPROM_UNLOCK_REGISTER           0x04
#define TMP117_EEPROM1_REGISTER                 0x05
#define TMP117_EEPROM2_REGISTER                 0x06
#define TMP117_TEMP_OFFSET_REGISTER             0x07
#define TMP117_EEPROM3_REGISTER                 0x08
#define TMP117_DEVICE_ID_REGISTER               0x0F

uint16_t deviceId = 0;

void setup() {
  // put your setup code here, to run once:
  Serial.begin(115200);

  // Reading the 16-bit TMP117_DEVICE_ID_REGISTER to ensure the data is correct. It must return 0x0117
  Wire.beginTransmission(TMP117_DEFAULT_ADDRESS);
  Wire.write(TMP117_DEVICE_ID_REGISTER);
  Wire.requestFrom(TMP117_DEFAULT_ADDRESS, 2); 
  deviceId = Wire.read();
  deviceId <<= 8;
  deviceId |= Wire.read();
  Wire.endTransmission();
  Serial.println();
  Serial.print("TMP117 ID: 0x");
  Serial.println(deviceId, HEX);
}

void loop() {
  // put your main code here, to run repeatedly:

}

imagen

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.