Vous êtes sur la page 1sur 12

# Lab #4: Operational Amplifier Application: Electronic Security System

## Design: Part 1of 2

Theory & Introduction
Goals For Lab #4
In Lab #4 and Lab #5, you will design, build and analyze an electronic security system using a
laser diode, a photo detector, operational amplifiers, etc. The main task is to design a circuit that
will detect an interruption in a light beam and sound an alarm. You will use an idealized model
of the op-amp, which simplifies analyses of op-amp circuits, and apply Kirchhoffs Laws and
superposition. You will need to understand the inverting configuration of an op-amp in this lab.
Theory
The block diagram of the system is shown in Figure 4.1. A laser diode (part no. DL3149-055) is
employed to send the light beam (red) to a photo detector (part no. FDS100). The photo detector
current induced by the light beam depends on the strength of the beam. An operational
amplifier, or op-amp, will be connected to the photo detector to convert the current into voltage.
Since the signal levels, or our voltage values, are very small, a second op-amp will be used to
increase the signal level so it can be used to activate a buzzer. A comparator will then be used to
increase the electronic noise immunity and to determine whether the beam is continuous or not.
Whenever the beam is obstructed, the comparator output will be changed. It will then be locked
by a latch circuit and a buzzer will sound. Light Emitting Diodes (LEDs) are used to show the
status of the output.

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

## 1) zero current into the inputs

2) zero potentia l difference between the inputs

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.

## Lab #4: Operational Amplifier Application: Electronic Security System Design

Part 1 of 2

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

## Lab #4: Operational Amplifier Application: Electronic Security System Design

Part 1 of 2

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:
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
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 Voltage.
Select the physical channel you wish to use. In this case, use Analog Channel 0 (ai0)

## Lab #4: Operational Amplifier Application: Electronic Security System Design

Part 1 of 2

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
manually in your block diagram during the lab. The method you use is up to you!

## Lab #4: Operational Amplifier Application: Electronic Security System Design

Part 1 of 2

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

## Task #1: Construct the laser diode drive circuit.

I.
Turn on the NI ELVIS module. Choose the variable power supply. Set the variable
power supply to +12V and 12V. You will need to use the variable power supply
from the manual knobs on the front of the NI ELVIS unit. This is important because
you will be implementing your own virtual instrument in Task #4, and you cannot use
the software instrument panel at the same time you use LabVIEW with your VI.
Using the bench digital multi- meter (DMM), measure the output from the variable
power supply. If it is not with 5% of +/- 12 volts, adjust the output, manually use the
knobs on the front of the NI ELVIS system so that the DMM reads that the output is
+12V and 12V. Note: you will need to be sure the switch on the NI ELVIS system
is also set to manual. Choose one half of one of the long strips on the breadboard to
be the +12V. Note that the long strips are connected together in two halves on the
board. So either use the lower or upper half to be your. Choose another are to be the
12V rail. Choose a third place of the breadboard to connect to ground of the NI
ELVIS system. You will need more than one of each of these, so choosing a half of a
long strip provides you will multiple connections. Turn off the NI ELVIS breadboard
for now.
II.
Build the laser diode drive circuit shown in Figure. 4.7a towards the left side of your
breadboard. For now, Ra = 0. There is an equivalent resistance, Req=200, in the
laser apparatus that has been provided for you. Connect the red line of the laser diode
to +12V. Be sure the DMM is off. Connect the black line of the laser diode to the
input to the DMM in series. Note: You will need to use the DMM as an ammeter.
Therefore, you need to switch the input to the DMM and be sure to push the button
that tells the DMM to read [Current]. Connect the black wire from the ammeter to
important so you do not damage any of the equipment..
III.
Turn on the NI ELVIS board.. DO NOT EVER LOOK DIRECTLY AT THE BEAM
TO AVOID DAMAGE TO YOUR EYES. YOU WILL BE REMOVED FROM THE
LAB IF YOU DO NOT FOLLOW THIS INSTRUCTION. Measure and record, in
Table 4.1 the current that is flowing through the diode. Turn off the NI ELVIS board.
Calculate Vd and record in Table 4.1.
Lab #4: Operational Amplifier Application: Electronic Security System Design
Part 1 of 2

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

## Task #2: Construct the Photo detector circuit.

