EE283 Electrical Measurement Laboratory Laboratory Exercise #7: Digital Counter

Similar documents
1 Second Time Base From Crystal Oscillator

CHAPTER 6 DIGITAL INSTRUMENTS

). The THRESHOLD works in exactly the opposite way; whenever the THRESHOLD input is above 2/3V CC

Lab 2 Revisited Exercise

EE-110 Introduction to Engineering & Laboratory Experience Saeid Rahimi, Ph.D. Lab Timer: Blinking LED Lights and Pulse Generator

ENGR 210 Lab 12: Analog to Digital Conversion

Electronic Instrumentation

ENGR-4300 Fall 2006 Project 3 Project 3 Build a 555-Timer

University of North Carolina-Charlotte Department of Electrical and Computer Engineering ECGR 3157 Electrical Engineering Design II Fall 2013

University of North Carolina, Charlotte Department of Electrical and Computer Engineering ECGR 3157 EE Design II Fall 2009

ANALOG TO DIGITAL CONVERTER

B.E. SEMESTER III (ELECTRICAL) SUBJECT CODE: X30902 Subject Name: Analog & Digital Electronics

+15 V 10k. !15 V Op amp as a simple comparator.

LABORATORY EXPERIMENT. Infrared Transmitter/Receiver

DEPARTMENT OF ELECTRICAL ENGINEERING LAB WORK EE301 ELECTRONIC CIRCUITS

Project 3 Build a 555-Timer

EE 368 Electronics Lab. Experiment 10 Operational Amplifier Applications (2)

Electronics. RC Filter, DC Supply, and 555

EE 3101 ELECTRONICS I LABORATORY EXPERIMENT 9 LAB MANUAL APPLICATIONS OF IC BUILDING BLOCKS

State Machine Oscillators

ENGR-2300 Electronic Instrumentation Quiz 3 Spring Name: Solution Please write you name on each page. Section: 1 or 2

Module 9C: The Voltage Comparator (Application: PWM Control via a Reference Voltage)

DEPARTMENT OF ELECTRICAL ENGINEERING AND COMPUTER SCIENCE MASSACHUSETTS INSTITUTE OF TECHNOLOGY CAMBRIDGE, MASSACHUSETTS 02139

Lab 8. Stepper Motor Controller

Analog-to-Digital Conversion

HIGH LOW Astable multivibrators HIGH LOW 1:1

UNIVERSITI MALAYSIA PERLIS

MASSACHUSETTS INSTITUTE OF TECHNOLOGY Hands-On Introduction to EE Lab Skills Laboratory No. 2 BJT, Op Amps IAP 2008

Massachusetts Institute of Technology MIT

Lab Exercise # 9 Operational Amplifier Circuits

PreLab 6 PWM Design for H-bridge Driver (due Oct 23)

Lab #7: Transient Response of a 1 st Order RC Circuit

EG572EX: ELECTRONIC CIRCUITS I 555 TIMERS

EE223 Laboratory #4. Comparators

ECE 2010 Laboratory # 5 J.P.O Rourke

ASTABLE MULTIVIBRATOR

DIGITAL ELECTRONICS: LOGIC AND CLOCKS

9 Feedback and Control

Long Loopstick Antenna

EE431 Lab 1 Operational Amplifiers

ENGR4300 Test 3A Fall 2002

Electronic Instrumentation

EUP V/12V Synchronous Buck PWM Controller DESCRIPTION FEATURES APPLICATIONS. Typical Application Circuit. 1

Physics 335 Lab 1 Intro to Digital Logic

In-Class Exercises for Lab 2: Input and Output Impedance

LM555 and LM556 Timer Circuits

PRESENTATION ON 555 TIMER A Practical Approach

Class #6: Experiment The 555-Timer & Pulse Width Modulation

ELM409 Versatile Debounce Circuit

Capacitive Touch Sensing Tone Generator. Corey Cleveland and Eric Ponce

EEE312: Electrical measurement & instrumentation

Use the fixed 5 volt supplies for your power in digital circuits, rather than the variable outputs.

University of Jordan School of Engineering Electrical Engineering Department. EE 204 Electrical Engineering Lab

MSK4310 Demonstration

ML4818 Phase Modulation/Soft Switching Controller

CHAPTER 4: 555 TIMER. Dr. Wan Mahani Hafizah binti Wan Mahmud

Using the SG6105 to Control a Half-Bridge ATX Switching Power Supply. Vcc. 2uA. Vref. Delay 300 msec. Delay. 3 sec V2.5. 8uA. Error Amp. 1.6Mohm.

transformer rectifiers

