Purpose - University of Utah

Download Report

Transcript Purpose - University of Utah

Physics 2225 Minilab 5: Analog Circuits / Digital Circuits
Purpose of This Minilab
• Gain some basic experience in reading and building
electronic circuits.
• Learn how digital circuits and digital logic work.
• Learn some basic digital to analog interfacing.
Physics 2225 Minilab 5: Analog Circuits / Digital Circuits
Analog Circuits – The Voltage Divider
Suppose you have a fixed voltage power supply (Vin).
To generate a voltage Vout (between 0 and Vin): Build a “voltage divider”
using two resistors (R1 and R2).
Vin
R1
Vout
R2
Ground (0V)
Physics 2225 Minilab 5: Analog Circuits / Digital Circuits
The Voltage Divider – How it Works
The total resistance of the circuit is:
Rtotal = R1+R2
 The current from Vin to ground is:
I
Vin
I
Vin  0
R1  R2
Ohm’s law for R2: Vout  0V  R2 I
R1
(1)
(2)
(3)
Combining (2) and (3):
Vout
R2
Ground (0V)
Vout  Vin
R2
R1  R2
Physics 2225 Minilab 5: Analog Circuits / Digital Circuits
The Voltage Divider – How to Choose R1 and R2
Vout  Vin
R2
R1  R2
Example task:
Vin = 5V ………..create Vout = 2V
R2
2

R1  R2 5
Vin
I
R1
Vout
R2
Ground (0V)
Many Possible Solutions:
R1 = 3 W R2 = 2 W
R1 = 30 W R2 = 20 W
R1 = 300 W R2 = 200 W
R1 = 3000 W R2 = 2000 W
etc.
Physics 2225 Minilab 5: Analog Circuits / Digital Circuits
The Voltage Divider – Which Solution to
Choose?
Many Possible Solutions:
R1 = 3 W
R2 = 2 W
R1 = 30 W
R2 = 20 W
R1 = 300 W R2 = 200 W
………………………….
R1 = 300 K W R2 = 200 K W
etc.
Current I is very large
(maybe too large for the
power supply to handle)
Current I is very small
(Problem when attaching
circuits with smaller resistances
to Vout).
Physics 2225 Minilab 5: Analog Circuits / Digital Circuits
Attaching a Simple Circuit to Voltage Divider
Choose R1 and R2 such that:
R1<<R3
R2<<R3
Otherwise Vout drops much lower
and is no longer what you
designed it to be.
Vin
R1
Vout
R2
R3
attached circuit
For Activity 1 you should
choose R1 and R2 to be less
than 10kW but not too low.
Recommended range: a few
few hundred W.
Physics 2225 Minilab 5: Analog Circuits / Digital Circuits
Voltage Divider on the Bread Board
To 5V
(Vin)
To Ground
(0V)
R1
Vout
R2
Physics 2225 Minilab 5: Analog Circuits / Digital Circuits
Measuring Vout of Voltage Divider
Black clip
should be
on ground.
For correct polarity
make sure GND
indicator goes into
“COM” input on
DMM.
Physics 2225 Minilab 5: Analog Circuits / Digital Circuits
Inverting Amplifier Circuit – How it Works
R4
I
I
V-
Vin
Negative
feedback loop
Vout
R3
+
V+
Virtual equality:  Voltage at “-” input = Voltage at “+” input
(V- = 0Volt because V+ = 0Volt)
Current flows around op-amp (and basically none into it, because op-amp has
very high input resistance)
 Current through R3 = Current through R4
Physics 2225 Minilab 5: Analog Circuits / Digital Circuits
Inverting Amplifier Circuit – How it Works
R4
I
I
V-
Vin
Vout
R3
+
V+
V  V V  0 Vin

Applying Ohm’s Law on R3 : I  in   in
R3
R3
R3
Applying Ohm’s Law on R4: I 
V  Vout 0  Vout  Vout


R4
R4
R4
Vin  Vout

R3
R4
Vout
R
 4
Vin
R3
Physics 2225 Minilab 5: Analog Circuits / Digital Circuits
Inverting Amplifier Circuit – How it Works
R4
I
I
V-
Vin
Vout
R3
+
V+
Vout
R
  4  " Gain of the am plifier"
Vin
R3
Example: R4 = 10 kW R3 = 5 kW
 Gain = - 2
This means: If Vin = 2V then Vout = – 4V
Notice how EASY it is to design an amplifier with a specific gain
simply by choosing the proper ratio of R4 and R3 !!!
Physics 2225 Minilab 5: Analog Circuits / Digital Circuits
Inverting Amplifier Circuit – Amplifying a Signal
(just to show you more applications…)
R4
Vin
I
I
V-
Vout
Vout
R3
+
V+
Sinusoidal input signal
Sinusoidal output signal:
• Is inverted
• Has different amplitude
Physics 2225 Minilab 5: Analog Circuits / Digital Circuits
The Inverting Amplifier Circuit YOU Will Build
5V
R1
R4
Vin
Note: +12V and
-12V connections
for amplifier not
shown in diagram.
-
R2
R3
Vout
+
Gain of amplifier circuit:
Vout
R4
G

