Analog and Digital Measurements living with the lab 14 digital input / output pins 6 analog input pins © 2011 LWTL faculty team.

Slides:



Advertisements
Similar presentations
Khaled A. Al-Utaibi Interfacing an LED The Light Emitting Diode (LED) Applications DC Characteristics & Operation Interfacing to.
Advertisements

Button Input: On/off state change Living with the Lab Gerald Recktenwald Portland State University
EMS1EP Lecture 9 Analog to Digital Conversion (ADC) Dr. Robert Ross.
ARDUINO CLUB What we’re really doing. BASICS The setup() and loop() functions.
Electrical team Arduino tutorial I BY: JOSHUA arduini
Lab7: Introduction to Arduino
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.
Digital & Analog Inputs. Review Fundamental parts of an Arduino program are … Setting output types using pinMode. Declaring variables Can write a digital.
Analog and Digital Measurements living with the lab 14 digital input / output pins 6 analog input pins © 2012 David Hall.
Khaled A. Al-Utaibi  Digital Vs Analog Signals  Converting an Analog Signal to a Digital One  Reading Analog Sensors with the.
Using the Arduino to Make an LED Flash Work in teams of two! living with the lab digital I/O pins (I/O = input / output) USB cable plug power pins.
Living with the lab Introduction to Arduino Programming arduino.cc Gerald Recktenwald Portland State University
PING))) Ultrasonic Distance Sensor living with the lab ultrasonic pressure waves from PING))) speaker The PING))) sensor emits short bursts of sound and.
IR Object Detection living with the lab IR light from LED IR light reflected off object IR LED IR receiver Infrared (IR) light leaving an LED reflects.
Finish your programs from last week STOPLIGHT CIRCUIT! You may need … – int – void setup() – void loop() – pinMode – digitalWrite – delay.
1 Introduction to Coding. 2 Example Codes A lot of example codes are given with Arduino IDE A code can often be based on a previous example rather than.
Embedded Programming and Robotics Lesson 2 C Programming Refresher C Programming1.
1 Ultrasonic Distance Sensor. 2 How it Works The distance sensor emits short bursts of sound and listens for this sound to echo off of nearby objects.
Basic Circuits – Lab 2 Arduino and Sensors Xmedia Spring 2011.
ARDUINO PROGRAMMING Working with the Arduino microcontroller.
Working with Arduino: Lesson #1: Getting Acquainted with the Kit EGN1007.
Objectives: Lead Switching Circuitry/Control Analog to Digital Converter Write to Computer.
chipKit Sense Switch & Control LED
PING))) Ultrasonic Distance Sensor living with the lab ultrasonic pressure waves from PING))) speaker The PING))) sensor emits short bursts of sound and.
ProtoSnap Introduction to Arduino Casey Haskell, Pete Lewis, David Stillman, Jim Lindblom, Pete Dokter, Lindsay Levkoff, Trevor Zylstra.
Introduction to the Arduino
Cascade switching of an LED EAS 199B Winter 2013.
Sparkfun Electronics ATtiny85 Arduino Quick Reference Sheet
BM-305 Mikrodenetleyiciler Güz 2015 (3. Sunu) (Yrd. Doç. Dr. Deniz Dal)
ARDUINO 1. Basics  Comments  /* * Blink * * The basic Arduino example. Turns on an LED on for one second, * then off for one second, and so on... We.
Analog on the Arduino int k; // integer = 16 bits k = analogRead(1); Analog volts value (0V → 5V) returns from 0 to 1023 into “k” (10 “bits” = 1024 values)
Microcontroller Hands-on Workshop #2 Ahmad Manshad New Mexico State University Institute of Electrical and Electronics Engineers October 31, 2009.
Line following tips photoresistors positioned near floor photoresistor circuits © 2011 LWTL faculty team living with the lab.
Arduino libraries Datatekniker Udvidet hardware/software.
Photoresistor resistance changes dramatically with light level living with the lab Using Photoresistors with an Arduino © 2011 LWTL faculty team.
IR Object Detection living with the lab IR light from LED IR light reflected off object IR LED IR receiver Infrared (IR) light leaving an LED reflects.
ME 120: Arduino Programming Arduino Programming Part II ME 120 Mechanical and Materials Engineering Portland State University
Programming in Arduino Materials:Arduino Board Casperelectronics Pre Pres. Notes Photos from workshop?
:Blink Blink: Er. Sahil Khanna
1 Introduction to Coding. 2 Example Codes A lot of example codes are given with Arduino IDE A code can often be based on a previous example rather than.
BM-305 Mikrodenetleyiciler Güz 2016 (3. Sunu)
Sparkfun Electronics ATtiny85 Arduino Quick Reference Sheet
Val Manes Department of Math & Computer Science
Cascade switching of an LED
Logic Gates.
European Robotic LABoratory
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.
Arduino - Introduction
Control the color and brightness of an RGB LED with a Potentiometer
BM-305 Mikrodenetleyiciler Güz 2017 (3. Sunu)
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.
using the Arduino to make LEDs flash
analog and digital measurements
Arduino programs Arduino toolchain Cross-compilation Arduino sketches
Arduino : Introduction & Programming
CTY SAR FCPS Shawn Lupoli, Elliot Tan
CTY SAR FCPS Shawn Lupoli, Elliot Tan
Arduino Uno circuit basics
Setting up a basic program with Arduino
Introduction to Arduinos
Arduino程式範例.
Arduino UMBC IEEE Sekar Kulandaivel Week 3: Motor Control w/ H-Bridges
Interrupts.
Presentation transcript:

Analog and Digital Measurements living with the lab 14 digital input / output pins 6 analog input pins © 2011 LWTL faculty team

2 living with the lab A digital system is a data technology that uses discrete (discontinuous) values. By contrast, analog (non-digital) systems use a continuous range of values to represent information. Although digital representations are discrete, they can be used to carry either discrete information, such as numbers, letters or other individual symbols, or approximations of continuous information, such as sounds, images, and other measurements of continuous systems.

Inputs and Outputs An input “receives” information or senses a voltage in the external world. An output “delivers” information or makes something happen in the external world. 3 living with the lab Below is an example from an earlier class where we made an LED flash on and off. Are we using digital pin 0 as an input or an output? void setup() { pinMode(0, OUTPUT); } void loop() { digitalWrite(0, HIGH); delay(1000); digitalWrite(0, LOW); delay(500); } digital output

4 living with the lab Receiving Input from an Arduino int val; val = digitalRead(7); int val; val = analogRead(5); digital inputanalog input val is either 0 or 1 0 = voltage sensed at digital pin 7 is LOW (0V) 1 = voltage senses at digital pin 7 is HIGH (5V) val is an integer between 0 and = voltage sensed at analog pin 5 is zero volts 1023 = voltage senses at analog pin 5 is five volts Guess what val would be if the voltage sensed at analog pin 5 was 2.5V? 511

5 living with the lab Digital Inputs The Arduino reference indicates that digitalRead () will return... a value of HIGH if the voltage at the digital input pin is greater than 3 volts a value of LOW if the voltage at the digital input pin is less than 2 volts. time (milliseconds) voltage (V) digitalRead() returns LOW or 0 digitalRead() may return a value of HIGH or LOW digitalRead() returns HIGH or 1 LOW or HIGH??? low high ambiguous

6 living with the lab Analog Inputs The analog input pins on your Arduino have 10-bit resolution and consequently measure in (2) 10 or 1024 increments. The analogRead () functions returns a value between 0 and 1023, where 0 is zero volts and 1023 is 5 volts. smallest increment of voltage that can be read = volts

7 living with the lab data point from plot above If a digital pin is used to sample voltage if an analog pin is used to sample voltage output of digitalRead() hypothetical analogRead() output voltage computed from analogRead() output time (milliseconds) voltage (V) digitalRead() returns LOW or 0 digitalRead() may return a value of HIGH or LOW digitalRead() returns HIGH or 1 point 1point 2 point 3 Examples 2 ambiguous