ECE 2A Lab #3 Lab 3 Waveforms and The Oscilloscope Overview Thus far we have focused on constant-voltage or constant-current measurements (DC). For time-varying signals the oscilloscope is an extremely valuable measurement and visualization tool. This lab will investigate the use of the Bench Function Generator to generate various types of time-varying signals, and will explore many features of the Bench Oscilloscope for observing time-varying signals in circuits. While modern digital scopes have simplified waveform measurements in some respects, it remains important for every self-respecting electrical engineer to understand the oscilloscope inside and out in order to use it intelligently. We will also introduce the diode and LED in this lab. Table of Contents Background Information Periodic Waveforms Coaxial Cables and Connectors Grounding Issues Pre-lab Preparation Before Coming to the Lab Required Equipment Parts List In-Lab Procedure 3.1 Basic Oscilloscope Operations Earth Grounding on the Scope Connectors? Waveform Display and Measurement Triggering for Periodic Signals DC Offsets, DC/AC Coupling Display Cursors 3.2 Probing Waveforms in Circuits The Diode Displaying Multiple Traces; Rectifier Circuit An LED Blinker Circuit 1 2 2 3 4 6 6 6 6 6 6 6 7 7 8 9 9 9 9 10 © Bob York 2 Waveforms and The Oscilloscope Background Information Voltage (or Current) Periodic Waveforms Electrical signals in real systems (telecommunications, computer data links, radar, etc) are often complicated, but superposition allows us express such signals as sums of mathematically simpler waveforms. Sinusoidal waveforms in particular play an especially important role in electrical engineering for this reason. Fourier series or Fourier transform methods provide the mathematical foundation for expressing arbitrary time-varying signals in terms of sinusoids. Furthermore, sinusoidal waveforms are naturally produced by the rotating electromagnetic machinery used in power generation (e.g. turbines in coal-fired plants, hydroelectric facilities, windmills, etc.), so sinusoidal waveforms also play an important role in AC power engineering and power transmission. But sinusoids are not the only simple waveforms that will be important in our studies. Square waves, pulse trains, exponential waveforms, and linear ramp waveforms also arise naturally in various circuits or situations. In general we distinguish between two types of waveforms: 1) periodic signals, those that repeat continuously over a very long time, and 2) transient signals, those that exist for a short time and eventually die off. Sinusoidal signals are clearly examples of periodic signals. The sudden burst of current in a light bulb when it is switched “on” is an example of a transient signal. This lab will focus on periodic signals. The function generator on your bench is designed to generate various types of periodic waveforms, and the oscilloscope is used for observing them. vmax v p p vave vmin T Time Figure 3-1 – An example of a periodic waveform and associated parameters. Figure 3-1 is intended as an example of a generic periodic waveform, annotated with certain important descriptive elements that are widely used to characterize such waveforms: the time period T ; the maximum and minimum values, vmax and vmin ; the “peak-to-peak” value, v p p vmax vmin ; and the average value, vave . It is important to note that these properties apply any periodic quantities, not just voltages, so the “v” in these variables could represent anything. The average value of the waveform is found by integrating the function over one period and then dividing by the period. vave 1 T t T v(t ) dt (1.1) t The starting point for integration doesn’t matter. The average value of the waveform is often referred to as a DC offset, since the waveform is shifted vertically by a constant (DC) value. © Bob York 3 Background Information The frequency of the signal is related to the time period. Experimentally the frequency f is usually expressed in hertz [Hz], or cycles per second, so f 1 / T . For sinusoidal signals it is also common to use a “cyclical frequency” which describes the total phase change per second. By definition a sinusoid goes through a 2 phase change in one period, which gives the following relationships (memorize these if you haven’t already!) 1 2 2 f [rad/s] (1.2) [Hz] T T We often talk about frequency in hertz but use in our analyses, so a common source of error is to forget the extra factor of 2 in the conversion. Try to remember that the units of are always radians per second, not hertz! Electrical power or energy is computed from the square of voltage and current. For this reason it is common to define another quantity called the RMS (root-mean-square) value, given by f vrms 1 T t T v 2 (t ) dt (1.3) t The average power can then be expressed easily in terms of the RMS value. For the special but important case of a zero-average sinusoidal signal with a peak amplitude of vmax , substituting v(t ) vmax sin t into (1.3) gives v vrms max for v(t ) vmax sin t (1.4) 2 In AC power systems the voltages and currents are almost always specified in terms of their RMS values. For example, the nominal voltage on the wall outlets in the U.S. is around 120V rms, so the actual peak voltage is 120 2 170 V . . Insulating jacket (PVC) Outer conductor/shield (foil/braided wire) Insulator (PE or PTFE) Center conductor BNC connectors Figure 3-2 – Coaxial cable construction and BNC connectors commonly used in instruments. Coaxial Cables and Connectors By now you should appreciate that at least two conductors are always needed for interconnecting circuits or measurement equipment. Multi-conductor interconnects are often called “transmission-lines”. For low-level and/or time-varying signals we often use a shielded conductor system which helps isolate the electrical signals from external interference and also prevents the signal from radiating away (an important consideration for highfrequency interconnects). Coaxial cables are a common and ubiquitous choice for two- 4 Waveforms and The Oscilloscope conductor interconnects, ad consist of a central conductor (usually solid copper wire) surrounded by a cylindrical outer conductor, with some insulating material in between (often PTFE, or Teflon). Such cables can be used for signals into the GHz range (“gigahertz”, where 1 GHz=109 Hz). Coaxial cables are designed for a specific characteristic impedance (in Ohms). For example, the cable TV connections in your home typically use 75Ω cables; for other instruments or higher frequencies 50Ω cables are more common. Your later coursework in electromagnetics or high-frequency communications will teach you more about transmissiontheory and how the characteristic impedance influences the electrical behavior of a system, but in ECE 2, the frequencies will generally be low enough that this parameter doesn’t play much of a role. It turns out that characteristic impedances in the range of 50-75Ω have very good power-handling and low-loss features, which is why those cable impedances are commonly used. Figure 3-3 – Comparison of coaxial connectors (source: www.fujikura.co.uk). Getting signals in and out of the cables efficiently proves somewhat challenging at highfrequencies so special connectors have been developed for certain applications. Figure 3-3 illustrates just some of the most commonly-encountered types for frequencies below 18GHz. You are probably familiar with the type-F connector found on most cable-TV boxes and connections. BNC connectors are very attractive for lab instruments because of their quickconnect “twist-and-lock” feature (no screw threads). The choice of connector ultimately limits the upper frequency range of a given cable. BNC connectors work well up to a few hundred MHz, and have become the de facto standard in most electronic labs and equipment. Grounding Issues In instrument connections the outer conductor on the coax/BNC connection is universally the reference node, and this is also usually connected to the instruments chassis (metal housing), and to earth ground through the instrument’s power cable. The inner conductor is then the signal of interest: e.g. the output signal of the function generator, or the signal to be measured © Bob York 5 Background Information by the oscilloscope. Our lab cables have red and black alligator clips added to the coax section – red to the inner and black to the outer conductor. Wall Outlet Function Oscilloscope Generator Ch1 Ch2 BNC BNC A Red Red R1 Coax Black Coax B Black R2 C Figure 3-4 – Example of an incorrect test setup. R2 is effectively shorted out in this measurement because both ends are connected to earth ground (the outer conductor of the BNC connectors are grounded via the power cords of the two instruments). An oscilloscope measures time-varying voltages. The measurements are therefore similar to an ordinary voltmeter measurement. However, unlike the DMM the oscilloscope reference is already internally connected to earth ground, and this has important and sometimes unintended consequences in measurements. Figure 3-4 shows an example. Here a simple voltage divider is attached across the output terminals of the function generator, and the oscilloscope is attached in a naive attempt to measure the voltage across R1 directly. However, this connection actually shorts out R2, because the outer conductors of both the function generator and oscilloscope are connected to earth ground via the power cords (shown as the dotted lines inside the instruments). To avoid this in the future we will always make the outer conductors of the instruments a common reference by connecting all the black leads on the coaxial cables to the same node in the circuit. If we need a DC power supply, we will attach the COM terminal to earth ground (using a jumper wire on the power supply). In this way all the oscilloscope measurements can be safely made with respect to the common (ground) node by simple moving the clip for the inner (red) conductor to various parts of the circuit. So, back to Figure 3-4, if we wanted to observe the voltage across R1 the correct way to do this would be to first make node C the common (ground) reference. We would then use a feature built into most oscilloscope that allows us to add or subtract the signals coming into channels 1 & 2. Thus if channel 1 is connected to node A and channel 2 to node B, subtracting the two signals would yield the voltage across R1. Of course these comments strictly apply only if the instruments are in fact connected to earth ground. This will always be true in our ECE 2 lab, but it is possible to make “floating” measurements, either by defeating the grounding of the power cord (not recommended!), or by using battery-powered instruments. 6 Waveforms and The Oscilloscope Pre-lab Preparation Before Coming to the Lab □ Read through the details of the lab experiment to familiarize yourself with the components and testing sequence. □ One person from each lab group should obtain a parts kit from the ECE Shop. Required Equipment ■ Provided in lab: Bench power supply, Function Generator, and Oscilloscope ■ Student equipment: Solderless breadboard, and jumper wire kit Parts List Qty 2 1 1 1 1 Description 1 k-Ohm 1/4 Watt resistor 100 k-Ohm 1/4 Watt resistor 1N4148 Diode Red LED, 725mcd @ 20mA Yellow LED, 725mcd @ 20mA If the 1k resistors are not in your kit, you should have some leftovers from lab #1. Alternatively you can substitute the 510Ohm resistors from Lab #2. In-Lab Procedure Read the instructions carefully. If you skim through the text too quickly you may miss something important. □ Each critical step begins with a check box like the one at the left. When you complete a step, check the associated box. Be sure to document all steps and results in your notebook for inclusion in your lab report. 3.1 Basic Oscilloscope Operations The overriding goal here is to make you aware of the many features on the scope which will be crucial for success in ECE 2 and beyond. This lab is the ONLY time we will discuss the operation of the scope in this much detail, so it is critical that you pay close attention. The key impediment for students nowadays is undoubtedly the “AutoSet” button. Beware of this button! It may often be a reasonably thing to press at the start, but the more you rely on it the less chance you will have of ever understanding waveform measurements and making intelligent use of the oscilloscope in the future. Earth Grounding on the Scope Connectors? □ With the oscilloscope and function generator off, check for continuity between the reference terminals of the oscilloscope and function generator. These are the metallic © Bob York Basic Oscilloscope Operations 7 outer barrels of the Ch 1 and Ch 2 BNC terminals of the scope and the “Main Out” BNC terminal of the function generator. Recall that a continuity check is just a resistance measurement where any low number of ohms constitutes a connection. Now check continuity between any of these terminals and the Ground terminal of the power supply (temporarily disconnect the jumper wire between COM and Ground). Are they all connected? (The correct answer is “yes”!) Temporarily unplug the function generator to verify that the earth ground connection is through the power cords. Waveform Display and Measurement Connect the Function Generator’s Main Output to Channel 1 of the oscilloscope – red to red and black to black. For later convenience, attach the alligator clips to wires on your breadboard, rather than directly to each other. □ Set the function generator to output a 1 kHz, 4 V peak-to-peak amplitude, sine wave. Make sure the DC Offset knob is pushed in, and that the Main 0.2 Vp-p button is out. Press the Ch1 menu button on the scope and select the follow: DC coupling, BW Limit off, Probe 1x, and Invert off. Adjust the scope’s time scale, SEC/DIV knob, to get 2-3 cycles of the waveform displayed (you can estimate this from the signal frequency). □ Press the Measure button to bring up the scope’s measurement screen. Set the measurement boxes to use Ch1 as the source, and select Freq, Cyc RMS, Pk-Pk, and Mean as the measurement types. Record the values shown. □ Configure the DMM as a voltmeter and connect it to the function generator output along with the scope – COM to ground and V/Ω to signal out. Record and compare the voltmeter readings for AC and DC volts. Change the function generator to triangle, and then to square wave, comparing the DMM to the scope. Do the two instruments compute the same RMS value? Which is closest to the theoretical value for the amplitude? □ Does frequency measured by the oscilloscope match the frequency in the function generator display? Measure the period of the sinewave by counting divisions, and compute frequency as 1/T. Do you agree with the scope? Change the measurement type of one of the measurement boxes to Period. Are the scope’s period and frequency measurements self consistent? □ Use the Horizontal position knob to move the waveform left and right, and then leave it centered. Notice the black arrow at the top of the screen, and the M Pos readout that tells you how far off center you are. Likewise use the Vertical position knob to move the trace up and down, and then leave it centered vertically. Do any of the measurement values change when you adjust the horizontal or vertical position? Triggering for Periodic Signals Oscilloscope triggering is probably the most important yet misunderstood aspect of oscilloscope operation. The scope can only display a finite time interval on the screen, set via the “SEC/DIV” knob. After it finishes recording and displaying the waveform for some time interval it has to start over again for the next time interval. Consequently, to create a still image on the screen the scope has to start recording/plotting the waveform at the same point within the signal period each time. This is the trigger point, and is set as a certain threshold voltage (Trigger Level) and Slope (Rising/Falling): □ Press the Trigger button to access the scope’s trigger menu. Select Edge, not Video, Slope Rising, Source Ch1, Mode Auto, and Coupling DC. Be sure you still have 2-3 8 Waveforms and The Oscilloscope cycles of the waveform visible on the screen. Notice the black trigger arrow on right of screen. Adjust trigger level using the Trigger Level knob. What relation is there between the level of the trigger arrow and the value of the waveform at time zero, v(t 0) ? □ Change Slope to “Falling”. What changes? Now change the trigger level; is the relationship between trigger level and v(t 0) the same as before? What happens if trigger-level raised beyond amplitude of the trace? Notice the “T Trig’d” at the top changes to “R Auto”. □ Press Run/Stop. What happens? Notice the Stop sign. Press Run/Stop again. With the trigger level still greater than the signal amplitude, change the trigger Mode to Normal. The trigger status is now “R Ready”. Adjust the trigger level back down to 500mV. □ Press AutoSet.. What all changed? Lesson: Don’t press AutoSet unless you’re prepared to have all your settings changed! □ Adjust the function generator to make the output peak-to-peak 1.0V. Make sure you have a triggered, stable display, then disconnect the scope ground (black clip) from the function generator ground. Is it still stable. □ Reconnect the ground. Press the 0.2Vp-p button on the function generator. Verify that you now have a peak-to-peak amplitude of 100mV. 20mV/Div would be a good vertical sensitivity for viewing this waveform. Try to get a triggered, stable display, then disconnect the scope ground again. Does anything happen? Press Run/Stop to get a look at the signal. Spread it out in time with the Sec/Div knob if you like. Differences in the ground references inside the function generator and inside the oscilloscope lead to unpredictable results in the last step. Some people have trouble seeing waveforms and others won’t. Even though we verified with the ohmmeter that these nodes are connected to each other, and to earth ground, it isn’t always a reliable low-resistance connection and is susceptible to interference from a variety of sources. So we make the connection reliable and stable by connecting them externally—black alligator clip to black alligator clip. Measurements of small signals in really high-speed circuits, like radio receivers, need even better ground connections. □ Reconnect the ground and change the trigger coupling to HF Reject. Is it easier to trigger with HF Reject selected? Try the other coupling options. DC Offsets, DC/AC Coupling This is also an important section. If we ask you to create a waveform with a certain DC offset as part of a lab next quarter in ECE 2B, “I don’t remember how” will not be an acceptable response! Similarly if we ask you to observe a small-amplitude AC signal riding on a large-amplitude DC offset, “I can’t see the signal on the scope” will not be acceptable! □ Reset the function generator to the original signal – 1 kHz, sine wave, 4V pk-to-pk. Get a stable display showing 2-3 cycles of the waveform, triggering at the zero level, rising, using Auto mode. Press the Measure button to get the measurement screen. Select AC volts on the DMM. Compare the scope’s Cyc RMS measurement to the DMM’s AC voltage. Pull out the DC Offset knob on function generator. Adjust until Ch1’s Mean =1.0V. Did the DMM AC volts change? How about the Cyc RMS value? □ Press the CH 1 menu button. Change coupling to AC. Press measure. Now what is Cyc RMS? Mean? What can you conclude about how the scope and DMM measure RMS of a sinewave with a DC offset? © Bob York Probing Waveforms in Circuits □ 9 Put the DMM in DC volts mode and dial in various DC offsets. Does the scope’s display change when the offset changes? Switch Ch1 back to DC coupling. Push in the DC offset knob on the function generator. What happens to the offset? Display Cursors □ Set the function generator to produce a 1kHz, 0 to 5V square wave. This means the lowvoltage level is 0, or ground level, and the high voltage level is +5V. Trigger on the rising edge of the square wave. Expand the display using the Sec/Div knob to get a good view of the rising edge. □ Press the Cursor button on the scope to bring up the cursor menu. Select Time as the cursor type and measure the rise time of the square wave. This is the time required for the voltage to change from 10% of the final value to 90% of the final value. Note that the vertical position knobs are used to adjust the cursor levels. □ Change the cursor Type to Voltage and measure the overshoot. That is the amount the signal rises about the final value (5V) before settling. □ Press the Measure button and change one of the measurement boxes to Rise Time. Does the scope get the same answer you did? □ Change the measurement to Fall Time? Is there a reading? Change the Trigger slope to trigger on the falling edge. Now is there a Fall Time? 3.2 Probing Waveforms in Circuits The Diode In this step we introduce the diode, a Diode nonlinear component that will be used to Anode Cathode create a simple wave-shaping circuit and make the oscilloscope measurements a little Band marks cathode on diode package more meaningful and interesting. The diode symbol and a representative package are shown in Figure 3-5. A diode is the electronic equivalent of a one-way street, Figure 3-5 – Diode symbol and typical package. allowing significant current flow in only one direction indicated by the arrow in the symbol. If the anode has a higher voltage than the cathode, current can flow. If the voltage polarity is reversed, very little current can flow. There is usually a band indicating the cathode side of the device on the package. Displaying Multiple Traces; Rectifier Circuit Diodes will be discussed in detail in ECE 2B, you do not need to know much about them for 2A labs. When a diode is used in circuits with time-varying bipolar voltages some interesting effects can be observed because the diode will respond differently to the positive and negative parts of the waveforms. In such cases it is helpful to use the oscilloscope to observe both the input and output waveforms simultaneously. By overlaying the input and output waveforms we can get an immediate visual impression of how the circuit is functioning. 10 □ □ Waveforms and The Oscilloscope First set the function generator to produce a 5V amplitude, 1 kHz sine wave, with zero DC offset, and connect it to a series diode/resistor circuit as shown in Figure 3-6. Connect channels 1 and 2 of the oscilloscope as indicated. Using the Ch 2 menu button, verify that Channel 2 is set for DC coupling. CH2 1N4148 CH1 Function Generator 100 kΩ GND Press AutoSet to get an initial acquisition of the two waveforms. If both Ch1 and Ch 2 are not displayed, press the menu button of Figure 3-6 – Simple diode “rectifier” circuit the one which isn’t. You can alternately press the Ch 1 and Ch 2 menu buttons to see how to remove or recall a trace from the display. □ Using the Volts/Div knobs set both channels to the same vertical scale. Using the vertical position knobs center both traces; that is, put the zero reference level exactly at the center. Notice the two black arrows on the left of the screen, indicating where these are. Sketch the resulting waveform. Can you explain the waveforms based on the simple statement above describing the operation of the diode? □ What RMS values do the scope and DMM make for the waveform of channel 1? This is called a half-wave rectified signal. □ Pull out the DC offset knob and adjust the DC offset of the function generator. Can you get an entire sine wave to appear on the resistor (channel 1)? What DC offset is required? Zero the DC offset (push in the knob). □ You may notice that the full input signal does not appear on the resistor – there is some voltage drop on the diode. To see this in greater detail, lower the amplitude of the Anode function generator output to 1V. Change the vertical sensitivity of both channels to LED 500mV/div, making sure the zero reference Cathode for each is still the same. Sketch what you see. □ Now press AutoSet. What happens? Again, the important lesson here is: Don’t press AutoSet unless you’re prepared to have your settings changed! An LED Blinker Circuit A light-emitting diode (LED) is just that: it is functionally equivalent to any other kind of diode, but emits light when current flows through it. The LED symbol and package information is shown in Figure 3-7. © Bob York Flat on cathode side Anode (long) Cathode (short lead) Figure 3-7 – Light-Emitting Diode (LED) and symbol 11 Probing Waveforms in Circuits □ □ Return the function generator amplitude to 5V and build the circuit shown in Figure 3-8. Leave the frequency at 1kHz for now. Set channel 1 and 2 once again to have the same V/div and the same zero reference position. Both LEDs should be on, Red Yellow although probably not with equal Func. brightness. CH1 CH2 Gen. Adjust the DC offset until the LEDs appear equally bright. What offset is required? From this, which LED would you say is more efficient? □ 1 kΩ 1 kΩ GND Now reduce the function generator Figure 3-8 – LED circuit. frequency to 1 Hz. Explain what you see visually and reconcile this with your oscilloscope waveforms. Do you understand why both diodes appeared to be simultaneously “on” when the generator was at 1kHz? Congratulations! You have now completed Lab 3 As noted in the previous lab: keep all your leftover electrical components! Specific Discussion Items for Lab Report Much of this experiment was tutorial in nature, guiding you through the various steps required to use the oscilloscope and function generator effectively. You do not need to report on every single step! Some specific ideas for the report might be as follows: ■ ■ ■ ■ ■ Re: grounding issues, be sure you understand what is going on in Figure 3-4 and the ramifications of the internal earth grounding of the oscilloscope inputs. Re: Oscilloscope triggering: what happens when the triggering threshold is larger than the waveform amplitude? Can you explain why? Re: Section on DC Offsets: Calculate the average and RMS values of the 4V peak-topeak sinewave with and without the 1V DC offset. Compare with the measurements taken with the scope and DMM. Re: Display Cursors: Report the rise and fall times measured on the square wave. Calculate an average and RMS value for the square wave used in this section. Re: Diode Circuits: You measured what was referred to as a “half wave rectified” sinewave. Explain the waveform observed based on the simple statement above describing the operation of the diode. Sketch or print out the waveform. Report the peak value that you measured, compare with the amplitude of the function generator output, and calculate the average and RMS values of this signal. Based on your measurements, what is the voltage drop across the diode when it is conducting? Explain why a complete sinewave could be observed on Ch. 1 when the DC offset was applied.