ECEN 214 Lab 5

You are on page 1of 8

Revised February 20, 2018

Lab 5: Operational Amplifier Application: Electronic Security System


Design: Part 2 of 2

Theory & Introduction –

Infrared Current to Signal


Photo Comparator LEDs
Emitter Voltage Amplifier Latch
Detector
Converter

Figure 5.1 – Block Diagram of Electronic Security System

Goals for Lab 5


In this lab, the second of the two experiments for putting together an electronic security system,
you will put together all the pieces of the electronic security system that were studied in the first
experiment in this series. You will design each of the components to work together within the
system and then build and test the system.

Theory
In Lab 4, we studied the components that can be used to create a system that outputs one of two
logic levels (voltages) depending on whether an IR light beam is obstructed on not. The output of
the comparator would switch instantaneously (almost) as the light beam switches between the
obstructed and unobstructed states. If we desire to use this in the context of a security system, we
could use the comparator output to trigger an alarm when the light beam is obstructed, but we
probably would not want the alarm to turn off as soon as the light beam becomes unobstructed
again. It would be preferable if the alarm continued until someone verifies that all is safe and
manually resets it. We will use a digital logic device called a latch to keep our alarm on once it is
triggered until somebody resets it.

For today’s experiment, we will be using a latch. The signal output of a comparator changes when
the input signal changes above/below the reference voltage. Sometimes you may need to hold the
status, even if the input changes. CD4044 shown in Figure 5.2 is one such device. When the S (set)
terminal is low, it sets the output Q as high. When R (reset) terminal is low, it resets the output Q
as low. When the S and R terminals are high, the output Q keeps previous status. The output status
for both S and R low is not defined. Therefore this input status should be avoided.

Lab 5: Operational Amplifier Application: Electronic Security System Design: Part 2 of 2 Page 1
Revised February 20, 2018

In this experiment we will use the CD4044 latch. The IC actually has three latches, but we will
only use one of them. The pinout is shown in Figure 5.2 along with a truth table that describes the
function of this device. The latch has two inputs S (set) and R (reset) along with a single output
Q. For our use, the inputs of S and R stay high in the normal condition (light beam unobstructed).
If the light beam is obstructed, the S input is pulled low and therefore the Q output goes high. If
the obstruction is removed, the S input returns back to high. Since both of the S and R are high,
the output Q stays high until the R input is pulled low. Once the R is low, the output Q goes low.
Then, the R returns back to high and the Q stays low.
CD4044

Q4 1 16 VDD

NC 2 15 S4

S1 3 14 R4

R1 4 13 Q1

Truth Table
ENABLE 5 12 R3
S R Q
R2 6 11 S3
H H No Change
S2 7 10 Q3 L H H

GND 8 9 Q2 H L L
L L Undefined

(a) Pins for the DC4044 Latch (b) Truth Table for DC4044 the Latch
Figure 5.2

Be sure you understand the information about the latch we will be using. Contact your TA if you
have questions about how this works.

Lab 5: Operational Amplifier Application: Electronic Security System Design: Part 2 of 2 Page 2
Revised February 20, 2018

Prelab
Read all of Lab 5 and review Lab 4. Items that should be handed in are marked in bold below.

A. Based on the measurements you made of the various components in Lab 4, design the system
contained in the dashed box in Figure 4.1 of Lab 4 (see also Figure 5.5 of this lab). The design
should be such that the output of the comparator is at its high level (+5V) when the light beam is
unobstructed and at its low level (0V) when the light beam is obstructed. Include a schematic
diagram of your design including all resistor values.

B. Model in SPICE your design from Part A above. To do this, start with the SPICE simulation
from Part A of prelab 4 (or the detector of Figure 4.9 if you are not using the op-amp for the current
to voltage converter). The output of the first stage should be the input to an op-amp signal
amplifying stage in Task 2 of Lab 4. Wire the output of the signal amplifier to the input of the
comparator from Task 3 of Lab 4. Run two simulations of this three stage configuration. The first
should have the same input current as in Part A of prelab 4. Save and print the schematic with
voltages shown to hand in. Change the input current to be 0A. Run a second simulation and
see what your output is. Save and print the schematic with voltages shown to hand in. If you
have questions on this, contact your TA.

C. Solve the following questions using Figure 5.3 below. The initial condition of the output Q is
high (H). Hint: Refer to the truth table in Figure 5.2 of this lab.
(a) When /ALM is pushed on, creating a short to ground, what are the input
voltages of S and R, and the output voltage Q?
(b) After (a) happens, /ALM is released. What is the output voltage Q?
(c) After (a) and (b) happen, /RESET is pushed on, creating a short to ground,
what are the input voltages of S and R, and the output voltage Q?
(d) After (a), (b) and (c) happen, /RESET is released. What is the output voltage
Q?
D. Solve the following questions using Figure. 5.4. Assume 0.7V voltage drop across LEDs
when they are positively biased. Show your calculations.
(a) When VB=0V, which LED is on?

Lab 5: Operational Amplifier Application: Electronic Security System Design: Part 2 of 2 Page 3
Revised February 20, 2018

(b) When VB=5V, which LED is on?


(c) If you want to limit the current thorough the LEDs to 10mA for both cases of
3 (a) and 3 (b), find out the resistor values of RG and RR.

+5V +5V

+5V

Figure 5.3

+5V

