What is an Arduino ? Open Source electronic prototyping platform based on flexible easy to use hardware and software.

Slides:



Advertisements
Similar presentations
Lab7: Introduction to Arduino
Advertisements

ARDUINO FRAMEWORK.
Anurag Dwivedi & Rudra Pratap Suman.  Open Source electronic prototyping platform based on flexible easy to use hardware and software.
How to use Arduino By: Andrew Hoffmaster.
Embedded Sumo 1T4 – 1T5 UTRA.
Re-programming the Simon Says with Arduino Linz Craig, Brian Huang.
Intro to Arduino with LilyPad Make a MakerSpace, Artisan’s Asylum Linz Craig, Chris Taylor, Mike Hord & Joel Bartlett.
Introduction.
 Main Components:  Sensors  Micro controller  Motor drivers  Chasis.
Embedded Programming and Robotics Lesson 2 C Programming Refresher C Programming1.
Introduction to Arduino Prepared by R. Lamond.  “Arduino is an open-source electronics prototyping platform based on flexible, easy- to-use hardware.
Intro to Arduino Zero to Prototyping in a Flash! Material designed by Linz Craig, Nick Poole, Prashanta Aryal, Theo Simpson, Tai Johnson, and Eli Santistevan.
Intro to Arduino Zero to Prototyping in a Flash! Material designed by Linz Craig, Nick Poole, Prashanta Aryal, Theo Simpson, Tai Johnson, and Eli Santistevan.
Embedded Programming and Robotics
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.
Intro to Arduino Zero to Virtual Prototyping in Seven Hours
ProtoSnap Introduction to Arduino Casey Haskell, Pete Lewis, David Stillman, Jim Lindblom, Pete Dokter, Lindsay Levkoff, Trevor Zylstra.
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
Overview What is Arduino? What is it used for? How to get started Demonstration Questions are welcome at any time.
Sparkfun Electronics ATtiny85 Arduino Quick Reference Sheet
Microprocessors Tutorial 1: Arduino Basics
Introduction to Electronics and Custom Circuits
SAMI MAKERSPACE MAKE: AN ELECTRONICS WORKSHOP. ARDUINO BASICS Credit to: Sparkfun and Linz Craig, Nick Poole, Prashanta Aryal, Theo Simpson, Tai Johnson,
Microcontroller Hands-on Workshop #2 Ahmad Manshad New Mexico State University Institute of Electrical and Electronics Engineers October 31, 2009.
1 Introduction to Haptics Introduction to the Hapkit board Allison M. Okamura Stanford University.
Introduction to Programming the Arduino Dr Gaw 3/21/14.
Intro to Arduino Basic Arduino John Wolf (WolfDenElectronics.com)
Arduino “Getting Started” Instructor : Dr Matthew Miss Khin Yi Kyaw
Pulse-Width Modulation: Simulating variable DC output
1 Microcontrollers. 2 Programmers work in the virtual world Machinery works in the physical world Microcontrollers connect the virtual and physical world.
Harpeth Hall Jan 2016 Introduction to Arduino Prepared for Harpeth Hall Winterim January 2016.
Having fun with code, using Arduino in a middle school CS classroom
Arduino - Introduction
Arduino.
Arduino Part 1 Topics: Microcontrollers
Getting Started: Building & Programming
Sparkfun Electronics ATtiny85 Arduino Quick Reference Sheet
Val Manes Department of Math & Computer Science
Microprocessors Tutorial 1: Arduino Basics
Intro to the Arduino Created by
Arduino & its hardware interfacing
UTA010 : Engineering Design – II
An Arduino Workshop A Microcontroller.
Get Your Project Started with Arduino
UCD ElecSoc Robotics Club 2017/2018
Arduino Part 1 Topics: Microcontrollers Programming Basics
Въведение в Arduino.
Arduino - Introduction
Analog Input through POT
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.
Intro to the Arduino Topics: The Arduino Digital IO
Working with Arduino: Lesson #1: Getting Acquainted with the Kit
Welcome to Digital Electronics using the Arduino Board
Arduino : Introduction & Programming
Programming 2: The Arduino IDE & First Sketches
Arduino Practice: Photoresistors, PWM, Potentiometers, Motors
Aeroponic Engineering and Vertical Farming
Lab #1: Getting Started.
Arduino Uno circuit basics
Introduction to Arduinos
SAURABH GINGADE.
Model Blimp Design Competition Programming Workshop by Youth College (International) / VTC May
Introduction to arduino
Introduction to Arduino IDE and Software
Presented By,  Mamata Yadav (BE Elex & Comm.) Vice R&D Coordinator(HW), PCRT  Payal Shah (BE Elex & Comm.)  Ananta Das (BE Elex & Comm.) R&D Team,PCRT.
Pulse-Width Modulation: Simulating variable DC output
Presentation transcript:

What is an Arduino ? Open Source electronic prototyping platform based on flexible easy to use hardware and software.

2 Arduino Board “Strong Friend” Created in Ivrea, Italy in 2005 by Massimo Banzi & David Cuartielles Open Source Hardware Processor Coding is accessible & transferrable  (C++, Processing, java)

Arduino… is the go-to gear for artists, hobbyists, students, and anyone with a gadgetry dream. rose out of another formidable challenge: how to teach students to create electronics, fast. http://spectrum.ieee.org/geek-life/hands-on/the-making-of-arduino

PWR IN USB (to Computer) RESET SCL\SDA POWER Digital I\O Analog INPUTS 4 RESET SCL\SDA (I2C Bus) POWER 5V / 3.3V / GND Digital I\O PWM(3, 5, 6, 9, 10, 11) Look up analog ref Analog INPUTS

