element14 Community
element14 Community
    Register Log In
  • Site
  • Search
  • Log In Register
  • About Us
  • Community Hub
    Community Hub
    • What's New on element14
    • Feedback and Support
    • Benefits of Membership
    • Personal Blogs
    • Members Area
    • Achievement Levels
  • Learn
    Learn
    • Ask an Expert
    • eBooks
    • element14 presents
    • Learning Center
    • Tech Spotlight
    • STEM Academy
    • Webinars, Training and Events
    • Learning Groups
  • Technologies
    Technologies
    • 3D Printing
    • FPGA
    • Industrial Automation
    • Internet of Things
    • Power & Energy
    • Sensors
    • Technology Groups
  • Challenges & Projects
    Challenges & Projects
    • Design Challenges
    • element14 presents Projects
    • Project14
    • Arduino Projects
    • Raspberry Pi Projects
    • Project Groups
  • Products
    Products
    • Arduino
    • Avnet Boards Community
    • Dev Tools
    • Manufacturers
    • Multicomp Pro
    • Product Groups
    • Raspberry Pi
    • RoadTests & Reviews
  • Store
    Store
    • Visit Your Store
    • Choose another store...
      • Europe
      •  Austria (German)
      •  Belgium (Dutch, French)
      •  Bulgaria (Bulgarian)
      •  Czech Republic (Czech)
      •  Denmark (Danish)
      •  Estonia (Estonian)
      •  Finland (Finnish)
      •  France (French)
      •  Germany (German)
      •  Hungary (Hungarian)
      •  Ireland
      •  Israel
      •  Italy (Italian)
      •  Latvia (Latvian)
      •  
      •  Lithuania (Lithuanian)
      •  Netherlands (Dutch)
      •  Norway (Norwegian)
      •  Poland (Polish)
      •  Portugal (Portuguese)
      •  Romania (Romanian)
      •  Russia (Russian)
      •  Slovakia (Slovak)
      •  Slovenia (Slovenian)
      •  Spain (Spanish)
      •  Sweden (Swedish)
      •  Switzerland(German, French)
      •  Turkey (Turkish)
      •  United Kingdom
      • Asia Pacific
      •  Australia
      •  China
      •  Hong Kong
      •  India
      •  Korea (Korean)
      •  Malaysia
      •  New Zealand
      •  Philippines
      •  Singapore
      •  Taiwan
      •  Thailand (Thai)
      • Americas
      •  Brazil (Portuguese)
      •  Canada
      •  Mexico (Spanish)
      •  United States
      Can't find the country/region you're looking for? Visit our export site or find a local distributor.
  • Translate
  • Profile
  • Settings
Personal Blogs
  • Community Hub
  • More
Personal Blogs
Legacy Personal Blogs Arduino Tutorial #6: Introduction To Arduino Using Matlab Simulink
  • Blog
  • Documents
  • Mentions
  • Sub-Groups
  • Tags
  • More
  • Cancel
  • New
  • Share
  • More
  • Cancel
Group Actions
  • Group RSS
  • More
  • Cancel
Engagement
  • Author Author: meera_hussien
  • Date Created: 28 Jan 2019 1:13 PM Date Created
  • Views 2247 views
  • Likes 4 likes
  • Comments 5 comments
  • tutorial
  • mega
  • arduino_tutorials
  • arduino_tutorial
  • matlab
  • arduino
Related
Recommended

Arduino Tutorial #6: Introduction To Arduino Using Matlab Simulink

meera_hussien
meera_hussien
28 Jan 2019

Arduino Tutorial #6: Introduction To Arduino Using Matlab Simulink

 

                 In this tutorial, I would like to introduce you to the Arduino using the Matlab Simulink. Previously we have seen how to program an Arduino using the IDE. The process is pretty much the same, but the methods are different. The first thing you need to to do is to install the Matlab.


image



The installation process is straightforward. Once you have installed it, the next step is to open the Simulink. The Simulink comes together with the Matlab as a package. But before that, we must install the Simulink arduino package. This can be downloaded from the Add-Ons.


image



image



In the Add-Ons window, type Arduino and wait for the search to complete. Once it is done, go to the left panel and look for the "Using Simulink" and choose the Simulink Fundamentals. The window will refresh and next choose the first option. Once it is installed open the Simulink.



image


Then click the choose the "Blank Model". And it will bring you to a new window.



image


In this window choose the Library browser, which I have highlighted in below figure.


image


Once you click, a new window will pop up.


image

Next click "Simulink Support Package For Arduino Hardware".


image


