Introduction: Measurement of Temperature Using ADT75 and Arduino Nano

ADT75 is a highly accurate, digital temperature sensor. It comprises of a band gap temperature sensor and a 12-bit analog to digital converter for monitoring and digitizing the temperature. Its highly sensitive sensor makes it competent enough to measure the ambient temperature accurately.

In this tutorial the interfacing of the ADT75 sensor module with arduino nano has been illustrated. To read the temperature values, we have used arduino with an I2c adapter.This I2C adapter makes the connection to the sensor module easy and more reliable.

Step 1: Hardware Required:

The materials that we need for accomplishing our goal includes the following hardware components:

1. ADT75

2. Arduino Nano

3. I2C Cable

4. I2C Shield for Arduino Nano

Step 2: Hardware Hookup:

The hardware hookup section basically explains the wiring connections required between the sensor and the arduino nano. Ensuring correct connections is the basic necessity while working on any system for the desired output. So, the requisite connections are as follows:

The ADT75 will work over I2C . Here is the example wiring diagram, demonstrating how to wire up each interface of the sensor.

Out-of-the-box, the board is configured for an I2C interface, as such we recommend using this hookup if you’re otherwise agnostic.

All you need is four wires! Only four connections are required Vcc, Gnd, SCL and SDA pins and these are connected with the help of I2C cable.

These connections are demonstrated in the pictures above.

Step 3: Code for Measurement of Temperature:

Lets start with the arduino code now.

While using the sensor module with the arduino, we include Wire.h library. "Wire" library contains the functions which facilitate the i2c communication between the sensor and the arduino board.

The entire arduino code is given below for the convenience of the user:

<p>#include<Wire.h></p><p><wire.h>// ADT75 I2C address is 0x48(72)</wire.h></p><p><wire.h>#define Addr 0x48</wire.h></p><p><wire.h>void setup()</wire.h></p><p><wire.h>{  </wire.h></p><p><wire.h>// Initialise I2C communication as Master  </wire.h></p><p><wire.h>Wire.begin();  </wire.h></p><p><wire.h>// Initialise serial communication, set baud rate = 9600  </wire.h></p><p><wire.h>Serial.begin(9600);  </wire.h></p><p><wire.h>delay(300);</wire.h></p><p><wire.h>}
void loop()</wire.h></p><p><wire.h>{  </wire.h></p><p><wire.h>unsigned int data[2];</wire.h></p><p><wire.h>// Start I2C transmission  </wire.h></p><p><wire.h>Wire.beginTransmission(Addr);  </wire.h></p><p><wire.h>// Select data register  </wire.h></p><p><wire.h>Wire.write(0x00);  </wire.h></p><p><wire.h>// Stop I2C transmission  </wire.h></p><p><wire.h>Wire.endTransmission();</wire.h></p><p><wire.h>// Request 2 byte of data  </wire.h></p><p><wire.h>Wire.requestFrom(Addr, 2);</wire.h></p><p><wire.h>// Read 2 bytes of data  </wire.h></p><p><wire.h>// temp msb, temp lsb  </wire.h></p><p><wire.h>if (Wire.available() == 2)  </wire.h></p><p><wire.h>{    </wire.h></p><p><wire.h>data[0] = Wire.read();    </wire.h></p><p><wire.h>data[1] = Wire.read();  </wire.h></p><p><wire.h>}</wire.h></p><p><wire.h>// Convert the data to 12 bits  </wire.h></p><p><wire.h>int temp = ((data[0] * 256) + data[1]) / 16;  </wire.h></p><p><wire.h>if(temp > 2047)  </wire.h></p><p><wire.h>{  	</wire.h></p><p><wire.h>temp -= 4096;	  </wire.h></p><p><wire.h>}  </wire.h></p><p><wire.h>float cTemp = temp * 0.0625;  </wire.h></p><p><wire.h>float fTemp = (cTemp * 1.8) + 32;</wire.h></p><p><wire.h>// Output data to serial monitor  </wire.h></p><p><wire.h>Serial.print("Temperature in Celsius : ");  </wire.h></p><p><wire.h>Serial.print(cTemp);  </wire.h></p><p><wire.h>Serial.println(" C");  </wire.h></p><p><wire.h>Serial.print("Temperature in Fahrenheit : ");  </wire.h></p><p><wire.h>Serial.print(fTemp);  </wire.h></p><p><wire.h>Serial.println(" F");  </wire.h></p><p><wire.h>delay(500);</wire.h></p><p><wire.h>}</wire.h></p>

In wire library Wire.write() and Wire.read() is used to write the commands and read the sensor output.

Serial.print() and Serial.println() is used to display the output of the sensor on the serial monitor of the Arduino IDE.

The output of the sensor is shown in the picture above.

Step 4: Applications:

ADT75 is a highly accurate, digital temperature sensor. It can be employed in a wide range of systems including environmental control systems, computer thermal monitoring etc. It can also be incorporated in industrial process controls as well as power system monitors.

Comments