Concepts: INPUT vs. OUTPUT 5 Concepts: INPUT vs. OUTPUT Referenced from the perspective of the microcontroller (electrical board). Inputs is a signal / information going into the board. Output is any signal exiting the board. Almost all systems that use physical computing will have some form of output What are some examples of Outputs?

Concepts: INPUT vs. OUTPUT 6 Concepts: INPUT vs. OUTPUT Referenced from the perspective of the microcontroller (electrical board). Inputs is a signal / information going into the board. Output is any signal exiting the board. Examples: Buttons Switches, Light Sensors, Flex Sensors, Humidity Sensors, Temperature Sensors… Examples: LEDs, DC motor, servo motor, a piezo buzzer, relay, an RGB LED

Concepts: Analog vs. Digital Microcontrollers are digital devices – ON or OFF. Also called – discrete. analog signals are anything that can be a full range of values. What are some examples? More on this later… 5 V 0 V

Open up Arduino Hints: For PC Users  Let the installer copy and move the files to the appropriate locations, or Create a folder under C:\Program Files (x86) called Arduino. Move the entire Arduino program folder here. For Mac Users  Move the Arduino executable to the dock for ease of access. Resist the temptation to run these from your desktop.

Arduino Integrated Development Environment (IDE) 9 Two required functions / methods / routines: void setup() { // runs once } void loop() // repeats Be sure to point out the what all of the buttons do. error & status messages

Settings: Tools  Serial Port 10 Your computer communicates to the Arduino microcontroller via a serial port  through a USB-Serial adapter. Check to make sure that the drivers are properly installed. All connections to computers- mice, printers etc use a serial port. Gotta pick the right one.

Settings: Tools  Board 11 All connections to computers- mice, printers etc use a serial port. Gotta pick the right one. Next, double-check that the proper board is selected under the ToolsBoard menu.

if() statements / Boolean digitalWrite() analogWrite() digitalRead() if() statements / Boolean analogRead() Serial communication BIG 6 CONCEPTS                            This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 United States License.

Continuous Ringing when light is shone Let’s get to coding… Project 1 – Light Alarm “Hello World” of Physical Computing Psuedo-code – how should this work? LED Turn on Wait Alarm On Continuous Ringing when light is shone

Comments, Comments, Comments Comments are for you – the programmer and your friends…or anyone else human that might read your code. // this is for single line comments // it’s good to put a description at the top and before anything ‘tricky’ /* this is for multi-line comments Like this… And this…. */

15 comments Review the two main parts of the sketch – void setup() and void loop() Provide rationale for good commenting. Emphasize the need for good / clean coding practices like indenting.

Three commands to know… 16 Three commands to know… pinMode(pin, INPUT/OUTPUT); ex: pinMode(13, OUTPUT); digitalWrite(pin, HIGH/LOW); ex: digitalWrite(13, HIGH); delay(time_ms); ex: delay(2500); // delay of 2.5 sec. // NOTE: -> commands are CASE-sensitive Three commands to rule the world… or at least do 80% of cool Arduino projects.

Project #1: Wiring Diagram 17 Project #1: Wiring Diagram Image created in Fritzing

Programming Concepts: Variables Variable Scope Global --- Function-level

Programming Concepts: Variable Types 8 bits 16 bits 32 bits byte char int unsigned int long unsigned long float

Fading in and Fading Out (Analog or Digital?) A few pins on the Arduino allow for us to modify the output to mimic an analog signal. This is done by a technique called: Pulse Width Modulation (PWM)

Concepts: Analog vs. Digital To create an analog signal, the microcontroller uses a technique called PWM. By varying the duty cycle, we can mimic an “average” analog voltage. Pulse Width Modulation (PWM)

Programming: Conditional Statements if()

Programming: Conditional Statements if() void loop() { int buttonState = digitalRead(5); if(buttonState == LOW) { // do something } else { // do something else DIG INPUT

Boolean Operators ( ) == ( ) is equal? ( ) != ( ) is not equal? Description ( ) == ( ) is equal? ( ) != ( ) is not equal? ( ) > ( ) greater than ( ) >= ( ) greater than or equal ( ) < ( ) less than ( ) <= ( ) less than or equal

analogRead() Arduino uses a 10-bit A/D Converter: this means that you get input values from 0 to 1023 0 V  0 5 V  1023 Ex: int sensorValue = analogRead(A0);

Using Serial Communication 26 Using Serial Communication Method used to transfer data between two devices. Data passes between the computer and Arduino through the USB cable. Data is transmitted as zeros (‘0’) and ones (‘1’) sequentially. For this reason, we typically do not use Digital I/O 0 or 1 for anything in our designs. Arduino dedicates Digital I/O pin # 0 to receiving and Digital I/O pin #1 to transmit.

Serial Monitor & analogRead() Initializes the Serial Communication 9600 baud data rate prints data to serial bus

Serial Monitor & analogRead() Opens up a Serial Terminal Window

Examples: Analog Sensors Sensors Variables Mic soundVolume 29 Analog Sensors Examples: Sensors Variables Mic soundVolume Photoresistor lightLevel Potentiometer dialPosition Temp Sensor temperature Flex Sensor bend Accelerometer tilt/acceleration

Additional Serial Communication Sending a Message 30 Additional Serial Communication Sending a Message void loop ( ) { Serial.print(“Hands on “) ; Serial.print(“Learning ”) ; Serial.println(“is Fun!!!”) ; }

Serial Communication: Serial Debugging 32 Serial Communication: Serial Debugging void loop() { int xVar = 10; Serial.print ( “Variable xVar is “ ) ; Serial.println ( xVar ) ; }

Serial Communication: Serial Troubleshooting 33 Serial Communication: Serial Troubleshooting void loop ( ) { Serial.print (“Digital pin 9: “); Serial.println (digitalRead(9)); }