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
}
}
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?
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