MATLAB does not detect my Arduino

51 views (last 30 days)
Fatemeh Hamidizadeh
Fatemeh Hamidizadeh on 20 Oct 2020
Commented: Rik on 7 Dec 2021
Hi, I am using Macbook, and when i want to connect my arduino to MATLAB,using a hub, it does not detect the hardware while I am able to connect it to arduino application. How can I fix it?

Answers (1)

Jemima Pulipati
Jemima Pulipati on 22 Oct 2020
From my understanding, you are receiving an "Cannot detect arduino hardware" error when trying to connect an arduino in MATLAB on Macbook while using the "arduino()" command.
Without specifying parameters to the "arduino" command, MATLAB seems to be having trouble detecting Arduino devices on your machine.
Please try connecting to the Arduino board by explicitly specifying the port ID and board type in the "arduino" call. On a Mac the port string often starts with "/dev/". As an example:
>> a = arduino('/dev/tty.usbmodem1421','Uno')
a =
arduino with properties:
Port: 'COM3'
Board: 'Uno'
AvailablePins: {'D2-D13', 'A0-A5'}
Libraries: {'I2C'}
There could be several reasons you are experiencing the issues. You can try the following troubleshooting steps mentioned in the MathWorks documentation.
If you are still experiencing arduino hardware issues, contact MathWorks Technical Support.
  1 Comment
Rik on 7 Dec 2021
comment posted by @Veronica Maria Rodriguez Betancourtt as flag:
It worked good! Thanks!

Sign in to comment.

Community Treasure Hunt

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

Start Hunting!