LabA_resistors-1

docx

School

Wayne State University *

*We aren’t endorsed by this school

Course

215

Subject

Electrical Engineering

Date

Feb 20, 2024

Type

docx

Pages

21

Uploaded by fatsopanda5202

Report
EECS 215 Labs 1,2,3: R2R DAC EECS 215 Lab A – R-2R Digital to Analog Converter (DAC) Submission instructions: Use this document as your lab report template. Fill in the tables below as instructed, save as PDF, and submit each lab report on Gradescope by the deadline. Prelab 2 Supplies Needed 2 Lab Report Requirements 2 Introduction 3 Part One 4 Part Two 8 Part Three 14 1
EECS 215 Labs 1,2,3: R2R DAC 1. P RELAB It is not necessary to submit anything from the pre-lab. However, running through these exercises will save a great deal of time when executing all of your labs in the future. What’s in the box Confirm your kit # with the course instructor. Ensure that all parts in your box are accounted for. You will be responsible for your AD2 and all the missing or broken parts at the end of the semester, so make sure to check your box before beginning every lab for the following: 1. AD2 and I/O leads 2. Breadboard 3. Speaker Waveforms Installing Waveforms Waveforms is the name of the software that you use to run the AD2. The process for downloading Waveforms depends on your OS. OSX, Windows, and Linux Installing the software is easy. Follow the link, choose your operating system and click submit. https://mautic.digilentinc.com/waveforms-download Important: If on Mac, make sure dwf.framework gets copied to your frameworks folder. Dragging might not be sufficient, copy and paste if needed. ChromeOS Unfortunately, ChomeOS does not support downloadables, but there is a workaround. You will need to connect to CAEN remotely, and add Waveforms on your CAEN machine. You can then use AppsAnywhere to open Waveforms. Details can be found here: https://caen.engin.umich.edu/connect/ For a detailed breakdown of each feature of the AD2 and Waveforms, the manufacturer produced an easy-to-follow YouTube playlist. If you get stuck, they are a great resource: https://www.youtube.com/watch? v=HUAy0J3XqaU&list=PLSTiCUiN_BoLtf_bWtNzhb3VUP- KDvv91. Here, we will outline the more frequently used features which you will use throughout your labs. 1. Scope An oscilloscope measures voltage as a function of time. Scopes are extremely helpful instruments for observing transients and debugging analog circuits. Being able to effectively navigate the various options and settings will save time during the lab. 2
EECS 215 Labs 1,2,3: R2R DAC 3
Your preview ends here
Eager to read complete document? Join bartleby learn and gain access to the full version
  • Access to all documents
  • Unlimited textbook solutions
  • 24/7 expert homework help
