Using Simulink with Arduino

This page describes the steps required to set up Simulink to work with Arduino. The instructions assume that you have MATLAB installed on your computer.

To use Simulink to create code that can be run on the Arduino, we need to install the Arduino Support Package from Simulink. We can install the support package from directly within the MATLAB environment. To do this, do the following:

  1. Open up MATLAB.
  2. Navigate to Resources/Add-Ons and click the drop-down arrow.
  3. Click “Get Hardware Support Packages”
  4. When the Support Package Installer box opens up, select “Install from Internet”.
  5. A box that looks like the following will open up. Select ‘Arduino’ in the box on the left, and check ‘Install’ for the entry that has ‘Simulink’ under the Required Base Product (this should be the only entry).
  6. Follow through with the installation

Using the Arduino Support Package

  1. In the MATLAB command prompt, type in simulink and hit ‘enter’.
  2. When the library browser opens up, scroll down and you should see a new library entitled ‘Simulink Support Package for Arduino.’
  3. You can drag-and-drop these blocks into your model as you would normal Simulink blocks. You can also use blocks from other libraries.