Community College of Allegheny County Unit 7 Page #1. Analog to Digital

Similar documents
INA169 Breakout Board Hookup Guide

Community College of Allegheny County Unit 4 Page #1. Timers and PWM Motor Control

Community College of Allegheny County Unit 8 Page #1. Op-Amps

SEN Description. Features. MG-811 Specifications

EGG 101L INTRODUCTION TO ENGINEERING EXPERIENCE

1 PART A : MAKING THE DIGITAL THERMOMETER 1. There are three parts to this exercise, which takes two 3-hour laboratory sessions.

TWEAK THE ARDUINO LOGO

OSCILLOSCOPES, MULTIMETERS, & STRAIN GAGES

Arduino: Sensors for Fun and Non Profit

Arduino Sensor Beginners Guide

.:Twisting:..:Potentiometers:.

You'll create a lamp that turns a light on and off when you touch a piece of conductive material

For this exercise, you will need a partner, an Arduino kit (in the plastic tub), and a laptop with the Arduino programming environment.

EM Arduino 4-20mA Shield Documentation. Version 1.5.0

Disclaimer. Arduino Hands-On 2 CS5968 / ART4455 9/1/10. ! Many of these slides are mine. ! But, some are stolen from various places on the web

LABORATORY 5 v3 OPERATIONAL AMPLIFIER

Lab assignment: Strain gauge

ESC 100: Exploring Engineering. Fall Lab 2: Calibrating An Infrared Distance Sensor

Experiment P-10 Ohm's Law

FABO ACADEMY X ELECTRONIC DESIGN

Lesson 3: Arduino. Goals

Arduino Digital Out_QUICK RECAP

ANALOG TO DIGITAL CONVERTER ANALOG INPUT

Assignment 8 Analyzing Operational Amplifiers in MATLAB and PSpice

HAW-Arduino. Sensors and Arduino F. Schubert HAW - Arduino 1

Module: Arduino as Signal Generator

Building a Microcontroller based potentiostat: A Inexpensive and. versatile platform for teaching electrochemistry and instrumentation.

Part 1: DC Concepts and Measurement

Arduino Intermediate Projects

Arduino Microcontroller Processing for Everyone!: Third Edition / Steven F. Barrett

ENGN/PHYS 207 Fall 2018 Assignment #5 Final Report Due Date: 5pm Wed Oct 31, 2018

Monitoring Temperature using LM35 and Arduino UNO

Computational Crafting with Arduino. Christopher Michaud Marist School ECEP Programs, Georgia Tech

Introduction to. An Open-Source Prototyping Platform. Hans-Petter Halvorsen

EE 233 Circuit Theory Lab 3: First-Order Filters

Class #3: Experiment Signals, Instrumentation, and Basic Circuits

Electronic Instrumentation Sensors and Actuators

OPERATIONAL AMPLIFIERS (OP-AMPS) II

Laboratory Exercise - Seven

Sensor-Emulator-EVM. System Reference Guide. by Art Kay High-Precision Linear Products SBOA102A

Lab 2: Blinkie Lab. Objectives. Materials. Theory

Lab Exercise 6: Digital/Analog conversion

J. La Favre Using Arduino with Raspberry Pi February 7, 2018

Lab 5: Arduino Uno Microcontroller Innovation Fellows Program Bootcamp Prof. Steven S. Saliterman

Arduino and Servo Motor

ECE 2274 MOSFET Voltmeter. Richard Cooper

University of North Carolina, Charlotte Department of Electrical and Computer Engineering ECGR 3157 EE Design II Fall 2009

DATASHEET. Amicrosystems AMI-AD1224 HIGH PRECISION CURRENT-TO-DIGITAL CONVERSION MODULE PRODUCT DESCRIPTION FEATURES

Single-channel power supply monitor with remote temperature sense, Part 1

University of Michigan EECS 311: Electronic Circuits Fall 2009 LAB 2 NON IDEAL OPAMPS

ET 438B Sequential Digital Control and Data Acquisition Laboratory 4 Analog Measurement and Digital Control Integration Using LabVIEW

Model 176 and 178 DC Amplifiers

