Raspberry pi running in external mode send data over (serial) communication to arduino uno

조회 수: 6(최근 30일)
Dear all,
In my project I want to combine the processing power of a Raspberry Pi3 with an arduino uno microcontroller. The goal is to develop a vision based controlled mobile robot. Where the image processing takes places at the Raspberry (find a state reference [x,y,theta]) and the robot control is handled by the Arduino. I want to use the Raspberry Pi support package for Simulink for the image processing on the Raspberry. The code for controlling the robot (read encoders, compute control action, etc.) is complete. Hence, the missing part is sending a reference value (array [1x3]) from the Raspberry to an Arduino.
Some internet research suggests that is possible to setup communication between the devices over the USB ports. Other methods include creating a serial connection between the GPIO pins of Raspberry and the RX TX pins on the Arduino. However, it is unclear to me how to 'write' information over such a connection from the simulink environment (since there is no serial write block available in the support package).
  • What is the best/easiest way to connect the Raspberry to an Arduino?
  • How do i sent data (array of [1x3]) to the Arduino from the Raspberry Simulink model?
kind regards, Jeroen


Venkatachala Sarma
Venkatachala Sarma 2016년 5월 30일
Hi Jeroen,
First, there is no Simulink block as of now for serial communication with Raspberry PI as given in the following link.
You could use these commands inside a MATLAB Function Block
Hope this helps.


Find more on Simulink Support Package for Raspberry Pi Hardware in Help Center and File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by