I.
With the NI ELVIS board off, build the photo detector circuit shown in figure 4.6 to
the right of your laser diode. Start by gently inserting the op-amp IC into the
breadboard so that it straddles the trough running across the board. The large
channels on the breadboard are ideal for mounting DIP chips. (Remember to provide
12V to the proper pins on the op-amp). From the photo detector, connect the red
line to +12V and the black line to the 741 op-amp. Connect the 22k feedback
resistor to the pins shown in Figure 4.7b. Be sure to connect pin 3 to ground.
II.
Turn on the NI ELVIS board. Align the beam to the photo detector. REMINDER:
NEVER LOOK DIRECTLY INTO THE LIGHT BEAM. Be sure to keep a
can lead to inconsistent results for your output voltages. Measure the output voltage
of the op-amp, Vout with the bench DMM Record your results in table 4.2.
III.
Measure the output voltage Vout, no-beam when the beam is obstructed. You may
obstruct the beam using a book or several sheets of paper. Record your result in
Table 4.2.
IV.
Measure the current, Id, through the laser diode with the bench DMM. Be sure to
change the connections on the DMM so it will read current instead of voltage. Do
this by placing the ammeter in series with the laser as before.
V.
Add resistance, RA, in series with the laser diode portion of the circuit as shown in
figure 4.6. First, RA = 51. Place the resistor between the black line from the laser
diode and ground.
VI.
As above, measure Vout , Vout, no-beam and Id and record in table 4.2.
VII. Replace RA = 51 with RA = 130 . Measure Vout , Vout, no-beam and Id and record in
table 4.2
VIII. Replace RA = 130 resistor with RA = 300 resistor. Measure Vout , Vout, no-beam and Id
and record in Table 4.2.
IX.
Remove RA from the circuit for the next part of the procedure.
X.
DO NOT DISMANTLE the whole circuit. You will use it both in Task #3 and Task
#4.
Lab #4: Operational Amplifier Application: Electronic Security System Design
Part 1 of 2

Page 9

## Task #3: Construct the amplifier

I.
Turn off the NI board. Place a 2nd 741 op-amp on the breadboard to build the circuit
shown below in Figure 4.8. Remember to make the connections to +12V and -12V.
Be sure to connect pin 3 to ground.
22k

+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.

## Task #4: Implement a virtual comparator.

I.
Connect the output from the 1st op-amp to the input of the DAC channel AI0. You
will connect AI0- to the ground of the NI ELVIS system. Connect the HP DMM to
DAQ analog output 1 on the board.
II.
Repeat Task #2 recording your results in table 4.5. Record the output shown on your
voltage indicator for each Req. Even though you are varying the current at the same
place with your different values of Req, the output is being taken at a different stage.
Therefore, do not expect the value to be the same for both tables. What values do you
expect for the output of a comparator? Does the value of Req effect the output of the
comparator? Should it? Why or why not? (These are questions to consider for the
lab report.)

## Lab Report Requirements

Follow all Lab Report Requirements as outlined in the introduction of the lab manual.
Compare and contrast Table 4.2 with Table 4.5. What are the differences? How do you account
for the differences?
What should we consider a threshold voltage for the beam being on? Why is this not equal to
zero?

## Lab #4: Operational Amplifier Application: Electronic Security System Design

Part 1 of 2

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.

## Given a block diagram, identify what it is supposed to do in LabVIEW

Draw a current to voltage converter using standard PSPICE parts.
Draw an inverting op-amp with a given gain. Specify resistor values.
Draw a non-inverting op-amp with a given gain. Specify resistor values and the formula
to use.
5. Given the pins of a DIP, specify the pins of an op-amp.

Part 1 of 2

Page 11

## Tables and Results

Parameter Values:

Measured I d

Req + RA
Measured I d
200
251
330
500

Calculated Vd = 12 I d Req

Measured Vout

Vi
Measured Vamp,out
0.1V
0.5V
1.0V
Assume an ideal op amp for calculations.

Vout, no-beam

Calculated Vamp,out

Measured Vamp,out
With laser beam at the photodetector
Without laser beam at the photodetector
Req + RA
Measured I d
200
251
330
500

Measured Vout

Vout, no-beam

Part 1 of 2

Page 12