tc74 temperature sensor and arduino

General project help for Adafruit customers

Moderators: adafruit_support_bill, adafruit

tc74 temperature sensor and arduino

Postby jedihonor » Sat Mar 03, 2012 10:32 pm

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
jedihonor
 
Posts: 8
Joined: Mon Oct 10, 2011 11:23 pm

Re: tc74 temperature sensor and arduino

Postby netpro » Wed May 16, 2012 3:19 pm

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.
netpro
 
Posts: 1
Joined: Wed May 16, 2012 2:48 pm

Re: tc74 temperature sensor and arduino

Postby adafruit_support_rick » Wed May 16, 2012 5:01 pm

jedihonor -

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 jedihonor points out, you would need two different part numbers to do what you're trying to do.
User avatar
adafruit_support_rick
 
Posts: 2892
Joined: Tue Mar 15, 2011 10:42 am
Location: Buffalo, NY


Return to General Project help

Who is online

Users browsing this forum: mibignistinly and 14 guests

Stuff to buy from the Adafruit store and links to product documentation!


New Products [102]

Raspberry Pi[80]
 
FLORA[23]
 
Bunnie Studios[9]
 
FPGA[1]
 
mbed[11]
Arduino[60]
 
NETduino[14]
 
BeagleBone[24]
 
Android[6]
 
XBee[10]
More Dev Boards[30]


 
BoArduino[8]
 
SpokePOV[4]
 
TV-B-Gone[4]
 
MiniPOV[3]
 
SIM reader[3]
 
Microtouch[5]
 
Clocks & Watches[18]
 
Drawdio[4]
 
Brain Machine[1]
 
Game of Life[2]
 
MintyBoost[2]
More DIY Kits[16]


 
MaKey MaKey[3]
 
Tweet-a-Watt[5]
 
Young Engineers[33]
 
Discover Electronics[2]
 
Snap Circuits[4]
 
littleBits[3]
 
Project packs[8]


 
Breakout Boards[33]
LCDs & Displays[48]
Components & Parts[69]
Batteries & Power[49]
EL Wire/Tape/Panel[52]
LEDs[109]
 
Wireless[14]
Cables[60]
 
Lasers[6]
Sensors/Parts[145]
 
Enclosures/Cases[11]
 
Solar[11]
 
RFID / NFC[13]
Prototyping[70]
 
iDevices[13]
Tools[71]
 
Wearables[39]
 
CNC[37]
 
Robotics[29]
 
3D printing[1]
 
Materials[24]


 
Stickers[41]
 
Skill badges[55]
 
Books[25]
 
Circuit Playground[7]
 
Gift Certificates[4]