EECS 215 Labs 1,2,3: R2R DAC Example scope capture 2. Wavegen The Waveform Generator allows you to output a signal which you can as an input to a circuit and thus use it to analyze your circuit’s behavior. For example, a low pass filter will respond differently to a high frequency periodic wave than a DC current, you might use the Waveform Generator to verify this. 4 Using the scope With the AD2 in demo mode (simply don’t connect your AD2 via USB) open a Scope window. Press Scan / Run. Change the mode to Shift then Screen. What are the differences? On the right side, navigate to the time menu. Change the Base to 10 ms /div. What happens? The screen is crowded so uncheck Channel 1 under the Options menu on the right side to focus in on the blue waveform. Let’s say you want to observe each waveform on top of each other, so you can see the details of each. On the right side of the window under Options change the Range of each to 1V/div. Drag the blue arrow on the left hand side of the screen up, and the yellow one down. Now suppose you would like to save an image of the oscilloscope graph or CSV data. Press Stop, and then Export. From here, you can download either CSV data or an image file of your scope. Congratulations, you have mastered 90% of the oscilloscope functionality! Generating a waveform Connect your AD2 to your computer, then connect the multicolored cable assembly to the AD2 by aligning the top indent. Do Not Force It! It will feel like the cable should be pushed in more, but the interconnects are short. Take a jumper cable and connect the Waveform Generator 1 (W1), which is yellow, output to the Scope Ch.1 Positive (1+), which is orange, input. Connect a Ground, which is black, to Scope Ch.1 Negative (1-), which is orange and white. Open Waveforms. In the top bar of the window click on the plus sign next to ”Welcome” and add a Scope and Wavegen pages to your workspace. By playing with the window options in the top right, you can get both on the same page. Press Run on the wavegen tab after configuring a wave of your choosing. Press Run on the oscilloscope. Play with the time base value and range values to get a clean-looking output. If what is on the scope is the same as the waveform you configured, Congratulations! It works!
EECS 215 Labs 1,2,3: R2R DAC Example waveform capture 3. Measurements Now let’s measure the period of this sinusoid. Since the frequency is 1 kHz, we expect a period of T =1 f = 1 ms. We will do this in the following two ways: 5 Measuring peak-to-peak voltage Continue with the wavegen connected to the oscilloscope. Configure a 1 kHz, 2 V amplitude sine wave using wavegen. Let’s suppose we first want to measure the peak-to- peak voltage of the sinusoid (which we expect to be 4 V). To begin, click the first Measurements menu on the scope menu bar (note that there are two of them, we are talking about the first (left) one). A panel should show up in the scope display that is titled “Measurements.” In this panel, click the Add button on the toolbar, and then select Defined Measurement . Under “Channel 1,” click the triangle by Vertical (i.e. a voltage), then select Peak2Peak , and click Add . Close the measurement window, and you should
EECS 215 Labs 1,2,3: R2R DAC 1. Using Measurements: In the same measurements panel, click Add, Defined Measurement , choose Channel1, and click Horizontal, i.e. a time measurement. Now select the Period item, click Add , and then click Close . You should now see the period of the sinusoid populated into the measurements table, and the measured period should also be very close to the expected period of 1 ms. We could have also measured the frequency by using the same steps as above but instead of choosing the Period measurement, choosing the Frequency measurement. 2. Using Cursors: A second way to measure the period of the sinusoid is by applying cursors at the beginning of one period and then at the beginning of the next period, and measuring the difference between the cursors. To do this, click the X Cursors menu, and then in the “X Cursors” panel, click the Normal button. This will start a new vertical cursor. Drag a the cursor to align with a peak (or upward zero crossing) of the sine wave. Now create a second X cursor by again clicking Normal. Drag this cursor until it lines up with the next peak (or upward zero crossing) following cursor 1. In the X Cursors table, you will find a column labeled “Ref.” By default, both cursors have no reference. Change the reference of cursor 2 to be 1 by clicking the drop-down menu which reads “none” and instead choosing 1. In the Δ X column, you should now see that the difference between the two cursors has populated in the table. This represents the period. Example cursor measurement 4. Power Supplies 6
Your preview ends here
Eager to read complete document? Join bartleby learn and gain access to the full version
  • Access to all documents
  • Unlimited textbook solutions
  • 24/7 expert homework help
EECS 215 Labs 1,2,3: R2R DAC Power is required for active components , which are different from passive components such as resistors and capacitors. Op-Amps are active components you will use frequently during lab. They are active because op-amps have the capability of amplify an input signal. Any active component requires external power, usually from a power supply. The AD2 has a built-in power supply (capable of providing ± 5 V) which can be configured through the Waveforms software. Breadboarding A typical breadboard relies on two simple operating principles. The outermost grid of holes (between the blue and red lines) are connected vertically, while the interior grid of holes are connected horizontally. Usually, the outer holes are used for power supplies or grounds, so that short wires can be used to power or ground components. 7 Setting the Power Supply To set the power supply of the AD2, first click the Supplies button on the main Waveforms display. A new panel should open up which contains various controls for configuring the power supply. To supply positive voltage, enter the desired voltage next to the “Positive Supply (V+)” button. Similarly, for negative voltages, type the desired negative voltage in the text box next to the “Negative Supply (V-)” button. Once you set the voltages to be the right values, click Master Enable is Off to turn it on. Note that, since the AD2 is USB powered, each channel has a maximum current rating of 700 mA. If the current flowing through either of the two channels exceeds this value, the power supply will generate a warning message and will automatically turn off.
EECS 215 Labs 1,2,3: R2R DAC Figure 10: Holes on orange lines are connected Measuring with the Keysight equipment You will be using the Keysight 34416A Digital Multimeter at your bench to measure values of resistance and capacitance. To measure a component: 1. Ensure that the Multimeter is set to measure from the front cables. 2. Plug in two cables with “banana” connectors to the HI (red) and LO (black) Input channels. 3. Connect “alligator” clips to the other end of your banana cables. 4. Complete the circuit by clamping either end of a resistor with each alligator clip. 5. Press the Ω2W button to measure resistance. 6. To access the options in blue, such as the capacitor measurement, use the blue shift button before selecting your measurement setting. The top red HI input is only capable of measuring voltage, so if you are planning to measure current it is necessary to switch the cable from the HI input channel to where it says “3A” on the bottom. 8 Bad Good Power rails Nodes
EECS 215 Labs 1,2,3: R2R DAC 5. S UPPLIES N EEDED 1. AD2 2. Digital Multimeter (DMM) 3. Breadboard 4. Computer with Waveforms installed 5. 5 20 resistors 6. 3 10 resistors 7. Jumper wires 6. L AB R EPORT R EQUIREMENTS Part 1 2 Tables Part 2 Breadboard photo 2 WaveForms Screenshots 3 Tables Part 3 1 Table 2 Equations 9
Your preview ends here
Eager to read complete document? Join bartleby learn and gain access to the full version
  • Access to all documents
  • Unlimited textbook solutions
  • 24/7 expert homework help
