This is a breakout board for the incredibly small TMP102 digital temperature sensor. The TMP102 is a digital sensor (I2C a.k.a. TWI), has a resolution of 0.0625°C, and is accurate up to 0.5°C. This is a very handy sensor that requires a very low-current.
Communication with the TMP102 is achieved through a two-wire serial interface. There is no on-board voltage regulator, so supplied voltage should be between 1.4 to 3.6VDC. Filtering capacitors and pull-up resistors are included as shown.
Features:
- 12-bit, 0.0625°C resolution
- Accuracy: 0.5°C (-25°C to +85°C)
- Low quiescent current
- 10µA Active (max)
- 1µA Shutdown (max)
- 1.4V to 3.6VDC supply range
- Two-wire serial interface
- 2x Mounting Holes
How’s the weather? TMP102 + Arduino
The TMP102 is a
very simple, yet accurate, ambient temperature sensor which is capable
of detecting .0625ºC changes between -25 and +85°C, with an accuracy of
0.5°C. And the real kicker… It does all of this while only consuming
10µA (10 millionths of an amp). The thing is quite tiny, so SparkFun has put it on a breakout board to make things easier.
Naturally, you probably already ordered a few of these for your
room-to-room sensor-network to prove to your landlord that the heat is
dropping below the agreed temperature. Wait… That’s just me? You just
want to know how to hook one up to your Arduino? Ok… I can help with
that.
The TMP102 is an I2C device, so when we are done with it, it will actually tell you the temperature, not send an analog signal that you then need to interpret. But that also means it is a little harder (code-wise) than just using an ADC and reading an analog voltage. But, in return for the added complexity, It is also more accurate then any analog reading the Arduino is capable of. So, if you actually care what the ambient temperature is, and not just checking to see if the temperature has changed, this is your guy. I say ambient temperature because it would be a little hard to connect this to anything, and it doesn’t support a thermocouple.
Naturally, you probably already ordered a few of these for your
room-to-room sensor-network to prove to your landlord that the heat is
dropping below the agreed temperature. Wait… That’s just me? You just
want to know how to hook one up to your Arduino? Ok… I can help with
that.The TMP102 is an I2C device, so when we are done with it, it will actually tell you the temperature, not send an analog signal that you then need to interpret. But that also means it is a little harder (code-wise) than just using an ADC and reading an analog voltage. But, in return for the added complexity, It is also more accurate then any analog reading the Arduino is capable of. So, if you actually care what the ambient temperature is, and not just checking to see if the temperature has changed, this is your guy. I say ambient temperature because it would be a little hard to connect this to anything, and it doesn’t support a thermocouple.
The sensor has an address pin (ADD0) that is used to change the address the sensor is located at. This is useful if you need more than one of these hooked up to one Arduino, you can still call them independently even on the same bus. We are grounding this pin so that the sensor will use the address of 72 (0x48 in hex). Connecting this pin to V+ (3.3v on the arduino) would set the address to 73 (0x49 in hex), and you would just need to change that address at the top of the code ( int tmp102Address = 0x49; ).
The code for the TMP102 is the easiest I2C device I have yet run across, and accessing the value from it is just a few lines of code. To please the greatest ammount of people, we are going to output the values in both Celsius and Fahrenheit. But if you wanted to do the math, and had your reasons, you could output Réaumur or even Delisle.
Arduino 1.0 Compatible
//Arduino 1.0+ Only //Arduino 1.0+ Only ////////////////////////////////////////////////////////////////// //©2011 bildr //Released under the MIT License - Please reuse change and share //Simple code for the TMP102, simply prints temperature via serial ////////////////////////////////////////////////////////////////// #include <Wire.h> int tmp102Address = 0x48; void setup(){ Serial.begin(9600); Wire.begin(); } void loop(){ float celsius = getTemperature(); Serial.print("Celsius: "); Serial.println(celsius); float fahrenheit = (1.8 * celsius) + 32; Serial.print("Fahrenheit: "); Serial.println(fahrenheit); delay(200); //just here to slow down the output. You can remove this } float getTemperature(){ Wire.requestFrom(tmp102Address,2); byte MSB = Wire.read(); byte LSB = Wire.read(); //it's a 12bit int, using two's compliment for negative int TemperatureSum = ((MSB << 8) | LSB) >> 4; float celsius = TemperatureSum*0.0625; return celsius;