Vin
R3
Voltage divider
from Activity 1
Note: Vin is now the input voltage of the amplifier
circuit (don’t confuse this with prior Vin from voltage
divider).
Physics 2225 Minilab 5: Analog Circuits / Digital Circuits
Amplifier is an Integrated Circuit (IC): LF351
1
+
2
3
-12V 4
Notice the
semicircular
cutout (helps
to identify pin
number)
pin 1
8
+
7
6
+12V
8 pins (connections)
4 on each side
Out
5
pin chart for LF351 (view from top)
(pins 1, 5, 8 are not used)
All pin diagrams are
shown in the lab manual.
Physics 2225 Minilab 5: Analog Circuits / Digital Circuits
Connecting LF351 to Create Amplifier Circuit
R4
+12V
5V
R1
R3
1
8
2
7
3
6
4
5
R2
-12V
Vout
Physics 2225 Minilab 5: Analog Circuits / Digital Circuits
Using the Breadboard for IC connection
5 holes in a
“column” are
electrically
connected.
But:
Red and Green
are NOT connected
across the center break.
The center break
Physics 2225 Minilab 5: Analog Circuits / Digital Circuits
Inserting IC into Bread Board
Insert IC into bread board across the
center divide: 4 pins on each side.
Push IC all the way down.
indentation
pin 1
Example: Use any of these 4
holes to connect to pin 4
pin 4
Physics 2225 Minilab 5: Analog Circuits / Digital Circuits
5
6
Out
4
-12V
3
+
+
7
2
-
1
-
8
+12V
Connecting +12V and –12V Power to the IC
Physics 2225 Minilab 5: Analog Circuits / Digital Circuits
Complete Amplifier Circuit
Voltage divider
R4
R3
Clips attached as
shown measure
Vin of amplifier
circuit.
Physics 2225 Minilab 5: Analog Circuits / Digital Circuits
Measuring Vout of Amplifier Circuit
The output voltage
of the amplifier
circuit is measured
where R4 attaches
to pin 6 of the
LF351 IC.
Physics 2225 Minilab 5: Analog Circuits / Digital Circuits
Taking out an IC
Grab the IC with the
yellow IC removal tool.
Pull evenly and straight
upwards.
The IC removal tool helps to
avoid bent or broken pins.
Physics 2225 Minilab 5: Analog Circuits / Digital Circuits
Binary Numbers
In digital electronics information is coded as binary numbers which
contain only Ones and Zeroes.
Example: 1001 (binary) = 1x23+0x22+0x21+1x20 = 9 (decimal)
Any decimal number can be converted to a binary number and stored
electronically (e.g., in a computer).
1’s and 0’s are often stored as High (5Volt) and Low (0 Volt) voltages.
For example, the number shown above (1001) could be represented
by 4 “data lines” that have either high or low voltages.
1
0
5V 0V
0
1
0V 5V
Physics 2225 Minilab 5: Analog Circuits / Digital Circuits
Digital Circuits – The Basic Idea
Input #1
Digital Circuit
Output
Input #2
Digital circuits have one or more “inputs” and one or more “outputs”.
• Inputs are wires or pins to which a given voltage is applied.
• Outputs are wires or pins that provide a certain voltage. The value of the
output voltage depends on the value of the voltages applied to the inputs.
Never apply a voltage to an output! The output already generates its
own voltage. You can “read” that voltage (e.g., with a DMM).
Physics 2225 Minilab 5: Analog Circuits / Digital Circuits
Digital Circuits – The Basic Idea
Input #1
Digital Circuit
Output
Input #2
Why are they called “digital”? Because we apply only two specific
voltages to the inputs and we can only receive one of these two voltages on
the output, nothing else.
These two voltages are called “High” and “Low” voltage. They are also
called “1” and “0”  They can represent a binary number (“digit”).
Digital circuits are some of the basic building blocks in computers.
Physics 2225 Minilab 5: Analog Circuits / Digital Circuits
Digital Circuits – TTL
Input #1
Digital Circuit
Output
Input #2
“TTL” (Transistor-Transistor Logic) circuits are digital
circuits
that use the following “High” and “Low” voltages:
High = 5 Volts = “1”
Low = 0 Volts = “0”
Physics 2225 Minilab 5: Analog Circuits / Digital Circuits
Digital Circuits – Example: The Inverter
Input
Inverter
Output
Inverter has only one input and one output.
How the inverter behaves:
If you apply a “high” voltage to the input  You get “low” voltage at the output.
If you apply a “low” voltage to the input  You get “high” voltage at the output.
…in other words …
5V on input  0V on output
0V on input  5V on output
“1” on input  ”0” on output
…in other words … “0” on input  “1” on output
Physics 2225 Minilab 5: Analog Circuits / Digital Circuits
Digital Circuits – The Inverter
The official symbol
This ring symbolizes
“inverting”.
Truth Table for Inverter
Input
0
1
Output
1
0
Physics 2225 Minilab 5: Analog Circuits / Digital Circuits
The “AND” Gate – Another Digital Circuit
A
Q
B
Truth Table for AND Gate
Input A Input B Output Q = A•B
0
1
0
1
0
0
1
1
0
0
0
1
Physics 2225 Minilab 5: Analog Circuits / Digital Circuits
The “NAND” Gate – Another Digital Circuit
Indicates
“invert”
A
Q
B
Truth Table for NAND Gate
Input A Input B Output Q = A•B
0
1
0
1
0
0
0
1
1
1
1
0
Just like “AND”
gate but additionally
inverted”.
Physics 2225 Minilab 5: Analog Circuits / Digital Circuits
What Good are Digital Circuits?
Digital circuits are basically automated decision makers.
Very simple example:
A burglar alarm that rings a bell when a door is open but only
when the alarm is actually activated. You can use an “AND” gate.
Circuit that produces
5V signal if door is open
and 0V when closed.
Circuit that produces 5V
when alarm is “ON”, 0V
when it is “OFF”.
Circuit that rings a bell
when 5V is applied.
By combining digital circuits you
can build very complicated
decision making machines.
Physics 2225 Minilab 5: Analog Circuits / Digital Circuits
4081 : The AND Gate IC (contains 4 gates)
5 Volt
View from the top
Input A
Input B
A and B could, for example,
be connected to SW1 and 2
on the bread board.
Output Q
Output Q could, for example,
be connected to the logic indicator
(green LED) on the bread board.
Physics 2225 Minilab 5: Analog Circuits / Digital Circuits
Digital to Analog Converter (DAC)
The music on an I-pod or on a CD is stored digitally as lots of binary
numbers. To actually create sound when playing the music these
binary numbers (digital) must be converted into “analog” voltages (the
garden-variety that is not limited to specific “High” and “Low” voltages).
Once those analog voltages are generated from the digital data they
can then be applied to a loudspeaker.
Speaker
CD
(digital
data)
DAC
Physics 2225 Minilab 5: Analog Circuits / Digital Circuits
Building a Basic DAC With an Op-Amp
I1
SW1
R
5.6kW
I2
SW4
I
I
SW2
SW3
4
V0 Volt
10kW
I3
+
22kW
I4
V+
47kW
We know this voltage
(virtual equality)
I  I1  I 2  I 3  I 4
Vout
Vout  R4 I
More current
means higher
Vout.
Physics 2225 Minilab 5: Analog Circuits / Digital Circuits
I1
SW1
R
5.6kW
I2
SW4
I
I
SW2
SW3
4
10kW
I3
V0 Volt
-
Vout
+
22kW
I4
V+
47kW
I  I1  I 2  I 3  I 4
If SW1 is “0”  I1=0
If SW1 is “1” (5V)  I1=5V/5.6kW
Similar for I2, I3, I4
Physics 2225 Minilab 5: Analog Circuits / Digital Circuits
I1
SW1
R
5.6kW
I2
SW4
I
I
SW2
SW3
4
10kW
I3
V0 Volt
22kW
I4
+
Vout
V+
47kW
With SW1….SW4 you can switch on and off I1…..I4.
I will become more or less.
Vout will become more or less.
Physics 2225 Minilab 5: Analog Circuits / Digital Circuits
I1
SW1
R
5.6kW
I2
SW4
I
I
SW2
SW3
4
10kW
I3
22kW
I4
V0 Volt
+
Vout
V+
47kW
Because the 4 resistances are different, the 4 currents (when switched on) will be
different.
When SW1 is switched on more current is added than when SW2 or SW3 or
SW4 is switched on.
SW1 has a greater influence on Vout than SW2 (contributes more to I).
SW2 has a greater influence on Vout than SW3.
Etc..
Physics 2225 Minilab 5: Analog Circuits / Digital Circuits
I1
SW1
R
5.6kW
I2
SW4
I
I
SW2
SW3
4
10kW
I3
22kW
I4
V0 Volt
+
Vout
V+
47kW
The 4 resistances are weighted differently by factors of about 2, 4, and 8
just like digits in binary numbers.
If the 4 inputs represent a 4 digit binary number, the output voltage is
proportional to the value represented by that binary number.
Build the circuit and try it out!
Physics 2225 Minilab 5: Analog Circuits / Digital Circuits
Remember: These power point presentations
are available on our website, so you can download
them on the computer at your lab table.