Bridge Measurement Systems

ENGR 40M Project 4: Electrocardiogram. Prelab due 24 hours before your section, August Lab due 11:59pm, Saturday, August 19

Coding with Arduino to operate the prosthetic arm

+ power. V out. - power +12 V -12 V +12 V -12 V

MAE106 Laboratory Exercises Lab # 1 - Laboratory tools

Lecture 4: Basic Electronics. Lecture 4 Brief Introduction to Electronics and the Arduino

WebSeminar: Signal Chain Overview

EEE3410 Microcontroller Applications Department of Electrical Engineering. Lecture 10. Analogue Interfacing. Vocational Training Council, Hong Kong.

EEC WINTER Instructor: Xiaoguang Leo" Liu. Application Note. Baseband Design. Duyen Tran ID#: Team DMK

Date Issued: 12/13/2016 iarmc.06: Draft 6. TEAM 1 - iarm CONTROLLER FUNCTIONAL REQUIREMENTS

ME 461 Laboratory #5 Characterization and Control of PMDC Motors

SCHOOL OF TECHNOLOGY AND PUBLIC MANAGEMENT ENGINEERING TECHNOLOGY DEPARTMENT


CPSC 226 Lab Four Spring 2018

Application Note AN 102: Arduino I2C Interface to K 30 Sensor

Introduction PNP C NPN C

Operational Amplifier (Op-Amp)

University of Pittsburgh

// Parts of a Multimeter

EE-110 Introduction to Engineering & Laboratory Experience Saeid Rahimi, Ph.D. Labs Introduction to Arduino

MICROCONTROLLERS BASIC INPUTS and OUTPUTS (I/O)

Attribution Thank you to Arduino and SparkFun for open source access to reference materials.

Analog I/O. ECE 153B Sensor & Peripheral Interface Design Winter 2016

Basics before Migtrating to Arduino

2.017 DESIGN OF ELECTROMECHANICAL ROBOTIC SYSTEMS Fall 2009 Lab 4: Motor Control. October 5, 2009 Dr. Harrison H. Chin

PHYS 3152 Methods of Experimental Physics I E2. Diodes and Transistors 1

PHYS 1402 General Physics II Experiment 5: Ohm s Law

EE 2274 DIODE OR GATE & CLIPPING CIRCUIT

Workshop 9: First steps in electronics

USER MANUAL FOR THE LM2901 QUAD VOLTAGE COMPARATOR FUNCTIONAL MODULE

Calibration Coefficients and Thermistor Selection

Introduction to the Op-Amp

Nixie millivolt Meter Clock Add-on. Build Instructions, Schematic and Code

Group 39. Jeff Mueller, EE Jon Graff, EE Thierry Alerte, CpE Jonathan Schooley, EE

Interface MEMS 3-Axis Accelerometer to Microcontroller

Lab Exercise # 9 Operational Amplifier Circuits

introduction to Digital Electronics Install the Arduino IDE on your laptop if you haven t already!

EARTH PEOPLE TECHNOLOGY. EPT-200TMP-TS-U2 Temperature Sensor Docking Board User Manual

Lab: Blood Pressure. Goal: Design and test a bandpass filter that can isolate a blood pressure signal.

SIMULATIONS WITH THE BUCK-BOOST TOPOLOGY EE562: POWER ELECTRONICS I COLORADO STATE UNIVERSITY. Modified February 2006

User Guide for the e NABLE Hand Test Rig

Written by Hans Summers Wednesday, 15 November :53 - Last Updated Wednesday, 15 November :07

Ballistocardiograph 1

High Voltage Waveform Sensor

10: AMPLIFIERS. Circuit Connections in the Laboratory. Op-Amp. I. Introduction

Rodni What will yours be?

Lecture 14 Interface Electronics (Part 2) ECE 5900/6900 Fundamentals of Sensor Design

Differential Amplifier : input. resistance. Differential amplifiers are widely used in engineering instrumentation

Transcription:

