Topics: ArduinoIO package Simulink with arduinoIO

Slides:



Advertisements
Similar presentations
Installing the MATLAB Add-On
Advertisements

Lab7: Introduction to Arduino
Re-programming the Simon Says with Arduino Linz Craig, Brian Huang.
MotoHawk Training Model-Based Design of Embedded Systems.
1 Arduino Board: Arduino UNO Arduino Programing Environment: Arduino 0022
 Main Components:  Sensors  Micro controller  Motor drivers  Chasis.
Embedded Programming and Robotics
Welcome to Workshop 88’s Tiny85 Class Please download Tiny core libs from: (for Arduino 1.0, not 1.5!) Unzip and.
Working with Arduino: Lesson #1: Getting Acquainted with the Kit EGN1007.
Arduino Part 1 Topics: Microcontrollers Programming Basics: structure and variables Digital Output Analog to Digital Conversion.
Part 1 Using the ARM board And start working with C Tutorial 5 and 6
Dean Brock, Rebecca Bruce and Susan Reiser, CCSC SE 2009 Using Arduino Material taken from Todbot blog Bionic Arduino Todbot blog Bionic ArduinoTodbot.
LAB 1 MATLAB, dSPACE and Simulink
Arduino. What is it? A open-source software suite and single-board microcontroller. Allows easy and affordable prototyping of microcontroller applications.
Introduction to the Arduino
EE 460 Advanced Control and System Integration
Getting Started With the Arduino Uno
1 - Remove LED from 13 and GND - Bring out your breadboard from HW#4 Arduino Overview:
Teaching Digital Logic courses with Altera Technology
Rebecca Bruce and Susan Reiser, May 2015 Analog Input and Output.
Programming in Arduino Materials:Arduino Board Casperelectronics Pre Pres. Notes Photos from workshop?
Bdps 2 Lecture 2. Circuits and Ohm's Law For resistive circuits.
CSE 341 Project : Ultrasonic Radar PRESENTED BY: NAME : AKIFA TASNEEM ID : SECTION: 02 1.
Arduino Week 3 Lab ECE 1020 Prof. Ahmadi. Objective Data acquisition (DAQ) is the process of measuring an electrical or physical phenomenon such as voltage,
What is programming? Make an algorithm to do something in a specific language programming. – Algorithm: a procedure or formula for solving a problem.
Introducing the Arduino Uno Presented by Dave Mawdsley, DACS Member, Linux SIG Member (wiring, programming and running a cute traffic light simulation)
Having fun with code, using Arduino in a middle school CS classroom
Arduino.
BEST Robotic, Inc. MATLAB/Simulink Team Training
Arduino Part 1 Topics: Microcontrollers
Michael Rahaim, PhD Candidate Multimedia Communications Lab
Welcome to Arduino A Microcontroller.
DE2-115 Control Panel - Part I
Overview What is Arduino? What is it used for? How to get started
Scrolling LCD using Arduino.
Microcontroller basics
Lab 1: Using NIOS II processor for code execution on FPGA
Val Manes Department of Math & Computer Science
Downloading Arduino FOR WINDOWS.
Microcontroller basics
Arduino is an open-source platform for building electronics projects
connect a DC-Motor with an arduino
Microprocessors Tutorial 1: Arduino Basics
IBM PC Controlled Keypunch4b
Overview What is Arduino? What is it used for? How to get started
Arduino Part 1 Topics: Microcontrollers Programming Basics
ECEN/MAE 3723 – Systems I MATLAB Lecture 2.
Introduction to Arduino Microcontrollers
Simulink Basics Reijo Vuohelainen
Arduino and Grove LET’S START.
Topics: Analog/Digital Read Relay control 7 segment control Buzzer
Roller Coaster Design Project
مقدمة في الاردنيو د فضل الاكوع.
Topics: Arduino Target Package
Working with Arduino: Lesson #1: Getting Acquainted with the Kit
David Nicholls, Hitex (UK) Ltd.
Welcome to Digital Electronics using the Arduino Board
Introducing the Arduino Uno
Banyule Coding Club: Learn Arduino Richard Counsel Malcolm Macleod Watsonia Library - June 2018 Reference materials here ->
Simulink Support for VEX Cortex BEST Robotics Sandeep Hiremath
Arduino programs Arduino toolchain Cross-compilation Arduino sketches
Intro to Micro Controllers
Introduction to Arduino
Lab #1: Getting Started.
Arduino Uno circuit basics
Introduction to Arduino
Arduino and Grove LET’S START.
Introduction to Arduino IDE and Software
ECE 3567 Microcontrollers Lab
Introduction to Programing the Cortex for BEST
Presentation transcript:

