Arduino Target for Simulink

From Matt Bilsky

Installing the Arduino Package in Simulink 2011

To install the Arduino Target for Simulink:

  1. Download the package located here:
  2. Extract the zip file to an easy to find location (i.e. C:/arduinoTarget)
  • Note that it is important to select a folder that has no spaces in the path
  1. Follow the installation instruction located at C:/arduinoTarget/README.txt

Note the following changes to the instructions from MathWorks:

  • We are going to use the Arduino IDE version 23 which may be downloaded here: Just extract the archive to an easy to located directory (i.e. your desktop)
  • As stated in the README file, PIL (processor in the loop) mode is only supported in matlab 2011b or later. This guide was written using 2011a.

Configuring IDE Model

At the Matlab command prompt execute the following:

  1. Set the path of your Arduino IDE: arduino.Prefs.setArduinoPath('c:\Program Files\arduino\arduino-0023')
  2. To see a list of supported Arduino boards: arduino.Prefs.setBoard
  3. Choose your specific board: arduino.Prefs.setBoard('uno')
  4. Search for available COM ports: comPorts=arduino.Prefs.searchForComPort
  5. Set your COM port: arduino.Prefs.setComPort('COM9');

Available Demos from MathWorks

Type the name of the demonstration at the Matlab command prompt to launch the model

  • demo_arduino_blink
  • demo_arduino_blink_challenge
  • demo_arduino_blink_challenge_stateflow
  • demo_arduino_serial_communication
  • demo_arduino_serial_communication_host

Below is a video showing the install process performed in Simulink 2011a

(Set playback to 720p for a clearer picture)