tc74 temperature sensor and arduino

General project help for Adafruit customers

Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.
Locked
User avatar
jedihonor
 
Posts: 8
Joined: Tue Oct 11, 2011 12:23 am

tc74 temperature sensor and arduino

Post by jedihonor »

Hi,
I would like to connect 2 tc74 temperature sensors to the arduino and have searched high and low with no luck finding examples. I am using the microchip TC74A1. THe code below was found on the internet, author unknown. It works with one sensor.

I have used the I2C buss to connect the 1st sensor. How would I add a 2nd sensor. I would like to measure outside/ inside temp. I am unfamiliar how to address multiple sensors on the buss. Here is my code for the 1st sensor.

Code: Select all

#include "Wire.h"
//wire library

 // I assume this is the register address there the temp info is stored per the data sheet.  

#define address 0x49

#define delayC 1000
//delay count in ms

#define baudrate 9600
//baudrate for communication
byte val = 0;
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.write(val);

Wire.requestFrom(address, 1);
if (Wire.available()) {
temperature = Wire.read();
Serial.println(temperature);
} 

else {
Serial.println("---");
}
delay(1000);
}
Thank you for your time.
Scott

netpro
 
Posts: 1
Joined: Wed May 16, 2012 3:48 pm

Re: tc74 temperature sensor and arduino

Post by netpro »

I am not the most qualified to answer this but I am fairly certain that you wire them in series and use two different TC74s, for instance, TC74A1 should have an address of 0X49 and TC74A7 would be 0X4F. the I2C bus can call them by address on the same wire which is the beauty of I2C.

I am working on a similar project and learning as I go but that would be my best guess and I see that you posted this question some time ago so I considered any help may be better than none.

User avatar
adafruit_support_rick
 
Posts: 35092
Joined: Tue Mar 15, 2011 11:42 am

Re: tc74 temperature sensor and arduino

Post by adafruit_support_rick »

BANNED -

You can't connect two TC74A1's to the same bus, because they have the same I2C address. The suffix of the part number tells you the address: TC74Ax, where x=0..7. As BANNED points out, you would need two different part numbers to do what you're trying to do.

Locked
Please be positive and constructive with your questions and comments.

Return to “General Project help”