File Exchange

image thumbnail

Simulink Support Package for Arduino Hardware

version 1.4.1 (15 KB) by

Run models on Arduino boards.

8 Ratings



Editor's Note: Popular File 2013 2014 2015 2016

Simulink® Support Package for Arduino® Hardware enables you to create and run Simulink models on Arduino boards. The support package includes a library of Simulink blocks for configuring and accessing Arduino sensors, actuators, and communication interfaces. It also enables you to interactively monitor and tune algorithms developed in Simulink as they run on Arduino.

This support package is functional for R2013a and beyond.

Comments and Ratings (35)

Pradeep KS

Hi Om,
  The error log shows that make utility is not able to resolve space in the gmake path i.e."E:\Program Files\MATLAB\R2016b\bin\win64\gmake". Could you please check if your system Environment "PATH" has any cygwin entry which might conflict with the Windows cmd shell utility.
If exists, please remove those paths and try building the model.

Note: Take a back of your PATH variable before modifying.

Om Sharma

Geting error during uploading simulink model in arduino. Please help

### Generating code into build folder: C:\Users\Om\Documents\MATLAB\untitled1_ert_rtw
### Invoking Target Language Compiler on untitled1.rtw
### Using System Target File: E:\Program Files\MATLAB\R2016b\rtw\c\ert\ert.tlc
### Loading TLC function libraries
### Initial pass through model to cache user defined code
### Caching model source code
### Writing header file untitled1.h
### Writing header file untitled1_types.h
### Writing source file untitled1.c
### Writing header file rtwtypes.h
### Writing header file untitled1_private.h
### Writing source file untitled1_data.c
### Writing header file rtmodel.h
### Writing source file ert_main.c
### TLC code generation complete.
### Creating project marker file: rtw_proj.tmw
### Evaluating PostCodeGenCommand specified in the model
### Using toolchain: Arduino ARM v1.6.7 | gmake (64-bit Windows)
### Creating 'C:\Users\Om\Documents\MATLAB\untitled1_ert_rtw\' ...
### Building 'untitled1': E:\Program Files\MATLAB\R2016b\bin\win64\gmake -f all
'E:\Program' is not recognized as an internal or external command,
operable program or batch file.
### Creating HTML report file untitled1_codegen_rpt.html
### Build procedure for model: 'untitled1' aborted due to an error.
Error(s) encountered while building "untitled1":
### Failed to generate all binary outputs.

Gerald Lee

Pradeep KS

Hi Roxy,
 Only MATLAB and Simulink License is required to program the Arduino boards.
You need Simulink Coder License to view the generated code.

Roxy Short

Does this require Simulink coder?

Finally resolved - thanks to Guarav. Uninstalled the MATLAB and Simulink Arduino Hardware Support Packages. Re-installed (just the Simulink Package) and it works fine now. Not sure if there is any issue with installing the MATLAB package as well.

Justin Mellor

R2017a arduino_gettingstarted compilation error

I have followed the getting started instructions but get this compiler error:

C:/ProgramData/MATLAB/SupportPackages/R2017a/toolbox/target/supportpackages/arduinotarget/registry/../src/MW_ArduinoHWInit.cpp:33:43: error: 'Serial_begin' was not declared in this scope
     Serial_begin(0, _RTT_BAUDRATE_SERIAL0_);
gmake: *** [MW_ArduinoHWInit.o] Error 1
### Build procedure for model: 'arduino_gettingstarted' aborted due to an error.

The MATLAB and Simulink HW Support Packages are installed and I have installed the MinGW64 compiler:
'MEX configured to use 'MinGW64 Compiler (C)' for C language compilation.'

What am I missing?


Can someone know how to solve the following issue?:

- Tried to install the package Opening the .mlpkginstall file from within MATLAB.

- The following pop-up appears during the installation.

"Error installing third party package Arduino software: Invalid zip file ( than it has been reported the installation path)

Hi all,

Could someone help me with the following issue?:

- Tried to install the package Opening the .mlpkginstall file from within MATLAB.

- The following pop-up appears during the installation.

"Error installing third party package Arduino software: Invalid zip file ( than it has been reported the installation path)



Antonin (view profile)

