TMP100_Temperature_Sensor__SKU_TOY0045_-DFRobot

Introduction

This temperature sensor used TMP100 chip is ideal for extended temperature measurement in a variety of communication,consumer, environmental,and instrumentation applications,etc... You can change the address or working voltage of the device depend on the environment.5V or 3.3V regular voltage input change by one tiny switch.I2C digital output communication ,easy to get temperature datas of different address,the resolution can be changed also. This sensor isable to be powered by 5V or 3.3V which make it compatile with both Gadgeteer, Arduino DUE 3.3V system and standard Arduino UNO/Mega 5V system.

Applications

Specification

Documents

Diagram

TOY0045 diagram

More details

TMP100 Rsgister Introduction

Address Pins and Slave Addresses

Steps:

  1. Change the address in the code(it should be matched with the board)
  2. Change the short current cap on the board according to the table
  3. Power the whole system again once change the address

Address Pins and Slave Addresses

Pointer Register introduction

Pointer Register Type

Resolution of the TMP100

Resolution of the TMP100

Configuration Register Format

Configuration Register Format For the TMP100,Shutdown Mode is enabled when the SD bit is 1. The device will shutdown once the current conversion is completed. For SD equal to 0, the device will maintain continuous conversion. The power-up/reset value of the Configuration Register is all bits equal to 0. The OS/ALERT bit will read as 1 after power-up/reset.

Byte of Temperature Register

Byte of Temperature Register

Sample Code

/*
 Sample code for the TMP100 Temperature sensor
 website:www.DFRobot.com

 Connection:

 VCC-5V
 GND-GND
 SDA-Analog pin 4
 SCL-Analog pin 5
*/

#include <Wire.h>
int tmpAddress = B1001011; //Slave Addresses set
int ResolutionBits = 10;   //Resolution set
void setup()
{
  Wire.begin();        // join i2c bus (address optional for master)
  Serial.begin(9600);  // start serial for output
  SetResolution();
}

void loop()
{
  getTemperature();
  delay(200);
}

float getTemperature()
{
  Wire.requestFrom(tmpAddress,2);
  byte MSB = Wire.read();
  byte LSB = Wire.read();
  int TemperatureSum = ((MSB << 8) | LSB) >> 4;
  float celsius = TemperatureSum*0.0625;
  Serial.print("Celsius: ");
  Serial.println(celsius);
}

void SetResolution(){
  if (ResolutionBits < 9 || ResolutionBits > 12) exit;
  Wire.beginTransmission(tmpAddress);
  Wire.write(B00000001); //addresses the configuration register
  Wire.write((ResolutionBits-9) << 5); //writes the resolution bits
  Wire.endTransmission();
  Wire.beginTransmission(tmpAddress); //resets to reading the temperature
  Wire.write((byte)0x00);
  Wire.endTransmission();
}