Download ECE1250F14_Lab7_LevelShift

Survey
yes no Was this document useful for you?
   Thank you for your participation!

* Your assessment is very important for improving the workof artificial intelligence, which forms the content of this project

Document related concepts

Electrical engineering wikipedia , lookup

Index of electronics articles wikipedia , lookup

Josephson voltage standard wikipedia , lookup

Multimeter wikipedia , lookup

Amplifier wikipedia , lookup

Analog-to-digital converter wikipedia , lookup

Integrated circuit wikipedia , lookup

Regenerative circuit wikipedia , lookup

Electronic engineering wikipedia , lookup

Wien bridge oscillator wikipedia , lookup

Surge protector wikipedia , lookup

Resistive opto-isolator wikipedia , lookup

Voltage regulator wikipedia , lookup

Wilson current mirror wikipedia , lookup

CMOS wikipedia , lookup

Valve RF amplifier wikipedia , lookup

Valve audio amplifier technical specification wikipedia , lookup

Radio transmitter design wikipedia , lookup

Power electronics wikipedia , lookup

Two-port network wikipedia , lookup

Integrating ADC wikipedia , lookup

Transistor–transistor logic wikipedia , lookup

Current mirror wikipedia , lookup

Schmitt trigger wikipedia , lookup

Network analysis (electrical circuits) wikipedia , lookup

Switched-mode power supply wikipedia , lookup

Operational amplifier wikipedia , lookup

Rectiverter wikipedia , lookup

Opto-isolator wikipedia , lookup

Transcript
ECE 3300 Lab 2
ECE 1250 Lab 7
Measuring: Voltage
Building: Op-Amp Circuits
Designing: Level Shifter
Overview: In Lab 7 you will:
 Build several level-shifter circuits that shift voltages coming out of a comparator
to voltages appropriate for the inputs of logic gates.
 Calculate the output voltages of various level-shifter circuits.
 Measure the output voltages of various level-shifter circuits.
 Design a level shifter circuit.
 Plot the output voltage of a level shifter circuit.
This lab deals with the problem of changing voltages from a comparator (or other op-amp
circuit) to levels appropriate to drive digital logic gates. Circuits that map voltages from
one range to another are called level-shifters. It is common for different parts of a circuit
to have different power supply levels, and some voltage translations are so common that
special level-shifter IC's are designed for them. In this lab, we will see how to design
several kinds of level-shifters.
Equipment List:
 MyDAQ board with cables. (You can hook them to the lab computers if you don’t
want to bring your laptop.)
 Multisim software.
 From earlier Labs:
o Protoboard & wire kit
 Additional parts:
o Resistors: 100 kΩ (six)
o IC: LM324 quad op-amp
o Potentiometer: 20 kΩ
Safety Precautions:
 myDAQ power supplies: The analog and digital power supplies in the myDAQ have
separate reference (or "ground" [which is a misnomer, since they are not actually
connected to earth ground]) connections. The two references must be connected to
each other for circuits to work properly.
Instructions & Reference Material:
 MyDAQ as voltmeter
