University of California Berkeley Department of Electrical Engineering and Computer Sciences EECS 100, Professor Bernhard Boser LABORATORY 6 v3 TIME DOMAIN Inductors and capacitors add a host of new circuit possibilities that depend on their ability to remember, i.e. to store energy, and thereby signals and information. In this laboratory we will use capacitors to build timer circuits. Timers have a many uses. Applications in include circuits that automatically turn off lights or equipment after a specified period, (annoying) flashers that make lights blink, or synthesizers used in sirens or electronic organs. Timers are also used by other electronic circuits, for example as computer clocks. In fact, the 555 timer circuit used in this laboratory is one of the most successful ICs ever: Designed 1970 by Hans Camenzind at Signetics (later Philips and now NXP) and introduced 1971 (the same year Intel introduced its first 4-Bit! microprocessor executing up to 60,000 instructions per second), sales are still strong with over 1 billion units sold each year! Tell me if you can think of other people who invented something single handedly with similar success and longevity. That Intel microprocessor has long been relegated to museums. The notorious RC charging and discharging circuit that is at the basis of so many homework and exam problems is also at the center of many timer circuits (exams are practical, after all). For example, the time it takes to charge a capacitor to, say, 2/3 the supply voltage can be used to delay turning on a device. Likewise, discharging a capacitor from 2/3 VCC to 1/3 VCC sets the time to turn a device off. Combine these two circuits and you have a clock turning on and off at a rate set by a capacitor and resistors. Turing this simple idea into a complete electronic circuit calls for several functions in addition to the capacitor and charging and discharging resistors. Switches are used to alter between charging and discharging cycles. Comparators determine when a certain voltage level has been reached. Altogether quite a few components are needed to build that timer circuit. The 555 timer includes all these functions in an 8-pin package. The circuit diagram of the 555 is reproduced below: Page 1
The figure below illustrates the different functions realized by the chip. Three resistors establish the reference voltages supplied to two comparators (the amplifier-like symbols with a thresholding sign). The flip-flop is a 1-Bit memory. A pulse on the R input sets the output to VCC where it stays until a pulse is applied to the S input after which the output switches to ground. The ground state is also stable: only a renewed pulse on R turns the output back on. The discharge switch uses negative logic: it is on when the output is low, and off when the output is high. The circuit below shows how the 555 timer can be configured as an oscillator. Suppose that the output is high and, consequently, the discharge switch turned off. The capacitor charges through R A and R B and the voltages V 1 and V 2 rise. When V 2 reaches the control voltage (2/3 of V CC ), the flip-flop is reset and the output goes low. The discharge switch turns on and V 1 is immediately pulled to ground. Because of the flop-flop the output stays low and the discharge switch on. The capacitor now discharges through R B. into node V 1, which is held at ground by the discharge switch. When V 2 reaches the threshold of the bottom comparator (1/3 V CC ), the flip-flop is set high again and the process repeats. Page 2
The figure below illustrates the output and the voltage across the capacitor for several cycles. An excellent tutorial can be found online: http://www.uoguelph.ca/~antoon/gadgets/555/555.html Page 3
Lab Session: LAB REPORT Name 1: Name 2: SID: SID: 1. Electronic Toy Organ Let s derive an equation for the frequency of oscillation of the timer circuit shown in the guide. It is practical to calculate the charging time t 1 and discharging time t 2 independently. The total time for each cycles is then T=t 1 +t 2 and the frequency of oscillation is f=1/t. The charging interval starts when V 2 =V CC /3 and V out goes high. The discharge switch opens and V 1 goes to a voltage between V 2 and V CC set by R A and R B. Derive and expression for V 1 at the start of the charging interval. Express in terms of V CC, R A, and R B. Expression for V 1 : Now the capacitor charges through until V 2 =2/3V CC.. Derive an expression for t 1, the time it takes for V 2 to increase from V CC /3 to 2/3V CC. Express in terms of R A, and R B. Expression for t 1 : Now the output turns low and the discharge switch is on. Derive an expression for the time t 2 it takes V 2 to discharge to V CC /3. Express in terms of R A, and R B. Expression for t 2 : Finally combine your results to calculate the frequency of oscillation. Expression for f: For C=10nF, calculate the values of R A and R B that result in f=10khz and t 1 =2t 2. R A = Page 4
R B = Round to the nearest available resistance value. Perform a transient analysis in Multisim to verify your result. Turn in a copy a plot showing V out, V 1, and V 2 as a function of time. Note that Multisim has a built-in component for the 555 timer. Multisim output of 10 P Now build the timer circuit in the laboratory. Power it from a 5V supply and check the waveforms with the oscilloscope. Explain discrepancies with the simulation: Comparison of circuit with simulation of 3 M Now connect a speaker to the timer output. Replace R A with a potentiometer to adjust the frequency and start playing your favorite tune. Since this simple organ will not win a beauty contest the winner is who makes the ugliest noise. Play your results to the ears of the TA. Have them sign your lab report. Tone generator of 7 M Page 5
2. Function generator The timer circuit produces square waves. Often other waveforms are required. Analyze the circuit below and sketch the output waveform (neglect the 1MΩ resistor; come to the office hours if you would like to find out what it is for). Verify your result with Multisim and turn in a plot of the waveform. Adjust R x and C x such that the output amplitude is 2V peak to peak for a 10kHz timer output. Note that there is more than one solution, pick one for which you have the (approximately) correct component values. Power the opamp from a ±5V supply and the timer from +5V. Function generator (Multisim) Function generator (lab) of 10 P of 10 M Page 6
SUGGESTIONS AND FEEDBACK Time for completing prelab: Time for completing lab: Please explain difficulties you had and suggestions for improving this laboratory. Be specific, e.g. refer to paragraphs or figures in the write-up. Explain what experiments should be added, modified (how?), or dropped. Page 7
Lab Session: PRELAB SUMMARY Name 1: SID: Summarize your prelab (P) results here and turn this in at the beginning of the lab session. Attach MultiSim schematic and plots for problems 1 and 2. Problem 1 V 1 Result t 1 t 2 F R A R B Multisim output 2 Multisim output of 10 P of 10 P Page 8