LabVIEW Interface for Arduino Discussions

cancel
Showing results for 
Search instead for 
Did you mean: 

ADXL345 connected to Arduino (SPI) to LabView

Look at this, in Arduino IDE I am using Arduino Duemilanove or Diecimila, ATmega328 because I cannot upload a sketch when I choose the Arduino UNO. So in LabView, when I am uploading the LINX firmware in the "Device Type", I'd select Arduino Uno (I tried Leonardo as well) for a silly reason that the board that I am using right now looks like the UNO (I know that is silly).

img.png

By the way, the board that I am using is a local brand here in my country.

85866516_1_1000x700_arduino-uno-alexan-aceduino-v21-metro-manila.jpg

When I tried the Blink Example I keep on getting the same errors over and over again.

0 Kudos
Message 21 of 31
(3,162 Views)

LINX does not provide native support for either the Duemilanove or Diecimila, probably because the Arduino community has retired those boards.  I'm not familar with either of those boards so I'm not sure what would need to be changed to make it work.

I'd recommend that you search on the LINX forums.  If you don't find any topics regarding the Arduino Duemilanove or Diecimila, you can post a topic and see if anyone has had any experience with them using LINX.

Message 22 of 31
(3,162 Views)

Thank you Nathan for helping me out and for the patience. I'll get back on this one. I've already posted a thread in LINX forum.

0 Kudos
Message 23 of 31
(3,162 Views)

Hey Nathan, I am now using an Arduino UNO. Here's what I did. Uploaded my arduino code. Then go to LabView, uploaded the LINX Firmware. I run the VI I created but I get an Error 5001. Here's a preview: img.png

I tried the Blink (Simple) example and it is working. No errors whatsoever.

0 Kudos
Message 24 of 31
(3,162 Views)

I am now getting this error.

img.png

0 Kudos
Message 25 of 31
(3,162 Views)

Here's what I did now:

I move the ADXL345 OPEN block inside the While Loop. Removed the ADXL345 CLOSE block. I am no longer receiving the error. However, I am not getting any real-time reading from my sensor.

When I click the "Run" button, it will run for some seconds then will stop automatically. The x,y,z data then will have a new set of data.

Here's the snippet of my VI.

img.png

I think what causing the Error 5004 is the ADXL345 Close Block. So I removed it.

But what I really need is the real-time reading of the data because I need to plot them.

0 Kudos
Message 26 of 31
(3,162 Views)

UPDATE:

First of all, sorry for my constant post on this thread.

I think I figured out the way to plot the data real-time. However, when I click run, it will not start reading/plotting the data until after 10 secs. Is that normal?

Also, if you could help me out on how to properly calibrate the values that I am getting because the values are very small and it reads at a high rate. (When I use the serial monitor in the Arduino IDE, the x,y,z values are from - value to 500+ value.)

Here's the snippet of the VI as well as when the program is running.

img.png

img2.png

Right now, I am figuring out how to reset the data when I click the run button again.

0 Kudos
Message 27 of 31
(3,162 Views)

When you first run the VI it needs to connect to the Arduino which is not

instantaneous.

The values you get are in units of gravity (g).

0 Kudos
Message 28 of 31
(3,162 Views)

Ah so it's normal.

So how can I make the reading looks something like the image below?

img.png

or the reading that I am getting right now is more accurate and reliable? Additional question, if I simply change the constant 2 value in my VI to 16. Does that mean I am now running at 16g range?

0 Kudos
Message 29 of 31
(3,162 Views)

JersonJose wrote:

Ah so it's normal.

So how can I make the reading looks something like the image below?

img.png

or the reading that I am getting right now is more accurate and reliable?

The data is the same, it's just been properly converted into units of gravity.

Additional question, if I simply change the constant 2 value in my VI to 16. Does that mean I am now running at 16g range?

No.  If the sensor supports it, you would have to set the range parameter on the ADXL345.  In this case, it looks like you'd need to create a new VI to do this since it does not appear to be a function that's already been created.

Since we are no longer talking about LIFA (this forum), you should take your discussion to the LINX forums for support with LINX (there will be more people able to help you).

0 Kudos
Message 30 of 31
(3,162 Views)