Franz Duran INTRODUCTION TO A RDUINO PROGRAMMING & INTERFACING Engr. Franz Duran, MEP-ECE RapidSignal Electronics.

Slides:



Advertisements
Similar presentations
Wireless Cue Light Project
Advertisements

Khaled A. Al-Utaibi Interfacing an LED The Light Emitting Diode (LED) Applications DC Characteristics & Operation Interfacing to.
EMS1EP Lecture 4 Intro to Programming Dr. Robert Ross.
Electrical team Arduino tutorial I BY: JOSHUA arduini
Lab7: Introduction to Arduino
ARDUINO FRAMEWORK.
Anurag Dwivedi & Rudra Pratap Suman.  Open Source electronic prototyping platform based on flexible easy to use hardware and software.
What is Arduino?  Arduino is a ATMEL 168 micro-controller kit designed specially for small projects  User friendly IDE(Integrated Development Environment)
Embedded Sumo 1T4 – 1T5 UTRA.
Introduction 2 BASIC Stamp®. Microcontrollers Microcontrollers can be thought of as very small computers which may be programmed to control systems such.
Re-programming the Simon Says with Arduino Linz Craig, Brian Huang.
Arduino. Arduino is a tool for making computers that can sense and control more of the physical world than your desktop computer. It's an open-source.
1 Arduino Board: Arduino UNO Arduino Programing Environment: Arduino 0022
Introduction.
Introduction to Arduino Prepared by R. Lamond.  “Arduino is an open-source electronics prototyping platform based on flexible, easy- to-use hardware.
Embedded Programming and Robotics
ARDUINO PROGRAMMING Working with the Arduino microcontroller.
Working with Arduino: Lesson #1: Getting Acquainted with the Kit EGN1007.
Dean Brock, Rebecca Bruce and Susan Reiser, CCSC SE 2009 Using Arduino Material taken from Todbot blog Bionic Arduino Todbot blog Bionic ArduinoTodbot.
2.0 EMBEDDED CONTROLLER Engr. Hj. Mohamad Fauzi bin Zakaria Department of Mechatronics and Robotics Engineering Faculty of Electrical and Electronic Engineering.
Microcontroller Hands-on Workshop #3 Ahmad Manshad New Mexico State University Institute of Electrical and Electronics Engineers November 7, 2009.
MICRO CONTROLLER MODULE 1. Learning Objectives Name some gadgets that use microcontrollers. Define a microcontroller. Differentiate between a computer.
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
1 - Remove LED from 13 and GND - Bring out your breadboard from HW#4 Arduino Overview:
Arduino A free development system based on Atmel AVR 8 bit microcontrollers. LB8X Tom.
Microcontrollers, Microcomputers, and Microprocessors
Arduino Training New Mexico Mathematics, Engineering, and Science Achievement (NM MESA) Getting Started.
Final Year Project(EPT4046) Development of an internet controlled Surveillance Mobile Robot By Mimi Madihah Bt Mohd Idris Id: BACHELOR OF ENGINEERING.
INTERNET OF EVERYTHING SDU 2016 Week 4. Simple Digital and Analog Inputs  The Arduino’s ability to sense digital and analog inputs allows it to respond.
Microcontroller basics Embedded systems for mortals.
Microcontroller basics Embedded systems for mortals.
Robotics Grant Agreement No LLP UK-LEONARDO-LMP Project acronym: CLEM Project title: Cloud services for E-Learning in Mechatronics Technology.
Programming in Arduino Materials:Arduino Board Casperelectronics Pre Pres. Notes Photos from workshop?
Introduction to Arduino A very basic intro to Arduino, the IDE and the Servos class.
Arduino + Bluetooth TYWu. Connection Arduino + Bluetooth Module.
Arduino Programming Part 6: LCD Panel Output ME 121 Portland State University.
Arduino “Getting Started” Instructor : Dr Matthew Miss Khin Yi Kyaw
INTRODUCTION TO A RDUINO PROGRAMMING Parimeet Rathore ( )
ME 120: Arduino Programming Arduino Programming Part 1 ME 120 Mechanical and Materials Engineering Portland State University
Arduino Board SHUBHAM PANCHAL: What is an Arduino? A microcontroller board + programming IDE Microcontrollers & Robotics.
Introducing the Arduino Uno Presented by Dave Mawdsley, DACS Member, Linux SIG Member (wiring, programming and running a cute traffic light simulation)
Prototyping with Microcontrollers and Sensors. Overview Objective Background Information Problem Statement Materials Procedure Assignment Closing.
Having fun with code, using Arduino in a middle school CS classroom
Arduino.
Getting Started: Building & Programming
By Rick Darby Sponsors: Geekspace Gwinnett The WorkSpot
Assist. Prof. Rassim Suliyev - SDU 2017
Prototyping with Microcontrollers and Sensors
Microcontroller basics
Microcontroller basics
UTA010 : Engineering Design – II
Get Your Project Started with Arduino
UCD ElecSoc Robotics Club 2017/2018
Arduino Part 1 Topics: Microcontrollers Programming Basics
INC 161 , CPE 100 Computer Programming
3.0 ARDUINO WORKSHOP PRESENTATION FOR STUDENTS IN 4º DEGREE OF COMPULSORY SECONDARY EDUCATION 3.0.
Arduino.
Introduction to Arduino Microcontrollers
Introduction to Arduinos
Roller Coaster Design Project
ARDUINO     What is an Arduino? Features 14 Digital I/O pins 6 Analogue inputs 6 PWM pins USB serial 16MHz Clock speed 32KB Flash memory 2KB SRAM.
Arduino 101 Credit(s):
Working with Arduino: Lesson #1: Getting Acquainted with the Kit
Welcome to Digital Electronics using the Arduino Board
Introducing the Arduino Uno
Programming 2: The Arduino IDE & First Sketches
Aeroponic Engineering and Vertical Farming
Lab #1: Getting Started.
Introduction to Arduinos
Presentation transcript:

