ENGR 210 Lab 12: Analog to Digital Conversion

Similar documents
EE283 Electrical Measurement Laboratory Laboratory Exercise #7: Digital Counter

ENGR-4300 Fall 2006 Project 3 Project 3 Build a 555-Timer

ELG3336: Converters Analog to Digital Converters (ADCs) Digital to Analog Converters (DACs)

). The THRESHOLD works in exactly the opposite way; whenever the THRESHOLD input is above 2/3V CC

Digital Logic Circuits

DIGITAL ELECTRONICS: LOGIC AND CLOCKS

EEE312: Electrical measurement & instrumentation

CHAPTER 6 DIGITAL INSTRUMENTS

B.E. SEMESTER III (ELECTRICAL) SUBJECT CODE: X30902 Subject Name: Analog & Digital Electronics

ENGR-2300 Electronic Instrumentation Quiz 3 Spring Name: Solution Please write you name on each page. Section: 1 or 2

ELG4139: Converters Analog to Digital Converters (ADCs) Digital to Analog Converters (DACs)

ANALOG TO DIGITAL (ADC) and DIGITAL TO ANALOG CONVERTERS (DAC)

Lab 2 Revisited Exercise

Lab 5. Binary Counter

CHAPTER ELEVEN - Interfacing With the Analog World

DEPARTMENT OF ELECTRICAL ENGINEERING LAB WORK EE301 ELECTRONIC CIRCUITS

Lab 6. Binary Counter

ASTABLE MULTIVIBRATOR

11 Counters and Oscillators

Physics 309 Lab 3 Bipolar junction transistor

Digital Applications of the Operational Amplifier

Introduction to the Op-Amp

Chapter 5: Signal conversion

Data Converters. Dr.Trushit Upadhyaya EC Department, CSPIT, CHARUSAT

Instructions for the final examination:

Linear Integrated Circuits

PreLab 6 PWM Design for H-bridge Driver (due Oct 23)

Name EET 1131 Lab #2 Oscilloscope and Multisim

Module -18 Flip flops

COMBINATIONAL and SEQUENTIAL LOGIC CIRCUITS Hardware implementation and software design

ELEC2 (JUN15ELEC201) General Certificate of Education Advanced Subsidiary Examination June Further Electronics TOTAL. Time allowed 1 hour

Data Conversion and Lab Lab 4 Fall Digital to Analog Conversions

Physics 335 Lab 1 Intro to Digital Logic

DIGITAL TO ANALOG AND ANALOG TO DIGITAL CONVERTER

Use the fixed 5 volt supplies for your power in digital circuits, rather than the variable outputs.

PHYSICS 536 Experiment 14: Basic Logic Circuits

1. The decimal number 62 is represented in hexadecimal (base 16) and binary (base 2) respectively as

TECH 3232 Fall 2010 Lab #1 Into To Digital Circuits. To review basic logic gates and digital logic circuit construction and testing.

Introduction to IC-555. Compiled By: Chanakya Bhatt EE, IT-NU

Fan in: The number of inputs of a logic gate can handle.

Class #6: Experiment The 555-Timer & Pulse Width Modulation

ECE3204 D2015 Lab 1. See suggested breadboard configuration on following page!

Electronic Instrumentation

R 1 R 2. (3) Suppose you have two ac signals, which we ll call signals A and B, which have peak-to-peak amplitudes of 30 mv and 600 mv, respectively.

Process Components. Process component

Digital Logic Troubleshooting

Exercise 1: DC Operation of a NOT and an OR-TIE

Sirindhorn International Institute of Technology Thammasat University at Rangsit

ENGINEERING TRIPOS PART II A ELECTRICAL AND INFORMATION ENGINEERING TEACHING LABORATORY EXPERIMENT 3B2-B DIGITAL INTEGRATED CIRCUITS

EXPERIMENT 12: DIGITAL LOGIC CIRCUITS

Sequential Logic Circuits

Lab 7: DELTA AND SIGMA-DELTA A/D CONVERTERS

Amplitude modulator trainer kit diagram

MODULE TITLE : OPERATIONAL AMPLIFIERS TOPIC TITLE : OSCILLATORS LESSON 2 : RELAXATION OSCILLATORS

ENGR-2300 Electronic Instrumentation Quiz 3 Spring 2015

Laboratory 3 W. Liu, by A. Shakouri and K. Pedrotti. Introduction to Bipolar Junction Transistors

Experiment # 2 The Voting Machine

ECE 2010 Laboratory # 5 J.P.O Rourke

For the op amp circuit above, how is the output voltage related to the input voltage? = 20 k R 2

Chemistry Hour Exam 1

EE ELECTRICAL ENGINEERING AND INSTRUMENTATION

CHAPTER 6. Motor Driver

1 Analog and Digital Communication Lab

ANALOG TO DIGITAL CONVERTER

