analog and digital measurements

Slides:



Advertisements
Similar presentations
Why won’t my Arduino work???? living with the lab © 2012 David Hall.
Advertisements

temperature system wiring
College of Engineering & Science living with the lab Ohm’s Law © 2012 David Hall 1.5V.
Using the servo library living with the lab Libraries are computer programs written to add functionality to Arduino programs. A library to control hobby.
Conductivity sensor implementation living with the lab © 2011 LWTL faculty team.
Analog and Digital Measurements living with the lab 14 digital input / output pins 6 analog input pins © 2012 David Hall.
Waterproofing a thermistor ENGR 121 living with the lab © 2013 David Hall.
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.
User-defined functions in Arduino sketches living with the lab © 2012 David Hall.
Analog and Digital Measurements living with the lab 14 digital input / output pins 6 analog input pins © 2011 LWTL faculty team.
Using Your Arduino, Breadboard and Multimeter Work in teams of two! living with the lab 1 © 2012 David Hall.
Thermistor calibration living with the lab © 2013 David Hall.
Cascaded switching of a solenoid valve living with the lab transistor relay solenoid valve © 2012 David Hall.
Assembly of conductivity flow loop living with the lab (in preparation for calibrating conductivity sensor)
Switches & whiskers on the Arduino living with the lab lever arm switches mounted to Arduino © 2012 David Hall.
Using fixed-cell references and built-in functions in Excel living with the lab © 2012 David Hall.
220  470  Gnd5V Currents Through Parallel Resistors 1 living with the lab © 2012 David Hall.
Using Hobby Servos with the Arduino living with the lab © 2012 David Hall.
Introduction to Microsoft Excel living with the lab © 2012 David Hall.
Voltage Drops Around Closed Loops 470  220  5V   220  living with the lab © 2012 David Hall.
Navigating the engineering disciplines robot challenge living with the lab © 2012 David Hall.
Kirchoff’s Current Law (KCL) living with the lab University of Pennsylvania Library and Wikipedia Gustav Kirchoff (left) and Robert Bunsen (right) Bunsen.
Adding a Barrel Jack to a Battery Pack living with the lab © 2012 David Hall.
Using for loops to control LEDs living with the lab 1 1 arduino.cc the for statement allows us to repeat a block of commands a limited number of times.
Building Circuits.
Pump Fabrication Day Group A will draw their pump
Controlling Servos with the Arduino
Connecting Switches.
Series and Parallel Resistors
Introduction to the Arduino
Why Won’t My Arduino Work?
Troubleshooting Your Multimeter
Using servos.
calibration of conductivity sensors
Servo Library and Functions
Line Following Tips photoresistor circuits
Robot Assembly.
How to Use Dial Calipers
Controlling a Motor with Cascading Switches
Introduction to Transistors
Introduction to the Fishtank
RGB LEDs.
Conservation of Mass Problem
Maxbotix Ultrasonic Distance Sensor
Conductivity Sensor.
Schedule 8:00-11:00 Workshop: Arduino Fundamentals
Introduction to Transistors
Servo Library and Functions
Troubleshooting Your Multimeter
a few of my favorite sensors
using for loops to control LEDs
using the Arduino to make LEDs flash
Acquiring Data from an ADXL335 Accelerometer
Using Photoresistors with an Arduino
Line Following Tips photoresistor circuit
Using “if” statements.
Controlling the Heater
Digital Input from Switches
Implementing Switches Using Interrupts
Arduino: For Loops.
Non-Concurrent Force Systems
IR Object Detection IR detector IR LED IR light reflected off object
Radio Frequency Transmitter and Receiver
Interfacing a Rotary Encoder with an Arduino
Conservation of Mass Problem
Non-Concurrent Force Systems
Evaluating Design Alternatives
Counting Servo Gear Teeth (FS90R Servos)
Static Equilibrium Problem
Arduino程式範例.
Presentation transcript:

analog and digital measurements 14 digital I/O pins (I/O = input / output) analog input pins

DISCLAIMER & USAGE The content of this presentation is for informational purposes only and is intended only for students attending Louisiana Tech University. The author of this information does not make any claims as to the validity or accuracy of the information or methods presented. Any procedures demonstrated here are potentially dangerous and could result in injury or damage. Louisiana Tech University and the State of Louisiana, their officers, employees, agents or volunteers, are not liable or responsible for any injuries, illness, damage or losses which may result from your using the materials or ideas, or from your performing the experiments or procedures depicted in this presentation. If you do not agree, then do not view this content. The copyright label, the Louisiana Tech logo, and the “living with the lab” identifier should not be removed from this presentation. You may modify this work for your own purposes as long as attribution is clearly provided.

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. Below is an example from an earlier class where we made an LED flash on and off. Are we using digital pin 2 as an input or an output? digital output void setup() { pinMode(2, OUTPUT); } void loop() { digitalWrite(2, HIGH); delay(1000); digitalWrite(2, LOW); delay(500);

receiving input from an Arduino digital input analog input int val; val = digitalRead(7); int val; val = analogRead(5); 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 1023 0 = 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

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) 0 1 2 3 4 5 6 7 8 9 5 4 3 2 1 digitalRead()returns HIGH or 1 high digitalRead()may return a value of HIGH or LOW ambiguous digitalRead()returns LOW or 0 low LOW or HIGH???

analog inputs The analog input pins on your Arduino have 10-bit resolution and consequently measure in (2)10 or 1024 increments. 2 10 =1024 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 = 0.00488 volts 𝑣𝑜𝑙𝑡𝑎𝑔𝑒=analogRead 𝑜𝑢𝑡𝑝𝑢𝑡∙ 5 𝑣𝑜𝑙𝑡𝑠 1024

data point from plot above examples point 1 point 2 point 3 time (milliseconds) voltage (V) 0 1 2 3 4 5 6 7 8 9 5 4 3 2 1 digitalRead()returns HIGH or 1 digitalRead()may return a value of HIGH or LOW digitalRead()returns LOW or 0 data point from plot above If a digital pin is used to sample voltage if an analog pin is used output of digitalRead() hypothetical analogRead() output voltage computed from analogRead() output   217∙ 5𝑉 1023 =1.061𝑉 1 217 526∙ 5𝑉 1023 =2.571𝑉 2 ambiguous 526 964∙ 5𝑉 1023 =4.712𝑉 3 1 964