LabVIEW Interface for Arduino Discussions

cancel
Showing results for 
Search instead for 
Did you mean: 

Tmp102 Sensor Lifa

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!

0 Kudos
Message 1 of 13
(5,881 Views)

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.

Message 2 of 13
(4,573 Views)

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.

0 Kudos
Message 3 of 13
(4,573 Views)

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)

Message 4 of 13
(4,573 Views)

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!

0 Kudos
Message 5 of 13
(4,573 Views)

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: tempreadingsimple.jpg

Message 6 of 13
(4,573 Views)

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

0 Kudos
Message 7 of 13
(4,573 Views)

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

Message 8 of 13
(4,573 Views)

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.

Message 9 of 13
(4,573 Views)

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.

Message 10 of 13
(4,573 Views)