Pages: [1]   Go Down
Author Topic: Problems with tmp100 i2c temp sensor  (Read 3798 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Newbie
*
Karma: 0
Posts: 5
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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!
 
Logged

Georgina Ontario
Offline Offline
Sr. Member
****
Karma: 5
Posts: 437
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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

Just another Hacker

Offline Offline
Newbie
*
Karma: 0
Posts: 5
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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

The register is 0x00.

Thank you.
Logged

Global Moderator
Netherlands
Offline Offline
Shannon Member
*****
Karma: 211
Posts: 13531
In theory there is no difference between theory and practice, however in practice there are many...
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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

Rob
Logged

Rob Tillaart

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

Offline Offline
Newbie
*
Karma: 0
Posts: 5
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
Logged

Worcester, MA
Offline Offline
God Member
*****
Karma: 3
Posts: 623
Arduino rocks
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
Logged

I2C GPS Shield

Checkout my Open Source GPS Tracker on Kickstarter

Offline Offline
Newbie
*
Karma: 0
Posts: 1
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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

Pages: [1]   Go Up
Jump to: