ESP32 and TMP175 digital temperature sensor example

The TMP75 and TMP175 devices are digital temperature sensors ideal for NTC and PTC thermistor replacement. The devices offer a typical accuracy of ±1°C without requiring calibration or external component signal conditioning. IC temperature sensors are highly linear and do not require complex calculations or look-up tables to derive the temperature. The on-chip 12-bit ADC offers resolutions down to 0.0625°C. The devices are available in the industry standard LM75 SOIC-8 and MSOP-8 footprint.

The TMP175 and TMP75 feature SMBus, Two-Wire, and I2C interface compatibility. The TMP175 device allows up to 27 devices on one bus. The TMP75 allows up to eight 8 on one bus. The TMP175 and TMP75 both feature an SMBus Alert function.

The TMP175 and TMP75 devices are ideal for extended temperature measurement in a variety of communication, computer, consumer, environmental, industrial, and instrumentation applications.


  • TMP175: 27 Addresses
  • TMP75: 8 Addresses, NIST Traceable
  • Digital Output: SMBus™, Two-Wire™, and I2C
    Interface Compatibility
  • Resolution: 9 to 12 Bits, User-Selectable
  • Accuracy:
    • ±1°C (Typical) from –40°C to 125°C
    • ±2°C (Maximum) from –40°C to 125°C
  • Low Quiescent Current: 50-µA, 0.1-µA Standby
  • Wide Supply Range: 2.7 V to 5.5 V
  • Small 8-Pin MSOP and 8-Pin SOIC Packages



Module Connection ESP32 Connection
VCC 3v3
SDA SDA (21)
SCL SCL (22)



<pre>#include &lt;Wire.h&gt; 

byte TempHi;              // Variable hold data high byte
byte TempLo;              // Variable hold data low byte
boolean P_N;              // Bit flag for Positive and Negative
unsigned int Decimal;     // Variable hold decimal value

void Cal_Temp();
void setup() 
  Wire.begin();             // join i2c bus (address optional for master) 
                      Main Loop
void loop() 
  const int I2C_address = 0x37;  // I2C write address 
  Wire.write(1);             // Setup configuration register
  Wire.write(0x60);          // 12-bit
  Wire.write(0);             // Setup Pointer Register to 0
  while (1)
    // Read temperature value
    Wire.requestFrom(I2C_address, 2);
    while(Wire.available())          // Checkf for data from slave
      TempHi =;       // Read temperature high byte
      TempLo =;       // Read temperature low byte
    Cal_Temp ();
    // Display temperature
    Serial.print("The temperature is ");
    if (P_N == 0)
    Serial.println(" degree C");

void Cal_Temp()
  if (TempHi&amp;0x80)          // If bit7 of the TempHi is HIGH then the temperature is negative
    P_N = 0;
  else                      // Else the temperature is positive
    P_N = 1;
  TempHi = TempHi &amp; 0x7F;   // Remove sign
  TempLo = TempLo &amp; 0xF0;   // Filter out last nibble
  TempLo = TempLo &gt;&gt;4;      // Shift right 4 times
  Decimal = TempLo;
  Decimal = Decimal * 625;  // Each bit = 0.0625 degree C



open the serial monitor and you will see something like this

The temperature is 22.8125 degree C
The temperature is 22.8125 degree C
The temperature is 23.5625 degree C
The temperature is 23.6875 degree C
The temperature is 24.3750 degree C
The temperature is 24.6250 degree C
The temperature is 25.0 degree C
The temperature is 25.2500 degree C
The temperature is 25.4375 degree C



1pcs CJMCU-175 TMP175 27 Address Digital Temperature Sensor