In 16b, we added drastic improvements to External mode on Arduino Uno, Mega, Mega ADK and Due.
On Uno and Mega, you can log 1 signal @1kHz without data drops. The limited memory of Uno will allow you to monitor up to 6 signals before you run out of memory.
We increased the baudrate of Uno and Mega boards to 921400 to further improve the experience, while Due still uses 115200.

This is at least 30 times faster than in previous versions, even on the Due board.

Hi Sahil, Could you please report the error message to our Technical Support team? You can create a technical support request at the following page:


sahil Kumar

I have matlab R2013a and an arduino uno and have tried to download and install the support package for Arduino by both methods and it doesnt seem to work.
       When I try to manually download it and load it through matlab the open folder does not show that file.
       Whereas when I try to download and install it through it asks for permission but then the progress bar is shown stuck at about 80% and then after a while I get an error , please help.

audi alahmad

thank you for help


Antonin (view profile)

Hi Rami,
Not sure if you are looking for Linux support. If you are, note that Linux is supported as a host platform for this support package from R2015b onwards.
More on the system requirements at the following page:
I hope it helps,

still not working on 2014a...why??

Dan Lluch

Dan Lluch (view profile)

@ tin zar - This particular .mlplginstall file is functional for 13a and beyond... opening the file in 15a will initiate the installation process for the Simulink Support Package for Arduino Hardware.

you can see an overview of the arduino options with MathWorks tools and releases first introduced here:

can this support package also work for matlab R2015a?

I am able to install but not able to open the library. Please help.

The problem of installing the package on R2014a has been reported several times. It is ironic that MATLAB package is installed with no problems. The problem has been presentiment for months although other packages are installed successfully like Raspberry Pi and USB webcam

sai kiran

When I am trying to install the arduino package it says
Possible causes:
- You have recently cleared your MATLAB preferences, or
- You are using a shared MATLAB installation and the above support packages
  were installed by another user.

I am not understanding what to do.
But i have successfully installed Arduino Due package. Can anyone help me


Klont (view profile)

When I double-click the aruinoio.mlpkginstall file in the Current Folder window in Matlab 2014a on Ubuntu 12.04 LTS, I get an error-dialog stating:

MATLAB Support Package for Arduino Hardware cannot be installed on this system. It requires: Base Product: MATLAB Host Platforms: Win32,Win64,Mac64

How do I connect to Arduino from Matlab from Linux?


Sina (view profile)

Hi. I am trying to use this package with an Arduino Uno board that's connected to a motor driver to drive a motor to my desired position and speed (later with implementing a PID controller).
I was wondering how I can use this package with the motor real time. Or how I can design the PID controller in Simulink for this application.
Thank you.


Carlos (view profile)

Thanks Md. Ashfaque & Sreeram! As a temporary solution I used the for iterator block and buffered the bytes in an array. I shall look into custom blocks later on for better efficiency.


Hi Carlos,

There are two options
1) One could use for iterator block or something that can read bytes one by one and then buffer them as per application needs in the model
2) or on the contrary create a custom block that uses the Serial.readBytes function from the arduino standard library.
For creating a Custom driver block one could follow the guide published at

Hope this helps,
Sreeram Mohan

Md. Ashfaque

Hi Carlos,
The best way to transmit an array of characters/string is to use the s-function builder block and simply use the Serial.print() command that is used in the Arduino IDE.


Carlos (view profile)

Hello, if I want to read multiple bytes of data in each time step, what I should do with the Serial Read block since it only read 1 byte everytime? Thanks.

It has problems in Windows 8.1 when I try to download model to Arduino.

addie irawan

I have a problem on using most of the PWM pins in PWM block for Arduino Mega 2560. The warning prompt shows this block only for Arduino UNO not Arduino Mega although the mask prompt written it support both boards. Please help me on this

Murat Belge

Support package installer is supported since R2012a. Type in "targetinstaller" at the MATLAB command prompt to launch the installer.


A (view profile)

Support Package Installer only for MATLAB 8.1 (R2013a)?

Hi, I´m trying to do data adquisition with arduino in simulink, I configured the device and run the configurations (build the code), but I have a problem, when I start te simulation appear a error message, "Checksum mismatch. Verify the correct target application is running and if necessary rebuild target code."

I appreciate your help, thanks!

erik popo

it's a good tool


New thumbnail.

no change - upgrading hardware support package download action

updating thumbnail and description

Minor license update

MATLAB Release
MATLAB 8.1 (R2013a)

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

» Watch video