Topics: ArduinoIO package Simulink with arduinoIO Arduino Part 3 Topics: ArduinoIO package Simulink with arduinoIO

Workshop Overview Matlab VS IDE Getting started Hands-on Project 1: LED control Hands-on Project 2: LED dimmer Hands-on Project 3: Reading digital signal Hands-on Project 4: Up counter Hands-on Project 5: Reading analog signal Hands-on Project 6: LED dimmer v2 Hands-on Project 7: Relay control Hands-on Project 8: 7-segment control

Using MATLAB vs. IDE Environment 1 MATLAB is more interactive, results from Digital/Analog I/O instructions can be seen immediately without needing to program – compile – upload – execute each time. It is a good idea even just for algorithm prototyping 2 For wider-breadth projects (that might include data analysis, signal processing, calculations, simulation, statistics, control design …) MATLAB is better suited

1 2 MathWorks Solutions Arduino IO Package: Used to perform analog and digital input and output as well as motor control from the MATLAB command line 2 Arduino Target: Used to compile and download Simulink® code directly to the Arduino board

1 2 3 Getting started Install Matlab 2012a or later version Get arduinoIO package, unzip and place the folder inside a MATLAB folder : C:\Program Files\MATLAB 3 Open pde folder. By using arduino IDE software, load adiosv.pde into your arduino

Getting started(cont.) 4 Go to arduinoIO folder, copy everthing inside examples and simulink folder and paste it in the main arduinoIO folder Paste here 5 Open the matlab software, change your current folder to ArduinoIO folder ArduinoIO 6 Double click the arduino_io_lib.mdl file

Getting started(cont.) 7 You should be able to see simulink library for the arduino IO package Supported simulink block for arduino ArduinoIO Click to launch your first simulink example example

Getting started(cont.) 8 Your first arduino-simulink block Click to start simulation Your on-board led should blink once the program run. Select your com port Output to arduino led pin13

Hands-on Project 1: LED control Prepare your simulink block: Click library browser to view other simulink block Click new to create new simulink model

Hands-on Project 1: LED control Compulsory when using ArduinoIO package Prepare your simulink block: Drag and drop the required block to create new model Can be obtained from simulink library browser

Hands-on Project 1: LED control 2 Click to start simulation Run your simulink model Set to ‘inf’ This block will send digital signal 0 or 1 to arduino pin13. When the simulation runs, double click to change the switching position and observe the LED on your board

Hands-on Project 2: LED dimmer 1 Simulink model Prepare your hardware When simulating, vary slider gain to adjust the led brightness

Hands-on Project 3: Reading digital signal 1 2 Hardware Simulink model 10kOhm When you release the switch When you press the switch

Hands-on Project 4: Up counter 1 2 Hardware Simulink model 10kOhm

Hands-on Project 4: Up counter 2 Simulink model(cont.)

Hands-on Project 5: Reading analog signal 1 2 Hardware Simulink model

Hands-on Project 6: LED dimmer v2 1 2 Hardware Simulink model Gain : 5/1024 Gain : 255/1024 R 1k Ohm R 220 Ohm

Hands-on Project 7: relay control 1 hardware setup (use relay module from SIRIM robokit): relay2 relay1 relay4 relay3 GND 5v

Hands-on Project 7: relay control 2 The simulink model: 12

Hands-on Project 8: 7-segment control 1 hardware setup (use 7segment module from SIRIM robokit): 5v GND Bit 1 Bit 0 Bit 3 Bit 2 display4 display3 display2 display1

Hands-on Project 8: 7-segment control 2 The setting: bit3 bit2 bit1 bit0 display 1 2 3 4 5 6 7 8 9 we will use display number 4 only the number will be displayed based on the following table: 5v GND Bit 1 Bit 0 Bit 3 Bit 2

Hands-on Project 8: 7-segment control 2 Simulink model:

Hands-on Project 8: 7-segment control 2 Simulink model:

Hands-on Project 8: 7-segment control 2 Simulink model: uint8([ 0 0 0 1 ]) uint8([ 0 0 010 ]) uint8([ 0 0 1 1 ]) uint8([ 0 1 0 0 ]) uint8([ 0 1 0 1 ]) uint8([ 0 1 1 0 ]) uint8([ 0 1 1 1 ]) uint8([ 1 0 0 0 ]) uint8([ 1 0 0 1 ])

Hands-on Project 8: 7-segment control 3 The results:

http://www.mathworks.com/har dware-support/arduino- matlab.html www.arduino.cc www.ladyada.net/learn/arduino www.EarthshineElectronics.com https://learn.sparkfun.com/ http://www.mathworks.com/har dware-support/arduino- matlab.html References