Lab # 1 Introduction To Instruments. (Digital Oscilloscope and Digital Function Generator) and Software Ltspice
Lab # 1 Introduction To Instruments. (Digital Oscilloscope and Digital Function Generator) and Software Ltspice
(Digital
Oscilloscope and Digital Function Generator) and
Software LTspice
Objectives
Basic understanding of creating arbitrary waveforms using function generator.
Pre-Lab Assignment
This Lab has no Pre-Lab Assignment.
Introduction:
Oscilloscope
An oscilloscope is a graph displaying device. It is used to visualize time-varying electronic
signals on a screen. The signals are graphed using an analog circuitry or a digital apparatus.
Analog Oscilloscope:
It works on the functionality of Cathode Ray Tube (CRT). A beam of electrons is made to fall on
a screen where it becomes visible as a bright blue dot. The beam is then moved along a
horizontal line using a saw-tooth voltage applied along the horizontal axis. The fast moving dot
gives the appearance of a blue line. Then the signal to be graphed on the screen is applied
vertically so that the beam of electrons moves in a vertical access accordingly. The result is a
plot of the time varying applied signal on the oscilloscope screen.
Digital Oscilloscope:
It works on the functionality of Analog-to-Digital (A/D) converter. The applied input analog
signal is sampled at a high rate; the received samples are then plotted on the screen.
Digital Oscilloscopes have some obvious benefits over analog counterparts. The advent in digital
circuitry has made the oscilloscopes cheaper. Moreover the sampled signal in a digital
oscilloscope can be stored in memory, can be easily modified or transferred to a computer for
further analysis. In this lab we shall conduct all experiments using digital oscilloscopes.
However it is advised that engineering students should get hands-on experience on both types of
oscilloscopes.
In our lab (i.e. Electronics Lab: CIIT Islamabad) we shall work with Agilent 3000 Series
oscilloscopes.
This feature requires an input frequency at least 50Hz and a duty cycle at least 1%.
Input a Signal:
Use one of the supplied passive probes to input the signal into one of the channels of the
oscilloscope.
Using the Run Control Buttons:
There are two buttons for starting and stopping the oscilloscope’s acquisition system:
Run/Stop and Single.
When the Run/Stop button is red, data acquisition is stopped. To start acquiring data,
press Run/Stop.
Horizontal Scale:
The horizontal controls consist of:
The horizontal scale knob — changes the oscilloscope’s time per division setting using
the center of the screen as a reference.
The horizontal position knob — changes the position of the trigger-point (trigger is
explained in the subsequent section) relative to the center of the screen.
The Main/Delayed button ( We shall not use this button in this lab: For details of this
feature refer to the user manual of the device)
Turn the horizontal scale knob to change the horizontal time per division (time/div)
setting. The time/div setting changes in a 1- 2- 5 step sequence. The time/div setting is
also known as the sweep speed.
Push the horizontal scale knob to toggle between vernier (fine scale) adjustment and
normal adjustment. With vernier adjustment, the time/div setting changes in small steps
between the normal (coarse scale) settings.
The time/div setting is displayed in the status bar at the bottom of the screen.
Triggering:
The trigger determines when captured data should be stored and displayed. When a trigger is set
up properly, it can convert unstable displays or blank screens into meaningful waveforms. When
the oscilloscope starts to acquire a waveform, it collects enough data so that it can draw the
waveform to the left of the trigger point. The oscilloscope continues to acquire data while
waiting for the trigger condition to occur. After it detects a trigger, the oscilloscope continues to
acquire enough data so that it can draw the waveform to the right of the trigger point.
Edge — can be used with analog and digital circuits. An edge trigger occurs when the
trigger input passes through a specified voltage level with the specified slope.
To adjust the trigger level, turn the trigger Level knob. Two things happen: The trigger
level value is displayed at the lower left- hand corner of the screen and a line is displayed
showing the location of the trigger level with respect to the waveform (except when
using AC coupling or LF reject coupling modes).
Push 50% to set the level at 50% of the signal’s vertical amplitude.
To make an acquisition even if no valid trigger has been found: Press Force.
Forcing a trigger is useful, for example, when you want to display the DC voltage of a
level signal.
Vertical Controls
The channel (1, 2), Math, and Ref buttons — turn waveforms on or off (and display or
hide their menus).
The vertical scale knobs — change the amplitude per division setting for a waveform,
using ground as a reference.
The vertical position knobs — change the vertical position of the waveform on the
screen.
Pressing the channel (1, 2), Math, or Ref buttons have the following effect: If the waveform
is off, the waveform is turned on and its menu is displayed. If the waveform is on and its
menu is not displayed, its menu will be displayed. If the waveform is on and its menu is
displayed, the waveform is turned off and its menu goes away.
Turn its vertical scale knob to change the amplitude per division setting. The amplitude/div
setting changes in a 1- 2- 5 step sequence from2 mV/div to 10
Push its vertical scale knob to toggle between Vernier (fine scale) adjustment and normal
adjustment. With Vernier adjustment, the amplitude/div setting changes in small steps
between the normal (coarse scale) settings.
The amplitude/div setting is displayed in the status bar at the bottom of the screen.
Adjusting their vertical position lets you compare waveforms by aligning them above one
another or on top of each other. When an input channel waveform is on: Turn the vertical
position knob to change the vertical position of the waveform on the screen. Notice that the
ground reference symbol on the left side of the display moves with the waveform.
Notice that, as you adjust the vertical position, a message showing the position of the ground
reference relative to the center of the screen is temporarily displayed in the lower left- hand
corner of the screen.
To specify channel coupling, if the channel’s menu is not currently displayed, press the
channel button (1, 2). In the Channel menu, press Coupling to select between:
AC — blocks the DC component of the input waveform and passes the AC component.
Function Generator
A function generator is a device to generate arbitrary time varying waveforms. It is used for
testing and designing circuits in a lab environment. The function generator used in this lab is
Agilent 3320A.
Generating a Signal:-
Turn the power on and press the output key.
Enter a value of 2 using numeric keypad and then choose units to be kHz. We can also
specify time period instead of frequency if we press the “Freq” soft key and then specify
the time period.
Similarly press the Amplitude soft key to enter amplitude and offset soft key to enter DC
offset.
The units can be changed by pressing first the +/- key and then entering new units.
Similarly by pressing the square, ramp, pulse etc keys we can generate arbitrary
waveforms of different characteristics.
In-Lab
Task 1:-
Turn on Oscilloscope and Function generator.
Note down the values of Channel 1 status and Time base status on the oscilloscope
screen. Write them down in the table.
Generate a sinusoidal wave of 2 KHZ and 5Vp-p. Connect the signal using probes to the
oscilloscope. Press Auto Scale.
Press channel (1) button, make sure from the menu that coupling is DC, bandwidth limit
is off and probe is set at (1X).
Play with the horizontal and vertical position and scale knobs and try to understand their
effect. Finally auto-scale again.
Note down the new values of Channel 1 Status and Time base Status. Interpret the graph
displayed using these values.
Change the offset to -1V then 1.5V then 2V then. Observe the change in waveform.
Change the vertical scale i.e. the whole waveform is again at the center of screen. Note
down the new values of Channel 1 Status and Time base Status.
Press “measure” button, press “Voltage” and then press soft keys to determine values of
Vpp, Vrms, Vmin and Vmax. Similarly press “Time” and determine the values of
frequency, period etc. Fill the table.
Task-2:-
Generate a square wave pulse between 0-5V. Let the frequency be 4KHZ. What is the
time period?
What is the value of time base status? For how much time the waveform is +5Volts (0n
time). For how much time the waveform is 0Volts (Off-time). Find the ratio of On-time
and the time period of the square wave.
To measure the time (off or on) note down the time base status. It represents how much
time one division (box) on the horizontal axis represents. Using this information calculate
the time i.e. divisions for which the wave is +5V and for which it is 0volts.
Another method is to press “measure” button of oscilloscope. Press “Time” (press soft
key again to view next set of measurements) and note down the value of “+width” (on-
time) and “-width” (off-time).
Task-3:-
Generate a Sine wave of 1 KHz (note down its value in radians/sec using w = 2πf), 10V p-
p.
Delay the wave using horizontal position knob until the live waveform is at 180 degrees
out of phase with the reference (π radians). 180 degrees means the wave becomes exactly
the inverted version of the reference waveform. Note the numerical value of the time
delay.
Change the frequency to 3 KHz and 3.5 KHz and repeat the experiment. Fill the table
3. From Tools menu the color preferences can be changed, the grid can be turned on or off
from the view menu.
5. The component button can be used to put any circuit component on the schematic
diagram. The wire button can be used to connect different components.
6. The label button can be used to give labels to different nodes. Otherwise a default name
is given to each node.
7. To delete a component from the diagram either use F5 or click the scissors button and
click on the component to be deleted.
10. This window contains a collection of basic component; to make the circuit as shown above
choose the voltage source and place it on the schematic diagram.
11. Place resistors on the schematic diagram and join those using wires to make the complete
circuit. To rotate a resistor so that it can be placed as in the given circuit , select the resistor
and press “ctrl+r” . Similarly “ctrl+e” is used to mirror a resistor . Place the ground at the
lower mode.
12. The circuit is complete. To set the values of observe that each component has two labels
attached to it. One represents the name and other represents the value of the component. To
change the name or the value of any component left click on the corresponding label e.g.
each resistor comes with a label R1, R2 etc. that represents its name. Each resistor is also
accompanied by a label R that represents its value. To change the value of the resistor use left
click on the label. The following window appears.
13. Enter the value in the text field and click ok.
14. Another way setting different properties of a component is by using left click on the
component itself e.g. if we use left click on the voltage source the following window
appears.
15. Now the DC value and the source internal resistance can be set from this window. The
advanced button can be used to change the voltage source from DC to other types which shall
be explored in other tasks.
1. After the circuit has been made and values are set as explained above we can simulate
the circuit to determine the DC bias point i.e. all node voltages and currents.
2. Suppose we set the DC voltage source equal to 5V and both resistors are set equal to 1K.
(The symbol for prefixes such as kilo and milli and mega are case insensitive can be
confusing e.g. the symbol for kilo is K or k , for milli it is M or m and for mega it is MEG or
meg. A complete list can be found in appendix of this document).
3. Now click Simulate->run from the top menu or click the run button on the toolbar. The
following window appears
4. It shows the possible type of analyses LTspice can perform. At the moment we are only
interested in the DC bias point so click the DC op pnt button on the top menu of this window
and click ok.
6. Since we placed no label on the nodes so they are given names n001 and n002.
The node with ground connected is named 0.
7. Now we place our own labels on the nodes by using the label net button on the
toolbar and run the simulation again
So the node voltages and current through each component are listed. Note that the current through the
resistor R1 is negative. The reason is that R1 was rotated before being placed in the circuit. LTspice
defines a predetermined direction of current through each resistor. A negative value shows that the actual
direction of current is opposite to the predetermined assumed direction. To check what direction LTspice
has assumed click View-> Spice Netlist from the top menu. A netlist is a text version of the schematic
diagram. The following window appears
8. It shows that R1 is connected between nodes N2 and N1 and hence the assumed direction of
current is from N2 to N1. Whereas the actual current flows from N1 to N2 and hence the output
generated a negative sign.
9. To connect R1 i.e. the assumed direction is from N1 to N2 select the resistor by using the
move or drag button (the buttons with the symbol of open or closed hand) from the toolbar and
press ctrl+e to mirror the resistor. Now run the simulation and view the Spice Netlist.
10. The current through Voltage source is negative as it should be by passive sign convention.
DC Sweep Analysis:
DC Sweep is a type of simulation in LTSpice where the DC voltage of one or more than one
source(s) is varied in a step-wise manner. At each step the DC bias point is calculated, the results
are usually represented in the graphs. This type of analysis is most suitable when plotting the V-I
curves of different devices or when designing a specific DC bias point for a particular circuit.
2. As in the case of BJT discussed in the previous lab since we have not specified
any parameters of the diode, LTspice has used the default values. A list of all
parameters and the corresponding default values are given in the Appendix.
3. The DC characteristics of the diode are defined by the reverse saturation current
IS, the ohmic resistance RS and the ideality factor N (also known as emission
coefficient). To specify these values we write
.MODEL myDiode D ( IS = 1e -15 N=1.1 RS = 0)
5. Another way of specifying a diode maybe to use ‘left-click’ on the diode and click
‘Pick New Diode’ from the window that appears. It will present a list of list of
available diodes which may be used for the simulation.
6. To perform the DC sweep analysis click the run command and choose the
‘DC Sweep’ button on the window that appears.
7. Provide the name of the DC source which will perform the sweep i.e. V1 in our case. Provide
a start value (0V) and an end value (2V) and an increment (i.e. step) value of 0.05V.
8. The simulation will be performed and a graphical window would appear.
GRAPHICAL ANALYSIS (TRACE):-
Since the results of the DC Sweep are best viewed using a graphical utility so shall use the
graphical analysis of LTSPICE also called TRACE. When we use a DC Sweep analysis the value
of the DC voltage source varies from the initial to the final value in the form of incremental
steps, at each step all voltages and currents are measured and stored. Here we want to plot the
diode current as the value of diode voltage varies.
Maximize the graph window; take the mouse cursor over the horizontal axis, the mouse cursor
changes into a scale icon. Use the ‘right-click’ button and a window would appear.
This window tells us that the quantity plotted on the horizontal-axis is the DC source voltage
V1.
It also tells what the maximum and minimum value on the axis is and where the ticks are placed.
We can change all these values. Since we want to plot diode current vs. diode voltage so we
should place diode voltage on the horizontal-axis. To do so change the value of ‘Quantity
plotted’ from ‘V1’ to V(V1) – V(V2).
Now move the mouse cursor somewhere on the graphical screen and use ‘left-click’, from the
drop-down menu that appears click ‘Add Trace’. The following window appears
complete circuit. To rotate a resistor so that it resistor and press “ctrl+r”. Similarly “ctrl+e” at the lower
node.
It lists all the voltages and current which have been calculated during the DC sweep simulation. Choose
I(D1) which is the diode current.
A number of mathematical operations can be performed on the graphs. A constant may be added,
subtracted, multiplied or dived from the graph. Two or more graphs may be added, subtracted, multiplied
or divided. Similarly the logarithm or some trigonometric function of the graph may be plotted as well. In
appendix a list of possible mathematical functions is provided. To apply a mathematical operation on the
graph use left click on the title of the graph (I(D1) in this case).
The following window appears
By using right click on the graph, the numerical values at different points can be observed.
Calculate the frequency of waveforms with periods of (a) 10 s, (b) 5 ms, (c) 200 μs.
Find values for the period, frequency, peak amplitude, peak-to-peak amplitude and rms
amplitude for the sine wave shown below:
Post-Lab Discussion
What are the important features of ammeters, voltmeters and ohmmeters?
For the circuits shown below the value values of the resistors should be the last two digits of
your roll number with kilo, mega or milli your choice.
a)
b)
c)
d)
X10:
LEVEL
If we change the vertical position of the signal, will it change the amplitude?
If we change the horizontal position of the signal, will it change the amplitude?
References
1.User`s and Services Guide Agilent 3000 Series Oscilloscopes.
2.Users Guide Agilent 33220 A 20MHZ Function / Arbitrary Waveform Generator.
3. meterman-33xr user-manual, BK Precision – instruction manual