LabVIEW Interface for Arduino Discussions

cancel
Showing results for 
Search instead for 
Did you mean: 

LabView + Arduino + Altitude sensor HELP!!!!!

I am new to programming with LabView and using an Arduino board, thus my need for some serious help!!! I am using an Altitude/Pressure Sensor MPL3115A2 Breakout which uses an I2C output interface. I have been able to run the sensor connected to the Arduino board through the Arduino software but I am completely illiterate when it comes to LabView (despite using it for everything in undergrad - which was a while ago). I have managed to get the Arduino functions installed and can use them in LabView but I am stuck when it comes to the interface to have the data output from the sensor be read in graph form in LabView and ultimately put into a text file for further uses. Help me please!!!!! Any suggestions pointing me in the right direction would be much appreciated!!!!

Here is the sensor I am using: https://www.sparkfun.com/products/11084

0 Kudos
Message 1 of 6
(4,739 Views)

Altitude data to within 30cm NICE! I now have one on the way and will hopefully provide an vi for u when I get it. Although I have not tested the i2c function myself it is supported in LIFA. With arduino and LV u should be able to set up a system to log altitude temperature and time stamp data to excel also u should be able to view the data in a chart in LV. I may be wrong hear but the breakout seems to operate on a 3v supply witch u can get supply from Arduino but im not to shore about the data line u may need a converter to bring it down to 3v

0 Kudos
Message 2 of 6
(3,577 Views)

So because I don't have a lot of time to wait for someone to write the program for me (sorry Nick85, no offense), I started writing the program myself. I have no errors but I am not getting anything out despite the Arduino board lighting up like Christmas. I have noticed that my sensor will not output data correctly if running at a 115200 baud rate, but I cannot get the Arduino icon to change to 9600 even though I went into the program itself and changed it. Can someone please help me and tell me what I have done wrong? Also, how can I change the baud rate to be 9600?

ThanksArdunio Uno.png

0 Kudos
Message 3 of 6
(3,577 Views)

What exactly are you trying to do?  Your first post mentions a sensor (that uses I2C) but your second is trying to read an analog pin continuously.

The altitude sensor uses I2C to communicate.  This can normally be done with the default LIFA I2C VIs.  However, the default I2C VIs probably won't work because the sensor requires a a setting that is not currently implemented in the LIFA I2C VIs (a repeated start command).

There are two options, modify the existing I2C VIs to implement the repeated start or creat new custom LIFA function that either do all the communication with the sensor or to create a new set of I2C VIs for LIFA.

0 Kudos
Message 4 of 6
(3,577 Views)

That is the problem - I don't know what I am doing!!! I'm a chemical engineer that is trying to do a EE job for the project I am working on because we cannot hire a EE at the present time.

So, currently my sensor is wired so that the SDA is output through the analog channel on the Arduino board. This was the schematic I found for a similar type of sensor, now if there is a different way to wire this, please let me know. This set up works for when you are running the code in the Ardunio interface and it provides excellent data. No one here where I work knows what to do with what I am trying to do - so someone please help me!

wiring.jpg

0 Kudos
Message 5 of 6
(3,577 Views)

Well, I can't do it all for you but here is a modified version of the I2C Write.vi that will be required to use the sensor.  Upload this new version of the firmware to your Arduino and use "I2C Write 2.vi" instead of "I2C Write.vi" if you want to port the functions over to LabVIEW.

However, it might be easier to make a new LIFA function that simply uses the existing Arduino code for the sensor.

0 Kudos
Message 6 of 6
(3,577 Views)