This Example demonstrates the TMP006 IR temperature sensor.

Example Video

Hardware Required

  • TI LaunchPad

  • Educational BoosterPack MKII


None. This basic example just uses your LaunchPad and BoosterPack only.


 Infrared temp sensor TMP006 example for Educational BoosterPack MK II

Modified 03 Dec 2013
by Dung Dang

This example code is in the public domain.
#include "Adafruit_TMP006.h"
#define USE_USCI_B1

Adafruit_TMP006 tmp006;
void printFloat(float value, int places) ;

void setup()

  // Initalizes the TMP006 for operation and for I2C communication
  if (! tmp006.begin(TMP006_CFG_8SAMPLE)) {
    Serial.println("No sensor found");
    while (1);

void loop()
  float objt = tmp006.readObjTempC();
  Serial.print("Object Temperature: "); Serial.print(objt); Serial.println("*C");
  float diet = tmp006.readDieTempC();
  Serial.print("Die Temperature: "); Serial.print(diet); Serial.println("*C");

  delay(1000); // 4 seconds per reading for 16 samples per reading
Guide Home