Once you click this this, it will expand and dispalys another 4 more option.
Choose common and next choose the digital output.


image


Now we have the Arduino digital output block. Next, we need to provide a pulse to it. In order to do this, we can use one of the blocks under the Simulink option, which is the Sources. Click sources and choose Pulse Generator.


image


Once we have this, we need to measure the output from the pulse generator. To achieve this we can use the Sinks and choose Scope.


image


Once we have all of them in place, we can start to connect them.


image


The first step is to set up the pulse generator and measure its output with the scope.


image



The set up of the pulse generator is as shown in the image above. Next is to connect to the scope and check the output.






From the video, it shows the waveform which is created through the pulse generator. Here is the snapshot of the image. In the snapshot, it can be seen that the pulse is being generated every one second.



image


Once this done, the next step is to connect the pulse generator to the Arduino.


image


Once we connect the pulse generator to the Arduino, the Arduino pin need to be configured as well. We can use any pin which we desire but in this example, we choose Pin 13. The reason for Pin 13 is because it is connected to the internal LED. To achieve this we can simply double on the Arduino and change it.

Next step is to configure the hardware.


image


The Host Board Connection com port number depends on the individual PC. In my case, the com port number is 12.

The final step is to click the Deploy To Hardware Button.


image



Once this button is clicked, it will compile and execute on the target board.

That's all for now, in our next tutorial we shall try to do some small projects using the Simulink.
  • Sign in to reply

Top Comments

  • noorpuri
    noorpuri over 6 years ago +3
    Will MATLAB Arduino support work for all other boards which can be targeted with Ardunio package like . STM32F4 Discovery.
  • noorpuri
    noorpuri over 6 years ago +3
    I am interested because , MATLAB and Arduino combination could be use as starting point for learning the MODEL Based Embedded Design .
  • meera_hussien
    meera_hussien over 6 years ago in reply to noorpuri +1
    Hi noorpuri , I am not sure on that, but i believe it can be done. I will update you if i can get hold of any resources. Thank you.
  • madhugovindarajan
    madhugovindarajan over 6 years ago in reply to noorpuri

    Hi Milan.

     

    The table in this page lists all the Arduino boards supported in this workflow shown here.

     

    Based on this link - for STM32 Discovery boards, you will need a different toolbox called Embedded Coder which cannot be purchased with Student Suite.

     

    HTH,

    Madhu

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • More
    • Cancel
  • noorpuri
    noorpuri over 6 years ago

    I am interested because , MATLAB and Arduino combination  could be use as starting point for learning the MODEL Based Embedded Design .

    • Cancel
    • Vote Up +3 Vote Down
    • Sign in to reply
    • More
    • Cancel
  • dubbie
    dubbie over 6 years ago

    This was something I was always interested once I knew it was possible, but never got around to looking into as there just wasn't enough time, or availability of MATLAB. My old University used a floating licence arrangement and there were never enough licences to be sure of running a whole class. Plus, I preferred to use free software the students could download at home so that they could continue working when away from campus. The Arduino IDE was much better for this approach. But I've always liked MATLAB,, based on it's original concept of a matrix laboratory, as I was working with robots and transforming coordinate systems along a robot arm, for which it was perfect.

     

    Dubbie

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • More
    • Cancel
  • meera_hussien
    meera_hussien over 6 years ago in reply to noorpuri

    Hi noorpuri,

     

    I am not sure on that, but i believe it can be done. I will update you if i can get hold of any resources. Thank you.

    • Cancel
    • Vote Up +1 Vote Down
    • Sign in to reply
    • More
    • Cancel
  • noorpuri
    noorpuri over 6 years ago

    Will MATLAB Arduino support work for  all other boards which can be targeted with Ardunio package like . STM32F4 Discovery.

    • Cancel
    • Vote Up +3 Vote Down
    • Sign in to reply
    • More
    • Cancel
element14 Community

element14 is the first online community specifically for engineers. Connect with your peers and get expert answers to your questions.

  • Members
  • Learn
  • Technologies
  • Challenges & Projects
  • Products
  • Store
  • About Us
  • Feedback & Support
  • FAQs
  • Terms of Use
  • Privacy Policy
  • Legal and Copyright Notices
  • Sitemap
  • Cookies

An Avnet Company © 2025 Premier Farnell Limited. All Rights Reserved.

Premier Farnell Ltd, registered in England and Wales (no 00876412), registered office: Farnell House, Forge Lane, Leeds LS12 2NE.

ICP 备案号 10220084.

Follow element14

  • X
  • Facebook
  • linkedin
  • YouTube