Community College of Allegheny County Unit 7 Page #1 Analog to Digital "Engineers can't focus just on technology; they need to develop their professional skills-things like presenting yourself, speaking in front of a large group and working within a technology team." Laura Harmon, recent grad & system engineer at Lockhead Martin (eetimes 8/14/99) Revised: Dan Wolf, 4/17/2018

Community College of Allegheny County Unit 7 Page #2 OBJECTIVES: Understanding of A/D Resolution, offset and slope. Experience and understanding of the AD590 temperature sensor. Use of the Arduino analog inputs. DELIVERABLES THAT YOU MUST SUBMIT 1. Experiment #1 Graph and Table #1 2. Experiment #2 Graph and Table #2 3. Practice Problems On-Line Reading Material: Required: a) http://www.eetimes.com/document.asp?doc_id=1276974 b) Explanation for three types of ADC: http://hyperphysics.phyastr.gsu.edu/hbase/electronic/adc.html#c1 Optional: a) Everything you wanted to know about A-D Convertors: http://www.delftek.com/wpcontent/uploads/2012/04/national_abcs_of_adcs.pdf b) https://learn.sparkfun.com/tutorials/analog-to-digitalconversion c) http://www.allaboutcircuits.com/textbook/digital/chpt- 13/practical-considerations-adc-circuits/ INTRODUCTION TO THE ARDUINO ANALOG TO DIGITAL CONVERTOR: The Arduino has six different Analog Inputs, numbered A0 to A5. Each has a 10-bit converter with a +5V reference voltage so the resolution is: Volt Resolution = 5Volt or Volt 2 10 Resolution = 5Volt = 4.88mV 1023 This means that an analog voltage between 0 and +5V will be measured in 1023 steps of 4.88mV. It takes about 100mS (0.0001 second) to read an analog input, so the maximum sample rate is about 10K times per second.

Community College of Allegheny County Unit 7 Page #3 INTRODUCTION TO THE AD590 TEMPERATURE SENSOR: The AD590 is a 2-terminal integrated circuit temperature transducer that produces an output current proportional to absolute temperature. For supply voltages between 4 V and 30 V, the device acts as a high impedance, constant current regulator passing 1μA per degree K. In order to convert the (1μA per degree K) constant current to a voltage for the ADC, we will add a 1K resister as follows: +5V 1uA / degk AD590 Temperature sensor 1mV / degk 1K ohm 77degF = 25degC = 298uA 70degF = 21degC = 294.15uA è 298mV @ 1K ohm load 70degF = 21degC = 294.15mV Outputs 1mV per C At 25 C (298 K or 77 F), the AD590 sensor will output 298uA though the 1K resister. According to ohm s law, 298uA though a 1K ohm resister provides a voltage of: Voltage = I R = 0.000298 1000 ohms = 0.298V = 298mV And each additional K increase or decrease will result in a corresponding 1uA change in output current from the AD590 producing a corresponding 1mV change in voltage. Note that a single degree Kelvin is equal in magnitude to a degree Celsius so we can also say for each degree Celsius we will see a 1mV change in output voltage. Figure #3 shows some key values of temperature, voltage and current for this circuit. EQUIPMENT REQUIRED: 1. Arduino Uno, power supply, cable, and USB Hub. 2. 10KΩ, 10-turn potentiometer 3. +5V Power supply 4. AD590 Temperature Sensor 5. 1000Ω resister

