SparkFun Forums 

Where electronics enthusiasts find answers.

Your source for all things Atmel.
By pjrestrepo
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 csete
Thanks for posting this, it was very helpful.
Wouldn't it be safer to connect V+ of tmp102 to 3.3V instead of 5?
By pjrestrepo
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
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 ( ... 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)...

By pjrestrepo
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.
long long title how many chars? lets see 123 ok more? yes 60

We have created lots of YouTube videos just so you can achieve [...]

Another post test yes yes yes or no, maybe ni? :-/

The best flat phpBB theme around. Period. Fine craftmanship and [...]

Do you need a super MOD? Well here it is. chew on this

All you need is right here. Content tag, SEO, listing, Pizza and spaghetti [...]

Lasagna on me this time ok? I got plenty of cash

this should be fantastic. but what about links,images, bbcodes etc etc? [...]