10-25-2013 09:27 AM
Hello.
I have a project using this sensor. Two days ago I have purchased an Arduino Uno v3 and a TMP102 sensor. The sensor works great with arduino board interface and show on the serial monitor the values. But now I must use it somehow with LabView ( i have labview 2011). I have installed the newest LIFA_base on arduino and I tried to do the wirings with the components in LV using multiple guides. The problem is I don't get any readings (and I really don't know how to display it in LV). Can someone help me please, with the most basic and simple VI in labview, to read from tmp102 and show the temperatures in a numeric display, or thermometer, etc.? Thank you very much for your patience and time spent for me. Have a great day!
10-25-2013 11:07 AM
Hey flavyx,
Can you post the Arduino code you used to get the tmp102 working (it will save us the trouble of looking up the spec sheet). Were you able to get some of the LIFA examples working (in labview help>>find examples then search for Arduino.
Can you also please post the LV code you wrote to talk to the tmp102. We'll see if we can point you in the right direction.
-Sam K
LabVIEW Hacker
Join / Follow the LabVIEW Hacker group on Google Plus.
10-25-2013 02:22 PM
I have used the code from here: http://bildr.org/2011/01/tmp102-arduino/ but I have removed the fahrenheit conversion and l left it just with celsius. From the examples, what I have tried and was working was the blinking led example, analog read pin.
10-25-2013 10:13 PM
Ok, here it is based on that example code. (Note that that code won't work for negative temperatures but I've fixed that here)
10-26-2013 03:30 AM
Thank you very much guys for your effort, and I am really sorry that you spent your time for me. It works great, except that is shows 400+ degrees. I will figure it out somehow. Thanks a lot. Have a nice day!
10-26-2013 03:56 AM
Well, i tried that one but made it more simpler by removing a big part of it. After removing the "multiplying by 0,625" the temeperature jumped to thousands. The thing that made this huge numbers was the "join numbers thing". Now i tried something, but it only shows the integer value, and the zecimal value only to "240" or something like that. Here is the modified example:
10-26-2013 05:54 AM
I'd really like to know where from does the hex "x48" come from, and what it actually does and why the zecimal shows only to value 240. Thanks
10-26-2013 09:53 AM
The 0x48 is the I2C bus address of the TMP102 sensor. See page 10 of the spec sheet: http://www.ti.com/lit/ds/symlink/tmp102.pdf
The two LSbs of the address can be configured using the A0 pin. 0x48 assumes A0 is connected to ground.
-Sam K
LabVIEW Hacker
10-26-2013 02:58 PM
Sorry, I forgot to do the final bit shift that is required to get the right values. It is fixed in my original post above.
10-26-2013 03:00 PM
You can't just remove all the code that I added in the loop because it is processing the data into the correct bit-format. I did, however, forget to add one step that was causing it to give some outrageously high values. I have that fixed above in my attachment.
The two bytes have to be combined to get an actual value. The bytes by themselves do not hold any relevant information.
Please let me know if it works for you.