Hardware Support

Raspberry Pi Support from Simulink

Run models on Raspberry Pi


Capabilities and Features

Simulink® Support Package for Raspberry Pi™ lets you develop algorithms that run standalone on your Raspberry Pi. The support package extends Simulink with blocks to drive Raspberry Pi digital I/O and read and write data from them. After creating your Simulink model, you can simulate it and download the completed algorithm for standalone execution on the device. One particularly useful (and unique) capability offered by Simulink is the ability to tune parameters live from your Simulink model while the algorithm runs on the hardware.

The support package includes:

  • Library of Simulink blocks that connect to Raspberry Pi I/O, such as audio input and output, video input and display, GPIO read and write, and ThingSpeak™ read and write
  • Hardware setup screens to configure Raspberry Pi hardware and Wi-Fi network interface
  • Customization of existing Raspbian OS images to make it compatible with the Simulink Support Package
  • Data logging from sensors and signals into MAT files saved on the Raspberry Pi
  • UDP and TCP/IP blocks to let your Raspberry Pi communicate with Arduino®LEGO MINDSTORMS® EV3, and mobile devices (Android™ and iOS)
  • Read and write blocks to communicate with peripherals over serial and the SPI and I2C protocols (Raspberry Pi board as the Master)
  • Publish and subscribe blocks for MQTT client support for machine-to-machine and IoT applications
  • Blocks to read input from the Raspberry Pi Sense HAT used in Astro Pi, such as humidity, pressure, and acceleration, user input from the joystick, and a block to write to the RGB LED Matrix display
  • Audio file read block to read audio files as PCM data, and multichannel support for Audio Capture and Playback blocks
  • Access to audio and video algorithms through add-on products such as Audio System Toolbox™ and Computer Vision System Toolbox™
  • Model deployment for standalone operation
  • Interactive parameter tuning and signal monitoring of applications running on Raspberry Pi
  • Documentation that guides you on how to create a device driver block to access specific features of your hardware board
  • Simulink Coder™ lets you access the C code generated from Simulink and trace it back to the original model.
  • Embedded Coder® lets you generate optimized code, use code replacement libraries, and perform software-in-the-loop and processor-in-the-loop verification.

Learn more about Raspberry Pi programming with MATLAB and Simulink.

Supported Hardware

The following Raspberry Pi models are supported by the support package. 

Raspberry Pi Model Simulink Releases Supported
Raspberry Pi 1 Model B (discontinued) R2014a - Current 
Raspberry Pi 1 Model B+ R2014b - Current 
Raspberry Pi 2 Model B R2014b - Current 
Raspberry Pi 3 Model B R2016a - Current 
Raspberry Pi Zero W R2018a - Current 
Raspberry Pi 3 Model B +
R2018b - Current

Note: Raspberry Pi 1 Model A, Raspberry Pi 1 Model A+, and Raspberry Pi Zero are currently not supported.

Available in R2018b: Simulink Support for the Raspberry Pi 3 Model B+

About Raspberry Pi

Raspberry Pi is a popular, low-cost, credit card sized single-board computer that supports embedded Linux operating systems, such as Raspbian. Raspberry Pi is powered by ARM® Cortex® A processors and provides peripheral connectivity for stereo audio, digital video (1080p), USB, and Ethernet – with optional camera board and sensor board add-ons.

Platform Support

See the hardware support package system requirements table for current and prior version, release, and platform availability.

View enhancements and bug fixes in release notes.


Related Hardware Support Views: Simulink, Alsa, Consumer Electronics, Control Systems, C ∕ C++ Code Generation, Digital Signal Processing, Embedded Systems, Ethernet, Image Processing and Computer Vision, Internet of Things, MathWorks Supported, Power Electronics Control Design, Project-Based Learning, Raspberry Pi, Run on Target Hardware, Serial, Support Package Installer Enabled, USB, Webcam (USB Video)

Ready to install?

Before installing the support package, confirm you have the correct setup. View system requirements and installation options.

Get support package

Software

Required

Note: Raspberry Pi 3 requires release 2016a or later.

Recommended

Support Package

Required

Support Package Installer installs this support package and all required third-party software. To start the installer, go to the MATLAB toolstrip and click Add-Ons > Get Hardware Support Packages. For more information, read the documentation.

Get support package

Hardware

Required

  • Raspberry Pi 1 Model B or B+, Raspberry Pi 2 Model B, Raspberry Pi 3 Model B, Raspberry Pi Zero W, Raspberry Pi 3 Model B+ (Premier Farnell/Element 14 and RS Components)
  • 4 GB SD card (Raspberry Pi 1 Model B) or 4 GB microSD card (Raspberry Pi 1 Model B+, Raspberry Pi 2 Model B, Raspberry Pi 3 Model B)
  • 5 V power supply; 700 mA or greater
  • Ethernet cable from the host computer to the Raspberry Pi
  • SD card reader (Raspberry Pi 1 Model B) or microSD card reader (Raspberry Pi 1 Model B+, Raspberry Pi 2 Model B, Raspberry Pi 3 Model B)
  • Note: Raspberry Pi 1 Model A and Raspberry Pi 1 Model A+ are not currently supported.
  • Recommended
  • USB webcam
    (Support package tested with Logitech Webcam Pro 9000)
  • Audio patch cables
  • USB hub with external power supply

Recommended

  • USB webcam
    (Support package tested with Logitech Webcam Pro 9000)
  • Audio patch cables
  • USB hub with external power supply

Software

Required

All required third-party software is installed by the Support Package Installer.

Don't see the hardware you're looking for?