Franz Duran INTRODUCTION TO A RDUINO PROGRAMMING & INTERFACING Engr. Franz Duran, MEP-ECE RapidSignal Electronics

Franz Duran OVERVIEW Microcontrollers & Robotics

Franz Duran OVERVIEW  DAY 1 (Morning) o Introduction to Microcontroller Technology o Introduction to Arduino microcontroller board o Introduction to RapiDuino Microcontroller Learning Module o Basic Arduino Programming and Interfacing  Interfacing with LEDs, switches, & LCD Microcontrollers & Robotics

Franz Duran OVERVIEW  DAY 1 (Afternoon) o Interfacing with 4x4 keypad o Interfacing with Analog Sensors o Interfacing with Serial Communication Microcontrollers & Robotics

Franz Duran OVERVIEW  DAY 2 (Morning) o Introduction to P-BOT mobile robot trainer o Maze mobot programming o Line follower mobot programming Microcontrollers & Robotics

Franz Duran OVERVIEW  DAY 2 (Afternoon) o Line follower mobot race o Android-controlled mobot o DIY line follower mobot Microcontrollers & Robotics

Franz Duran MICROCONTROLLER BASICS Microcontrollers & Robotics

Franz Duran What is a microcontroller?  MCU  A single-chip computer  Invented in the 1970’s  Used as “embedded” controller Microcontrollers & Robotics

Franz Duran Where are MCUs used?  used as dedicated controllers in: o Home and office appliances o Consumer & Personal electronics o Medical equipment o Industrial equipment o Automotive electronics o Naval/Avionics/Aerospace Microcontrollers & Robotics

Franz Duran Why use a microcontroller?  Low-cost  Flexible  Small outline  Low-power Microcontrollers & Robotics

Franz Duran Why use a microcontroller?  Low-cost o Typical price range: P50 to P1000  Flexible  Small outline  Low-power Microcontrollers & Robotics

Franz Duran Why use a microcontroller?  Cheap  Flexible o Re-programmable o High-integration devices  Small outline  Low-power Microcontrollers & Robotics

Franz Duran Why use a microcontroller?  Cheap  Flexible  Small outline o small physical size = low PCB footprint o tiny packages: DIP, SOP  Low-power Microcontrollers & Robotics

Franz Duran Why use a microcontroller?  Cheap  Flexible  Small outline  Low-power o Battery-operated application o Use SLEEP/low-power operation Microcontrollers & Robotics

Franz Duran ARDUINO MICROCONTROLLER Microcontrollers & Robotics

Franz Duran What is an Arduino?  A microcontroller board + programming IDE Microcontrollers & Robotics

Franz Duran What is an Arduino?  A complete MCU board o ATMEGA microcontroller o USB circuit o Power supply circuit o Reset button o Female header connectors Microcontrollers & Robotics

Franz Duran What is an Arduino?  Easy-to-use Arduino Development environment o Program is called Sketch Microcontrollers & Robotics

Franz Duran Arduino ECOSYSTEM  Arduino Board o Simple, open-hardware design  Arduino Programming IDE o C/C++-based, open-source o Built-in functions  Arduino Community o Design Arduino-compatible circuits (Shields) o Software and hardware collaboration Microcontrollers & Robotics

