Featured Post

High CMRR Instrumentation Amplifier (Schematic and Layout) design for biomedical applications

Instrumentation amplifiers are intended to be used whenever acquisition of a useful signal is difficult. IA’s must have extremely high input impedances because source impedances may be high and/or unbalanced. bias and offset currents are low and relatively stable so that the source impedance need not be constant. Balanced differential inputs are provided so that the signal source may be referenced to any reasonable level independent of the IA output load reference. Common mode rejection, a measure of input balance, is very high so that noise pickup and ground drops, characteristic of remote sensor applications, are minimized.Care is taken to provide high, well characterized stability of critical parameters under varying conditions, such as changing temperatures and supply voltages. Finally, all components that are critical to the performance of the IA are internal to the device. The precision of an IA is provided at the expense of flexibility. By committing to the one specific task of

Interfacing Arduino Uno with MATLAB

Method-1:
Step-1: Download the ArduinoIO MATLAB support file from here 
Step-2: Download the Source file from here 


Step-3: Add the downloaded ArduinoIO folder to your MATLAB bin path 
in my case it is "C:\Program Files\MATLAB\R2012a\bin"

Step-4: Connect your Arduino board to your PC/Laptop

Step-5: Open Arduino IDE Tool and copy the downloaded source file on to the new sketch file. Compile it and upload it on to the Arduino Uno board.

Step-6: Now Open your MATLAB and type "arduino" on command prompt. You will see some scrolling message. Then type "a=arduino('COMx'), x is your COM port number which is assigned to your board. 

Step-7: If you want to read analog port data then type "b=a.analogRead(0)" this will read analog port A0 data. If you want read/write any digital pin use these instructions
 a.pinMode(9,'input'); 



 a.pinMode(13,'output');

 a.digitalwrite(13,0) ;





arduino;
a=arduino('COM3'); // In my case it is connected to COM3 port
t=1:1:100;
b=a.analogRead(0);
plot(b);
a.pinMode(8,'input');
a.digitalRead(8);
a.pinMode(13,'output');
a.digitalWrite(13,1);
pause(1)
a.digitalWrite(13,0);

Method-2:

Step-1: Write this code in Arduino IDE tool and upload this code on to your board. 
void setup()
{
   Serial.begin(9600);
  while (!Serial) {
      ; // wait for serial port to connect. Needed for Leonardo only
    }
}

void loop()
{
  Serial.print("Hello World!");
 // Write your code here
}

Step-2: Open MATLAB and type this code in matlab file and run the code

s = serial('COM3'); // In my case it is connected to COM3 port
fopen(s);
fprintf(s, 'Your serial data goes here');
out = fscanf(s);
% Data Analysis 
fclose(s);
delete(s);
clear s;



Comments