Intro to Arduino Basic Arduino John Wolf (WolfDenElectronics.com)

Slides:



Advertisements
Similar presentations
RedBot An introduction to robotics using the SparkFun RedBot Board
Advertisements

Lab7: Introduction to Arduino
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)
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.
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.
Khaled A. Al-Utaibi  What is Arduino?  Arduino Boards  Arduino Shields  Arduino Uno Hardware.
Embedded Programming and Robotics Lesson 2 C Programming Refresher C Programming1.
Basic Circuits – Lab 2 Arduino and Sensors Xmedia Spring 2011.
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.
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
Microcontroller Hands-on Workshop #3 Ahmad Manshad New Mexico State University Institute of Electrical and Electronics Engineers November 7, 2009.
LVTech / / IRC #makelv on freenode.net Jared Steckel AN INTRODUCTION.
Microprocessors Tutorial 1: Arduino Basics
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
Tweaking Your Simon Adding a photoresistor and changing code Instruction by Pete Lewis and Linz Craig.
Microprocessors Tutorial 1: Arduino Basics
Getting Started With the Arduino Uno
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,
Rebecca Bruce and Susan Reiser, May 2015 Analog Input and Output.
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.
1 Introduction to Haptics Introduction to the Hapkit board Allison M. Okamura Stanford University.
Programming in Arduino Materials:Arduino Board Casperelectronics Pre Pres. Notes Photos from workshop?
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.
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.
Getting Started: Building & Programming
By Rick Darby Sponsors: Geekspace Gwinnett The WorkSpot
Assist. Prof. Rassim Suliyev - SDU 2017
Microcontroller basics
Val Manes Department of Math & Computer Science
Microcontroller basics
Microprocessors Tutorial 1: Arduino Basics
UTA010 : Engineering Design – II
An Arduino Workshop A Microcontroller.
Welcome to Arduino A Microcontroller.
UCD ElecSoc Robotics Club 2017/2018
Arduino Part 1 Topics: Microcontrollers Programming Basics
Arduino - Introduction
Introduction to Arduino Microcontrollers
Arduino and Grove LET’S START.
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
Introducing the Arduino Uno
Arduino : Introduction & Programming
Arduino Practice: Photoresistors, PWM, Potentiometers, Motors
Introduction to Arduino
Arduino and Grove LET’S START.
Introduction to Arduinos
Introduction to arduino
Pulse-Width Modulation: Simulating variable DC output
Presentation transcript:

Intro to Arduino Basic Arduino John Wolf (WolfDenElectronics.com)

There are 10 types of people. Those that understand binary, and those that do not understand binary. Make that 11 types. Those that understand binary, those that don't, and those who didn't grasp this joke even if they did understand binary.

Objectives – We’ll Learn  Arduino pedigree  Arduino Integrated Development Environment (IDE)  Serial Monitor interface and other IDE features-works well with Processing  Start writing code   Add concepts describing physical computing as we go – Why explosions occur

More Objectives…  Pulse Width Modulation (PWM)  Analog signals -> Digital  Driving motors – H-Bridges  How servos work – feedback loops  Pulling it together with Ohm’s Law  Voltage regulators  Power limitation of the USB port  MOST IMPORTANT – Glossary of terms (learn to use a pencil again)

There are shields for everything you can think of. If not, build one and get rich. This is why Arduino is so popular… or.org How to keep up on Arduinos

Match Arduino to Application (8-bit computing – yeah!)

Texas Instruments LaunchPad MSP430 Texas Instruments BeagleBone Black Raspberry Pi Alternatives

Arduino Board of Direction  “Teach the Youth”  Ivrea, Italy in 2005, Massimo Banzi & David Cuartielles  Open Source Hardware  Atmel Processor (8-bit power)  Coding is accessible (C++, Processing, ModKit and MiniBloq)

What’s an Arduino? Microcontroller board with all the support electronics built-in on the board. Has 14 digital I/O and 6 analog I/O connections. USB port, power jack, and voltages for support electronics attached to the board via the headers. Atmel AVR Computer USB Power in (7~12V) Digital I/O header Analog I/O header USB processor

Arduino IDE – resides on laptop  Where you write your source code  Compile, link your code and upload to the board  Code checker  Code layout feature  Organize code and libraries available  Provides a serial interface via the USB port to the Arduino board (IDE => Integrated Development Environment)

console area Serial Monitor App to interface to the Arduino via USB

