Things used in this project

Schematics

Pmod TMP3 and Arduino Uno Fritzing file
Fritzing file displaying the connection of the Pmod TMP3 to the Arduino Uno.
pmodtmp3arduinouno_cbyJQw38tL.fzz
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 CodeArduino
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

01aa44817a11ceb1a3050ebac4b68bbc
Martha Migliacio
1 project • 0 followers
Contact
Thanks to Lextronics.

Replications

Did you replicate this project? Share it!

I made one

Love this project? Think it could be improved? Tell us what you think!

Give feedback

Comments

Add projectSign up / Login