University of Utah Electrical & Computer Engineering Department ECE 1250 Lab 4 Pulse Width Modulation Circuit

Data Conversion and Lab Lab 4 Fall Digital to Analog Conversions

CONTENTS Sl. No. Experiment Page No

Electronic Instrumentation. Experiment 8: Diodes (continued) Project 4: Optical Communications Link

UNIVERSITI MALAYSIA PERLIS

Due date: Sunday, November 8 (midnight) Reading: HH sections , (pgs , )

Lab 7: DELTA AND SIGMA-DELTA A/D CONVERTERS

R & D Electronics DIGITAL IC TRAINER. Model : DE-150. Feature: Object: Specification:

University of Portland EE 271 Electrical Circuits Laboratory. Experiment: Op Amps

PHYS 536 The Golden Rules of Op Amps. Characteristics of an Ideal Op Amp

SRVODRV REV7 INSTALLATION NOTES

Chapter 13: Comparators

Physics 309 Lab 3 Bipolar junction transistor

Class #3: Experiment Signals, Instrumentation, and Basic Circuits

Introduction to IC-555. Compiled By: Chanakya Bhatt EE, IT-NU

Electric Circuit Fall 2016 Pingqiang Zhou LABORATORY 7. RC Oscillator. Guide. The Waveform Generator Lab Guide

EE283 Laboratory Exercise 1-Page 1

PHYS225 Lecture 18. Electronic Circuits

DEPARTMENT OF ELECTRICAL ENGINEERING AND COMPUTER SCIENCE MASSACHUSETTS INSTITUTE OF TECHNOLOGY CAMBRIDGE, MASSACHUSETTS 02139

Physics 120 Lab 6 (2018) - Field Effect Transistors: Ohmic Region

Laboratory 9. Required Components: Objectives. Optional Components: Operational Amplifier Circuits (modified from lab text by Alciatore)

Final Mini Project Report

EE 2274 DIODE OR GATE & CLIPPING CIRCUIT

High Current MOSFET Toggle Switch with Debounced Push Button

11 Counters and Oscillators

University of California at Berkeley Donald A. Glaser Physics 111A Instrumentation Laboratory

University of Pittsburgh

Autonomous Robot Control Circuit

Dev Bhoomi Institute Of Technology Department of Electronics and Communication Engineering PRACTICAL INSTRUCTION SHEET

Lab 5. Binary Counter

EE 210: CIRCUITS AND DEVICES

OBJECTIVE The purpose of this exercise is to design and build a pulse generator.

MASSACHUSETTS INSTITUTE OF TECHNOLOGY

Analog Electronic Circuits Lab-manual

555 Timer and Its Application

Fig 1: The symbol for a comparator

Comparators, positive feedback, and relaxation oscillators

Lab 6. Binary Counter

Lab Experiments. Boost converter (Experiment 2) Control circuit (Experiment 1) Power diode. + V g. C Power MOSFET. Load.

Oscilloscope Guitar Hero. Druck Green Daniel Shaar

Using Circuits, Signals and Instruments

MAINTENANCE MANUAL AUDIO MATRIX BOARD P29/

Transcription:

EE283 Electrical Measurement Laboratory Laboratory Exercise #7: al Counter Objectives: 1. To familiarize students with sequential digital circuits. 2. To show how digital devices can be used for measurement of frequency. The purpose of this laboratory exercise is to familiarize students with digital sequential circuits in general, and the counter in particular. Counters are very useful for a number of purposes, ranging to simply counting events, to serving as tachometers or frequency counters, and as a component in an Analog to al converter which converts an analog signal into a digital form suitable for further processing in a computer. This exercise will explore those three applications. Background: There are several new components that are used which are described below. 1. LM555 timer: The LM555, in its many variations, has been perhaps the most widely produced integrated circuit in the world. It really is just a Voltage controlled switch. It is generally used to alternately charge and discharge a capacitor through a resistor network. When the Voltage on the threshold input (pin 6) reaches down to (or below) about 1/3 of the power supply Voltage, and output Discharge (pin 7) turns off. That allows the capacitor to charge. When the Voltage at the trigger (pin 2) reaches about 2/3 of the power supply Voltage or above, the Discharge turns on, starting discharge of the capacitor. A second output (pin 3) indicates whether the capacitor is charging (high) or discharging (low). There is also a reset pin (pin 4) that we won t use (leave it tied to the positive supply), Considerable material about the LM555 timer can be found online. Figure 7.1 illustrates a typical timer circuit that can drive LEDs. The timer frequency and duty cycle (proportion of time high) depends of component values for R1, R2, and C. V CC R1 68K R2 39K C1 1uF + 7 6 2 4 Reset Discharge Treshold V CC 1 8 V CC al out Trigger Control V Ground 555 Timer 3 5 C2.01uF V CC indicator LED on if output low Pulses out indicator LED on if output high Figure 7.1 The LM555 timer used as an oscillator. The LM555 can be operated at various Voltages, but the frequency and timing is determined by the RC time constants as C1 charges through R1 and R2, then discharges through R2. These component values determining frequency and duty cycle. The time EE283 Laboratory Exercise 7 - Page 1

