MATLAB Support Package for Arduino Hardware
Acquire inputs and send outputs on Arduino boards
408.7K Downloads
Updated
11 Dec 2024
Interactively communicate with Arduino boards using MATLAB. Read and write sensor data, control actuators, and visualize results in real time—no code compilation required.
Leverage thousands of MATLAB functions for analysis, plotting, and algorithm development with your Arduino-collected data. You can also create and distribute standalone MATLAB applications that interface with Arduino hardware over Serial, even on systems without MATLAB installed.
Key Features
- Connect and communicate with Arduino boards via USB, Wi-Fi, or Bluetooth directly from MATLAB.
- Use integrated project files from Arduino Engineering Kit Rev2 for hands-on learning and project building. (Rev1 supported for R2019a–R2021b.)
- Communicate with external devices using GPIO, I2C, SPI, and CAN protocols.
- Programmatically control servos, shift registers, and rotary encoders.
- Read real-time data from a wide variety of sensors, including IMU, environmental, BNO055, GPS, APDS9960, and ultrasonic sensors.
- Create and use custom add-on libraries for Arduino and supported shields.
- Control and monitor Arduino boards using the Arduino Explorer App.
For supported Arduino boards and more features, visit: Arduino Support from MATLAB
Documentation
- Main Documentation Page
- Setup and Configuration Guide
- Example Projects and Scripts
- Supported Boards
- Arduino Documentation
- Release Notes
Example Applications
- Getting started: Getting Started with MATLAB Support Package for Arduino Hardware
- Explorer App: Measure Temperature and Control Peripherals using the Arduino Explorer App
- Deploy Arduino Functions to Arduino Hardware Using MATLAB Function Block : Gyroscope-Based Pedometer Using MATLAB Functions
- I2C Devices : Measure Temperature From I2C Device on Arduino® Hardware
- SPI Devices : Communicate with SPI Device on Arduino® Hardware
- Shift Registers : Push Button Control with 74HC165 Shift Register
- Shift Registers : Control 7-Segment Display with 74HC595 Shift Register
- Shift Registers : Control LEDs with 74HC595 Shift Register
- Quadrature Encoders : Control Rotary Encoder Knob
- Quadrature Encoders : Steer Two-Wheel Robot
- Servo Motors : Control Servo Motors
- Adafruit Motor Shield V2 : Control Motors Using Adafruit® Motor Shield V2
- CAN Interface : Read and Write CAN Messages with Arduino Hardware
- CAN Interface : Advanced CAN Communication with Arduino Using Vehicle Network Toolbox
- CAN Interface : Overcome Buffer Size Limitation of Arduino
- Motor Carrier : Webcam Controlled Rover Using Arduino Engineering Kit Rev 2
- Motor Carrier : Drawing Robot Using Arduino Engineering Kit Rev 2
- Sensors : Estimating Orientation Using Inertial Sensor Fusion and MPU-9250
- Sensors : Wireless Data Streaming Using BNO055 and Bluetooth® and Estimating Orientation Using Sensor Fusion
- Sensors : Plot Position Using GPS Connected to Arduino Hardware
- Sensors : Measure LSM9DS1 Sensor Outputs Using Nano 33 BLE Sense
- Custom Sensor : Create a Custom Arduino Add-On Library
- Custom Sensor : Read LSM303 Accelerometer Data from Arduino with a MATLAB Add-On Library
- Arduino Engineering Kit: The Drawing Robot, Part 1: Introduction to the Drawing Robot
- Arduino Engineering Kit: The Drawing Robot, Part 2: Configure and Test DC Motors of the Robot
- Arduino Engineering Kit: The Drawing Robot, Part 3: Draw Images from a Picture or Webcam
Additional Projects & Tutorials
- Arduino Map Maker - Mapping Your Surroundings Using MATLAB and Arduino
- Log Temperature Data from Arduino into MATLAB - Log Temperature Data from Arduino
- Solve a Rubik's Cube - Solve a Rubik’s Cube with a Webcam, Servos, and MATLAB
Support
- This support package is functional for R2014a and beyond.
- To use Arduino hardware with MATLAB versions R2013b and earlier, see - http://www.mathworks.com/matlabcentral/fileexchange/32374
- For any issues with this support package, please contact MathWorks Technical Support - https://www.mathworks.com/support/contact_us.html
Notes
- For MATLAB R2017a and earlier versions, this support package is currently unable to download third-party software. For details and workaround, see this Bug Report https://www.mathworks.com/support/bugreports/1741173
- MATLAB R2017b and later versions are unaffected
MATLAB Release Compatibility
Created with
R2016b
Compatible with R2016b to R2025a
Platform Compatibility
Windows macOS (Apple silicon) macOS (Intel) LinuxCategories
- Signal Processing > Signal Processing Toolbox >
- MATLAB > Data Import and Analysis > Data Import and Export > Hardware and Network Communication > Serial and USB Communication >
- Test and Measurement > Data Acquisition Toolbox > Analog Input and Output >
- Test and Measurement > Data Acquisition Toolbox > Digital Input and Output >
- Test and Measurement > Data Acquisition Toolbox > Periodic Waveform Generation >
- Test and Measurement > Data Acquisition Toolbox > Data Acquisition Toolbox Supported Hardware >
- Physical Modeling > Simscape Electrical > Electrical Block Libraries > Electromechanical >
Find more on Signal Processing Toolbox in Help Center and MATLAB Answers
Tags
Acknowledgements
Inspired: Arduino Pendulum Physics Lab, LSM303 Add-On Library for Arduino, DHT20 Temperature and Humidity, SGP30 eCO2 & TVOC sensor, L3G Add-On Library for Arduino, ADS1115 for MATLAB and Arduino, Capacitive Sensor Add-On Library for Arduino, EVM analysis of OFDM signal
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!Discover Live Editor
Create scripts with code, output, and formatted text in a single executable document.