[Temperature] TMP102 Sensor Library

The TMP102 is a low power digital temperature sensor with I2C interface. This is a library (for arduino or cpp) that gives a simple interface with the TMP102 module. You can easily read the temperature with the arduino just by requesting a single line. This keeps your sketches easy. Downloads and example usage is below.




This code is also included in the .zip and you can request it generally with the example from the menu in the arduino IDE.

  1. #include <wire.h>
  2. #include <tmp102.h>
  4. void setup()
  5. {
  6.   Serial.begin(9600);
  7.   TMP102.init();
  8. }
  10. void loop()
  11. {
  12.   int t;
  13.   delay(100); // There will be new values every 100ms
  14.   TMP102.getValues(&t);
  15.   Serial.print("Temperature: ");
  16.   Serial.println(t);
  18. }

Tim Zaman

MSc Biorobotics. Specialization in computer vision and deep learning. Works at NVIDIA.

You may also like...

3 Responses

  1. pskorovs says:

    The example sketch fails to compile under Arduino 1.0 RC2.

  2. Victor says:

    Hi, how can i work with 2 or more sensors???


  3. akulahpathub says:

    thanks for the code and the example, may i ask for the shutdown mode and one shoot? So i can take the atmega to sleep.
    Manyg thanks in advance.