Community College of Allegheny County Unit 7 Page #4 Experiment #1 A/D Verification: 1. Figure #1 shows an Arduino microcontroller connected to a 10Kohm, 10-turn potentiometer. This will allow us to vary the Arduino analog input voltage from zero to 10 Volts while monitoring the conversion process on the computer monitor. 2. Using your class notes, design the interfaces between the different components and create a detailed (and neat) schematic which includes everything needed to build the circuit. 3. Construct the circuit and attach a voltmeter or Oscilloscope to monitor the analog input voltage. Use a fixed +5V power supply and set the potentiometer to a midpoint. When complete, ask the instructor to review your schematic before applying power. 4. See Figure #4. Upload the Arduino with the program named: AnalogInput_CCAC.ino 5. Start the Arduino Serial Monitor: Tools Serial Monitor so that you can monitor the output of the Arduino A/D conversion. Note: Make sure that you do not apply more than 5.0V to the Analog input of the Arduino. An excess voltage will damage the Arduino. 6. Apply power and test the circuit. Set the potentiometer so that the analog input is just about 4.88mV. The Serial Monitor should indicate a RAW A/D count of 1 and a voltage level of 4.88mV. If necessary, adjust the potentiometer so that the Serial Monitor shows a RAW A/D value of 1 and an output voltage of 4.88mV (Vin may not equal Voutput). Record the data on Table #1. 7. Complete the rest of Table #1. Pick your own values for the rows with blank RAW A/D cells. After each voltage change, observe how constant the output voltage is. Does it drift? Why? When you are done, use Excel to graph the data with the RAW A/D value on the X-axis and the input voltage on the Y-axis. Compute and record the slope of this data (Y=MX+B) on the back of the graph.

Community College of Allegheny County Unit 7 Page #5 8. On the same graph, plot the line for the perfect A/D conversion where: X = RAW A/D Value = 1 and Y = 4.88mV X = RAW A/D Value = 1023 and Y = 5.000 Volts Compute and record the slope of this data (Y=MX+B) on the back of the graph. The offset and slope of these two plots may not be equal. What does this mean? 9. If you were reading a wheatstone bridge/strain gauge, how would the Arduino offset and slope error affect the strain gauge measurements? 10. Submit your graph and Table #1 as your documentation for this experiment. Voltmeter / Oscilloscope Input Voltage Vin Table #1 Serial Monitor RAW A/D Value Output in mv Voutput (Offset Error) Voltage Difference Vin Voutput 0 0 1 2 3 511 1023

Community College of Allegheny County Unit 7 Page #6 Experiment #2 Temperature Measurement: 1. Figure #2 uses an AD590 temperature sensor as the input to the Arduino. The AD590 generates 298uA through the 1K resister at 25 C (77 F) resulting in 298mV applied to the Arduino input. Every C above or below will result in a 1mV increase or decrease in voltage. Figure #3 shows a group of useful values. 2. Based on the 1K ohm resister value, the equation to convert the AD590 output (in mv) to degrees F is: Y = MX + B degf = 1.8 mv 459.67 3. Modify the circuit to include the AD590 as per Figure #2 and ask the instructor to review it before you apply power. 4. Test with a couple of different temperatures and record the results in Table #2. Plot them on an Excel graph and see how close them are to the equation provided above. Remember that you may have experienced an A/D converter offset in the experiment above and the offset may still exist. Voltmeter / Oscilloscope Input Voltage Vin Serial Monitor RAW A/D Value Table #2 Output in mv Voutput Actual Temperature F Computed Temperature TF = 1.8 * Voutput 459.67

Community College of Allegheny County Unit 7 Page #7 Optional Experiment #1: 1. Remove the wire to the Arduino analog input so the input is left floating. Observe the values on the Serial Monitor. What is happening? Optional Experiment #2: 1. The equation for the AD590 output-to- F calculation is given above, including the values for the slope and offset (M and B). Calculate the values for the slope and offset and show all of your calculations. You may find that building a voltage ( K versus F versus C versus mv) table first in MS- Excel might clarify the concepts and calculations. Note that the AD590 data sheet specifies that it outputs 1uA per K so you have to switch the units to C and F in order to explain the full equation.

Community College of Allegheny County Unit 7 Page #8 Figure #1 Arduino Analog-to-Digital +5V Arduino MicroController 10K 10-turn Potentiometer Analog In A0 Gnd USB Laptop

Community College of Allegheny County Unit 7 Page #9 Figure #2 AD590 Temperature Sensor +5V AD590 Temperature sensor Arduino MicroController Analog In A0 1K ohm 77degF = 25degC = 298uA 70degF = 21degC = 294.15uA è 298mV @ 1K ohm load 70degF = 21degC = 294.15mV Outputs 1mV per C Gnd USB Laptop AD590