EECS 215 Labs 1,2,3: R2R DAC 7. I NTRODUCTION In this lab, you will be building a 4-bit R-2R ladder Digital to Analog Converter (DAC) by using your Analog Discovery 2 (AD2) kit and the WaveForms program. Before starting this lab, make sure to complete the pre-lab (Lab 0) to understand how your AD2 works. Through this lab you will calculate and measure the resistance of the R-2R ladder, apply concepts of superposition to the DAC, and analyze the circuit using Norton/Thevenin equivalent circuits. Figure 1: Schematics of the R-2R ladder circuit 10
EECS 215 Labs 1,2,3: R2R DAC 8. P ART O NE Goal: Learn how to build a simple resistor circuit and compare the expected values of resistance and voltage to the actual output values. The goal of part 1 is to help students develop their skills in understanding nodes and using parallel and series techniques to calculate resistance. Measure resistor values with your multimeter You will first need five 20kΩ resistors and three 10kΩ resistors. You will find these in the component cabinet in the lab (1016.) The color code key ( and calculator ) can help you identify them. Then measure each of your resistors and record these in your lab notebook, which will be used to calculate the resistances across the circuit. Be sure to keep track of the individual values of R0-R7 in the table on the next page, when you measure them and when building the circuit. To measure the resistance of the resistors: 1. Set up your multimeter by following the directions in the pre-lab. 2. Attach one probe to each end of the resistor, and the multimeter will read the experimental value for the resistor (note: this value will be slightly smaller than the theoretical value). 3. Record the experimental values with the theoretical values in the table below. Reference Nominal Value Measured Value % error Example 1kOhm 1.03kOhm 3% R0 R1 R2 R3 R4 R5 R6 R7 Calculate and measure equivalent resistance 11
EECS 215 Labs 1,2,3: R2R DAC After you have measured each resistor’s experimental values, build the circuit shown in Figure 2 where all resistors are attached to ground. Use the picture as a reference. Once you have built the circuit on your protoboard, measure the resistance between the Out terminal to ground , and each of the three internal nodes ( V0 , V1 , and V2 ) to ground . You may want to use an extra wire from each alligator clip to “probe” each node of your circuit. Question: When you measure across each resistor while it is now connected to the circuit, do you expect the value to be different than before? Why or why not? 1. Connect the black probe to your Ground, and the red probe at the node that you want to measure. 2. Using parallel and series combination techniques from lecture, calculate the expected values of resistance from each of the measured nodes to ground, and compare your measured results with the expected values calculated (calculate % error). Hint: how can you re-draw this circuit to look like the ones from homework and lecture? Figure 2: Schematic of the R-2R ladder circuit grounded Equivalent Resistance calculated from nominal R values Equivalent Resistance calculated from measured R values Measured Equivalent Resistance Percent Error (Measured Equivalent R to Nominal Equivalent R) Example 1kOhm 1.03kOhm 1.05kOhm 5% 12
Your preview ends here
Eager to read complete document? Join bartleby learn and gain access to the full version
  • Access to all documents
  • Unlimited textbook solutions
  • 24/7 expert homework help
