SparkFun Forums 

Where electronics enthusiasts find answers.

Your source for all things Atmel.
By pjrestrepo
#97163
This sample code shows how to use the Digital Temperature Sensor Breakout - TMP102. Also notice that I am using a 5 v Arduino decimilanove. To drive the 3.3v TMP102 breakout, I am using Sparkfun's Logic Level Converter (sku: BOB-08745), connected as follows:

Low voltage to the 3.3v pin of the Arduino
High voltage to the 5.0v pin
High voltage Channel 1 Txo to the SDA pin (analog 4)
High voltage Channel 2 Txo to the SCL pin (analog 5)
Low voltage Channel 1 Txi to the SDA pin of tmp102
Low voltage Channel 2 Txi to the SCL pin of tmp102
The RX pins of the logic converter are not used
V+ of tmp102 connected to 3.3v
ADD0 of tmp102 connected to ground
ALT of tmp102 not connected
All grounds connected together.

The code is attached. It puts out the temperature in Deg C to a serial monitor.
You do not have the required permissions to view the files attached to this post.
Last edited by pjrestrepo on Fri Jun 04, 2010 7:57 pm, edited 1 time in total.
By pjrestrepo
#102436
Ooops, you are correct. V+ of the tmp102 should be connected to the 3.3V pin (low voltage side of the logic level converter). I corrected my previous post.
By dargs
#109366
Hi, quick question, if I connect the TMP102 V+ to the arduino onboard 3.3v, do I need to level shift the SDA & SLC signals, or can I connect them directly to Analog4/5 on the Arduino?

In the comments section of the product page (http://www.sparkfun.com/commerce/produc ... ts_id=9418) You(?) have said:

"I have an Arduino duemilanove, and have the tmp102 working. I connected V+ to the 3.3v pin on the Arduino board. Ground and Add0 to ground. SCL to analog pin 5, and sda to analog pin 4. The Alt connection is not needed. Here is my code, to read the sensor and print it through the serial port. I hope it helps. "

I am also aiming to connect an RTC module (BOB-00099) on the same I2C bus, which is running ok at the moment. So not sure if it's all going to work.. (First time playing with I2C)...


cheers
dargs
By pjrestrepo
#109397
I am not sure whether the +5 voltage on the Arduino will be too much for the tmp sensor. That's why I went the safe rout. I am also connecting the same RTC, but haven't had the time to complete my project. The first RTC I got from Sparkfun was dead on arrival, and I got a replacement sometime later. But I got busy afterwards and have not been able to test the whole project together. Let me know what you decide to do, and how it goes.

My project is a wireless thermostat that can start the AC or Heating and move a damper in the basement that moves the air mostly to the second floor. That way, I don't have to cool or heat the whole house in the evening and night.