LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Create a Ardunio-based oscilloscope with LabView and LINX?

Hi all,

New to Ardunio - been using LV for a while. My boss seems to think that there is a way to use an Arduino Uno land its on-board DAC ike an oscilloscope to read voltage vs. time and plot the waveform in a VI. Struggling to wrap my head around it. I can plot a sine and a square wave with the Analog Read within LINX, but it simply runs as # of samples on the x-axis and I can't control it with time (or slow down the # of ssmples collected). Has anyone ever written (or tried to write) an o-scope code for an Arduino in LabView? Any logic suggestions, a screenshot or example code (for LV 14 and down) would be useful. Thanks in advance!

0 Kudos
Message 1 of 3
(3,924 Views)
The Arduino has a maximum sampling rate of ~10kHz according to the spec and only a 0-5V 10-bit ADC so it really isn't very good as a scope - you'd also have to be careful about signal grounding and protecting the Arduino against high voltages if using it as a scope as it's such a low range. I also imagine that the sampling rate won't be particularly accurate (e.g. because of the clocks/timers on the Arduino).

If, after reading all of that, you *still* want to turn your Arduino into a scope, my suggestion would be to write a sketch which continually outputs the ADC values over the serial port at a specified rate. You could have a command you send to set/change the sampling rate and you may want to do some buffering of samples on the Arduino (e.g. read 10 samples and send them in batches). I imagine the LINX toolkit does on-demand reads which would be no good for trying to sample continously at a pre-determined rate.

LabVIEW Champion, CLA, CLED, CTD
(blog)
0 Kudos
Message 2 of 3
(3,888 Views)

Hi Sam, 

Thanks for the tips. 10 KHz is a bit slow, but as a proof of concept, it'll work for this purpose.  The signal never excdeeds 4V (it can't due to an inline pre-amp installed before the scope) and is properly terminated/grounded so I am not worried about spikes.  

You are correct - the LINX toolkit is all on-demand, so I will likely have to wire this the old-fashioned way through the VISA protocols.  If you have any other suggestions or examples you can point me to, please share.  Thanks!

0 Kudos
Message 3 of 3
(3,868 Views)