Introduction to Arduino 3 Introduction to Arduino With ArduBlock & LilyPad Dev One prebuilt of each circuit for each group, who has what experience?

Slides:



Advertisements
Similar presentations
Lecture 1 – Arduino Basics
Advertisements

Lab7: Introduction to Arduino
Mini-SumoBot Construction and Programming
Re-programming the Simon Says with Arduino Linz Craig, Brian Huang.
Intro to the Arduino Topics: The Arduino Digital IO Analog IO Serial Communication.
Potentiometer Electric circuit Cell or Battery Resistor Switch Bulb Earth/Ground LED.
Intro to Arduino with LilyPad Make a MakerSpace, Artisan’s Asylum Linz Craig, Chris Taylor, Mike Hord & Joel Bartlett.
Beginning Arduino Session 2 AN INTRODUCTION TO HACKING THE WORLD’S MOST POPULAR MICROCONTROLLER PLATFORM
New Human Computer Interfaces Amnon Dekel HUJI – CSE, Spring 2007 Class 3 March
Jeff Branson Education Outreach Coordinator Derek Runberg Curriculum Curator
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.
How to Build a Digital-Physical System-Lab Assegid Kidané Fall 2014.
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.
Basic Circuits – Lab 2 Arduino and Sensors Xmedia Spring 2011.
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.
Colorado Space Grant Consortium Gateway To Space ASEN 1400 / ASTR 2500 Class #12 Gateway To Space ASEN 1400 / ASTR 2500 Class #12 T-58.
Dean Brock, Rebecca Bruce and Susan Reiser, CCSC SE 2009 Using Arduino Material taken from Todbot blog Bionic Arduino Todbot blog Bionic ArduinoTodbot.
Intro to Arduino Zero to Virtual Prototyping in Seven Hours
Week 10 Today 1.Homework presentations and critique. 2.Review digital and analog inputs. 3.DIY - jumpers, soldering etc.
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
Smart Boards in the Classroom We will learn to: We will learn to: Physically connect the smartboard. Physically connect the smartboard. Configure the smartboard.
Arduino 101 Instructors: Ted Markson / Jim Sweeney.
Tweaking Your Simon Adding a photoresistor and changing code Instruction by Pete Lewis and Linz Craig.
L ILY P AD T RAINING C ENTENNIAL E LEMENTARY 2012 Material by Linz Craig Revision by Sarah Bloms Additional images by Modkit & Adam Meyer.
Overview What is Arduino? What is it used for? How to get started Demonstration Questions are welcome at any time.
Circuits, Systems, & the Arduino. Challenge: Make the bulb light up! -Make observations and explain why it has the setup it does? - What are the components.
WELCOME TO ARDUINO E-DAY CAR PROJECT MEETING – ITALY MARCH.
1 - Remove LED from 13 and GND - Bring out your breadboard from HW#4 Arduino Overview:
SAMI MAKERSPACE MAKE: AN ELECTRONICS WORKSHOP. ARDUINO BASICS Credit to: Sparkfun and Linz Craig, Nick Poole, Prashanta Aryal, Theo Simpson, Tai Johnson,
PWM: Pulse Width Modulation © 2014 Project Lead The Way, Inc.Digital Electronics.
A Quick Introduction to Arduino and Sensors Philip C. Fulmer, PhD, CHP Francis Marion University Florence, SC.
Arduino “Getting Started” Instructor : Dr Matthew Miss Khin Yi Kyaw
Pulse-Width Modulation: Simulating variable DC output
ME 120: Arduino Programming Arduino Programming Part 1 ME 120 Mechanical and Materials Engineering Portland State University
Electronic Instrumentation Project 204 Project Name: Light Level Monitor Student #1: Name ID Student #2: Name ID Student #3: Name ID.
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.
Getting Started: Building & Programming
Arduino Setup & Flexing the ExBow
Welcome to Arduino A Microcontroller.
By Rick Darby Sponsors: Geekspace Gwinnett The WorkSpot
Home automation using Arduino & ‘PIR sensor’
Microcontroller basics
Microprocessors Tutorial 1: Arduino Basics
An Arduino Workshop A Microcontroller.
Welcome to Arduino A Microcontroller.
Arduino Development for Beginners
Arduino - Introduction
‘SONAR’ using Arduino & ultrasonic distance sensor
fischertechnik® RoboPro Software for Gateway To Technology® RoboPro
Introduction to Arduinos
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.
What is an Arduino ? Open Source electronic prototyping platform based on flexible easy to use hardware and software.
Arduino 101 Credit(s):
Working with Arduino: Lesson #1: Getting Acquainted with the Kit
Welcome to Digital Electronics using the Arduino Board
Sensors and actuators Sensors Resistive sensors
Having fun with Arduino
Lab #1: Getting Started.
Introduction to Arduino
Introduction to Arduinos
Introduction to arduino
Presentation transcript:

