LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Arduino Analog data acquisition

Hello everyone.

So I'm trying to implement an acquisiton system with Arduino and LabVIEW. I've design an interface were you can introduce the acquisition speed and the number of samples, and with a button display de data on a graph and also save the data in a spreadsheet. I'm new to this topic of signal acquisition.

interface.png

My first aproach was to use LINX, but i couldn't make it work, So i decided to use LIFA(I know it was been discontinued, so i use Arduino 1.8.5 to avoid problems with the Frimware), since LIFA has Analog and Continuous sampling VI's.

 

For testing purpouses i'm using (In real life) and LM555 with a low pass filter. The circuit  produces a 1HZ (approximately) square signal.(The circuit example below,). 

circuit.png

 

So everything it's working BUT, when im acquiring the signal, the display, the frequency doesn't match with the acquiring signal im testing. Also i have some noise when im not acquiring anything. I tried to change the frequency of the 555 to something higher and it doesnt seem to resolve the problem.

NoiseNoise

 

Not the signal i wantNot the signal i want

 

My questions are: What i am doing wrong?, Is there something really obvious that im passing?, Is Arduino the problem?, Should i use VISA instead?. I also tested in another arduino nano that i have, and still the problem is there.

 

I did 2 different VI's, one using the continuous sampling function, and the other one using the finite analog sample(this ones is the one that has better results in my opinion).

 

I've alredy browse on all the NI comunity and i couldnt find anything similar my problem, also i've seen the examples that LIFA has, and also in those i still had the problem with the frequency.

 

And my final note, Any suggestion or advice is helpfull.  My native language is Spanish, so i apologize if there´s something misspelled. 

Kudos to everyone.

 

 

Download All
0 Kudos
Message 1 of 12
(4,838 Views)

Hi everyone! I need some help

 

I am trying to read, using a Arduino Mega and labview, a triphasic signal of voltage with three ZMPT101B modules. 

 

I thought I could use the following module of LIFA:

navarro08_0-1612696331072.png

 

but it turned out that the read signal is kind of weird. The signal's phase is around 60Hz. So accordingly Nyquist theorem the sample frequency should be more than 2*60Hz. 

I set it in that way, like 880Hz of acquisition samples and 40 samples, but it is not working.

 

 

Has anyone used this LIFA module to read an analog signal properly?

If I am not considering something, please tell me 🙂

 

Thanks for your help

 

0 Kudos
Message 2 of 12
(4,714 Views)

Hey bro! 

Actually I am having exactly the same problem!


Question, are you considering the Nyquist Theorem?

 Let me know if you resolve this problem

 

0 Kudos
Message 3 of 12
(4,736 Views)

@navarro08 wrote:


Question, are you considering the Nyquist Theorem?

 


I believe you are on the right track here.

 

My experience with LIFA and LINX I was only able to get a loop rates in the 200 hertz range.

 

200 samples per second is a very slow DAQ.

========================
=== Engineer Ambiguously ===
========================
0 Kudos
Message 4 of 12
(4,721 Views)

Hi bro!

Ok, this is the vi I am using!

I don't know what is wrong.It seems to be easy but the signal I get is weird.

0 Kudos
Message 5 of 12
(4,706 Views)

I have just attached another simple example,basically is the same.

Question, how many bytes an Arduino Mega sends per package?? 
It is an input of the beginning module

0 Kudos
Message 6 of 12
(4,703 Views)

Thanks

0 Kudos
Message 7 of 12
(4,695 Views)

Thank you for responding both of you

 

First of all, yeah im considering the Nyquist Theorem.

I manage to solve the problem by disconnecting and reconnecting the circuit in real life, make sure that everything is connected to ground. The problem wasn't arduino, was the circuit.

 

Also I raised the acquired frequency to 50Hz (48.0898347Hz) and so with it, sampling rate too (to at least 500 Hz).

good_signal.png

it works!!it works!! 

After the signal pass throught the filter, it looks like this.

It seems like the problem is solved.


BUT if you want to get more rigorous...

According to the next formula.

(Number of samples/Sampling Rate)*Acquire Frequency

You should get the Number of waves you should see on the graph

 

In the last image, according to the formula, you could see 9.6 waves, and that's correct.

But if we change the frequency...

ok.png

With the next one you should see 4.8, but it seems to be like 5.5 maybe, sometimes satisfies with the formula and sometimes not. Also the frequency changes a bit.

 

I am satisfied with the result, but if anyone knows why that happens, let me know.

0 Kudos
Message 8 of 12
(4,680 Views)

So I looked your VI, but you dont use the 'Init' and the 'Close' comunication of the LIFA package,also you have to use a while loop to get continous data. I recommend you to check the examples. They can help you a lot. Also check this VI i did here. Cheers!!

0 Kudos
Message 9 of 12
(4,679 Views)

Bro, I applied that formula and got the double of waves I was expecting :c sad!

0 Kudos
Message 10 of 12
(4,662 Views)