Arduino Programming with MATLAB and Simulink

Build Arduino projects using high level programming and block diagrams

Arduino programming is supposed to be fun but can become frustrating and time consuming for tasks such as plotting sensor data or incorporating advanced math, signal processing, or controls routines into your projects.

MATLAB and Simulink address several challenges with traditional Arduino programming.  The products support two primary workflows:

Read, write, and analyze data from Arduino sensors

MATLAB support package for Arduino lets you write MATLAB programs that read and write data to your Arduino and connected devices such as Adafruit motor shield, I2C, and SPI devices. Because MATLAB is a high level interpreted language, programming with it is easier than with C/C++ and other compiled languages, and you can see results from I/O instructions immediately – no compiling.  MATLAB includes thousands of built-in math, engineering, and plotting functions that you can use to quickly analyze and visualize data collected from your Arduino.

With MATLAB support package for Arduino, the Arduino is connected to a computer running MATLAB. Processing is done on the computer with MATLAB.

Benefits of using MATLAB for Arduino programming:

Develop algorithms that run standalone on the Arduino

Simulink support package for Arduino lets you develop algorithms in Simulink, a block-diagram environment for modeling dynamic systems and developing algorithms, and run them standalone on your Arduino.  The support package extends Simulink with blocks for configuring Arduino sensors and reading and writing data from them.  After creating your Simulink model, you can simulate it, tune algorithm parameters until you get it just right, and download the completed algorithm for standalone execution on the device. With the MATLAB Function block, you can incorporate MATLAB code into your Simulink model.

With Simulink support package for Arduino, you develop the algorithm in Simulink and deploy to the Arduino using automatic code generation. Processing is then done on the Arduino.

Benefits of using Simulink for Arduino programming:

  • Develop and simulate your algorithms in Simulink and use automatic code generation to run them on the device
  • Incorporate signal processing, control design, state logic, and other advanced math and engineering routines in your hardware projects
  • Interactively tune and optimize parameters as your algorithm runs on the device
  • Easily modify algorithms to run on other low-cost and commercial hardware platforms

See also: Simulink, MATLAB, Hardware for Project-Based Learning, Model-Based Design, Control systems, Internet of Things, Raspberry Pi programming, LEGO Mindstorms programming, robotics, control logic videos, Communicating with hardware and instruments

MATLAB Support Package for Arduino

Simulink Support Package For Arduino