Introduction to Arduino 3 Introduction to Arduino With ArduBlock & LilyPad Dev One prebuilt of each circuit for each group, who has what experience? Brian Huang Education Engineer brian.huang@sparkfun.com

Pre-Class Survey http://bit.ly/14Xk3Ek

Resources This PPT  ArduBlock Download & Installation  http://www.ardublock.com/

General Rules Raise your hand if you have a question. Be respectful. When I raise my hand… Share your findings with the people near you. Poke around, experiment, and have fun… Imagine, create, and play!!!

Objectives Provide a thorough introduction to the Arduino programming environment. Develop a use of simple functions to interact with the LEDs, light sensor, push button, and buzzer on the Protosnap Pro Mini.

Arduino LilyPad Protosnap Dev What is it? What can it do? Who cares?

What is it? Heart of it – ATMega328 (a $4 microcontroller) Open Source High tolerance for ESD and “bad” electronics practices… Provides easy way to interact with a computer physically – a.k.a. physical computing

What can it do? Great for prototyping ideas Great to teach Intro to Programming Arduino (no assembly required!) Lots and lots of options! Large pads can be sew- able

Who cares? Hackers / Makers Engineers Artists Musicians Kids! Teachers!! You!!!

Physical Computing

Components, Silk Screen & Pins 16 Components, Silk Screen & Pins What is all this??? Vibe Motor the Brain ATmega328 RGB LED Temp. Sensor Switch / Button Super important. Ask people to identify what sensor is connected to what pin later on. Light Sensor Light Emitting Diodes (LED) Buzzer / Speaker

Actual Pin-outs

ArduBlock Introduction to Programming Scratch-like interface Clear transition to text-based coding

Block Organization Control

Block Organization Pins

Block Organization Numbers/Constants

Block Organization Operators

Block Organization Operators

Block Organization Utilities

Block Organization Utilities I2C

Understanding Input vs. Output 26 Understanding 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?

Startup Arduino IDE Double-click on either the Arduino Icon or wherever you installed (saved) the Arduino program.

Plug it in Plug it in. FTDI is Serial buffer, 5V, GND, reset. 28 Plug it in Plug it in. FTDI is Serial buffer, 5V, GND, reset. 40-50 miliAmps source 3.3V system. 9 pins broken out. PWM and analogs. You can reconfigure analog ins to be outputs.

Lesson #0 – Configuring Arduino Setup Board (LilyPad Arduino w/ ATmega328) Setup COM Port PC – Highest COM # Mac – /dev/tty.usbserial-A####xXx

Settings: Tools  Board 30 Talk about different board types

Settings: Tools  Serial Port 31 Talk about different board types

Other Board Types 32 Arduino Fio – Programmed using Funnel (ActionScript, Processing, Ruby) LilyPad 328 Main Board Arduino Mega Mega Mini 3.3 Arduino Mini Pro 3.3 Arduino Uno Compatible -- Redboard

Load ArduBlock

Lesson #0 – Test Upload

Check for Status Messages

Let’s get to hacking… Lesson #1 – Blinking an LED “Hello World” of Physical Computing Psuedo-code – how should this work? Turn LED ON Wait Turn LED OFF Rinse & Repeat

Let’s get to hacking… Lesson #1 – Blinking an LED “Hello World” of Physical Computing

LED Pins 16 18 17

How are Analog Pins really identified? Digital Pins are numbered 0 to 13. Analog Input Pins are A0 to A5. A0 = 14 A1 = 15 A2 = 16 A3 = 17 A4 = 18 A5 = 19

Alright? Let’s blink! Challenge 1a – Blink multiple LEDs Plan out a pattern – can you make it? Challenge 1b – Blink to mimic a heartbeat Challenge 1c – Multiple LEDS – Knight Rider style

Save your Project Save early, Save often! Enumerate your iterations – (e.g. blink_10.adp, blink_11.adp, blink_12.adp…)

Concept: Analog vs. Digital Microcontrollers are digital devices – ON or OFF. An Analog signal is anything that can be a full range of values. What are some examples? Think of like a ramp or a hill.

Concept: Analog vs. Digital To create an analog signal, the microcontroller uses a technique called PWM. Pins 3, 5, 6, 9, 10, 11 are capable of producing an Analog Output Pulse Width Modulation (PWM)