Franz Duran RAPIDUINO SWORD3 Microcontrollers & Robotics

Franz Duran RapiDuino Sword3 Microcontrollers & Robotics ARDUINO BOARD

Franz Duran RapiDuino Sword3 Microcontrollers & Robotics Arduino Uno gizDuino

Franz Duran RapiDuino Sword3 Microcontrollers & Robotics 2x16 Character LCD

Franz Duran RapiDuino Sword3 Microcontrollers & Robotics Button Switches

Franz Duran RapiDuino Sword3 Microcontrollers & Robotics 4x4 Keypad

Franz Duran RapiDuino Sword3 Microcontrollers & Robotics 4x4 Keypad

Franz Duran RapiDuino Sword3 Microcontrollers & Robotics 7-segment displays

Franz Duran RapiDuino Sword3 Microcontrollers & Robotics Light- emitting diodes

Franz Duran RapiDuino Sword3 Microcontrollers & Robotics Real-time clock w/ back-up battery

Franz Duran RapiDuino Sword3 Microcontrollers & Robotics Serial EEPROM

Franz Duran RapiDuino Sword3 Microcontrollers & Robotics buzzer

Franz Duran RapiDuino Sword3 Microcontrollers & Robotics Serial Communication Circuit

Franz Duran RapiDuino Sword3 Microcontrollers & Robotics Bluetooth Transceiver Module

Franz Duran RapiDuino Sword3 Microcontrollers & Robotics Analog voltage sources

Franz Duran RapiDuino Sword3 Microcontrollers & Robotics Temperature sensor

Franz Duran RapiDuino Sword3 Microcontrollers & Robotics light- dependent resistor

Franz Duran RapiDuino Sword3 Microcontrollers & Robotics Power Supply Circuit

Franz Duran BASIC ARDUINO PROGRAMMING & INTERFACING Microcontrollers & Robotics

Franz Duran LED Interfacing  Build an LED circuit  Interface the LED circuit to the Arduino  Create an Arduino program that will turn on the LED Microcontrollers & Robotics

Franz Duran What is an LED?  Light-emitting diode o An electronic device that emit visible light when activated. o Typically used as electrical status indicators Microcontrollers & Robotics

Franz Duran LED Interfacing Microcontrollers & Robotics Circuit schematic

Franz Duran LED Circuit Microcontrollers & Robotics Circuit on breadboard

Franz Duran LED Circuit on Rapiduino  Connect LED1 to Arduino Pin 7 Microcontrollers & Robotics

Franz Duran Arduino Environment  Open the Arduino programming environment Microcontrollers & Robotics

Franz Duran Writing the Sketch void setup() { } void loop() { } Microcontrollers & Robotics Example #1

