I've posted two videos on YouTube about getting your Grove (or other Arduino-compatible board) connected to MATLAB. You can see the two videos here:
one includes the Grove Beginner Kit and the other is a standard Arduino Uno-compatible board. Depending on whether you are using the kit from the Bookstore or are using your own board from another source, either video should work to get your started.
Note on the Grove board: if you are having connection issues please refer to
- the Mathworks Hardware Help page, and
- update the driver software directly from SeeedStudio via it's Grove Board Wiki.
While one way to check the serial port software connection is with the Arduino IDE, as described in the two videos above, another is to use a program like CoolTerm (on Mac) and Realterm (on Windows). Here's check the serial ports in CoolTerm via teh Options menu:
Two interesting issues:
This issue ("avrdude: ser_open() ... COM3") seems to be discussed here.
In the second case the board worked with the Arduino IDE but not with MATLAB.
In both cases two suggested solutions may also be
- update to the firmware on the board may help...
- or updating the driver for the serial port may also help. (CP2102 USB Driver)
You may also need to verify that you are manually setting the port properly in Matlab (or Simulink): https://www.mathworks.com/help/supportpkg/arduino/ug/configure-host-com-port-manually.html
From Eric P.
In one case we found that the board could be programmed using the Arduino IDE and that Matlab could initially program the board but would then fail.
We suggested to the student to visit this page for advice
- Change Arduino root folder
- Or run Matlab as admin
- Or remove winavr ( of installed)
James Andrew Smith is an associate professor in Electrical Engineering and Computer Science Department in York University's Lassonde School. He lived in Strasbourg, France and taught at the INSA Strasbourg and Hochschule Karlsruhe while on sabbatical in 2018-19 with his wife and kids.