Main Content

Get Started with Simulink Online for Arduino

Simulink® Support Package for Arduino® Hardware in Simulink Online™ enables you to create, run, and deploy Simulink models on your Arduino hardware through your web browser. The support package is preinstalled in Simulink Online. You can access Simulink Online from any standard web browser. For more information, see Cloud Solutions Browser Requirements.

Simulink Online for Simulink Support Package for Arduino Hardware requires that you install MATLAB® Connector™ on your host computer. For more information, see Install MATLAB Connector for Hardware Connectivity.

Make sure that you connect your Arduino board to the same host computer you use to log in to Simulink Online.

Supported Arduino Boards, Workflows, and Platforms on Simulink Online

Simulink Online for Arduino currently supports these hardware boards.

  • Arduino Due

  • Arduino Leonardo

  • Arduino MKR WiFi 1010

  • Arduino MKR 1000

  • Arduino MKR Zero

  • Arduino Mega 2560

  • Arduino Mega ADK

  • Arduino Micro

  • Arduino Nano 3.0

  • Arduino Nano 33 BLE Sense

  • Arduino Nano 33 IoT

  • Arduino Robot Motor Board

  • Arduino Robot Control Board

  • Arduino Uno

Simulink Online for Arduino currently supports these workflows and modes.

  • Simulation mode

  • Connected IO mode

  • External mode (XCP over Serial)

  • External mode (XCP over WiFi)

  • Processor-in-the-loop (PIL)

  • Build and deploy

Currently, you can download and install MATLAB Connector on these platforms:

  • Windows®

  • Mac

  • Linux®

Connect and Set Up Arduino Board on Simulink Online

Open a MATLAB Online session at https://matlab.mathworks.com/. Log in with your MathWorks® Account credentials and click Open MATLAB Online.

Once you log in to Simulink Online, follow these steps to launch the Hardware Setup window.

  1. In Simulink Online, click the Add-Ons icon Add-ons panel in the sidebar to open the Add-Ons panel.

    Simulink Online Add-Ons

  2. Use the search box at the top of the Add-Ons panel to search for Simulink Support Package for Arduino Hardware or browse the list of add-ons in the Recommended for You section.

    Click the Options button Options next to the add-on and then click Setup.

    Simulink Online launch Hardware Setup Dailog Box

The Hardware Setup dialog box provides step-by-step instructions to guide you as you review third-party licenses, set up MATLAB Connector if it is not already configured, install third-party software, and configure your Arduino board. Follow the instructions on each page of the Hardware Setup window. Note the pop-up notifications that come from MATLAB Connector and allow permissions wherever required.

  1. Review Third-Party Tools and Licenses

    On the Review 3p License screen, review all the third-party tools, licenses, and cores that the support package includes. All the third-party tools are preinstalled with the support package. Click Next to proceed.

    Review Third-Party Tools and Licenses

  2. Install and Set Up MATLAB Connector

    Use the Set Up MATLAB Connector screen to install MATLAB Connector for hardware connectivity. For more information on MATLAB Connector, click Get MATLAB Connector on the Hardware Setup window.

    Get MATLAB Connector

    Complete installing and setting up MATLAB Connector. Then, return to the Simulink Online session on your browser.

    Click Connect to establish a connection between Simulink Online and MATLAB Connector.

    Connect to MATLAB Connector

    Simulink Online displays a notification window requesting your permission to open MATLAB Connector. Click Open MATLAB Connector to proceed.

    Request window for connecting with MATLAB Connector

    The browser displays a pop-up notification, requesting your permission to connect to MATLAB Connector. Click Continue to proceed.

    MATLAB Connector Notification

    You should receive a notification window in MATLAB Connector to allow Simulink Online to connect to MATLAB Connector. Click Open MATLAB Connector to proceed.

    Attempting to connect to MATLAB Connector notification

    Click Next once Simulink Online establishes a successful connection with MATLAB Connector.

    Successful connection established with MATLAB Connector

  3. Install Third-Party Software

    In the Install 3p Software screen, click Install to download and install the flashing tools on your host computer.

    Install Third-Party Software

    MATLAB Connector displays a notification window requesting your permission to install Arduino third-party tools on your host computer. Click Yes to proceed.

    Install Third-Party permission

    Click Next once the third-party software installation process is complete.

    Third-Party Installation Complete

  4. Set Up Arduino

    Connect your Arduino board and choose your options to complete the setup. The process to set up your Arduino board remains the same in Simulink Online as on your desktop. Note the pop-up notifications that come from MATLAB Connector and allow permissions wherever required. For more information, see Security Considerations for Arduino Simulink Online.

    When the hardware setup is complete, open the examples to get familiar with the support package and its features.

Run Simulink Model in External Mode on Arduino Board

In Simulink Online, you can run a Simulink model in XCP over serial mode on your Arduino board.

This section demonstrates the external mode (XCP over serial) workflow in the Get Started with Arduino Hardware example.

  1. In the MATLAB Command Window, open the Simulink model.

    openExample('arduino_gettingstarted')

    Getting Started with Arduino Hardware Simulink Model

  2. On the Modeling tab of the Simulink model, in the Setup section, click Model Settings.

  3. In the Configuration Parameters dialog box, make sure that the Hardware board parameter is set to the Arduino board you connect to your host computer. For this example, the hardware board is set to Arduino Nano 33 IoT.

  4. Select Target hardware resources and configure these parameters in the External mode properties.

  5. Select Apply > OK.

  6. On the Hardware tab of the Simulink model, in the Mode section, click Run on board.

  7. In the Run on Hardware section of the Simulink model, click Monitor & Tune.

  8. Give Simulink Online permission to flash your Arduino board by clicking Yes.

    Flash notification on Arduino board

  9. Give Simulink Online permission to access the serial port on your Arduino board by clicking Yes.

    Serial port access notification on Arduino board

    Observe that the LED on the board blinks with a time period of 1 second.

See Also

| | | | | |

Related Topics

Go to top of page