You are on page 1of 3

Food Living Outside Play Technology Workshop

Arduino I/O-Matlab basic tutorial


by rmagtibay on August 27, 2012

Table of Contents

Arduino I/O-Matlab basic tutorial . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1

Intro: Arduino I/O-Matlab basic tutorial . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2

Step 1: Step 1: Things you need to know . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2

Step 2: Step 2: Things you need (materials) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2

Step 3: Step 3: The dreaded process . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2

File Downloads . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3

Related Instructables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3

Comments . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3

http://www.instructables.com/id/Arduino-IO-Matlab-basic-tutorial/
Intro: Arduino I/O-Matlab basic tutorial
Its a simple illustration on how we can connect Arduino to Matlab and actually control and get information on Arduino
using Matlab

I have seen few tutorials regarding how to control or get data from Arduino using Matlab. Matlab is a very powerful tool for student and engineers a like. That's why i want
to create this tutorial as a start for those, like me want to explore the 2 powerful tools in engineering and techs.

It's a rough start for me since this is my first post in instructables.... feel free to comment so i can improve it thanks!

here's the vid for the demo:


http://youtu.be/R50R5ZK_URE

Step 1: Step 1: Things you need to know


In this tutorial you need to know the following:
1. Matlab and creating M-file and GUI (there are tons of tutorials online)
http://www.youtube.com/watch?v=D_hmws6dwgg
http://www.youtube.com/watch?v=TIqa98quARE
http://www.youtube.com/watch?v=qAGiAq6HhYQ
2. Arduino and Arduino programming
http://arduino.cc/en/Guide/HomePage
3. Arduino Support with Matlab
http://www.mathworks.com/academia/arduino-software/arduino-matlab.html
tutorials from Giampiero Campa
http://www.mathworks.com/matlabcentral/fileexchange/27843-arduino-io-package-slides-and-examples

Step 2: Step 2: Things you need (materials)


1. PC with Matlab installed and the ArduinoIO package from MathWorks
2. Arduino
3. USB cable for the Arduino
4. LED
5. Photodiode (Photoresistor as an alternative)
6. Resistors

Step 3: Step 3: The dreaded process


For the Arduino:
1. Connect the circuit.
2. Connect your Arduino to your PC.
3. From the ArduinoIO (http://www.mathworks.com/academia/arduino-software/arduino-matlab.html)
upload the adiosrv.pde to your arduino. Now your arduino will be the server that will accepting commands
comming from Matlab.
For the Matlab
3. Run your Matlab as an administrator.
4. From the command window in Matlab type "install_arduino" (make sure that the active directory is in your ArduinoIO folder)
For this tutorial my idea is to make a manual and automatic lighting of an LED
5. Create an M-File in Matlab (or download below my GUI program). Make sure you have the right COM port of your Arduino)
(the yes.m.txt is the program source code, the yes.fig.txt is the GUI just remove the txt extension)
6. Run the program. Enjoy!

http://www.instructables.com/id/Arduino-IO-Matlab-basic-tutorial/
File Downloads

yes.m.txt (3 KB)
[NOTE: When saving, if you see .tmp as the file ext, rename it to 'yes.m.txt']

yes.fig.txt (3 KB)
[NOTE: When saving, if you see .tmp as the file ext, rename it to 'yes.fig.txt']

Related Instructables

Arduino project Intro to Arduino Arduino Basics- Step by Step


done using by randofo Using Hexapod - Fun Guide to the
Matlab- Analog Output - potentiometers - with Matlab Arduino
Simulink. (video) Convert PWM to I made it at (video) by Leonardo by
by Mohammad Voltage (Photos) TechShop by c0ffeepowder
by ProvideYourOwn
AlShawabkeh madebyjoe
ProvideYourOwn

Comments
3 comments Add Comment

Analogue-Chick says: Aug 27, 2012. 8:19 AM REPLY


Welcome to Instructables! :D

rmagtibay says: Aug 27, 2012. 3:14 PM REPLY


Thanks ma aiz

amandaghassaei says: Aug 27, 2012. 8:35 AM REPLY


cool, great idea!

http://www.instructables.com/id/Arduino-IO-Matlab-basic-tutorial/

You might also like