constants are independent of Voltage, so the behavior of the circuit is independent of the power supply Voltage. Useful formulas are given below: The frequency in Hz is given by: f = 1 / (.693 C (R1 + 2 R2)) (7.1) The Duty cycle (percentage of time the signal is high) is given by: D = (R1 + R2) / (R1 + 2R2) (7.2) Notice that the duty cycle D cannot fall below 50%, and getting to 50% requires that R1 have the value 0, which is very undesirable since setting R1 to 0 will cause large currents to flow into the discharge pin (pin 7). If R2 is much larger than R1, the duty cycle will approach 50%. Figure 7.2 below illustrates these timing parameters. t high t low f = 1/ (t high + t low ) time D=t high / (t high + t low ) Figure 7.2 Information about timing 2. The decimal counter: This is an integrated circuit of the 74LS family, similar to those you worked with in laboratory Exercise #2. However, it is a sequential device. The state of the outputs (called Q D,Q C,, and Q A ) depends not just on the current inputs, but on their past history. The outputs Q D,Q C,, and Q A give the binary representation of a number, 0000 for 0, 0001 for 1, and so forth up to 1001 for 9. Each time a clock input makes a negative to positive transition, the outputs change to the next positive integer. When nine is hit, they next roll back over to zero. A clear input, if held low, resets the device to zero. An Enable T input can be hooked to the Ripple Carry Output of another counter so that it counts only when the previous device is on 9, allowing these counters to be cascaded for a multi-digit timer. The and Enable P inputs won t be used. See Figure 7.3 for the pinout diagram for this device. Figure 7.3 pinout diagram, top view EE283 Laboratory Exercise 7 - Page 2

3. The seven segment decoder-driver: This single device does the job that your Laboratory #2 circuit performed: it converts binary signals into the segment a to g outputs needed to drive a common anode LEisplay. Unlike your circuit, it also works for 8 and 9, so that makes it a good device to use to show the output of a counter. Furthermore, it can sink about 48mA per output (unlike 8mA peroutput for normal digital 74LS devices) so it can make your display bright. (You can use 220 Ohm resistors.) Figure 7.4 shows the pinout diagram. The D, C, B, and A inputs are the binary number. We won t use the other inputs; they can simply be tied high. (Note that there are lots of different 7 segment decoder devices for different kinds of applications.) Figure 7.5 shows the pin connections for the LEisplay. Figure 7.4 Seven Segment decoder device pinout diagram (top view) Figure 7.5 Common Anode LEisplay for Counter project 4. Op-amps (For extra credit part): Using the digital counter as an A/D converter requires the use of an op-amp to compare the Voltage of the input to be measured with a Capacitor Voltage. The capacitor is slowly charging from a current source. (We will use a resistor to power as an EE283 Laboratory Exercise 7 - Page 3

approximation of a current source.) The op-amp is used as a comparator, so that when the Capacitor Voltage rises to the same value as the measured Voltage, the comparator will flip from being close to the positive supply Voltage to being close to the negative supply Voltage (feedback isn t used). You can read about op-amps in the Lab #9 material. The idea is that the comparator, referencing the Voltage at the measured input, determines how long the counter counts. Figure 7.6 below illustrates in principle how an integrating A/D converter works. The current source into the capacitor produces a ramp Voltage that climbs linearly with time. How long does it take to get up to the same Voltage as the input to be measured? You use a digital timer for that. The timer s digital value is in a form that can be either displayed (as a DMM) or used by a computer (as a 12 bit signal, for example). Input V to be measured C Voltage C + - reset C slow fast Osc. Osc. count window Figure 7.6 Integrating A/D Converter pulses to be counted Counter The problem is that the LM741 or equivalent op-amp requires a second power supply. We d like to operate it at +5V and -2V. When operated at +5V and ground, the output cannot go low enough. The circuit shown later requires help for the output to be able to turn off the counter at the appropriate time. Also, the input is not sensitive below about 2 Volts, so it is not possible to measure low Voltages with a 0V negative supply. Using a power supply lower than 0 Volts mitigates both of these problems. However, not only is having a second power supply inconvenient, but it also becomes necessary to make sure that the signal going into digital circuits don t swing much below ground, or that can cause problems. While the material here shows the 741 op-amp being used, a supplement is expected to be promulgated showing how to use a single ended op-amp (either the LM3900 or the LM386, probably) instead. Figure 7.7 shows, for reference, the LM741 op-amp pinouts. Figure 7.7 LM741 Op-Amp pinout diagram EE283 Laboratory Exercise 7 - Page 4

