[ECEN 1400] Introduction to Digital and Analog Electronics R. McLeod Lab #2: Capacitors and the 555 Timer 1 Introduction The goal of this lab is to introduce capacitors in their role as elements of timing circuits and to convert an analog oscillation into a digital oscillation with a simple timer IC. For your convenience, things that should be included and discussed in your report are introduced in a unique color. 2 Components and Tools Required • From Your Kit: Breadboard Wires Wire Cutters and Pliers Various Resistors and Capacitors A Cat • From Your TA: A 555 Chip • On The Lab Bench: Variable DC Power Supply Function Generator Oscilloscope 3 Meet your New Instruments 3.1 Function Generator The function generator allows you to create time-varying voltages with different shapes and frequencies. Although the waveform generator has many capabilities, we will concentrate on a few of the main ones that are common to most waveform generators. The main parameters for specifying the waveform are: • Frequency (or its inverse, Period) • Shape (e.g. square, sinusoidal) • Amplitude (the magnitude of the signal in volts) Figure 1: Function Generator Version 2.0, September 10, 2014 Page 1 [ECEN 1400] 3.1.1 Introduction to Digital and Analog Electronics R. McLeod Changing the frequency First, we will change the frequency of the to 4 kHz. To change the frequency, push the PARAMETERS button, then the frequency soft-key. Type in a frequency on the keypad or change it with the knob, then finish by selecting units with the soft-keys. See Figure 2 for these steps. (a) First, select parameters. (b) Selecting frequency. (c) Adjust the frequency with the keypad or knob. (d) Select the units with the soft keys. Figure 2: Changing the frequency of a function generator. 3.1.2 Changing the waveform shape The second aspect of the waveform is its shape. Change the waveform shape to a square wave. This generator can produce a large number of shapes including ones supplied by the user. Press the WAVEFORM button and select the square wave. (a) First, press waveform. (b) Then, select square wave. Figure 3: Changing the waveform of a function generator. Version 2.0, September 10, 2014 Page 2 [ECEN 1400] 3.1.3 Introduction to Digital and Analog Electronics R. McLeod Changing the amplitude and offset. Change the peak-to-peak amplitude to 5 V. This means that the voltage will swing from +2.5V to -2.5V. Press the UNITS button and use the soft-key to make sure you are in the Amp/Offs (amplitude and offset) mode, not the High/Low mode. Set the Vpp amplitude to 5 V and the offset to 0 V. (a) First, press the soft key for ampli- (b) Then, input 5 and select the units of (c) Lastly, set the offset in parameters tude. volts. to be 0 V Figure 4: Changing the amplitude and offset of a function generator. Change the output termination. Like voltmeters and ammeters, the resistance of the source matters. This is a detail you will learn in later classes. For now, press the CHANNEL key to open the channel configuration screen. Press Output Load, then Set to High Z as shown in Figure 5. (a) First, press the soft key for channel. (b) Make sure the output load is Set to HIGH Z. Figure 5: Changing the output impendance of a function generator. Now you need some way to see if you have the waveform you want. That brings us to the oscilloscope. Version 2.0, September 10, 2014 Page 3 [ECEN 1400] 3.2 Introduction to Digital and Analog Electronics R. McLeod Oscilloscope An oscilloscope (or scope for short) is used to display a waveform or trace. This particular oscilloscope has the ability to show 4 different traces simultaneously. The connectors for the four channels are in the lower right-hand side of the picture. You will use the oscilloscope probe found in your lab kit for connecting your circuit to the scope. Figure 6: Oscilloscope Turn on both the function generator and the oscilloscope. Connect the oscilloscope to the function generator. At this point, you will probably not see anything displayed. (a) This is a scope probe. The pointy bit is positive and the (b) This is a BNC-to-banana plug clip is negative. adapter. Figure 7: Identifying the connectors to be used. (a) Plug the end of your scope probe into channel 1 of the oscilloscope. (b) Plug the BNC end of your BNC- (c) To complete the circuit between the to-banana plug adapter into function generator and the oscillochannel 1 of the function generator. scope, we must connect the ends. Figure 8: Hooking up the function generator and oscilloscope together. Version 2.0, September 10, 2014 Page 4 [ECEN 1400] Introduction to Digital and Analog Electronics R. McLeod To view an output of your function generator on the oscilloscope, you have to turn the output ON. (a) First, select the soft key channel. (b) Then, toggle the output to ON. Figure 9: Turning on the output of the function generator. With the older scopes, you would now start the process of finding the trace, however you are luckier. Press the AUTOSCALE button. You should see a square wave on the screen with voltage on the vertical axis and time on the horizontal axis. Figure 10: Finding the AUTOSCALE button. Set the trigger level. The trace should be stationary on the screen, which means that the scope has detected the rising edge of the square wave and placed it in the same place on the screen each cycle. Without this triggering, the trace will sweep randomly in the time axis. This is controlled by the trigger level, set with the knob on the right-hand side of the scope. Use the TRIGGER LEVEL knob to change the function voltage which the triggers the scope to reset the plot on the screen. You should see an indicator on the main screen move. Examine what happens when the trigger level is outside of the voltage range of the function generator. Figure 11: Finding the TRIGGER LEVEL button. Version 2.0, September 10, 2014 Page 5 [ECEN 1400] Introduction to Digital and Analog Electronics R. McLeod Set the time and voltage scales. The AUTOSCALE function has picked time and voltage increments for you that are probably reasonable. But you should know how to change them. Find the Horizontal and Vertical controls. There is a large knob for scale and a small knob for offset on each. Adjust these to understand what they do. If you lose the trace, just use AUTOSCALE again to get things back. Pick appropriate scales for the time and voltage increments and record them. (a) Find the HORIZONTAL knob. (b) Find the VERTICAL knob Figure 12: Locating the horizontal and vertical adjustment knobs. Measure features of your function. Older, analog scopes were capable of displaying traces and not much more. This digital scope can do much more. One very useful feature is measuring various quantities. Press the MEASURE button, then either the VOLTAGE or TIME soft-keys. Find the VOLTAGE PEAK-TOPEAK and FREQUENCY), then change them on the function generator to confirm that they track on the scope. Note that you need at least one period of the waveform on the scope for the measurements to be performed correctly. (a) First, press the MEASURE (b) Use the side screen soft keys softkey. to select VOLTAGE. (c) Then, scroll with the selection knob (shown) and push when Vpp is highlighted. (d) Select the TIME measure- (e) Lastly, select ments. QUENCY. FRE- Figure 13: Measuring the voltage peak-to-peak and frequency of the signal. Version 2.0, September 10, 2014 Page 6 [ECEN 1400] 4 Introduction to Digital and Analog Electronics R. McLeod The Capacitor Now lets combine these two new instruments with a circuit to do something useful. Build and take measurements from RC circuit. Construct the circuit below using a 2.2 kΩ resistor and a 0.0047 µF (or 4.7 nF) capacitor from parts in your lab kit. Now set the waveform generator to produce a 5 Vpp square-wave, with a 50% duty cycle. Set the frequency to 5 kHz. Record the parameters of the signal from your function generator. Remember to put (or keep) the waveform generator in High Z mode. Connect the oscilloscope across the waveform generator just to double check you have the waveform you expect. Figure 14: A Simple RC Circuit Now connect the oscilloscope across the capacitor, so you can measure the voltage as it changes. If you have a second probe, keep one on the source and use a second for the capacitor voltage. Keep the probe wired to the waveform generator connected to the input marked 1. Wire the second probe across the capacitor and connect it to the scope input marked 2. Save an image of the screen to a USB memory stick. Insert a USB stick into the front-panel and press the SAVE/RECALL button. In the Storage menu, press Storage. Continue to press this button or use the entry knob to select a graphics file format (PNG is a good choice). If you want to save the scope parameters, press Para Save. Press External to access your USB stick and navigate to the desired folder. Finally, create a New File and press Save. Check and record the RC time constant. Using either the measurement traces on the scope screen or your saved image, find the amount of time a decreasing voltage level takes to fall by e-1 = 36.8% or a rising voltage level grows by 1- e-1 = 63.2%. Measure and Record the actual resistance of your 2.2 K resistor and compare your measured time to the calculated RC time constant. Observe the impact of increasing frequency. Now double the frequency of the square-wave to 10k Hz. Again, save an image of the waveform for you lab report. Does the overall frequency of the voltage across the capacitor change? What happens to the amplitude of the voltage across the capacitor as the frequency increases? Try increasing the frequency once again, this time to 15 KHz. What happens to the shape of the waveform? This is the basis of filtering in which different frequencies in a waveform can be enhanced or suppressed. 5 The 555 Timer As A Digital Oscillator Now we will use the rising and falling time response of a charging and discharging capacitor to make a charge/discharge digital oscillator. Build and take measurements from timer circuit. Get a 555 timer chip from your TA and assemble the circuit below. Discuss how you built the circuit and include a picture of what you’ve built. Place a scope probe between RB and C1 (or pin6 or 2) and a second scope probe on the chip output, pin 3. Version 2.0, September 10, 2014 Page 7 [ECEN 1400] Introduction to Digital and Analog Electronics R. McLeod Figure 15: Astable 555 Timer Circuit Measure and describe your timer performance and include screen capture of its output. When you have a square wave emerging from your timer, accurately measure the high and low voltages, the high and low times and the frequency. How accurately would you be able to predict this frequency from the nominal resistance values? (hint, check the data sheet) Is accurate enough to be used in your clock? 6 6.1 Extra Credit: 10 Points Max More Blinking Lights Select new resistors and a capacitor for your 555 timer to decrease the frequency to several Hz. Drive an LED with the output if you dont have enough current, you may need to use your transistor driver circuit from the next lab. Congratulations, youve made a bike light! 6.2 Build A High Pass Filter The RC circuit of step 4 is called a low-pass filter because it passes low frequencies and blocks high frequencies, as you found. Now flip the positions of the resistor and capacitor and measure the voltage across the resistor. You now have a high-pass filter. Examine both the shape of the waveform and the amplitude as a function of frequency and try to understand it. In particular, look at relatively low frequency square waves and examine what happens when the square wave transitions from one voltage to another. Version 2.0, September 10, 2014 Page 8