Franz Duran Writing the Sketch void setup() { pinMode(7, OUTPUT); //Pin 7 is output pin. digitalWrite(7, HIGH); //LED is on. } void loop() { } Microcontrollers & Robotics Example #1

Franz Duran Writing the Sketch void setup() { pinMode(7, OUTPUT); //Pin 7 is output pin. digitalWrite(7, HIGH); //LED is on. pinMode(5, OUTPUT); digitalWrite(5, HIGH); } void loop() { } Microcontrollers & Robotics Example #1

Franz Duran Writing the Sketch  Click the Verify button Microcontrollers & Robotics Verify button

Franz Duran Steps for Uploading the Program 1.Connect the USB cable Microcontrollers & Robotics Note: Make sure USB-to-serial driver is installed first

Franz Duran Steps for Uploading the Program 2.Power up the Rapiduino board Microcontrollers & Robotics

Franz Duran Steps for Uploading the Program 3.Select the COM port number of the Serial Port Microcontrollers & Robotics

Franz Duran Steps for Uploading the Program 4.Select the Arduino Duemilanove w/ ATmega328 board Microcontrollers & Robotics

Franz Duran Steps for Uploading the Program 5.Press down the Reset button Microcontrollers & Robotics

Franz Duran Steps for Uploading the Program 6.While Reset button is pressed, click the Upload button 7.Release the Reset button Microcontrollers & Robotics Upload button

Franz Duran Steps for Uploading the Program Wait… … until uploading is done. Microcontrollers & Robotics

Franz Duran Steps for experimenting with the Rapiduino 1.Assemble the Arduino application hardware o Use ordinary solid wires 2.Write the sketch program 3.Upload program to Arduino Microcontrollers & Robotics

Franz Duran Arduino Sketch int LED1Pin = 7; //PIN7 is 'renamed' as LED1 void setup() { pinMode(LED1Pin, OUTPUT); digitalWrite(LED1Pin, HIGH); } void loop() { //nothing... } Microcontrollers & Robotics Example #1

Franz Duran Arduino Program  Called as Sketch o A simplified combination of C/C++ programming language  Consist of: osetup() function oloop() function Microcontrollers & Robotics

Franz Duran Arduino Program  The setup() function o The setup() function is called when a sketch program begins executing. o It is used to initialize variables, configure pin modes, begin using libraries, etc. o The setup() function will only run once, after each powerup or reset of the Arduino board. Microcontrollers & Robotics

Franz Duran Arduino Program  The loop() function o The loop() function repeatedly execute all codes appearing within its body. o Use it to actively control the Arduino board, i.e. read input, process information, send output Microcontrollers & Robotics

Franz Duran Arduino Program void setup() { //code1 //code2 } void loop() { //code3 //code4 //code5 } Microcontrollers & Robotics code1 code5 start code2 code4 code3

Franz Duran LED Interfacing  LED Blinker program Microcontrollers & Robotics Example #2 Configure Output pin start LED is off Time delay LED is on Time delay LED is off

Franz Duran Arduino Sketch: LED Blinker int LED1Pin = 7; void setup() { pinMode(LED1Pin, OUTPUT);//Pin 7 is output pin digitalWrite(LED1Pin, LOW);//LED is initially low } void loop() { digitalWrite(LED1Pin, HIGH);//Turn on LED. delay(500);//Time delay for 0.5 second. digitalWrite(LED1Pin, LOW);//Turn off LED. delay(250);//Time delay for 0.25 second. } Microcontrollers & Robotics Example #2

Franz Duran Button Switch Interfacing  Button switch: o a.k.a pushbutton or button o Used as simple input devices  Common example: o Tact switches Microcontrollers & Robotics

Franz Duran Button Switch Interfacing Microcontrollers & Robotics

Franz Duran Button Switch Interfacing Microcontrollers & Robotics Circuit on breadboard

Franz Duran Button Switch Interfacing  Program Description: o If button is pressed, turn on LED. o Else, if button is not pressed, turn off LED.  Operation: o Button is connected to Pin 5. o Pin 5 is configured as input pin o If button is pressed, Pin 5 reads Logic 0; else, if not pressed reads as Logic 1 Microcontrollers & Robotics

Franz Duran Button Switch Interfacing  Assemble circuit on Rapiduino: o LED1  Pin 7 o BUTTON1  Pin 5 Microcontrollers & Robotics

Franz Duran Arduino Sketch int LED = 7; int BUTTON = 5; void setup() { pinMode(BUTTON, INPUT); pinMode(LED, OUTPUT); digitalWrite(LED, LOW); } void loop() { int ButtonStat; ButtonStat = digitalRead(BUTTON); if(ButtonStat == LOW) { digitalWrite(LED, HIGH); } else { digitalWrite(LED, LOW); } } Microcontrollers & Robotics Example #3

Franz Duran 2x16 Character LCD Interfacing  Output device for displaying characters  2 rows, 16 characters Microcontrollers & Robotics

Franz Duran 2x16 Character LCD Interfacing Microcontrollers & Robotics POWER Pins CONTROL Pins DATA Pins BACKLIGHT LED pins 1 16

Franz Duran 2x16 Character LCD Interfacing Microcontrollers & Robotics Circuit on breadboard

Franz Duran 2x16 Character LCD Interfacing Microcontrollers & Robotics

Franz Duran 2x16 Character LCD Interfacing  Assemble circuit on Rapiduino: o LCD_RS  Pin 12 o LCD_EN  Pin 11 o LCD_D4  Pin 14 o LCD_D5  Pin 15 o LCD_D6  Pin 16 o LCD_D7  Pin 17 o LCD_RW  Ground (NOTE: Short J3 jumper) Microcontrollers & Robotics

Franz Duran 2x16 Character LCD Interfacing #include LiquidCrystal lcd(12, 11, 14, 15, 16, 17);//lcd pins void setup() { lcd.begin(16, 2); //set up the LCD's number of columns and rows: lcd.print("RapiDuino SWORD3"); //Print a text on first line lcd.setCursor(1, 1); //Move cursor to 2nd line lcd.print("with Bluetooth!");//Print a text on second line } void loop() { //Do nothing... } Microcontrollers & Robotics Example #4

Franz Duran END