menu

Back To Home

Tuesday, December 24, 2019

TC74 I2C temperature sensor using arduino uno R3

In this video we going to use TC74 temp sensor IC. The IC uisng I2C communication protocol. I use arduino uno R3  to read the data and display in laptop monitor.

About I2C:
https://en.wikipedia.org/wiki/I%C2%B2C


TC74 connection to arduino uno R3  :

PIN2-SDA(A04)
PIN3-Arduino GND
PIN4-SCL(A05)
PIN5-5V




Arduino program:

#include <Wire.h>

int temp_address=72;

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

void loop()
{


Wire.beginTransmission(temp_address);
Wire.write(0);
Wire.endTransmission();
Wire.requestFrom(address, 1);

while (Wire.available()==0);
int c = Wire.read();
int f =round(c*9.0/5.0+32.0);
Serial.print(c);
Serial.print("C,");
Serial.print(f);
Serial.print("F");

delay(5000);
}




No comments:

Post a Comment