EECS 215 Labs 1,2,3: R2R DAC V0 to GND V1 to GND V2 to GND Out to GND If any of your errors are >10%, there is likely a problem in your circuit or in your calculations and you should figure out what the source of the discrepancy is, correct it, and then retake your data. Note: on all labs, if your measured error is >10% you will likely need to troubleshoot your circuit to find the error. Submitting results with >10% error will not yield full credit. 13
EECS 215 Labs 1,2,3: R2R DAC 9. P ART T WO Goal: The goal of part 2 is to give students a brief introduction to digital circuits , and develop their understanding of node voltages . In this part, we will also begin to address the concept of superposition . Build and observe your DAC Here we are using the circuit we built in part 1 to use as a digital to analog converted (DAC). This means that your circuit will take a digital 4-bit binary input (4 ‘bits’ that can only represent a 0 or 1) and convert this to an analog voltage value. In binary, 4 I/O signal wires can be used to encode the numbers 0-15 shown in the table to the right. In this step, we will connect 4 I/O lines from our AD2 to the previous circuit and observe the output at different binary values. Using the same circuit you built in Part 1: 1. Disconnect R1, R3, R5, and R7 from ground. You are going to hook up your AD2 to the circuit using the digital I/O signal wires, ground, positive and negative leads for channel 1 of the oscilloscope. Connect your AD2 to the circuit using the schematic shown in Figure 3 (below). a. The color wires and AD2 label for the wires are shown on the schematic and where on the circuit they should be attached. b. The solid orange lead is the positive channel 1 scope, while the orange and white striped lead is the negative channel 1 scope. The black lead is connected to ground (there are multiples of these from the AD2, any will work). c. The multicolored leads (pink, green, purple, and brown) are the digital I/O (DIO) signals, which will be controlled by using the pattern generator in WaveForms. 2. Insert a picture of your breadboard, similar to Figure 3. 14
EECS 215 Labs 1,2,3: R2R DAC Picture of Your Breadboard [insert here] 3. Once the AD2 is connected to the circuit, you will next run a simple test to make sure it is attached correctly. Open the WaveForms application and connect your AD2 to the computer; you should be prompted to select your AD2 before moving on. 4. Once you are in the WaveForms program, open “Patterns” and add a new bus that contains DIO 0-3. 5. Select the “Type” dropdown menu, and select “Binary Counter”. Your pattern generator should look like Figure 4. 6. Click run on the pattern generator and return to the “Welcome +” tab at the top of WaveForms. 7. Open the “Scope” and then click run (your Patterns should be running at the same time). 8. Stop the scope, and take screenshots of both the Patterns and Scope from Waveforms, similar to Figures 4 and 5. Screenshot of Patterns in WaveForms [insert here] Screenshot of Scope in WaveForms [insert here] 15
Your preview ends here
Eager to read complete document? Join bartleby learn and gain access to the full version
  • Access to all documents
  • Unlimited textbook solutions
  • 24/7 expert homework help
