Go Down

Topic: Problems with tmp100 i2c temp sensor (Read 4120 times) previous topic - next topic

priya

Hello folks,

I'm trying to get tmp100 working with arduino fio. Here is the code
#define address 0x94
//address of the temperature sensor

#define delayC 1000
//delay count in ms

#define baudrate 9600
//baudrate for communication

#include <Wire.h>

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

void loop()
{
  Serial.print("temperature in Celsius: ");
  //let's signal we're about to do something

  int temperature;
  //temperature in a byte

  Wire.beginTransmission(address);
  //start the transmission

  Wire.send(0x00);

  Wire.requestFrom(address, 1);
  if (Wire.available()) {
    temperature = Wire.receive();
    Serial.println(temperature);
  } else {
    Serial.println("---");
  }

  Wire.endTransmission();
  //end the transmission

  delay(delayC);
}

When i run this code, i get "Temperature in celsius: ----" on serial monitor. I guess the device tmp100 is not giving any data to arduino over i2c. I checked address of tmp100 again and temperature register too. Both look fine. I don't understand what the problem is?
Please help!


WillR

Any chance you could post a link to the data sheet -- preferably from the manufacturers site? The one that shows the registers and recommended code is helpful. Who made it and what is the full part number.

Did you look for a library or working program for that device??
Just another Hacker

priya

Here's the link to manufacturers datasheet:
focus.ti.com/lit/ds/symlink/tmp100.pdf

The register is 0x00.

Thank you.

robtillaart

have you checked the forum yet ? - http://arduino.cc/forum/index.php/topic,10955.0.html

Rob
Rob Tillaart

Nederlandse sectie - http://arduino.cc/forum/index.php/board,77.0.html -
(Please do not PM for private consultancy)

priya

Thanks Rob. But i had checked that link already. I have tried some other variations in program also. Few libraries like I2Cmaster etc too!
Now i guess..the problem is in hardware, not the code. I have redesigned the tmp100 board. I'll get it manufactured in couple of days time and try out everything on it again.
Fingers crossed!


Priya.

wayneft

Problem is with your code.  You need a Wire.endTransmission after your Wire.send and you need to delete the Wire.endTransmission at the end of the sketch.
I2C GPS Shield

Checkout my Open Source GPS Tracker on Kickstarter

I have found an article about Arduino + TMP100 temperature sensor with Nokia 3310 LCD display here: http://avr.gamfrobotics.hu/?p=141

Go Up