How Can I Communicate With Infiniium Oscilloscope Matlab

Well, After a long time I have finally come with something new for this blog. The arduino based oscilloscope that I fabricated was a part of college Mini-projection. When I was researching for the projection I noticed that there were lot of Arduino based oscilloscopes which invariably had TFT screens equally their output monitors(I can't think of a better proper name!) and none of them used MatLab (equally far every bit my google and youtube search goes). But its just so easy to use MatLab. Although you lot have to toil a flake to go a proper fourth dimension-axis in your MatLab  plot, and biasing would be a scrap of an issue just all the same you would run across a flawless sine wave running through your PC monitor and get the satisfaction of having designed an ultra-cheap, ultra-easy-to-design Oscilloscope. Also I have left the toiling part to the readers, since neither of the bug mentioned have been solved in the nowadays web log.

The Circuit Schematic

cori.jpeg_bb Since I don't have a office generator with me in my room, like many others I accept usedAudacityfor generating sine waves. Since you can add some cool effects to the pure moving ridge, it will exist interesting to see your oscilloscope answer to it. The output from the male-male audio jack is given to a TRS-iii.5mm audio jack. Neglecting the stereo and mic pins, describe wires simply from thesleeve(to ground) and thetip to the 10\mu F electrolytic coupling capacitor. Since the arduino cannot read negative voltages, nosotros demand clamp up input 0V to 2.5V. (Notice that the above circuit can read entire sine wave even if the zero is slightly clamped up because the peak-superlative voltage from a directly audio jack will be ~0.5V, only still I have employed a voltage divider of equal resistances (10k\Omega each). V_{cc} for the divider is taken from arduino itself. The divider is then continued to aLow pass RC filter, which removes most of the noise and finally output of the filter is fed to pivot A1.

Arduino lawmaking

Yous have to run this simply once later you connect the board

          void setup()                                { Serial.begin(115200);                    }                    void loop()                      {                      int a=analogRead(A1);                      Serial.println(a);                      delayMicroseconds(62);                      }                  

A loftier baud-rate is preferred for cleaner wave, once you upload this , you would have to run the MatLab code. Every time the arduino code prints the analog read value information technology is actually saving information technology in theserial buffer, MatLab code is such that evey time at that place is an interaction betwixt MatLab and arduino it fetches 500 samples, in doing so at every interaction MatLab code has to wait for 62*500\mus (delay has been set to 62\mus since a sampling charge per unit of 16kHz was called in Audacity). Merely before y'all run the post-obit code you must have already run the arduino.chiliad, which I have attached at the end.

MatLab lawmaking

          clc; close all; articulate all;          south=serial('COM5','BaudRate',115200);                    fopen(s);                    x=ane:500;                    n=i;                    while due north==ane                                for i=1:length(x)                                tmp=fscanf(south,'%u');                                if length(tmp)>1                                continue;                      end                                y(i)=tmp';                                end                      y=y/1024*5;                      ylim([0 5]);                                plot(x,y)          drawnow                    end                    fclose(s);        

The MatLab still suffers from ane inconvenience; solution to which I have not yet found: Afterwards every fourth dimension you stop running the code, you lot have to manually close the serial objects of MatLab, may be its a minor flaw due to the way the code is written, one tin overcome it I guess. Once you run this, you can either open up Audacity or some online tone generator and watch the sine wave on your screen. Here'due south what I got

ard_18

Note biasing is at 2.5V, but its a very depression power betoken, ane tin can use an amplifier phase at the beginning or but connect it to a 5V_{pp} function generator. Promise yous guys enjoy doing this!

Arduino.one thousand file

arduino.m

burnswatchn1952.blogspot.com

Source: https://krishnamurthy1995.wordpress.com/2016/04/10/an-arduino-matlab-based-oscilloscope/

0 Response to "How Can I Communicate With Infiniium Oscilloscope Matlab"

Post a Comment

Iklan Atas Artikel

Iklan Tengah Artikel 1

Iklan Tengah Artikel 2

Iklan Bawah Artikel