View License

Download apps, toolboxes, and other File Exchange content using Add-On Explorer in MATLAB.

» Watch video

Highlights from
Arduino Serial Data Acquisition

Join the 15-year community celebration.

Play games and win prizes!

» Learn more

5.0
5.0 | 12 ratings Rate this file 214 Downloads (last 30 days) File Size: 522 KB File ID: #46775 Version: 1.3.0.1
image thumbnail

Arduino Serial Data Acquisition

by

Ye Cheng (view profile)

 

30 May 2014 (Updated )

Use serial communication to monitor live data from Arduino in MATLAB/Simulink

| Watch this File

File Information
Description

Do you want to monitor live data from Arduino® in MATLAB® and Simulink®?
-You can do so easily with Simulink External Mode if you use Arduino Mega 2560 and Arduino Due. http://www.mathworks.com/help/simulink/ug/remotely-monitoring-and-controlling-an-application-on-arduino-hardware.html
What if you use Arduino Uno?
-This File Exchange download will help you do exactly that.

This submission contains three files:
-serialRunOnArduino.slx: Download this model onto your Arduino board so that it sends data to serial port
-serialRunOnPC.slx: Run this model locally on your PC to collect and plot serial data in Simulink
-readArduinoSerial.m: Run this script to read and plot serial data in MATLAB

Required Products Simulink
MATLAB
MATLAB release MATLAB 8.3 (R2014a)
Other requirements Arduino Simulink Support Package - Required: http://www.mathworks.com/hardware-support/arduino-simulink.html Instrument Control Toolbox™ - Optional (Required only for serial read in Simulink)
Tags for This File   Please login to tag files.
Please login to add a comment or rating.
Comments and Ratings (20)
29 Aug 2016 Med Aymane Ahajjam  
14 Aug 2016 cris ponce

Gracias!!

Comment only
05 Jun 2016 cvrousseau

Thanks!

20 May 2016 Mahmoud Sayed  
19 Apr 2016 Andreas Oblong

Works perfectly

07 Apr 2016 Gábor Holló  
25 Mar 2016 sahab farjad

hi, at first thanks for your tutorial, it works, but with no results! I'm using GP2D120 IR-range-finder sensor and i don't know to connect the output signal sensor to witch pin in Arduino board.
thanks again for share this tutorial.

Comment only
25 Feb 2016 Geoffrey Sandja

when i try to run the serialRunOnArduino via run on Target Hardware on my Arduino Uno, i get
"Call to the function 'getTflTableList' failed."
I am using R2012b

Comment only
20 Feb 2016 Ankitkumar  
12 Jan 2016 Cristiano

I use R2015b and yun Arduino and the sample does not work out. Just out symbols like . It will be some limitation of Arduino Yun? The R2015b is the one that support ...

Comment only
23 Dec 2015 Rudra Chattopadhyay

OK, now I understand that it is because uint8 can represent a maximum value of 2^8 = 256, hence the 1/4 gain block in the Simulink model. It has nothing to do with sample time.

Comment only
22 Dec 2015 Rudra Chattopadhyay

My sensor output is in the range of 600-850 but the values read in are sample time dependent - when I used the default one (0.02s) the output was extraordinarily high (1e30 etc.) and when I used a sample time of 1s the output was lower (about 80). Any suggestions for getting the exact value in Simulink?

15 Oct 2015 alex harijanto

Great...!!! works

Thanks a lot

14 Sep 2015 DHRUPAL SHAH  
08 Sep 2015 kaveh dehno

Hi,

It works on my Leonardo, but gives me none sense data. I'm able to get the right data from Arduino serial monitor as well as the Mac Terminal.

Thanks
kaveh

Comment only
04 Sep 2015 Graham Lee

Worked with my UNO, and has an easy-to-follow setup guide. Great work, thanks!

01 Jul 2015 Rosco

Rosco (view profile)

Very helpful - got me up and running immediately. Thanks for sharing.

30 May 2015 Starhowl

It was only thanks to this submission that I understood data transmission on Arduino!

10 Feb 2015 chfakht chfakht

hello,
When trying this on the arduino uno, I get the following error when I try to run on target hardware: CRL: “None” cannot be found in the registry.

Comment only
07 Jan 2015 Nishant

The program shows 'catch err' error on line number 9.That's the only error that comes up.Please help me fix this.Thank you.

Comment only
Updates
30 May 2014 1.3

Minor trademark adjustment.

01 Sep 2016 1.3.0.1

Updated license

Contact us