Code covered by the BSD License  

Highlights from
Arduino meets MATLAB

3.0

3.0 | 4 ratings Rate this file 40 Downloads (last 30 days) File Size: 1.48 KB File ID: #24638
image thumbnail

Arduino meets MATLAB

by

 

04 Jul 2009 (Updated )

Matlab Linked to Arduino

| Watch this File

File Information
Description

The current submission illustrates a way to use the popular open source arduino boards with MATLAB illustrating the capabilities of data acquisition and visualization in real time .

The Arduino Demilanove based on the ATMEGA 328 is used to send a series of time series through the serial interface and the matlab code acquires the data and performs a meaningful part of the same at a baud rate of 9600.

There are quite a few things that could be made more visually appealing by using Matlab with the microcontrollers !

I was happy to get my board at a low cost not bearing much custom duties and i have listed the vendor who markets them in India !

Acknowledgements

This file inspired Interacting With An Arduino Using The Matlab Serial Commands.

MATLAB release MATLAB 7.4 (R2007a)
Other requirements Arduino IDE for the controller ! Arduino Demilanove Hardware platform from TENET TECHNETRONICS INDIA www.tenettech.com
Tags for This File   Please login to tag files.
Please login to add a comment or rating.
Comments and Ratings (15)
22 May 2014 thilina senevirathne  
20 Oct 2012 Joseph

Thanks for this one. However, I am using gizDuino MiniUSB with ATEM328. Unlike Arduino Uno, gizDuino is being read by the computer as "libusb" not as coneected in communication port. Therefore I have the problem of identifying what COM port to be use. Can you help me figure out how to solve my problem?

28 Jul 2012 Muhammad Awais Memon

Hi
i tried to interface arduino uno with matlab using command
a=arduino('COM3')
but facing errors like undefined function
can anyone help me out??

07 Mar 2012 Hossam

I would like to know how to send bytes from the arduino to matlab, and these bytes are packets for an image ? I would like to display the image on matlab. I would be grateful to who answers me :)

15 Feb 2012 Suresh

I don't see anything on the graph.

I have a Microcontroller board(Arduino Uno) that sends data between 1 - 1024(digits)for every 1000 mili seconds to the COM port 5 of Windows XP PC.

I want to receive this data in to MatLab and display a graph of Time versus Data. I want to display both Static and Dynamic or whichever is possible easily.

14 Jul 2011 Sreeram Mohan

Hi Alex is ,

Looks like what u need to do is the reverse of what my file submission does !

Instead of the fscanf u could do a fprintf to the com port that is assigned to the arduino on the PC and pass in the sinewave values from matlab !

Hope this helps !

--sreeram

14 Jul 2011 Sreeram Mohan

hi fremond khoo ,

Potentiometers are generally analog inputs which can be easily read through the pins on the arduino ! refer to the analogIn functions and a simple schematic on the arduino playground on how to do it !

Further the only interface through which the arduino can talk to any other software on a host (PC) is basically through the serial port.

so having said that
analogin --> Arduino --> serial.print --> matlab code

should be the psuedo path !

Hope this helps !

--sreeram

28 May 2011 Alex is

is it technically possible I mean?

28 May 2011 Alex is

Hi I am trying to generate sine waves from matlab and input into the arduino uno. can someone please help me in describing the procedure?

18 Mar 2011 fremond khoo

hi and good day to all,

i want to ask about the interface with arduino and matlab..i am now trying to get the data from potentiometer which is attached at my stepper motor shaft..can anybody tell me how to get the data from potentiometer through arduino board to my computer(MATLAB) and try to plot the graph at the same time?..i have the code to plot the graph but i cant run both files at the same..

either i run my motor or get data from potentiometer by turning the potentiometer myself..so how do i solve this??..

anyone would be so kind to help out here??

thanks in advance^^

25 Oct 2010 Gautam Vallabha

See here for another freely downloadable implementation of a MATLAB <-> Arduino interface over a USB serial cable:
http://www.mathworks.com/academia/arduino-software/arduino-matlab.html

09 Nov 2009 Sreeram Mohan

Hi Daniel,

A simple fix to the problem faced is to make the arduino to get a start command from the matlab and then start the communication from the arduino end.I have had success doing this and may be post an other sketch to the file exchange.

Cheers !
Ram

06 Nov 2009 Daniel McKenna

Thanks Ram. I was using code similar to the screen shot and it was not solving the timeout problems. It took me quite some time to figure this out but here's what was happening (In case anyone else cares):

The Arduino Starts sending serial messages on bootup. If Matlab is stated after the Arduino Matlab has a lot of trouble framing the Serial messages. What does work is to reset the arduino, and then while the bootloader is starting up, open the serial port. That way Matlab doesn't time out and it gets the first reading for the arduino. Another solution is to implement some sort of handshaking.

03 Nov 2009 Sreeram Mohan

Hi Daniel,

You could look at the snap shot with the file-submission and the c-code is clearly visible.

hope this helps,

cheers,
Ram

30 Oct 2009 Daniel McKenna

Do you have the Arduino side of this code? I get a timeout when I try to read in the serial data using the serial.write() on the arduino. Is there a end of line that is required by Matlab?

Updates
25 Sep 2009

Just added some places to find these boards in INDIA .

Contact us