Interfacing of Arduino With Matlab/Simulink: A Presentation ON
Interfacing of Arduino With Matlab/Simulink: A Presentation ON
PRESENTATION
ON:
INTERFACING OF ARDUINO WITH MATLAB/SIMULINK
PRESENTED BY:
Kartik Sharma
Department of Electrical Engineering
Rajasthan Technical University, Kota
Overview:
• What is Arduino?
• Why Arduino?
• Arduino Products
• Arduino Interfacing basics
• Arduino Interfacing Demonstration
What is Arduino??
• Arduino is an open-source prototyping platform based on
easy-to-use hardware and software.
• Inexpensive
• Cross-platform
• Simple, clear programming environment
• Open source and extensible software
• Open source and extensible hardware
Arduino boards:
Arduino UNO
Arduino MEGA
Arduino DUE
Arduino MINI
Arduino NANO
Understanding Arduino UNO
Interfacing Arduino with Simulink
For learning the interfacing of Arduino hardware with
Simulink we must have following tools available:
Software:
• Computer System with MATLAB R2012b or higher.
and installed with Simulink Support package for
Arduino Hardware.
Hardware:
• Any Arduino Board (UNO, MEGA..)
Open MATLAB:
Installing Support Package for Arduino
Open Simulink Library Browser:
Open Simulink Support Package for Arduino Hardware
Create a Model for Arduino Hardware
In this task, we will create a simple Simulink model that changes the state of
the Arduino digital output pin.
Insert the Pulse Generator block from the Simulink Sources library to the
new model.
Double-click the Pulse Generator block. Set the Pulse type to parameter to
Sample based and set the Sample time parameter to 0.2 second.
Insert the Digital Output block from Simulink support package for Arduino
hardware to the model. Use the default block settings.
• LEDs having 0.2 sec. time period and glows for only
40% duty cycle.
In the Simulink model, Click Tools > Run on Target Hardware > Prepare to Run.
Select the Hardware Implementation pane and select the required Arduino hardware
from the Hardware board parameter list. Do not change any other settings.
Click OK.
In the Simulink model, click the Deploy to Hardware button on the toolbar. The
model will now be deployed to the connected Arduino hardware.
Look at the LEDs attached to pin 9 and pin 10. The LED should blink one time
every second.