i2c ID

Hi everyone. I am new to the world of micro controllers and all that it brings.

I stumbled on the youtube clips and decided to have a go. My question is this.

Following Jeremy Blum/Arduino tutorials I had a go at 1408EGK tc740a temp sensor.

I understand that it is an I2c temp sensor.

How do I find it’s ID in the tutorial they use 72 but they state that it comes pre set any help would be great

Links ??

Check the data sheet. It should be there for any I2C addressable device.

One of the most useful bits of code I have for working with I2C is Nick Gammon’s I2C Scanner. It’s simple. It’s brute force. It works.

// I2C Scanner
// Written by Nick Gammon
// Date: 20th April 2011

#include <Wire.h>

void setup() {
  Serial.begin(115200);

  delay(5000);

  Serial.println ();
  Serial.println ("I2C scanner. Scanning ...");
  byte count = 0;
  
  Wire.begin();
  TWBR = 12;  // 400 kHz (maximum)
  //TWBR = 32;  // 200 kHz
  //TWBR = 72;  // 100 kHz (default)
  //TWBR = 152;  // 50 kHz
  //TWBR = 78;  // 25 kHz 
  //TWSR |= _BV (TWPS0);  // change prescaler
  //TWBR = 158;  // 12.5 kHz 
  //TWSR |= _BV (TWPS0);  // change prescaler

  for (byte i = 1; i < 120; i++)
  {
    Wire.beginTransmission (i);
    if (Wire.endTransmission () == 0)
      {
      Serial.print ("Found address: ");
      Serial.print (i, DEC);
      Serial.print (" (0x");
      Serial.print (i, HEX);
      Serial.println (")");
      count++;
      delay (1);  // maybe unneeded?
      } // end of good response
  } // end of for loop
  Serial.println ("Done.");
  Serial.print ("Found ");
  Serial.print (count, DEC);
  Serial.println (" device(s).");
}  // end of setup

void loop() {
Serial.println ("Loop.");
delay(20000);
}

Have fun with your projects.

  • Chip