Professional Documents
Culture Documents
Circuit Opam
Circuit Opam
Circuit Opam
Laser
Diode
Photodetector
Current-to-Voltage
Converter
Signal
Ampifier
Signal
Comparator
Latch
LED &
Buzzer
Figure 4.1.
In this first lab, you will construct the laser diode, the photo detector, the current to voltage
converter and the signal amplifier. In the next lab, you will build the last three stages.
+12V
+12V
Req
22k
200
red
red
+12V
black
Laser
Diode
black
Photodetector
7
+
6
4
Output
Voltage
LM741
N
-12V
Figure 4.2
Lab #4: Operational Amplifier Application: Electronic Security System Design
Part 1 of 2
Page 1
Figure 4.2 illustrates for the first three stages of the security system you will be building.
Working with a laser diode in lab requires extra safety procedures. Never point the laser diode at
a person. Instead, be sure that the laser points directly at the photo detector. You will be
building the first four stages shown in Figure 4.1 in lab today. Pay special attention to stage 3
and stage 4. Although the hardware of these stages are very similar, stage 3 converts current to
voltage and stage 4 amplifies the input voltage.
The ideal op-amp has two inputs and one output. The inputs are referred to as negative or
inverting, and positive or non- inverting. If you are not yet familiar with analyzing op-amps, you
should re-read Chapter 5 in your text. The output voltage is determined by the input voltages
and a network of resistors or other elements attached to the op-amp
These are the ideal characteristics we will use to model the actual 741 op-amp. See Chapter Five
in your textbook for more details on using and analyzing an op-amp.
The 741 op-amp you will use is an eight-pin DIP (Dual In- line Package) integrated circuit. It has
been carefully designed to give nearly ideal performance at room temperature, within certain
maximum ratings (download the datasheet from the WebCT). Seven of the eight pins are used in
this package, as shown in Figure. 4.3b. Fiugre 4.3b shows the IC pin numbers associated with
the op-amp circuit symbol. Pin 1, pin 5 and pin 8 will remain un-connected for your experiment.
It is a good idea to become familiar with the pin numbers and their usage before beginning the
lab.
LM741N
2
3
OFFSET
NULL
7
+
INVERTING
INPUT
NON-INVERTING
INPUT
-V
(a)
NC
+V
OUTPUT
OFFSET
NULL
(b)
Figure 4.3
Schematic diagrams including op-amps frequently omit the explicit power supply connections to
pins 4 and 7, but they are assumed to exist. In figure 4.3b, +V and -V refer to the positive and
negative power supply connections, respectively. In this lab we will use V = +12V. This
implies that the maximum operating output voltage will range from -12V to +12V for linear
operation of the op-amp. Otherwise saturation will occur which we want to avoid in our
application. Background on op-amps can be found in sections 5.1 and 5.2 in your textbook.
Lab #4: Operational Amplifier Application: Electronic Security System Design
Part 1 of 2
Page 2
We will be using the op-amp in the inverting configuration. Details on how to analyze the
Inverting- Amplifier circuit can be found in section 5.3 of your textbook. When doing the prelab,
be sure to show the calculations on how to find the output of your circuit. Remember, in order
for the formulas to work, the op-amp must be operating in the inverting region.
It is strongly recommended that you read the first three sections of chapter 5 in your text before
attempting the prelab for this lab.
Page 3
Prelab
Read the entire experiment and be prepared to answer questions in the prelab quiz.
Analyze the following circuit.
(a) Find VO as a function of R and Id (assume the op-amp is ideal).
(b) If Id = 20A and the desired VO = -0.44V, find the proper value for R.
(c) Verify your result by running a PSpice simulation using the 741 op-amp model.
(PSpice hint: Use uA741 as your op-amp. Pay special attention to your pins. Use
separate DC voltage sources which have been grounded for pin 7 and pin 4.)
R
+12V
2
3
Id
7
-
VO
4
LM741N
-12V
Figure 4.4
Model the following circuit in PSPICE. Take Vi = -0.44V. Use the value of R you calculated
above.
R
+12V
1k
Vi
+
-
2
3
7
+
Vamp,out
4
LM741N
-12V
Figure 4.5
Show all currents and voltages. Use part number uA741 from PSPICE to represent the LM741N
chip. Be sure PSPICE labels all nodes with voltages and currents.
Create the *.vi according the instructions below. If you have any questions on this, please
contact your TA. You can also consult www.ni.com/academic/lv_training/default.htm
Page 4
Comparator.vi
This security system design can also be implemented in software. We are going to implement
most of the stages using the LabVIEW software instead of multiple op-amps.
The virtual instrument you are creating for Lab #4 will actually simulate through stage number 5
as shown in Figure 4.1. If are not familiar with a comparator, you might want to read the
introduction to Lab #5. However, basically a comparator reads two voltages. One is in the
positive input and one is in the negative input. If the positive input is greater, the output is V+.
If the negative input is greater, the output is V-. For our physical circuit, we will need fairly high
V+ and V- to overcome noise. However, for this software implementation, we are going to use
0V and 3V as our outputs. Please attend a help session or see your TA if you would like more
information on this. Note that when being used as a comparator, the op-amp is not operating in
the linear region.
Use LabVIEW to create a VI that will do the following:
1. Monitor the output of the laser detector.
2. Produce an output on the analog output channel
Directions:
The following directions may help you to write your program. There are many ways that this
program could be written, so if you think of another way that works, do it. You will learn more
about LabVIEW that way. Using Context Help can be very helpful in troubleshooting. In order
to submit your VI for grading, print the block diagram and hand it in to your TA for
grading.
Open LabVIEW 7.0
1. Create a New VI. (Use a blank template.)
2. Create a While loop (use the palette).
Right click on the block diagram to bring up the functions palette.
All functions are available from the function palette.
Go to the [Exec Ctrl] menu to get to the while loop function. All of the following steps
will happen within the while loop.
3. Create an Input (use the palette). Note: To use the DAQ assistant, you will have to use
the computers in the 113D lab as you did in Lab #1. You can do the other steps and take
your file to the lab to complete with the DAQ Assistant if you have trouble finding time
to use the 113D lab.
Go to the input functions menu and create a DAQ Assistant.
Placing the DAQ Assistant on the block diagram will initiate a series of questions about
what kind of input you want to use. Make sure to place the input inside the while loop.
Select Analog Input.
Select Voltage.
Select the physical channel you wish to use. In this case, use Analog Channel 0 (ai0)
Page 5
Select appropriate voltage input limits max = 0V and min = -1V. If the polarity is
selected incorrectly, the program will not run. These inputs will be around the range
calculated in question 1 of the prelab.
4. Create an Output. (Again, this step must be done in the 113D lab.)
Go to the output functions menu and create a DAQ Assistant Place it inside the whileloop and answer the questions appropriately
Select Analog Output
Select Voltage
Select the physical channel DAQ analog output1
Select good limits of what you expect to output (0 to 3V)
5. Negate the signal by drawing a line for the output of the DAQ to an inverter
6. Create a Waveform output. If yo u want to monitor the signal at any part of your VI, you
may do so by placing a waveform graph onto the front panel. When you go back to the
block diagram, you may wire any part of the program you wish to monitor into the graph.
For example, you can take the output of the inverter and put it in the Waveform output to
see what the actual signal you are getting is.
Before we continue, consider the algorithm for the comparator.
If the input is below 0.2V the output is zero
If the input is above 0.2V the output is 3V
Note: This algorithm is the final output of the program you are writing. For the greater than
operation, the output will be 1 or 0. (A logical output.) For the whole program, you output
should be either 0 or 3 volts.
7. Put the logic on the block diagram
Input Conditioning
Go to the comparison functions in the Arith/Compare menu
Place a [>], a greater than block, and wire the output of the inverter to the input
Place a numerical constant down (look in Arith/Compare --> Numeric) and wire this
constant to the lower input of the [>] greater than block. Obviously, we want to compare
it to the input. So, our comparison value should be 0.2
The output of the [>] gate (which is the left most node on that block) will output a zero
anytime the input is less than the numeric constant. It will output a 1 anytime the input is
greater than the numeric constant. You can wire the output of the comparing gate
(greater than) to a waveform display as you did in step 6. This will allow you to view the
logical output of the circuit at this point. You will want to view this output during the lab
to see how varying Ra will effect the logical output of the circuit.
8. Output Conditioning
Place a [x], a multiplier block, from the Arith/Compare function menu in the while loop
Connect the output of the comparator to the input of the multiplier block.
Attach the output of the multiplier block to the output DAQ assistant you created.
Add a numerical constant and attach it to one of the inputs for the [x] block In our case,
this should be a 3. As stated at the beginning, we want the output of the comparator to be
either 0V or 3V.
Lab #4: Operational Amplifier Application: Electronic Security System Design
Part 1 of 2
Page 6
Now the output of the board will be whatever the output of the comparator is multiplied by the
numerical constant you plugged into the multiplier.
You will be attaching a physical input to Analog Channel 0 and the HP DMM to the DAQ
output. Therefore, it is very important to complete this virtual instrument before coming to lab.
As an added note, you may need to vary your program when you get to the lab. Each laser set is
different, and 0.2V may not be the correct value for the threshold of your components. There are
two ways to handle this. One is to place a control on the front panel of your VI so you can
change your threshold voltage while the program is running. Another is to adjust your threshold
manually in your block diagram during the lab. The method you use is up to you!
Page 7
Procedure:
Required Special Equipment:
1 51 resistor, W
1 130 resistor, W
1 300 resistor, W
2 22 k resistor, W
1 1 k resistor W
2 - 741 (or equivalent) operational amplifier
1 DL3149-055, Laser Diode
1 FDS100, Photodetector
Page 8
+12V
+12V
Id
22k
Req = 200
red
red
+
Vd
-
+12V
black
Laser
Diode
Ra
black
Photodetector
7
+
6
4
Output
Voltage
LM741
N
-12V
(a)
(b)
Figure 4.7
Page 9
+12V
1k
Vi
+
-
2
3
7
+
6
4
Vamp,out
LM741N
(2)
-12V
II.
III.
Figure 4.8
Using the variable power supply in the bench, apply a voltage input to the input of
your set- up and check that the output is as expected. Turn on the NI ELVIS board.
Record your measurement in Table 4.3. Disconnect the input voltage.
Connect the output of the 1st op-amp to the input of the 2nd op-amp. Check the output
of this stage with the laser with and without the beam obstructed. Record your
measurements in Table 4.4.
Page 10
Along with the questions asked through-out Lab #4, you should be prepared to answer the
following questions as part of the Lab Quiz at the beginning of next period:
1.
2.
3.
4.
Page 11
Measured I d
Calculated Vd = 12 I d Req
Measured Vout
Vout, no-beam
Calculated Vamp,out
Measured Vout
Vout, no-beam
Page 12