Hardware Support

Raspberry Pi Support from MATLAB and Simulink

Design, deploy, and interface to Raspberry Pi applications

Raspberry Pi Support from Simulink

Simulink Support Package for Raspberry Pi® Hardware 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.

  • Connected IO: Communicate with hardware peripherals during simulation without code generation.
  • Monitor Tune: Tune parameters from your Simulink model in real time while the algorithm runs on hardware.
  • Build Deploy Run: Create application-specific executables that runs on hardware using automated code generation.

You can now connect to the Raspberry Pi hardware board using Simulink Online.

Raspberry Pi hardware.

Getting Started

Install and setup a connection for Raspberry Pi in Windows®, Mac® and Linux® platforms. Deploy the algorithms.

Device Driver blocks.

Device Driver Blocks

Use device driver blocks to access specific features of your hardware board, such as communication protocols or hardware libraries, that are not included in the default Simulink Support Package for Raspberry Pi Hardware.

Simulink model of image inversion.

Web-Based Customizable Dashboard Blocks

Create an interactive dashboard display using the Dashboard Circular Gauge and Knob blocks from the Simulink Customizable Blocks library.

Plot for laser scan.

Read Lidar Laser Scan Data over ROS

Use Simulink Support Package for Raspberry Pi Hardware to read and receive a 2D lidar scan data of an indoor environment from a ROS.

Rotating fan and Sense HAT shield.

Predictive Maintenance for Rotating Device

Predict and monitor the health of a rotating device using a machine learning algorithm. Use the example below for predictive maintenance of any rotating device or piece of equipment so you can fix issues before failure occurs. Use the ThingSpeak platform to view the operational state in the cloud.

Simulink Library.

Speech Command Recognition

Deploy feature extraction and a convolutional neural network (CNN) for speech command recognition on Raspberry Pi. Capture audio from the microphone connected to the Raspberry Pi board and perform speech command recognition.

Supported Hardware

Raspberry Pi Model

  • Raspberry Pi 5
  • Raspberry Pi Compute Module 4
  • Raspberry Pi Zero 2 W
  • Raspberry Pi 4 Model B
  • Raspberry Pi 3 Model B+
  • Raspberry Pi Zero W
  • Raspberry Pi 3 Model B
  • Raspberry Pi 2 Model B
  • Raspberry Pi 1 Model B+

Note: Raspberry Pi 1 Model A, Raspberry Pi Model B, Raspberry Pi 1 Model A+, and Raspberry Pi Zero are currently not supported. Raspberry Pi Pico is supported from the Arduino support package from R2024b.

Supported Platforms: Windows, Mac, Linux

Raspberry Pi Support from MATLAB

MATLAB Support Package for Raspberry Pi Hardware provides two ways of programming Raspberry Pi applications from MATLAB.

  • Interactive Communication: Remotely communicate with a Raspberry Pi from a desktop installation of MATLAB or through a web browser with MATLAB Online. Acquire data from sensors and imaging devices connected to the Raspberry Pi and then analyze and visualize it in MATLAB.
  • Standalone Execution: Develop standalone embedded applications for Raspberry Pi with MATLAB Coder. Use interactive communication to prototype and develop your MATLAB algorithm. Then, automatically generate equivalent C code and deploy it to the Raspberry Pi to run as a standalone application.
Raspberry Pi hardware.

Getting Started

Install the support package, update the firmware, and connect to the hardware.

SPI interface.

Library Support

Use the libraries provided for interfaces like GPIO, Linux system shell, PWM and servo motor control, Raspberry Pi Sense HAT, Raspberry Pi Camera Module, USB webcam, I2C, SPI, and serial interfaces.

Code generation.

MATLAB Coder

Use MATLAB Coder to generate readable and portable C code from your MATLAB algorithm. Compile and execute this code on any processor by manually integrating it with the RTOS, I/O devices, and build tools for your processor.

Connection diagram.

Deep Learning Image Classification

Classify static image using deep learning on Raspberry Pi.

Generate and deploy code for an image classification algorithm using MATLAB Support Package for Raspberry Pi Hardware.

Code generation report.

Edge Detection

Deploy an edge detection algorithm on the Raspberry Pi hardware as a standalone executable using MATLAB Support Package for Raspberry Pi Hardware.

Audio event classification screenshot.

Audio Event Classification

Demonstrate audio event classification using a pretrained deep neural network, YAMNet, from TensorFlow™ Lite library on Raspberry Pi.

Supported Hardware

Raspberry Pi Model

  • Raspberry Pi 5
  • Raspberry Pi Compute Module 4
  • Raspberry Pi Zero 2 W
  • Raspberry Pi 4 Model B
  • Raspberry Pi 3 Model B+
  • Raspberry Pi Zero W
  • Raspberry Pi 3 Model B
  • Raspberry Pi 2 Model B
  • Raspberry Pi 1 Model B+

Note: Raspberry Pi 1 Model A, Raspberry Pi 1 Model B, Raspberry Pi 1 Model A+, and Raspberry Pi Zero are currently not supported. Raspberry Pi Pico is supported from the Arduino support package from R2024b.

Supported Platforms: Windows, Mac, Linux