Find Arduino Port on Windows, Mac, and Linux
Your computer running MATLAB® Support Package for Arduino® Hardware automatically detects the supported official Arduino boards. However, if you are using an unofficial (clone) Arduino hardware, you need to first install the required device drivers manually before connecting the board and identifying the port number.
In general, if you are not able to find the port name after connecting an official Arduino board or an unofficial (clone) board by following the steps mentioned in the below sections, ensure that you first check with the vendor and install the required driver or update the driver software.
Use arduinolist to identify the
port number to which your Arduino board is connected. If you are still not able to identify the port follow
the steps mentioned below.
Find Port Number on Windows
Connect the Arduino board to one of the USB ports on your computer running MATLAB Support Package for Arduino Hardware.
If you are connecting the board for the first time, ensure that the driver installation is also complete.
Open Device Manager (In the search box on the Windows Taskbar, type
Device Manager).In the Device Manager window, expand the
Ports (COM & LPT)list.Note the port name (
COM#) that displays the Arduino board's name.
You will be using this name (for example,
COM3) as the value ofPortinput argument while creating thearduinoobject.
Find Port Number on Macintosh
Connect the Arduino board to one of the USB ports on your Mac running MATLAB Support Package for Arduino Hardware.
If you are connecting the board for the first time, ensure that the driver installation is also complete.
Open Terminal in macOS. To do this, you can either use Spotlight Search (search for
Terminal) or use the Finder window (launch Finder, click Go > Utilities, and double-click Terminal).At the command prompt in the Terminal, go to the root directory (run this command:
cd /).In the root directory, run this command:
ls /dev/*.Note the port name
/dev/tty.usbmodem*or/dev/tty.usbserial*.You will be using this name (for example,
/dev/tty.usbmodem1421) as the value ofPortinput argument while creating thearduinoobject.
Find Port Number on Linux
Connect the Arduino board to one of the USB ports on your computer running MATLAB Support Package for Arduino Hardware.
Note
If you are connecting any Arduino board over USB, make sure that the respective COM port has the read, write, and execute permissions.
If you are connecting the board for the first time, ensure that the driver installation is also complete.
Open a Terminal in Linux.
At the command prompt in the Terminal, go to the root directory (run this command:
cd /).In the root directory, run this command:
ls /dev/tty*.Note the port name
/dev/ttyUSB*or/dev/ttyACM*.You will be using this name (for example,
/dev/ttyUSB0) as the value ofPortinput argument while creating thearduinoobject.