How to get the Arduino S/W  Go to  Click the “Download” tab  Now you have a choice:  If you have a new computer with the latest OS… go to the turquoise box and click the appropriate download. I suggest zip files.  Or… click on “Previous Releases” and download arduino This is the classic Arduino IDE that matches the basic set of Arduino boards. The new software adds-in compatibility with the new specialty boards and later OS’s.

Where to place the Arduino folder  Two logical places (although – anyplace will work, because the IDE is self contained – not installed into the OS)  Just put it in your My Documents folder.  Better: Put it in your Program Files (86) folder at C:\Program Files(86)\  This way, it’s part of your other programs  Easy to find

How to use the IDE  Let’s walk through this…  When you write your first sketch and go to “save as” to store it, browse to a new folder you set up in your regular My Documents directory.  The IDE will remember this path an store all your sketches there, plus give you a library folder to place Third Party libraries you will want to use.

Integrated Development Environment  What you do see:  Area for variables  The “setup()” function – void setup();  The “loop()” function – void loop();  int main(void); and Arduino.h are active, but hidden(C++)

More Arduino.h “methods”  pinMode – used to tell the compiler whether a pin is an input or an output  digitalWrite – whether to write-out a HIGH or LOW voltage  digitalRead – read-in the pin voltage for a HIGH or LOW value  analogRead – use the A/D converter to read an analog value (0-5V)  analogWrite – triggers the PWM feature

Analog to Digital Convertion +5V 0V Arduino uses 10bits or 1024 individual levels from 0 to 1023 Time(or analogReads) Pins A0 to A5

Pulse Width Modulation Outputs are always digital, even when representing analog. For PWM the Arduino pin turns on then off very fast (Arduino PWM base frequency is approx 490 Hz, 980Hz on pins 5, 6) 2 ms 0 Volts 5 Volts

Let’s Get Our Hands Dirty…

USB power called USBVCC. VIN cuts off USBVCC and applies power directly to +5V regulator, which also supplies 3.3V regulator. Barrel connection basically at the VIN point. Note: VIN polarity not protected like barrel connector. Regulator can accept 7 to 12V in, 5V out at ~500ma Must be aware of Uno Power Limitations VIN Barrel Connector GND Atmel328

Breadboard has two sets of +5V rails and Gnds. Each middle row is connected across, but not down. Center gutter is there for and IC to straddle. 9V battery can supply about double the current the USB port can 9V Wall-wart usually supply about 1.5A to 2A so are good. Basic gear to start fiddling around

Beef up the +5 Volts for more elaborate projects. Many projects require current loads or other voltages only and external supply can adequately handle. GND Can use Vin to power the Arduino

Addition Power Supply Built from old ATX supply from a discarded computer Old ATX

Pwr Box 2.0 Done the same way with better construction technique.

+5V GND 0 to 5V input LED Pot 220  +5V GND 220  I = 3.8/220 I = 17mA 1.2v E = I x R So… you have to learn about electronics as we go. Next level is learning how to solder your projects together – then make PCBs. All supported by Open Source developers. Fritzing CAD layout Ohm’s Law 3.8v here (190  20ma)

Example Sketch (C++) void loop() { val = analogRead(potPin); // read the input pin with ADC 10-bits analogWrite(ledPin, val / 4); // analogRead values go from 0 to 1023, //analogWrite values from 0 to 255 } int ledPin = 9; // LED connected to digital pin 9 (PWM pin) int potPin = A3; // potentiometer connected to analog pin 3 int val = 0; // variable to store the value read void setup() { pinMode(ledPin, OUTPUT); // sets the pin as output pinMode(potPin, INPUT); // sets the pin as input } type end Last statement scales the input-read to the output capability of the PWM

Pulse Width Modulation Outputs are always digital, even when representing analog. For PWM the Arduino pin turns on then off very fast (Arduino PWM base frequency is approx 490 Hz, 980Hz on pins 5, 6) 2 ms 0 Volts 5 Volts

Initially HIGH until button is pushed, then LOW Initially LOW until button is pushed, then HIGH Either circuit only draws 0.5 ma Logic set by path of least resistance

What defines a 1 or 0 ?  Logic circuits will register a “0” for voltages from 0 to about 0.8 volts.  Logic circuits will register a “1” for voltages from 2 to 5 volts. (some sources quote 3v)  Notice there is a dead-band where the logic level is questionable. Stay out of there in your designs.  Supplies that can’t hold up the current will cause voltage sag that can reach a point where logic gets faulty

Switch bounce caught in the act 0.1ms

Debounce can also be handled in hardware. The 74HLS279 was specifically designed to do this task. Debounce is handled here in software.

Use button to select different LED colors.

int

Pot values from the serial interface