Omron Thermal Sensor - I2C Addressing (and general usage)

Datasheet: http://media.digikey.com/pdf/Data%20Sheets/Omron%20PDFs/D6T44L_8L_Appl_Note.pdf I2C Tutorial: http://www.robot-electronics.co.uk/acatalog/I2C_Tutorial.html

I am having trouble identifying the address of the sensor from the datasheet. I understand that the format of an address is: 0x(num)(num). I think I saw it in the sample code but I'm not sure if it is just a sample ID or the real one. I could not find a specific sentence saying the id is xx.

Second, In the sample code, does anyone know what tPTAT and tPEC is?

I appreciate all the help! I know these are noob questions. I'm quite new to engineering, microcontrollers and inter-device communication.

There is an I2C "scanner" sketch which you can run on your arduino, which will detect any I2C devices which are properly connected to your arduino.

Your next step should be to download and run that sketch.

Most I2C devices have a fixed I2C bus address which they respond to. There is usually some method of selecting an alternative address, typically by setting one of the pins of the device to high, or low. Some devices have more complicated ways of setting the I2c address.

Thank you very much for the reply!
I was able to establish communication. Now, I’m having a little bit of trouble.

#include <Wire.h>

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

void loop()
{
  Serial.println("Next:");
  Wire.requestFrom(0x0a, 100);
  int a = Wire.available();
  while(Wire.available()>0){
    int b = Wire.read();
    Serial.println(b);
  }
  Serial.println(a);
  delay(1000);
}

Output:
Next:
255
255
255
(in total, 32 values of 255)
32

So there are 32 bits. And there happen to be 16 temperature pixels. I’m sure there is a connection.
On their sample code on the datasheet, I think this is what they are doing:
int a = readBuffer + readBuffer*256

I therefore attempted this code:

#include <Wire.h>

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

void loop()
{
  Serial.println("Next:");
  Wire.requestFrom(0x0a, 32);
  double a;
  while(Wire.available()>0){
    a = Wire.read();
    a = a + Wire.read()*256;
    Serial.println(a);
  }
  delay(100000);
}

Output:
-1
-1
-1
(in total, 16 values of -1)

Now, I found this very curious because -1 is typically used as a SENTINAL for error.
Additionally, 256+256*256 should not equal -1.

while(Wire.available()>0){
    a = Wire.read();
    a = a + Wire.read()*256;
  }

You check if there is more the ZERO but you read TWO. suppose there is only ONE available ;)

if the first returns 255 and the second returns -1 ==> a = -1

hint: while(Wire.available() >= 2) {

I see what you are saying but I don't quite understand. In the first code I had, the Wire.available() returned 32. So there are 32 bits available. Edit: I guess although there are 32 available, in practice(lol), there is a slight delay before the next one actually becomes available? I will still try Wire.available()>2 tomorrow in class. Because obviously what you are saying is what is happening.

Of course even if I am able to read 255 and 255, the sensor still is not sending the correct values. I attempted to point it at ice (to perhaps get the opposite end of the spectrum -- 0) but I still got 255 back. If anyone has any idea as to how to use this sensor, please let me know! It must be something wrong with my code, because the connection is solid (I think).

I appreciate the reply and will post how it works out!

What address does the I2C scanner find?

In the sample code in the PDF there are other addresses used than in your code...

0x0a was the address received.

And looks as thought that was correct because I finally got it to work. Turns out I had to send a command and then request data.

I have a question: 1. At the top of the second code for checking PEC values, it says, "see SMBus specifications." I could not find it anywhere on the PDF. What is it talking about? Are they the specific commands for the SMBus? Is SMBus specs (commands and stuff) standardized between all sensors or is it specific to each device? Cuz I could anything specific to my sensor.