The Laboratory Exercise: Procedure 7.1 Build an LM555 Timer circuit. We want a timer that will give a waveform like that shown in Figure 2 above, having a.10 second low time and a high time of 1 second or more (the exact value is unimportant). Connect pin 3 to an LED (in series with a resistor) to V CC, and you should see the LED blink at a bit over 1 Hz, staying lit for only.10 second at a time. Measure the waveform with the oscilloscope to make sure the low phase is very close to.10 sec. You can use a trimpot (small variable resistor) as one of the timing resistors in your circuit, R2, so that you can adjust the low time to be exactly what you want. Or use a regular pot. The time low is used to determine the interval over which the timer counts. 7.2 Build a three-digit digital decimal counter. Build a counter using s, s, and LED seven segment display devices that will count 000 to 999. Figure 7.8 below shows the schematic. You can toggle it to count single pulses with the debounce circuit shown; each time you flip the input on and off (by alternately grounding the set and reset inputs, the counter will count up one. Grounding the (active low) input to the sets the counter back to zero. All unused inputs can be pulled high with shared 1.0KW resistors. (Use a resistance 220W - 470W for the segments.) Note: You need to be careful with power supply arrangements for the counter devices. Take the power and ground for each device to the same bus strip, and bypass the power supply (as close as possible to the power connections) using a small (4.7 µf) tantalum capacitor. The point is to short out any high frequencies that appear on the power supply. Be careful to get the polarity correct; these capacitors will burst into flames if reversed. Reset Set Ground alternately 5V to count pushbutton to clear 74LS00 count input Debounced input for counter RCO Q A Q C Q D Clock RCO Q A Q C Q D Clock RCO Q A Q C Q D Clock Figure 7.8 al Counter with Debounced Input EE283 Laboratory Exercise 7 - Page 5 Most (leftmost) Least (rightmost)

The NAND gates shown are found in the 74LS00 device. It is similar to the 74LS08, having the same pinouts, but with inverted NAND outputs rather than uninverted AND outputs. The / signal should be held high with a 1.0K Ohm resistor. 7.3 Count stuff: As the digital counter counts, you can either count occurrences of events or frequencies. After you use the alternate grounding of /Set (active low signal Set ), and /Reset to count one at a time, try counting by getting rid of the NAND gate and directly contacting the count input (the signal going to the inputs) with a ground wire after disconnecting it from the 74LS00 gate output. Can you get it to count only one step at a time? Pretty hard to do that! This is the bounce that we need to get rid of to count cleanly. All switches have some degree of bounce (generating multiple pulses instead of just one) unless circuitry has been added to debounce them. Now, take an input from the signal generator. Set the output to 2V amplitude and 2V offset. Confirm with the oscilloscope that the waveform is square between 0V and 4V. (We don t want Voltages below 0V!) Connecting the signal generator ground to the counter s ground, and the signal to the count input, you should see the counter count: rapidly at high frequencies (say, 1KHz), slowly at slow frequencies (say, 1Hz). 7.4 Frequency counter: Add the 555 timer (and a bit of additional circuitry), from part 1 earlier, to your circuit, to turn it into a frequency counter, as shown in Figure 7.9. The 555 output time low will be the count time, the time high will be the hold time. We will count for 1/10 second, and hold for a second or more. (Adjust or substitute for R1 in the timer circuit to get a hold time that you like.) The NAND gate turns the source of pulses from the Frequency source to be measured on or off: On for.1 seconds, and off for your hold time. (The fact that the output is inverted really doesn t matter.) The output of the LM555 timer is inverted (using a NAND gate as an inverter) so that the.1 second low phase is a high signal to the NAND letting pulses through. The high pass filter resets the timer by putting a pulse on / very briefly each time it starts to count. about 100KΩ Frequency Source Input (From signal generator or a second 555 timer running faster) Vcc = 5V 74LS00 t low = 4 8 100ms Res Vcc Dis Out 3 7 6 2 Thr Byp 5 Gnd.001µF 1 10µF LM555.01µF Vcc = 5V 74LS00 1N4148 signal (high pass filter) Figure 7.9 Frequency Counter EE283 Laboratory Exercise 7 - Page 6 Most (leftmost) Least (rightmost)

Use your frequency counter to count pulses from the signal generator. When the signal generator is set to 1 KHz, you should see 100 displayed. At 10KHz it should roll over to display 000 since we can t count to 1000. Try various frequencies. You can use this to adjust the variable timing resistor of your LM555 to get exactly 000 at 10KHz. (That s called calibration.) Now, add a second LM555 timer to be a signal source. Use a smaller capacitor so that it counts fast. You can use a 1KW potentiometer for R2 and make R1 relatively small, maybe 470W, so you can get a range of different frequencies, an octave or more. If you use a 10KW pot with 1KW for R1, you can get an even wider range of frequencies. To hear the sound, you can connect pin 3 of the LM555 to a small speaker using a series resistor of about 47 Ohms. (Too much smaller, and you may overdraw the LM555.) You now have a frequency counter with something built-in to count, and if you hook it to a speaker or earphone, you could conceivably use it to tune musical instruments! 7.5 Make it a digital Voltmeter (extra credit): Set the second LM555 to get an appropriate frequency. (You can tweak it later.) Figure, by how many Volts will the capacitor Voltage rise in 100 milliseconds? That s the maximum Voltage you will be able to display. (It depends on R and hoices.) The circuit below in Figure 7.10 then lets you measure an input Voltage. Put the Voltage source between ground and the Vin input. You don t need the signal generator; the second LM555 serves that purpose. You can use a potentiometer to generate a Voltage to measure. Note that a diode is used to discharge the capacitor during the hold time. To save having to use a different logic device, we use three NAND gates together as a 3 input NAND. The two diodes at the op-amp output and 1K resistor fix the problem with the LM741, with its negative power supply at ground, not being able to go low enough to generate a good logic 0 to shut off the NAND gate. (The power connections to the LM741 are not shown. If you use a negative supply of about -3V, this circuit should behave better. You can use 2 small cells for that, and your 6V battery for V CC.) about about 100KΩ Vin about 10µF Vcc = 5V 100KΩ 1.0 µf Vcc = 5V 4 8 10KHz Res Vcc Dis Out 3 Counted pulses 7 6 2 Thr Byp 5 Gnd 1 Count time.01µf control LM555 (variable).01µf Count Vcc = 5V Window Vcc = 5V t low = 4 8 100ms Res Vcc Dis Out 3 7 6 2 Thr Byp 5 Gnd 1 LM555.01µF LM741 + - 1N4148 1N4148.001µF signal (high pass filter) 1N4148 A/D converter reset 74LS00 (Currently LM741 power from Vcc and Ground) Figure 7.10 al Voltmeter circuit EE283 Laboratory Exercise 7 - Page 7 Most (leftmost) Least (rightmost)

Student Group Names: EE283 Measurement Lab Project #7 (al Counter / Timer) Report Date: Section: Lab Station: Report: 7.1: LM555 timer circuit: Show schematic for timer circuit used to produce the 100 millisecond counter window signal. Specify resistor nominal values used, and measured value of variable resistors. Show Timer circuit capacitor and output waveforms (seen on Pins 3 and 6 of the LM555). Show them as a properly annotated graph: EE283 Laboratory Exercise 7 - Page 8

7.2, 7.3: Counter operation: Was your counter able to count individual steps from the debounce circuit? Without the debounce circuit, how many steps did the counter step for one switch touch? (Give several samples) 7.4: Frequency counter: With a 100 Hz signal from the signal generator into your frequency counter, graph the waveform seen at the counter input (the clock to the counter devices). We want to see the windowing effect, so the time axis should show at least 150 milliseconds. What counter value is seen for the following signal generator settings? Counter value 100 Hz: 1000 Hz: 5000 Hz 10,000 Hz 12,000 Hz Show the circuit for your second (signal source) 555 timer, and the information asked: LM555 Circuit (with component values): Frequency from oscilloscope: Count by your counter: EE283 Laboratory Exercise 7 - Page 9

Part 5: al Meter (extra credit) Show the circuit (with power sources) used for your counter Voltage measurement circuit. (Do not include the counter itself.) What are the counter values for: a. 0 Volts in (counter value) b. minimum value of Voltage that causes counter value to rise: (Volts) c. maximum count and Voltage where that count is seen (Volts) d. Meter sensitivity (counts per Volt): e. Anything else you may do to modify / improve the meter: EE283 Laboratory Exercise 7 - Page 10