University of Pennsylvania Department of Electrical and Systems Engineering ESE Undergraduate Laboratory Analog to Digital Converter PURPOSE The purpose of this lab is to design and build a simple Digital-to-Analog (DAC) converter using an OpAmp (LM741) and resistors. You will apply Thévenin s theorem to analyze an R-2R ladder network. Figure 1 Screen capture from the scope showing input (Ch1, Yellow) to ADC, output (Ch2, Green) from DAC and digital outputs D0, D1, D2 from 74148 encoder.
BACKGROUND Digital-to-Analog Converter: The input to a DAC is a binary word of n-bits and the output is an analog value, as schematically shown in Figure 2a. Figure 2: (a) DAC block diagram; (b) input-output characteristic of a DAC The n-bit word (or digital code) is a digital representation of a signal. The relationship between the analog output value and the binary word is for the case of a 3-bit code (b 2,b 1,b o ), as follows: V DAC = K 1 (b 2 /2 + b 1 /4 + b o /8) V ref V DAC =(b 2 /2 + b 1 /4 + b o /8) FS In which K 1 is a scale factor, V ref is a reference voltage, FS stands for Full Scale (=K 1 xv ref ) and b i is the ith bit of the digital word. The bit b o is called the least significant bit (LSB) and b 2 is the most significant bit (MSB). Each time the LSB changes the analog output will change by a value equal to FS/2 3 for a three bit DAC (or by FS/2 N for a N bit DAC). As an example, let s assume that the digital input is equal to (101), K 1 = 1 and the reference V ref = 5V. The output voltage will then be: V DAC = K(1/2 + 0/4 +1/8) V ref = 5/8xV ref = 5/8xFS = 3.125 V For each digital input (b 2,b 1,b o ) there will be a corresponding output as shown in Figure 2b for a total of 2 3 = 8 possible digital words. Notice that only discrete values of the output signal are possible. The more bits the input word has, the smaller the steps of the output signal will be (or the better the resolution). Typical ADCs have at least 8 bits of resolution and even 12 to 16 bits are not uncommon. In order to keep the lab manageable we will limit ourselves to building a simple 3-bit DAC and ADC. For more bits, one can extend the same principle by using more components. The scheme used in the lab to build these converters is only one of many possible designs. For higher resolution converters more sophisticated architectures are used. You will learn more about this in other classes.
PRE-LAB ASSIGNMENT 1. A practical circuit to implement a DAC converter is a R-2R ladder network, as shown in Figure 3a. Figure 3: (a) R-2R ladder network; (b) Thévenin's equivalent network Do a detailed circuit analysis in your notebook to show that the Thévenin's equivalent resistance and voltage, as shown in Figure 3b, is equal to: R T = R and V T = (V 2 /2+ V 1 /4 + V o /8) You can use the superposition principle to find Thévenin's equivalent voltage. 2. Assume that the voltages in the circuit of Fig. 3 can be either 0 or 5V, what is the smallest increment of the output voltage V out in the previous circuit of Fig. 3 (for one increment in binary number), i.e. the value of 1 LSB (as defined in Figure 2b)? 3. Design an OpAmp interface circuit whose input connects to the output of the R-2R ladder network so that each increment in the binary number produces 1V (or a -1V) increase (decrease) in output voltage V DAC (e.g. a (001) 2 gives a 1V output, a (011) 2 gives a 3V, while a (111) 2 gives a 7V output). Give the circuit and the calculations to find the resistor values. 4. In your lab notebook, calculate the expected analog output voltage (at the output of the OpAmp circuit) for each of the binary words of Table 1 D2 D1 D0 VDAC (calc.) (Volt) 0 0 0 0 0 1 0 1 0 0 1 1 1 0 0 1 0 1 1 1 0 1 1 1 Table 1 Expected Analog Voltage Vout(meas.) (Volt) 5. Draw a diagram similar to the one on figure 2b in your lab notebook, using the calculated values for V DAC.
IN LAB ASSIGNMENT A. Equipment 1. Digital Multimeter (HP34401A) 2. Triple output programmable power supply (HP E3631A) 3. Protoboard 4. Blue box with cables and connectors 5. Resistors 6. Potentiometer 7. Oscilloscope 8. Digital Probes 9. OpAmp LM 741 10. 7404 TTL Inverter B. Procedure 1. Build the R-2R ladder DAC as shown in figure 4. This circuit is similar to the one on your pre-lab. We only added an op-amp to amplify the output of the resistor ladder network. Calculate R1 and R2 such that the gain of the circuit is XXX. Figure 4 R-2R ladder network Fill out table 2 with your V OUT and V DAC calculated and measured values for the different switch configurations (Note that the 1s on the table correspond to the switch connected to 5V and the 0s to the switches connected to ground).
D2 D1 D0 Calculated V OUT Measured V OUT Calculated V DAC Measured V DAC 0 0 0 0 0 1 0 1 0 0 1 1 1 0 0 1 0 1 1 1 0 1 1 1 Table 2 Answers to first step 2. Modify your op-amp interface such that each increment in the binary number generates a 1V increment at the output. Measure and record the R1 and R2 values that gave you that kind of response. Use the following table to record the calculated and measured values of VDAC. D2 D1 D0 V OUT Calculated V DAC Measured V DAC 0 0 0 0 0 0 0 1 0 1 0 0 1 1 1 0 0 1 0 1 1 1 0 1 1 1 ~5V ~7V Table 3 Results for 1V increment 3. Next, you will interface your circuit from last week with the one that you just built. Connect D0, D1 and D2 from last week s circuit to the circuit shown on figure 5. The TTL inverter 7404 converts the voltage from ~3.8V to 5V. This will ensure that the voltages measured on step 2 will be similar to the calculation of voltages from your pre-lab.
Figure 5 A to D and D to A interface 4. Your Agilent s 7034B scope has the capability to acquire and display 16 channel digital signals along with signals acquired from its 4 analog inputs. (Refer to pages 359-368 on http://cp.literature.agilent.com/litweb/pdf/54695 97025.pdf). The logic probes should be connected to the back of the scope. They are numbered 0 16. Use the probe numbers #0, #1 and #2 to connect to pins 4, 8, 12 of 7404 respectively. Use the Digital function of the MSO7034B oscilloscope to display digital signals as shown in Figure 6.
Figure 6 Use of Digital inputs using logic probes Connect the signals to the oscilloscope as shown below: Channel 1 (Yellow): Input Signal Channel 2(Green): Output Signal (re constructed Sine Wave) D0 (Blue) : Digital signal bit D0 D1 (Blue) : Digital signal bit D1 D2 (Blue) : Digital signal bit D2 Does the scope screen look similar to Figure 1? Show this to your TA. Your exit tickets are the completed tables 1 through 3 and the waveforms from step 4.