𝑅𝐺
𝑉𝐵
𝑅𝑅

Figure 5.4

Lab 5: Operational Amplifier Application: Electronic Security System Design: Part 2 of 2 Page 4
Revised February 20, 2018

Procedure

Required Equipment:
 A selection of ¼ W resistors.
 1 red LED
 1 green LED
 1 – CD4044B Latch
 Battery pack capable of supplying 4.5-5V DC
 1 – LM319 op-amp comparator
 2 - LM741 (or equivalent) operational amplifiers
 1 – IR emitter and detector (pair)
 A selection of colored 24 gauge connection wires, at least 15 strands

Task 1 – For the first part of this lab, you are going to combine the pieces you studied in the last
lab. Using the circuitry studied in the previous lab, you should implement each of the boxes shown
in Figure 5.5. The design should be such that the output of the comparator is at its high level (+5V)
when the light beam is unobstructed and at its low level (0V) when the light beam is obstructed.
Please see the lab report section at the end of this lab for a description of items from this task that
you need to include in the lab report.

You should demonstrate to your TA that this part of your system functions correctly. Please do
not hesitate to ask your TA for help if you need it.

Infrared Current to Signal


Photo Comparator
Emitter Voltage Amplifier
Detector
Converter

Figure 5.5 – Components from Lab 4.

Task 2 - Construct the Latch


Connect the output of your circuit from Task 1 to the circuit shown in Figure 5.6. Be sure to
connect Pin 5 (ENABLE) to high (+5V) to enable the device. The dotted line to ground at the
reset (R) input will be your method to manually reset the latch. Connect one end of a wire to the
R input of your latch. Leave the other end disconnected. When you want to reset the latch, briefly
touch the other end to ground and then disconnect it again. This will momentarily put the low
voltage (0V) on the R input and then bring it back to its normal high state once the latch has been
reset.

Lab 5: Operational Amplifier Application: Electronic Security System Design: Part 2 of 2 Page 5
Revised February 20, 2018

You may need to RESET the latch after turning on the power to initialize the circuit. When you
have included the latch to your system from Task 1, verify that it is functioning correctly by
measuring the following:
 With the light beam unobstructed (and therefore the comparator output at +5V), reset the
latch. What is the voltage on the Q output?
 Obstruct the light beam so that the comparator output goes low. What is the voltage on the
Q output?
 Remove the obstruction from the light beam so that the comparator voltage goes back to
high. What is the voltage on the Q output?
 Reset the latch by connecting the R input to ground. What is the voltage on the Q output?

+5V

10𝑘Ω +5V

R 𝑉𝑑𝑑
Latch
Q Output
Comparator
Output S
GND

Figure 5.6 – Latch Circuit.

Lab 5: Operational Amplifier Application: Electronic Security System Design: Part 2 of 2 Page 6
Revised February 20, 2018

Task 3 - Add indicator LEDs.


+5V
Anode
(long lead)

Cathode
(short lead)

𝑅𝐺

Latch
Output
𝑅𝑅
Anode
(long lead)

Cathode
(short lead)

Figure 5.7 – LED Circuit


As a last step in the construction of your security system, you will add two LEDs to serve as
indicators. Add the circuit shown in Figure 5.7 to the latch output (Q) from Task 2. Use two LEDs
(one red and one green) as shown. Note the LEDs function much like the IR emitter in Lab 4. The
anode (A) is the long lead and the cathode (C) is the short lead. If there is a sufficient positive
voltage (measured from anode to cathode) across the LEDs, they will allow currently to flow and
emit light. Chose the resistor values to insure that no more than 10mA flows through the LEDs.
Verify that only one of the LEDs is lit at any point in time and that the green light is on under
normal conditions and the red light is on in an alarm situation. Show your TA when your system
is functioning and give yourself a pat on the back.

Before you leave the lab…


You should demonstrate to your TA your (hopefully) fully functional alarm system. Your TA will
ask you to explain some of your design choices so be prepared to discuss why you did what you
did.

Lab 5: Operational Amplifier Application: Electronic Security System Design: Part 2 of 2 Page 7
Revised February 20, 2018

Lab Report
In your lab report this week, make sure to include at least the following:
 Title Page
 Overall description of your security system and a brief description of how each component
works
 Discuss your various design choices (Task 1) you made and why. Please include
o Emitter – What value did you use for the resistor in the emitter circuit and why?
o Current to voltage converter
 Which circuit did you use here? Just a resistor or the op-amp circuit? Why?
 What resistor value did you use and why?
o Signal amplifier
 Did you use an inverting or non-inverting amplifier? Explain your choice?
 What amplification factor did you choose and why?
 What resistor values did you choose to construct your amplifier?
o Comparator
 What value did you choose as your reference voltage?
 Did you put the reference on the + input and the input on the – input or the
other way around? Justify your choice.
 Measurements – Please include any measurements you took to verify that various
components of your circuit are functioning correctly.
 Overall – Did you encounter any issues/difficulties in putting all of this circuitry together?
How did you ultimately solve any problems you encountered?
 Performance – Does your circuit work as intended?
o How far apart can you place the emitter and detector and still have the circuit function
correctly?
o Did you experience any false alarms or missed detections? How often does this
happen? Discuss what might be causing this and how you might be able to improve
your design to prevent this from happening.

Lab 5: Operational Amplifier Application: Electronic Security System Design: Part 2 of 2 Page 8

You might also like