Color Mixing with 3 LEDs analogWrite() Challenge 2a: How do you turn on the RED LED? Experiment with different values – what do you observe happens? How do you turn on the GREEN or the BLUE LED?

Color Mixing with 3 LEDs Tri-color LED The RGB LED is a Common- Anode (means the positive side of the LED is all tied to Vcc). The signal line is connected to the bottom of each LED. Don’t worry - it’s just a different method of completing a circuit! 5 V Pin 9 Pin 11 Pin 10

Color Mixing with 3 LEDs analogWrite() Challenge 2b: Experiment with different values of Red, Green, and Blue to create a couple different colors. Write down the values you used. Check these values with www.colorpicker.com Challenge 2c: Create a unique lighting display that integrates a blink, fade, or a switching of colors. Be prepared to have a name for your art piece and show this to the rest of the class.

Save your Project #2

Concept: If(), If() – else… conditional logic

Concept: If(), If() – else… conditional logic

A Simple Example DIG INPUT 2 Try this bit of code. What do you think will happen? Test it and write down your observations.

digital Inputs Buttons / Slide Switches 53 digital Inputs Buttons / Slide Switches What about this?? INPUT A5 INPUT A5 (a.k.a. 19) Analog Pin Digital I/O ID A0  14 A1 15 A2 16 A3 17 A4 18 A5 19 A6 20 Analog Pin Mapping

digital Inputs Buttons / Slide Switches 54 digital Inputs Buttons / Slide Switches Same as Pin A5 Challenge 3a: Re-arrange the blocks or add new ones to: Turn ON an LED when the button is pressed. Otherwise blink continuously…

digital Inputs Buttons / Slide Switches 55 digital Inputs Buttons / Slide Switches Challenge 3b: Now, using the button / switch – to start a disco/light changing pattern Challenge 3c: Now, using the button / switch – to turn on and off the VIBE motor.

Serial Monitor Serial print command Any message “glue” Data

Example

Open up Serial Monitor

Reading the Light Sensor?

Challenge Use the light sensor input to affect the blink rate of the LEDs. Use the light sensor input to affect the speed of a “knight-rider” or cylon display. Use the light sensor to ___________.

Save your Project #3 Sensors

Making Music Setting up the Speaker

Making Music Let’s Play a song… Twinkle-Twinkle: CC GG AA G FF EE DD C GG Happy Birthday: G G A G C B G G A G D C G G G E C C B A  Hot Cross Buns: B A G <> B A G <> G G G G <> A A A A B A G Mary Had A Little Lamb: B A G A BB B <> AA A <> BB B <> B A G A BBBB AAA BAG.

Musical Notes / Frequencies Frequency (Hz) C4 261 C#4/Db4 277 D4 293 D#4/Eb4 311 E4 329 F4 349 F#4/Gb4 369 G4 392 G#4/Ab4 415 A4 440 A#4/Bb4 466 B4 493 Note  Frequency (Hz) C5 523 C#5/Db5 554 D5 587 D#5/Eb5 622 E5 659 F5 698 F#5/Gb5 739 G5 783 G#5/Ab5 830 A5 880 A#5/Bb5 932 B5 987

Save your Project #4 Tone

Getting started with Arduino

Additional Resources http://www.sparkfun.com http://learn.sparkfun.com http://www.arduino.cc http://www.bildr.org

SparkFun Tutorials and Projects 68 SparkFun Tutorials and Projects GardenBot: www.sparkfun.com/news/598 High Altitude Balloon: www.sparkfun.com/tutorials/180 GPS Clock: www.sparkfun.com/tutorials/47 Earthquake Data Logger: www.sparkfun.com/tutorials/235

Thousands of Amazing ideas… The Cat Defender… http://www.plasma2002.com/blenderdefende r/ List of projects at Sparkfun: http://goo.gl/2M3AM

70 Questions?

71 Feedback? Before leaving, please fill out a quick survey so that I can get your e-mail and a little info about your familiarity with Arduino / Sparkfun. Thanks! http://bit.ly/ZAmDMk

www.sparkfun.com 6175 Longbow Drive, Suite 200 Boulder, Colorado 80301 72 www.sparkfun.com 6175 Longbow Drive, Suite 200 Boulder, Colorado 80301

73 Buttons / Slide Switches Digital Input, Pull-up Resistors, and digitalRead() DIG INPUT

74 Buttons / Slide Switches Digital Input, Pull-up Resistors, and digitalRead() DIG INPUT