Martha MigliacioAlex Wong
Published © GPL3+

Using the Pmod TMP3 with Arduino Uno

Application notes for Pmod TMP3 and Arduino Uno. In this app, the ambient temperature (in °F and °C) is displayed in the serial monitor.

EasyProtip1 hour310
Using the Pmod TMP3 with Arduino Uno

Things used in this project

Hardware components

Pmod TMP3
Digilent Pmod TMP3
×1
Arduino UNO & Genuino UNO
Arduino UNO & Genuino UNO
×1

Software apps and online services

Arduino IDE
Arduino IDE

Story

Read more

Schematics

Pmod TMP3 and Arduino Uno Fritzing file

Fritzing file displaying the connection of the Pmod TMP3 to the Arduino Uno.

Pmod TMP3 and Arduino Uno Fritzing Image

Fritzing image displaying the connection between the Pmod TMP3 and Arduino Uno.
Pmodtmp3arduinouno bb yp1wmyixqx

Code

Pmod TMP3 and Arduino Uno Code

Arduino
Using this code will display the ambient temperature in °F and °C in the serial monitor.
/************************************************************************
*
* Test of Pmod TMP3
*
*************************************************************************
* Description: Pmod_TMP3
* The ambient temperature (in ° F and ° C) is displayed in the serial monitor.
*
*
* Material
* 1. Arduino Uno
* 2. Pmod TMP3  (set jumpers JP1, JP2 and JP3 on GND)
*
************************************************************************/

#include <Wire.h> // call library
#define TCN75A_Adresse 0x48 // I2C adress of Pmod TMP3 module

int MSB;
int LSB;
int valeur;
float temperature;

void setup()
{
 Serial.begin(9600); // initialization of serial communication
 Wire.begin(); // initialization of I2C communication
 Init_TCN75A(); // initialization of Pmod TMP3
}

void loop()
{
 Wire.beginTransmission(TCN75A_Adresse); // Launch of the measure
 Wire.endTransmission();
 delay(10);
 Wire.requestFrom(TCN75A_Adresse, 2); // Recovery of the two bytes MSB and LSB
 if(Wire.available() <=2)
 {
  MSB = Wire.read();
  LSB = Wire.read();
 }
 valeur=LSB |(MSB<<8) ;
 valeur=valeur>> 4;
 temperature=valeur/16.00;
 Serial.print("MSB="); // display in serial monitor
 Serial.println(MSB);
 Serial.print("LSB=");
 Serial.println(LSB);
 Serial.print("Valeur=");
 Serial.println(valeur);
 Serial.print("Température en F = ");
 Serial.print(temperature*9/5 + 32,2);
 Serial.print(" ");
 Serial.print("Température en C = ");
 Serial.println(temperature, 2);
 delay(1000);
}

// Initialization of Pmod TMP3 module
void Init_TCN75A(void)
{
 Wire.beginTransmission(TCN75A_Adresse);
 Wire.write(0x01);
 Wire.write(0x60);
 Wire.endTransmission();
 Wire.beginTransmission(TCN75A_Adresse);
 Wire.write(0x00);
 Wire.endTransmission();
}

Credits

Martha Migliacio

Martha Migliacio

5 projects • 2 followers
Contact
Alex Wong

Alex Wong

5 projects • 6 followers
I work in Digilent and like creating projects
Contact
Thanks to Lextronics.

Comments

Add projectSign up / Login