Community College of Allegheny County Unit 7 Page #10 AD590 Output Current in Amps AD590 mv output with 1K ohm Resister Figure #3 AD590 Temperature Table Degree Celsius Degree Fahrenheit Degree Kelvin Calculated F = 1.8(mV)-459.67 0.00027315 273.15 0 32 273.15 32 0.00029415 294.15 21 69.8 294.15 69.8 0.00029515 295.15 22 71.6 295.15 71.6 0.00029615 296.15 23 73.4 296.15 73.4 0.00029715 297.15 24 75.2 297.15 75.2 0.00029815 298.15 25 77 298.15 77 0.00029915 299.15 26 78.8 299.15 78.8 0.00030015 300.15 27 80.6 300.15 80.6 0.00037315 373.15 100 212 373.15 212

Community College of Allegheny County Unit 7 Page #11 Figure #4 AnalogInput_CCAC.ino - Arduino Software /* Analog Input - Demonstrates analog input by reading an analog value on analog pin 0 The circuit: Potentiometer attached to analog input 0 center pin of the potentiometer to the analog pin one side pin (either one) to ground the other side pin to +5V Created by Dan Wolf, Updated on 3/23/2017 */ const int OUTPUT_PIN_LOW = 4; //this output will go high when the voltage exceeds the lower threshold const int OUTPUT_PIN_HIGH = 5; //this output will go high when the voltage exceeds the upper threshold const float OUTPUT_PIN_LOW_THRESHOLD = 1.0; //this is the low threshold in volts const float OUTPUT_PIN_HIGH_THRESHOLD = 3.0; //this is the high threshold in volts int sensorpin = A0; // select the input pin for the potentiometer int sensorvalue = 0; // variable to store the value coming from the sensor const byte numchar_in_load = 10; char AD_Reading_Str[numChar_in_Load]; char AD_Voltage_Str[numChar_in_Load]; float fad_voltage; void setup() { Serial.begin(9600); // set up Serial library at 9600 bps Serial.println("\n Arduino Analog-to_Digital - vmarch_23_2017"); Serial.println("Uses analog input A0 \n"); pinmode(output_pin_low, OUTPUT); //LED for low status pinmode(output_pin_high, OUTPUT); //LED for high status } void loop() { // read the value from the sensor: sensorvalue = analogread(sensorpin); fad_voltage = sensorvalue * 0.00488; //convert to voltage (5V / 1023 = 0.00488) dtostrf(sensorvalue, 5, 0, AD_Reading_Str); // convert the float value to a string value dtostrf(fad_voltage, 7, 5, AD_Voltage_Str); // convert the float value to a string value Serial.print("Raw A-D Value: "); Serial.print(AD_Reading_Str); // display the RAW A-D Value Serial.print(" ");

Community College of Allegheny County Unit 7 Page #12 Serial.print("A-D Voltage: "); Serial.print(AD_Voltage_Str); // display the analog input voltage Serial.print(" Volts \n"); if (fad_voltage > OUTPUT_PIN_LOW_THRESHOLD) { digitalwrite(output_pin_low, HIGH); //indicate voltage is higher then the low limit } else { digitalwrite(output_pin_low, LOW); //indicate voltage is lower then the low limit } if (fad_voltage > OUTPUT_PIN_HIGH_THRESHOLD) { digitalwrite(output_pin_high, HIGH); //indicate voltage is higher then the high limit } else { digitalwrite(output_pin_high, LOW); //indicate voltage is lower then the high limit } } delay(2000);

Community College of Allegheny County Unit 7 Page #13 PRACTICE PROBLEMS: 1. You are working with a 0 to +10volt, 14-bit ADC. a. What is the smallest voltage that it will be able to measure? b. What will be the RAW A-D output value when a 15mV signal is applied to the input? 2. Refer to the Linear Technology LTC1604 ADC Converter datasheet that is on the course website and answer the following questions: a. How many bits is this converter? b. What is its input voltage range? c. How many samples per second can it accept? 3. We have an RPM sensor that must be connected to the Arduino 10-bit ADC. The RPM sensor has a range of 0 to 8K RPM via a voltage range of 0 to +5volts. a. What is the expected input voltage to the ADC at 3K RPM? b. What is the RPM resolution for this application?