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.
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)
The Voltage Divider – How it Works The total resistance of the circuit is: Rtotal = R1+R2 (1) The current from Vin to ground is: Vin Vout Ground (0V) R1 R2 Ohm’s law for R2: I Combining (2) and (3):
The Voltage Divider – How to Choose R1 and R2 Example task: Vin = 5V ………..create Vout = 2V Vin Vout Ground (0V) R1 R2 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. I
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).
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 R3 R2 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. attached circuit
Voltage Divider on the Bread Board To 5V (Vin) To Ground (0V) R2 R1 Vout
Measuring Vout of Voltage Divider Black clip should be on ground. For correct polarity make sure GND indicator goes into “COM” input on DMM.
Inverting Amplifier Circuit – How it Works Negative feedback loop + - R3 Vout Vin V+ V- I 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
Inverting Amplifier Circuit – How it Works Vin - Vout R3 + V+ Applying Ohm’s Law on R3 : Applying Ohm’s Law on R4:
Inverting Amplifier Circuit – How it Works Vin - Vout R3 + V+ 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 !!!
Inverting Amplifier Circuit – Amplifying a Signal (just to show you more applications…) Vin Vout I I V- - Vout R3 + V+ Sinusoidal output signal: Is inverted Has different amplitude Sinusoidal input signal
The Inverting Amplifier Circuit YOU Will Build Note: +12V and -12V connections for amplifier not shown in diagram. Vin - Vout R3 + Gain of amplifier circuit: 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).
Amplifier is an Integrated Circuit (IC): LF351 Notice the semicircular cutout (helps to identify pin number) 1 2 3 4 8 7 6 5 - + +12V Out pin 1 8 pins (connections) 4 on each side All pin diagrams are shown in the lab manual. -12V pin chart for LF351 (view from top) (pins 1, 5, 8 are not used)
Connecting LF351 to Create Amplifier Circuit +12V R1 R2 5V 1 8 R3 2 7 Vout 3 6 4 5 -12V
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
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
Connecting +12V and –12V Power to the IC Out 8 7 6 5 - + 1 2 3 4 - + -12V
Complete Amplifier Circuit Voltage divider R4 Clips attached as shown measure Vin of amplifier circuit. R3
Measuring Vout of Amplifier Circuit The output voltage of the amplifier circuit is measured where R4 attaches to pin 6 of the LF351 IC.
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.
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 0 1 5V 0V 0V 5V
Digital Circuits – The Basic Idea Input #1 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).
Digital Circuits – The Basic Idea Input #1 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.
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”
Digital Circuits – Example: The Inverter Input 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. 5V on input 0V on output 0V on input 5V on output …in other words … “1” on input ”0” on output “0” on input “1” on output …in other words …
Digital Circuits – The Inverter The official symbol This ring symbolizes “inverting”. Truth Table for Inverter Input Output 0 1 1 0
The “AND” Gate – Another Digital Circuit Q B Truth Table for AND Gate Input A Input B Output Q = A•B 0 0 0 0 0 0 1 0 1 1 1
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 0 1 0 1 1 1 0 Just like “AND” gate but additionally inverted”.
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 rings a bell when 5V is applied. Circuit that produces 5V when alarm is “ON”, 0V when it is “OFF”. By combining digital circuits you can build very complicated decision making machines.
4081 : The AND Gate IC (contains 4 gates) 5 Volt View from the top Input A Input B Output Q A and B could, for example, be connected to SW1 and 2 on the bread board. Output Q could, for example, be connected to the logic indicator (green LED) on the bread board.
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
Building a Basic DAC With an Op-Amp + - R4 Vout V+ V- I 5.6kW 10kW 22kW 47kW SW1 SW2 SW3 SW4 Switches (5V or 0V) 0 Volt We know this voltage (virtual equality) I2 I3 I4 More current means higher Vout.
+ - R4 Vout I 5.6kW 10kW 22kW 47kW SW1 SW2 SW3 SW4 I2 I3 I4 I1 0 Volt I2 I3 I4 I1 If SW1 is “0” I1=0 If SW1 is “1” (5V) I1=5V/5.6kW Similar for I2, I3, I4
With SW1….SW4 you can switch on and off I1…..I4. + - R4 Vout V+ V- I 5.6kW 10kW 22kW 47kW SW1 SW2 SW3 SW4 0 Volt I2 I3 I4 I1 With SW1….SW4 you can switch on and off I1…..I4. I will become more or less. Vout will become more or less.
+ - R4 Vout I 5.6kW 10kW 22kW 47kW SW1 SW2 SW3 SW4 I2 I3 I4 I1 V- 0 Volt I2 I3 I4 I1 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..
+ - R4 Vout I 5.6kW 10kW 22kW 47kW SW1 SW2 SW3 SW4 I2 I3 I4 I1 0 Volt I2 I3 I4 I1 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!
Remember: These power point presentations are available on our website, so you can download them on the computer at your lab table.