Help! How to use ADT7420 with Arduino

Hi, everybody.

I have bought ADT7420 temperature sensor.
I have connected it to Arduino, but I think it seems connection wrong or code is wrong.
Because there are very little information and code about it on internet, so I cannot find a solution.

Could you kindly give me suggestions?

I connected like it

I have used this code
http://www.ccad.sist.chukyo-u.ac.jp/~mito/ss/Embedded/Arduino/temp/index.htm

#include <I2C.h>
#define ADT 0x48

int i,ans;
long temp;

void setup()
{
  I2c.begin();        //
  Serial.begin(9600);  // start serial for output
  delay(10);
  I2c.read(ADT,0x0B,1);
  byte st=I2c.receive();
  Serial.print("ID:(0xCB):");
  Serial.println(st, HEX);
}

void loop()
{
  int i;
  byte xH,xL;

  Serial.print("temp:");
  I2c.read(ADT,0x0,2);
   xH = I2c.receive();
   xL = I2c.receive();
   Serial.print(xH,HEX);
   Serial.print(xL,HEX);
   Serial.print(": ");
   Serial.print(int (long(word(xH,xL)/8) * 100/16));
   Serial.println(":0.01deg");
  delay(500);
}

Then, result is

ID:(0xCB):CB
temp:A40: 2050:0.01deg
temp:A38: 2043:0.01deg
temp:A40: 2050:0.01deg
temp:A38: 2043:0.01deg
temp:A40: 2050:0.01deg
temp:A40: 2050:0.01deg
temp:A40: 2050:0.01deg

Thanks reply to me :slight_smile:

Regards.

Could you tell us more information about how you have connected it?

Rubén :wink:

Hi,

Its not often I get to contribute a solution but I'm slowly leanring so can perhaps start putting something back :slight_smile:

Here is my sketch to read the ADT7420.... enjoy

#include <Wire.h>

#define ADT7420Address 0x48
#define ADT7420TempReg 0x00
#define ADT7420ConfigReg 0x03
long tempReading = 0;
float temp;

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

void loop() 
{   readADT7420();
    delay(1000); }

void readADT7420()
{
  Wire.beginTransmission(ADT7420Address);
  Wire.write(0x03);
  Wire.write(B10100000); //Set 16bit mode and one-shot mode
  Wire.endTransmission();
  delay(250); //wait for sensor
  
  byte MSB;
  byte LSB;
  // Send request for temperature register.
  Wire.beginTransmission(ADT7420Address);
  Wire.write(ADT7420TempReg);
  Wire.endTransmission();
  // Listen for and acquire 16-bit register address.
  Wire.requestFrom(ADT7420Address,2);
  MSB = Wire.read();
  LSB = Wire.read();
  // Assign global 'tempReading' the 16-bit signed value.
  tempReading = ((MSB << 8) | LSB);
  if (tempReading > 32768)
  {tempReading = tempReading - 65535;
  temp = (tempReading/128.0)*-1;}
  else
  {temp = (tempReading/128.0);}
  Serial.print("Temperature: ");
  Serial.println(temp,2);
}

Hallo, I understand your problem is solved?,
I saw your picture and was wondering how, where you ordered the `ADT7420 (3) 2012 SBI?
And is this already soldered with the ADT7420?

regards,
Gaby

Where did you buy the flexible PCB that holds the ADT7420? I want to buy one also.
Thank you.