EECS 215 Labs 1,2,3: R2R DAC Figure 3: Schematic and circuit board of the R-2R ladder circuit attached to the Analog Discovery 2 Figure 4: Patterns in WaveForms - Binary Counter 16
EECS 215 Labs 1,2,3: R2R DAC Figure 5: Scope in WaveForms - Binary Counter Question: This is the analog output from your digital binary counter. Do you know what digital input each analog step corresponds to? How might you predict that output using your knowledge of circuits? Node voltages When a bit is set to ‘0’, the output voltage will be 0V, but this is not necessarily true for a bit set to ‘1’. In order to calculate the expected analog outputs from our bus, we first need to measure the unique V DD that corresponds to a ‘1’ for our AD2. To measure this, we will first set bit 0 (b0) to have voltage V DD (a ‘1’ output) and bits 1-3 (b1-b3) to be connected to ground. Ground in this case is a ‘0’ output. 1. Set up a bus with DIOs 0-3 in the pattern generator. 2. Change the bus “Type” to “Number”; this will correlate the decimal values in Table 1 with the values for each bit. 3. The Most Significant Bit (MSB) is labeled in the WaveForms program as DIO 3, while the Least Significant Bit (LSB) is labeled as DIO 0. 4. By setting the “Parameter 1” number value to 1, you should measure V DD at b0 (DIO 0) and 0V and b1-3. Using the “Scope”, you can directly connect DIO 0 to Channel 1+ wire to measure the value of V DD . 17
EECS 215 Labs 1,2,3: R2R DAC Value V DD (at DIO 0) Hint: V DD is not the voltage value at any of the nodes V0-V3. 5. For each of the parts below, you will change the “Parameter 1” number value to step through setting only one digital input to VDD at a time, with all the other inputs set to 0V. Using the CH1+ wire, measure voltage at all nodes for each of the number settings. a. Set bit 0 to V DD and all other bits to ground (Number = 1) and record the voltages at all nodes. b. Set bit 1 to V DD and all other bits to ground (Number = 2) and record the voltages at all nodes. c. Set bit 2 to V DD and all other bits to ground (Number = 4) and record the voltages at all nodes. d. Set bit 3 to V DD and all other bits to ground (Number = 8) and record the voltages at all nodes. Question: Do you expect the node voltages to be equal to V DD ? Why might they not be? Number Value V0 (Volts) V1 (Volts) V2 (Volts) V3/Out (Volts) Example 1.65 V 1.68 V 0.92 V 0.61 V 1 (0001) 2 (0010) 4 (0100) 8 (1000) Measured Vout vs. Inputs 6. For each of the settings used in step 5) above, now calculate the expected values for each of the node voltages using series-parallel resistor combinations and nodal analysis, and using nominal resistor values and the measured value for VDD from step 4). 18
Your preview ends here
Eager to read complete document? Join bartleby learn and gain access to the full version
  • Access to all documents
  • Unlimited textbook solutions
  • 24/7 expert homework help
EECS 215 Labs 1,2,3: R2R DAC Number Value V0 (Volts) V1 (Volts) V2 (Volts) V3/Out (Volts) Example 1.65 V 1.68 V 0.92 V 0.61 V 1 (0001) 2 (0010) 4 (0100) 8 (1000) Theoretical Vout vs. Inputs 7. Comparing the measured and calculated values, if any of them are off by >10%, figure out what the source of the discrepancy is, correct it, and then retake your data. 19
EECS 215 Labs 1,2,3: R2R DAC 10.P ART T HREE Goal: Apply knowledge of superposition from lecture to predict the outputs from your 4-bit DAC. Apply knowledge of superposition For this lab you will use the same setup as in part two. 1. Open the WaveForms Program, and set up the pattern generator and scope as we did in the previous parts. a. Bus: DIO 0-3, Type: Number 2. For each number in the table below, set the number value in Patterns and measure the voltage at Out using the scope. Record your number values in the table below. 3. In step 5) of part 2, you measured the output voltage when only one digital input was VDD, while all others were 0V. This is similar to what we do when solving a circuit with multiple sources by using superposition. You can now use superposition and these measured values from step 5) in part 2 to calculate the expected output voltage for each number in the table below. Enter your calculated values in the table. 4. Compute the percent error between measured values, and calculated values using superposition and enter this in the table below. Number Value 4 bit Binary # Measured Out . (Volts) Calculated Out . (Volts) Percent error (%) Example Example 0.610 V 0.600 V 1.667 % 8 1000 12 1100 14 1110 15 1111 10 1010 5 0101 As the final step of this lab, you should use the concepts and theory from the lecture to derive a Thevenin equivalent circuit for the 4-bit DAC. 20
EECS 215 Labs 1,2,3: R2R DAC 1. Derive an expression for the Thevenin Equivalent voltage source of the 4-bit DAC. The source will be a function of each binary input signal b0 to b3, where the bx can take the value of either 0 or 1. (Find A-D here: V Thev = A b 0 + Bb 1 + Cb 2 + D b 3 ) 2. Determine the Thevenin Equivalent resistance of the 4-bit DAC at node out. R Thev = V Thev = Hint: How did you calculate the values in step 4 for the table? How would you write this into an equation so the output voltage is dependent on your bit inputs (b 0 – b 1 )? Remember that these bit values can only be 0 or 1. 21
Your preview ends here
Eager to read complete document? Join bartleby learn and gain access to the full version
  • Access to all documents
  • Unlimited textbook solutions
  • 24/7 expert homework help