You are on page 1of 6

Arduino-Simulink

Course to 6/9 26/8 9-12am, daily

University of Jordan

:Course coordinator
Mohammad AlShawabkeh/ B.Sc student Mechatronics engineering 09 Eng91moh@hotmail.com 962797150681+

:Prerequisites
Electronics 1 Digital logic design

Createdby: MohammadAlShawabkeh MechatronicsEngineering/B.Sc.Student Facultyof Engineering& Technology The Universityof Jordan Madaba,Jordan www.eng91moh.blogspot.com Mobile/Cellphone: +962797150681

Preface
-1-

This is an Arduino-Simulink course, introduced primary though the applications of two libraries, starting from the "ArduinoIO" to "Arduino Target" these two libraries created by Mathworks company to help the student-owned hardware to get solutions for controls, mechatronics, robotics, and signal processing in classroom labs. During this course many concepts will be discussed about designing control systems and mini projects using the Arduino UNO board and Simulink 7.12 R2011a, without using the manual programming. Many electronic devices will be discussed theoretically and practically, like sensors, diodes, resistors, transistors, LEDs, etc To summarize the overall knowledge of this course; five control systems will be designed using the two libraries, with some small projects to explain some concepts. I hope that you enjoy working through this course. In particular I hope you go on to enjoy the challenge and pleasure of designing and building control systems and mini projects.

Mohammad AlShawabkeh University of Jordan

1.1 Arduino UNO:


-2-

1.1.1 What is the Arduino? Arduino is an open-source electronics prototyping platform. It's intended for artists, designers, hobbyists, and anyone interested in creating interactive objects, environments, and embedded system.

1.1.2 Why do we use Arduino? Because, it's based on flexible, easy-to-use hardware and software.

1.2 Matlab-Simulink:
1.2.1 What is the Matlab-Simulink? Mathematical computing software for engineers and scientists created by Mathworks. MATLAB is a programming environment for algorithm development, data analysis, visualization, and numerical computation. Using MATLAB, you can solve technical computing problems faster than with traditional programming languages, such as C, C++, and Fortran. Simulink is an environment for multidomain simulation and Model-Based Design(1) for dynamic and embedded systems. It provides an interactive graphical environment and a customizable set of block libraries that let you design, simulate, implement, and test a variety of time-varying systems, including communications, controls, signal processing, video processing, and image processing.

(1): Model-Based Design is a process that enables faster, more cost-effective development of dynamic systems, including control systems, signal processing, and communications systems. In Model-Based Design, a system model is at the center of the development process, from requirements development, through design, implementation, and testing. The model is an executable specification that is continually refined throughout the development process. After model development, simulation shows whether the model works correctly.

1.2.2 Arduino-Simulink interfacing?

-3-

The interfacing process between Arduino and Simulink can be done using two libraries: ArduinoIO or Arduino Target. ArduinoIO: MATLAB Support Package for Arduino enables you to use MATLAB or Simulink to communicate with the Arduino board over a USB cable. This package is based on a server program running on the board, which listens to commands arriving via serial port, executes the commands, and, if needed, returns a result. Arduino Target: Embedded Coder Support Package for Arduino allows you to create Simulink applications that will run autonomously on your Arduino board. Using Simulink Coder and Embedded Coder, the Simulink model is automatically converted to readable C code, compiled, and downloaded to the Arduino.

1.3 Course objectives:


1.3.1 1.3.2 1.3.3 Build control systems and mini projects using Arduino's libraries by Simulink. Get the main aim of Modeling and Simulation. Dealing with electronics devices and sensors.

1.4 Highlights on Arduino UNO:


1.4.1 1.4.2 1.4.3 1.4.4 1.4.5 1.4.6 1.4.7 1.4.8 1.4.9 Microcontroller: ATmega328 Operating Voltage: 5v Input Voltage (recommended): 7-12 v Input Voltage (limits): 6-20 v DC Current per I/O Pin: 40mA DC Current for 3.3V Pin:50mA Flash Memory:32 KB Clock Speed: 16MHz Pins assignments: Analog read(A0-A5), analog write[PWM] (3,5,6,9,10,11), digital read(2-19), digital write(2-19).

1.5 Analog, digital, and PWM:


An analog or analogue signal is any continuous signal for which the time varying feature (variable) of the signal is a representation of some other time varying quantity with infinite number of values. A digital signal is discrete or discontinuous consisting of 'on' and 'off' states with finite number of values.

-4-

PWM: Pulse Width Modulation, or PWM, is a technique for getting analog results with digital means. This on-off pattern can simulate voltages in between full on (5 Volts) and off (0 Volts) by changing the portion of the time the signal spends on versus the time that the signal spends off. The duration of "on time" is called the pulse width. To get varying analog values, you change, or modulate, that pulse width. If you repeat this on-off pattern fast enough with an LED for example, the result is as if the signal is a steady voltage between 0 and 5v controlling the brightness of the LED.

-5-

*References:

1. Books: A. Practical Electronics for Inventors, Paul Scherz, Copyright 2000 by The McGraw-Hill Companies. All rights reserved. B. Introduction to Simulink with Engineering Applications, Steven T. Karris, Copyright 2006 Orchard Publications. All rights reserved. C. Designing Embedded Systems with PIC Microcontrollers, Second Edition,Copyright 2010 , Tim Wilmshurst. Published by Elsevier Ltd. All rights reserved.

2.Websites: A. Arduino.cc B. Mathworks.com

-6-

You might also like