TMP102 Digital Temperature Sensor Module (HCMODU0100)
Posted: Wed Jun 01, 2016 2:05 pm
The TMP102 device is a digital temperature sensor ideal for NTC/PTC thermistor replacement where high accuracy is required. The device offers an accuracy
of ±0.5°C without requiring calibration or external component signal conditioning. Device temperature sensors are highly linear and do not require complex calculations or lookup tables to derive the temperature. The on-chip 12-bit ADC offers resolutions down to 0.0625°C. The module (HCMODU0100) provides header pins for power (3.3V), and to its digital I2C interface including bus pullup resistors.
PLEASE NOTE: This module does not include an on-board regulator. Do not power it above 3.6V otherwise you will cause permanent damage.
Features:
• Accuracy Without Calibration:
– 2.0°C (max) from –25°C to 85°C
– 3.0°C (max) from –40°C to 125°C
• Low Quiescent Current:
– 10-μA Active (max)
– 1-μA Shutdown (max)
• Supply Range: 1.4 to 3.6 V
• Resolution: 12 Bits
• Digital Output: I2C interface Compatibility
Raspberry Pi users:
For Raspberry Pi uses we have tested this module with the free Cayenne cloud based IoT software platform. Simply connect the module to your Raspberry Pi as shown below and use the Cayenne software platform to get remote temperature readings without writing a single line of code.
You can create a free account simply by clicking our referral link below:
Arduino users:
To use this module with your Arduino please see the following connection diagram and sketch:
- /* FILE: TMP102_Example.cpp
- DATE: 01/06/16
- VERSION: 0.1
- AUTHOR: Andrew Davies
- Library created by Hobby Components Ltd (HOBBYCOMPONENTS.COM)
- 26/05/16 version 0.1: Original version
- This example sketch has been written to work with the TMP102 temperature sensor,
- and in particular the TMP102 digital temperature sensor module (HCMODU0100).
- The sketch will read the current temperature from the module and display it via
- the serial port. To connect the TMP102 to your Arduino connect it as follows:
- Uno/Nano..........TMP102
- 3V3...............3V3
- GND...............GND
- SCL...............A5
- SDA...............A4
- You may copy, alter and reuse this code in any way you like, but please leave
- reference to HobbyComponents.com in your comments if you redistribute this code.
- This software may not be used directly for the purpose of selling products that
- directly compete with Hobby Components Ltd's own range of products.
- THIS SOFTWARE IS PROVIDED "AS IS". HOBBY COMPONENTS MAKES NO WARRANTIES, WHETHER
- EXPRESS, IMPLIED OR STATUTORY, INCLUDING, BUT NOT LIMITED TO, IMPLIED WARRANTIES OF
- MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE, ACCURACY OR LACK OF NEGLIGENCE.
- HOBBY COMPONENTS SHALL NOT, IN ANY CIRCUMSTANCES, BE LIABLE FOR ANY DAMAGES,
- INCLUDING, BUT NOT LIMITED TO, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES FOR ANY
- REASON WHATSOEVER.
- */
- /* Include the wire library */
- #include <Wire.h>
- /* The TMP102 can have one of 4 I2C address: 0x48 (ADD0 Pin -> GND),
- 0x48 (ADD0 Pin -> 3.3V), 0x4A 0x48 (ADD0 Pin -> SDA),
- 0x4B 0x48 (ADD0 Pin -> SCL). For HCMODU0100 module default is 0x48 */
- int I2CAdd = 0x48;
- void setup()
- {
- /* Initialise the wire and serial port libraries */
- Wire.begin();
- Serial.begin(9600);
- }
- void loop()
- {
- /* Get the current temperature and output it to the serial port */
- Serial.println(GetTemp());
- /* Wait a second before doing it again */
- delay(1000);
- }
- /* Gets the current temperature via the I2C interface */
- float GetTemp()
- {
- int Data;
- /* Set the sensors address pointer to the 16bit temp register */
- I2CWritePointer(0);
- /* Result is in the most significant 12 bits so shift it down. */
- Data = I2CReadInt() >> 4;
- /* Result is now in 12 bit two's compliment so convert it to 16bit
- * two's compliment */
- if(Data & 0x0800)
- {
- Data += 0xF000;
- }
- /* Result is now in 0.0625oC increments so adjust it for oC */
- return Data * 0.0625;
- }
- /* Read two bytes from the sensors I2C interface and return it as a 16bit integer */
- unsigned int I2CReadInt()
- {
- unsigned int Data;
- Wire.requestFrom(I2CAdd, 2);
- Data = Wire.read() << 8;
- Data += Wire.read();
- Wire.endTransmission();
- return Data;
- }
- /* Writes to the sensors address pointer register */
- void I2CWritePointer(byte Register)
- {
- Wire.beginTransmission(I2CAdd);
- Wire.write(Register);
- Wire.endTransmission(true);
- }
Disclaimer: The Cayenne platform is an external free service and is not provided by, or connected to, Hobby Components Ltd. It is therefore not being sold as part of the product advertised on this page. As such we do not provide any guarantees or warranties with regards to this service. Issues or questions related to the Cayenne platform should be directed to Cayenne and not Hobby Components Ltd.
Libraries, example code, and diagrams are provided as an additional free courtesy by Hobby Components and are not sold as part of this product. We do not provide any guarantees or warranties as to their accuracy or fitness for purpose.
Descriptions and diagrams on this page are copyright Hobby Components Ltd and may not be reproduced without permission.