THIRD SEMESTER ELECTRONICS - II BASIC ELECTRICAL & ELECTRONICS LAB DEPARTMENT OF ELECTRICAL ENGINEERING

The Non Inverting Buffer

ENGR4300 Fall 2005 Test 4A. Name. Section. Question 1 (25 points) Question 2 (25 points) Question 3 (25 points) Question 4 (25 points)

Facility of Engineering. Biomedical Engineering Department. Medical Electronic Lab BME (317) Post-lab Forms

Experiment 5: Basic Digital Logic Circuits

1.) If a 3 input NOR gate has eight input possibilities, how many of those possibilities result in a HIGH output? (a.) 1 (b.) 2 (c.) 3 (d.) 7 (e.

ENGR4300 Fall 2005 Test 4A. Name solutions. Section. Question 1 (25 points) Question 2 (25 points) Question 3 (25 points) Question 4 (25 points)

Physics 303 Fall Module 4: The Operational Amplifier

UNIVERSITI MALAYSIA PERLIS

Project 3 Build a 555-Timer

Schmitt Trigger Inputs, Decoders

Cornerstone Electronics Technology and Robotics Week 21 Electricity & Electronics Section 10.5, Oscilloscope

University of California at Berkeley Donald A. Glaser Physics 111A Instrumentation Laboratory

Experiment # (3) PCM Modulator

ECE 220 Laboratory 3 Thevenin Equivalent Circuits, Constant Current Source, and Inverting Amplifier

UNIT III Data Acquisition & Microcontroller System. Mr. Manoj Rajale

PC-OSCILLOSCOPE PCS500. Analog and digital circuit sections. Description of the operation

Department of Electronics & Communication Engineering LAB MANUAL SUBJECT: DIGITAL COMMUNICATION LABORATORY [ECE324] (Branch: ECE)

VCC. Digital 16 Frequency Divider Digital-to-Analog Converter Butterworth Active Filter Sample-and-Hold Amplifier (part 2) Last Update: 03/19/14

Police Siren Circuit using NE555 Timer

Analog Electronic Circuits Lab-manual

Transistor Design & Analysis (Inverter)

OBJECTIVE The purpose of this exercise is to design and build a pulse generator.

Homework #01. Electronics Homework 01 MSCI 222C

USER MANUAL FOR THE LM2901 QUAD VOLTAGE COMPARATOR FUNCTIONAL MODULE

Revision: Jan 29, E Main Suite D Pullman, WA (509) Voice and Fax

GCSE (9-1) WJEC Eduqas GCSE (9-1) in ELECTRONICS ACCREDITED BY OFQUAL DESIGNATED BY QUALIFICATIONS WALES SAMPLE ASSESSMENT MATERIALS

Figure 1.1 Mechatronic system components (p. 3)

LAB #10: Analog Interfacing

EE 330 Laboratory 8 Discrete Semiconductor Amplifiers

Electronics. RC Filter, DC Supply, and 555

State Machine Oscillators

LM555 and LM556 Timer Circuits

Data Conversion and Lab Lab 3 Spring Analog to Digital Converter

Advantages of Analog Representation. Varies continuously, like the property being measured. Represents continuous values. See Figure 12.

Digital Electronics Course Objectives

Transcription:

ENGR 210 Lab 12: Analog to Digital Conversion In this lab you will investigate the operation and quantization effects of an A/D and D/A converter. A. BACKGROUND 1. LED Displays We have been using LEDs as indicators in the EWB simulations. Two ways to use LEDs as indicators are shown in Figure 1. Note that these circuits do not work with all logic families many times the logic gates cannot supply the current which the LED needs. In those cases you have to use an external transistor to supply extra current. The technique of using an external transistor can also be used to operate relays and lights from a logic gate. Although only an inverter is shown in Figure 1 you can use any logic gate which has the necessary current output. The actual current is dependent upon the particular LED used. If we assume a current of 10 ma and a typical voltage across the LED of about 1.7 volts, we can calculate R=(51.7)/0.01 ma = 3.3/0.1=330Ω. Using resistors in Figure 1 which are much smaller than this value can burn out the output of the integrated circuit. Larger values are better but will dim the LED. 5 volts 5 volts 5 volts R LED R LED (a) Using TTL output as a current sink. (b) Using TTL output as a current source Figure 1. LED driver circuits 2. Analog to Digital (A/D) and Digital to Analog (D/A) conversion Data that is obtained from a physical system is generally in analog form, i.e., it varies in time and can have any voltage between some maximum and minimum value. In order to do computerbased processing of that data it is necessary to first convert the information from analog to digital form. This is done by quantizing, or subdividing, the voltage range into a number of finitesize steps. The number of steps is usually 2 n 1, where n is the number of bits available for the binary word that will represent the analog voltage. An example of this quantization is shown in Figure 2 where n=3 has been chosen. As can be seen by comparing the two columns at the right of the figure, 1

there is always some error introduced in the conversion since no matter how many bits are chosen, there is always a step between levels. Digital readout 111 110 101 100 011 010 001 000 Analog Input Voltage 6.5 7.5 5.5 6.5 4.5 5.5 3.5 4.5 2.5 3.5 1.5 2.5 0.5 1.5 0 1/8 2/8 3/8 4/8 5/8 6/8 7/8 FS Fraction of Full Scale Figure 2. Three bit A/D quantization effect. There are various approaches to the implementation of an A/D converter. One of these makes use of a set of comparators whose inputs are referenced to the quantized voltage levels. This is the fastest type of A/D converter available and is often called a flash" converter. To demonstrate the quantization effect we will use an Electronics Workbench simulation. (This lab is a bit complicated to build and test in one lab period.) The fabricated circuit consists, in part, of an 8bit, comparatorbased flash A/D converter as shown in Figure 4. The output of the converter is an 8bit code which is converted into a 3bit binary code using the circuit of Figure 5. The output of this code converter is connected to the input of an op ampbased D/A converter (see Figure 3) whose output can, in turn, be displayed on a scope or a DMM. Z3 Z2 2kΩ Z1 4kΩ Vout Figure 3. 3bit D/A converter 2

Vref X6 X5 X4 X3 X2 X1 X0 Vin Figure 4. Flash A/D converter 3

X6 U1 X5 Z2 X4 Z1 X3 X2 X1 Z0 X0 Figure 5. 8to3 bit code converter There are many other approaches to converting analog numbers to digital representations. 1. You have actually already seen one other type of A/D converter in the 555 timer lab a 555 timer can be used as a V/F converter where an analog voltage controls the frequency of a 555 timer. A computer is then used to count the number of output pulses over a fixed period of time the count is a digital representation of the analog input quantity. 2. Another common type of A/D converter uses an input voltage to charge up a capacitor. The time that it takes to discharge this voltage is timed by a computer or a digital counter. This is the type most often found in digital instruments such as a DMM and, depending upon the exact details of the implementation, is called a single or dual slope integrating A/D. 3. Yet another common A/D called the successive approximation A/D uses a computer to generate a digital code which is sent to a D/A converter. This digitally generated voltage is compared to 4

the input voltage with a comparator. If the input voltage is higher than the generated voltage the code number is increased, if the input voltage is less than the generated voltage the code number is decreased. The computer typically uses a binary search technique to rapidly find the largest code number which will generate the largest voltage less than or equal to the input voltage. The difference between these converters lies in the details of how they work. The socalled flash A/D converter is the fastest. The dual slope integrating A/D converter is among the most accurate (especially using inexpensive components) and is among the slowest. The V/F converter is often the cheapest and is found in systems which use a microprocessor, such as computer controlled appliances. B. LAB INSTRUCTIONS Part 1: More logic circuits (a) You will use a single 7402 logic gate to determine the actual LOW and HIGH logic levels of a logic gate. Select a single gate from the 7402. Tie its two inputs together. Connect these inputs to the positive adjustable power supply output using a 300Ω resistor the exact value is not critical and you could use 330Ω, etc. Make sure the adjustable power supply is set to zero volts. Measure the output of your selected gate with a DMM. It should be near 5 volts if the input is zero. Remember that you have it connected essentially as an inverter. Now slowly increase the power supply voltage while monitoring the output of the selected gate with a DMM. Record the voltage at which the output goes low in Data Table 1. GND 1 2 3 4 5 6 7 14 13 12 11 10 9 8 Vcc Figure 6. A 7402 IC contains 4 2input NOR gates. (b) Repeat Step 1 except now start the input voltage at 5 volts and decrease the input voltage. Since the input is initially HIGH the output should be LOW. At some value of the input voltage, the output will change. Record this voltage in Data Table 1. (c) Add the circuit of Figure 1(a) to the output of your 7402 gate. Use the variable power supply to vary the input voltage to the 7402 gate between 0 and 5 volts. Does the LED function to indicate the output state of the gate? Measure the voltage drop across the LED and the resistor. Compute the current through the diode. Record these measurements in Data Table 2. (d) Using the gates on a 7402, build the circuit shown in Figure 7. 5

S Q* R Q Figure 7. RS Flipflop Determine the truth table for this circuit and record your measurements in Data Table 3. This is actually a RS flip flop and can have very perplexing behavior. Unlike combinational logic it works based upon the two inputs (R and S) AND the current (called the previous) output. To help you understand this circuit the theoretical behavior of an RS flipflop is shown in Figure 8. Notice that the new output (Q n1 ) is described in terms of R, S and the previous value of Q (called Q n ). DO NOT CONFUSE Q n1 with the Q* shown in Figure 7 Q n1 is the NEXT state (value) of the Q output of Figure 7. The actual operation of the RS flipflop can be more easily understood by a simple explanation. The R (also called the RESET) will always reset the Q output to zero (LOW) irregardless of the previous state of the output. The S (also called the SET) will always set the Q output to one (HIGH) irregardless of the previous state of the output. There will be no change in the Q output if both R and S inputs are zero (LOW). However, there is a problem if both R and S inputs are one (HIGH). Technically, you are trying to SET and RESET the output at the same time. As a result the output can be random and, consequently, undefined. In general, the Q* output of Figure 7 should behave as the NOT of Q and does not need to be separately explained. S R Q n (previous state) Q n1 (new state) 0 0 0 0 0 0 1 1 0 1 0 0 0 1 1 0 1 0 0 1 1 0 1 1 1 1 0 undefined 1 1 1 undefined Figure 8. Theoretical operation of RS Flipflop 6

Your final objective is to use the EWB simulation provided on the course Web page to observe and understand the operation of an A/D and D/A converter and the quantization effect that is produced by the overall circuit. The circuit diagram for the major components of this simulated circuit is shown in Figure 3, Figure 4 and Figure 5. 4. A voltage divider which can go from 0.5 volts to 5 volts is used to generate an input voltage for the A/D converter. This input voltage can be increased in 1% increments by typing a r on the keyboard; it can be decreased in 1% increments by typing R on the keyboard. The digital output of the A/D converter is shown by the horizontal row of LEDs labeled X0 to X6. This seven bit digital code is converted into a more conventional threebit digital code by the logic shown. The threebit code output, shown by the horizontal row of LEDs labeled Z0 to Z2, is input to a 3bit D/A converter. Verify that you can change Vin by varying the resistor. 5. Using the EWB simulation complete the truth table for the A/D and D/A converter, i.e, what are the seven and three bit codes as a function of Vin? Record your results in Data Table 4. Also determine Vout as a function of Vin and the threebit input code to the D/A. Also record these results in Data Table 4. 6. Replace the variable resistor R at the input of the A/D converter with the function generator. Adjust the function generator to produce a 0.5 Hz ramp of about 5 volts amplitude. None of these values are critical. Connect the oscilloscope to monitor Vin (the input to the A/D converter) and Vout (the output of the D/A converter). Run the simulation. The output of the D/A converter should be a waveform with discrete steps this waveform is often called a staircase. You should also see some voltage "spikes" on the staircase output of the D/A converter. Adjust the oscilloscope to get a good display of Vin and the corresponding Vout for Vin>0. Make a printout of this voltage waveform. 7

DATA AND REPORT SHEETS FOR LAB 12 Student Name (Print): Student Signature: Student Name (Print): Student Signature: Student Name (Print): Student Signature: Student ID: Date: Student ID: Date: Student ID: Date: Lab Group: Data Table 1. Voltage at which digital logic switches Input voltage at which output switches Initial Measured V out Measured V out after switch Increasing V in from 0 volts Decreasing V in from 5 volts Data Table 2. LED indicator characteristics (for LED illuminated) Voltage across R Voltage across LED Current through LED Measured Calculated 8

Data Table 3. Truth table for RS flipflop R S Q n Q n1 0 1 0 0 1 0 1 1 Data Table 4. A/D and D/A Converter Characteristics X 6 X 5 X 4 X 3 X 2 X 1 X 0 Z 2 Z 1 Z 0 V OUT V in < 0V 0 0 0 0 < V in < 0.625 0.625 < V in < 1.25 1.25 < V in < 1.875 1.875 < V in < 2.5 2. 5 < V in < 3.125 3. 125 < V in < 3.75 3. 75 < V in < 4.475 V in > 4.475V Be sure to print out your simulation waveform and include it with your report. 9

Questions 1. Why does Data Table 4 only show seven input codes? HINT: Can the A/D converter generate a an output code X 6 X 5 X 4 X 3 X 2 X 1 X 0 =0001000? 2. Using Data Table 4 explain how the digital logic converts the A/D converter outs X 6 X 5 X 4 X 3 X 2 X 1 X 0 into the threebit code Z 2 Z 1 Z 0 used by the D/A converter. 3. What are the voltage levels at the output of the D/A converter? What range of voltage does each level of the input code Z 2 Z 1 Z 0 represent? 4. In step C.7 you recorded a time dependent response of the D/A output. This response showed some voltage spikes (often called D/A glitches). Why do these appear? HINT: Look at which bits are changing in the input code. 5. Suppose you wanted to redesign the A/D converter so that each input step corresponded to exactly 0.5 volts. An easy way to do this is to change the value of Vref. What should this new value of Vref be? Be sure to include your calculations. 6. The buffer labeled U1 is required in the simulated circuit for it to work properly. Why? 10