https://utah.instructure.com/courses/266578/assignments/1347122
Prelab: Videos and Multisim
1. Review the material on level shifters in the instructions for the circuit system design
cards on the class website.
1
UNIVERSITY OF UTAH DEPARTMENT OF ELECTRICAL AND COMPUTER ENGINEERING
50 S. Central Campus Dr | Salt Lake City, UT 84112-9206 | Phone: (801) 581-6941 | Fax: (801) 581-5281 | www.ece.utah.edu
ECE 1250 LAB 7
2. (Optional) You will be faster if you do the Multisim simulations before you come to
lab. If you do not have Multisim running on your PC yet, then just do the Multisim
simulations on the lab computers.
WRITE-UP: Make sure to label each section in your notebook with the same
headings as highlighted below in yellow as you write the information mentioned
for each write-up section.
Experiment 1: Comparator circuit (30 points)
Connect the comparator circuit shown in Fig. 1. This comparator circuit will be used as
the input to each of level-shifters covered in this lab. Note: the minus power supply for
the op-amp in Fig. 1 is connected to reference rather than –15 V.
Using the voltmeter in your myDAQ, measure output voltage, vo, versus the input
voltage, vp, at the + input of the op-amp. Use enough measurements to show the
behavior of the comparator. In your notebook, record the voltages. Using MATLAB,
plot vo versus vp. Be sure to label your plot's axes, and give the plot an appropriate title.
Fig. 1. Comparator circuit.
Using the datasheet at http://www.onsemi.com/pub_link/Collateral/LM324-D.PDF,
determine the expected high and low voltages out of the op-amp. (Search through the
datasheet for the appropriate parameter. Hint: it is in the "Electrical Characteristics" table
in the datasheet, and you might have to extrapolate your answer from the available data.)
In your lab notebook, comment on the value in the datasheet compared with what you
measured.
WRITEUP: Explain your procedure. List your measurements for vp and vo, and
show your MATLAB plot. Make a table listing the measured high and low
comparator output voltages and the high and low values listed on the LM324
datasheet.
2
UNIVERSITY OF UTAH DEPARTMENT OF ELECTRICAL AND COMPUTER ENGINEERING
50 S. Central Campus Dr | Salt Lake City, UT 84112-9206 | Phone: (801) 581-6941 | Fax: (801) 581-5281 | www.ece.utah.edu
ECE 1250 LAB 7
Experiment 2: Voltage-divider level-shifter circuit (20 points)
In this part of the lab, you will build a very simple level-shifter, which is just a voltagedivider. The circuit is shown in Fig. 2.
Fig. 2. Comparator and V-divider level shifter.
Given the voltages measured in Experiment 1, find resistor values, R1 and R2, that cause
v1 to be as close to 0 V and 4.5 V as possible (to drive 74HCxx logic-gate inputs) when
the comparator output is low and high. Note that only the ratio of R1 to R2 matters,
although using values in the neighborhood of 100 kΩ is recommended in order to limit
currents (for which resistance greater than 1 kΩ is desired) and noise (for which
resistance less than 1 MΩ is desired) to reasonably small values.
Based on your design, purchase resistors and complete the circuit shown in Fig. 2.
Measure the actual high and low output voltages for the circuit.
WRITEUP: Explain your procedure. Make a table listing your predicted values
and your measurements for vo and v1 for high and low output voltages. Explain
why the measured and predicted values might be slightly different. If the logic
gates to be driven by the level-shifter can accommodate voltages up to 5 V but
not higher, what value of high voltage output should we design for (considering
that resistors are only accurate to ±5%)? Why is it safe to design for 0 V on the
low end if the logic gates might be damaged by a voltage below 0 V?
Experiment 3: General purpose level-shifter circuit (50 points)
Fig. 3 shows a general purpose level-shifter circuit that can map any two voltages out of
the comparator at vo to any two desired voltages (between VCC and –VCC) at v2. Note
that the minus power supply for the op-amp in Fig. 1 is now connected to–15 V rather
3
UNIVERSITY OF UTAH DEPARTMENT OF ELECTRICAL AND COMPUTER ENGINEERING
50 S. Central Campus Dr | Salt Lake City, UT 84112-9206 | Phone: (801) 581-6941 | Fax: (801) 581-5281 | www.ece.utah.edu
ECE 1250 LAB 7
than reference. Also, Rs may be connected to +15 V or –15 V, depending on the output
voltages desired at v2.
Fig. 3 General purpose level-shifter.
Fig. 4 shows a possible mapping of comparator output values to level-shifter output
values appropriate for driving 74HCxx series logic gates. vo1 = –15 V gets mapped to
v21 = 0.5 V, and vo2 = 12 V gets mapped to v22 = 4.5 V. Fig. 4 also shows the difference
of the input voltages as vo, the difference of the output voltages as v2, the average of
the input voltages as vo , and the average of the output voltages as v2 . These quantities
are convenient for algebraic manipulations, and they are easy to compute with a
calculator. In the present case, we have the following results:
Dvo º vo2 - vo1 = 12 - -15 V = 27 V
v +v
12 + -15 V
vo = o2 o1 =
= -1.5 V
2
2
Dv2 º v22 - v21 = 4.5 - 0.5 V = 4 V
v +v
4.5 + 0.5 V
v2 = 22 21 =
= 2.5 V
2
2
4
UNIVERSITY OF UTAH DEPARTMENT OF ELECTRICAL AND COMPUTER ENGINEERING
50 S. Central Campus Dr | Salt Lake City, UT 84112-9206 | Phone: (801) 581-6941 | Fax: (801) 581-5281 | www.ece.utah.edu
ECE 1250 LAB 7
Fig. 4 Mapping of comparator output voltages to level-shifter output voltages.
Fig. 5 shows our mapping of comparator output values to level-shifter output values in a
different way, and this figure shows that, if we were to map the transfer function of the
level-shifter (i.e., output voltage versus input voltage) for all input voltages, we would get
a straight line whose slope would be Dv2 / Dvo . This slope is the overall gain, G, of the
level-shifter circuit. This gain is a function of (ratios of) resistor values. If we define
some intermediate gain terms as ratios of resistors, we can express G succinctly. The
intermediate gain terms are as follows:
R
G1 º b
Ra
and
Rf
.
G2 º
Rs
The expression for G becomes the following:
G1
G=
×(1+ G2 ) .
1+ G1
5
UNIVERSITY OF UTAH DEPARTMENT OF ELECTRICAL AND COMPUTER ENGINEERING
50 S. Central Campus Dr | Salt Lake City, UT 84112-9206 | Phone: (801) 581-6941 | Fax: (801) 581-5281 | www.ece.utah.edu
ECE 1250 LAB 7
Fig. 5 Mapping of comparator output voltages to level-shifter output voltages.
The level-shifter must also have an offset that shifts the graph in Fig. 5 up or down
appropriately. The offset term is ±VCCG2, which is the response to the voltage at the
bottom of Rs when vo = 0 V. Adding this offset to a gain term gives the expression for
the level-shifter output:
G
v2 = vo 1 ×(1+ G2 ) - (±VCC )G2
1+ G1
Calculating resistor values for the general purpose level-shifter involves quite a bit of
algebra, which is shown below. Look through the equations below, and determine where
you should substitute the actual measured output values of vo1 and vo2 for your
comparator in order to get level-shifter outputs of 0.5 V and 4.5 V. (Note that vo1 [or
vOL] and vo2 [or vOH] will have changed now that the minus supply for the op-amp
is -15 V, and you will need to measure them again.)
The key design equations are the following:
Dv2
G1 =
Dvo (1+ G2 ) - Dv2
and
Dv v - v Dv
G2 = 2 o 2 o
±VCC Dvo
6
UNIVERSITY OF UTAH DEPARTMENT OF ELECTRICAL AND COMPUTER ENGINEERING
50 S. Central Campus Dr | Salt Lake City, UT 84112-9206 | Phone: (801) 581-6941 | Fax: (801) 581-5281 | www.ece.utah.edu
ECE 1250 LAB 7
Once we compute G1 and G2, we know the ratios of resistor Rb to Ra and Rf to Rs, and we
can design the level-shifter. Here are the calculations for the present case:
Dv2
4
G1 =
=
= 0.143
Dvo (1+ G2 ) - Dv2 27(1+ 0.18) - 4
Convenient standard values we can use that give us approximately G1 are Rb = 16 kΩ and
Ra = 110 kΩ.
Dv v - v Dv
4(-1.5) - 2.5(27)
G2 = 2 o 2 o =
» ∓0.18 Þ 0.18
±VCC Dvo
±15(27)
Since G2 is a ratio of resistors, it must be positive. This implies that we need to use -VCC
as the voltage below Rs in the circuit. Convenient standard resistor values we can use
that give us approximately G2 are Rf = 18 kΩ and Rs = 100 kΩ.
Check the values:
G
0.143
vo1 1 ×(1+ G2 ) - (-VCC )G2 = -15 ×
(1.18) - -15(0.18) = 0.486 V
1+ G1
1.143
G
0.143
vo2 1 ×(1+ G2 ) - (-VCC )G2 = 12 ×
(1.18) - -15(0.18) = 4.47 V
1+ G1
1.143
As hoped, we get the desired values, (within round-off error).
Now plug your vo1 and vo2 into the above equations, find suitable resistor values for Rb,
Ra, Rf, and Rs, and build the level-shifter circuit. Measure the circuit's input and output
voltages.
WRITEUP: Explain your procedure. Make a schematic diagram of your levelshifter showing all resistor values used. Make a table listing your desired values
and your measurements for vo and v2 for high and low voltages out of the
comparator.
7
UNIVERSITY OF UTAH DEPARTMENT OF ELECTRICAL AND COMPUTER ENGINEERING
50 S. Central Campus Dr | Salt Lake City, UT 84112-9206 | Phone: (801) 581-6941 | Fax: (801) 581-5281 | www.ece.utah.edu