0% found this document useful (0 votes)
14 views8 pages

Lab 1

The document outlines the first experiment of the EE230 Analog Circuits Lab at IIT Bombay, focusing on familiarization with the NGSPICE circuit simulator and lab equipment. It includes installation instructions for NGSPICE, basic operations, and detailed simulation tasks for various RC and RLC circuits. Additionally, it describes the use of lab equipment such as digital multimeters, oscilloscopes, and function generators, along with guidelines for the lab report submission.

Uploaded by

durgesh
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
14 views8 pages

Lab 1

The document outlines the first experiment of the EE230 Analog Circuits Lab at IIT Bombay, focusing on familiarization with the NGSPICE circuit simulator and lab equipment. It includes installation instructions for NGSPICE, basic operations, and detailed simulation tasks for various RC and RLC circuits. Additionally, it describes the use of lab equipment such as digital multimeters, oscilloscopes, and function generators, along with guidelines for the lab report submission.

Uploaded by

durgesh
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 8

lOMoARcPSD|52618558

EE230 Analog LAB Experiment 1

Analog Circuits Laboratory (Indian Institute of Technology Bombay)

Scan to open on Studocu

Studocu is not sponsored or endorsed by any college or university


Downloaded by D ([email protected])
lOMoARcPSD|52618558

EE 230 – Analog Circuits Lab - 2021-22/I (Autumn)


Experiment 1: Familiarization with NGSPICE Circuit Simulator and Lab Equipment
(Ver 2, July 23,2021)

Part A – NGSPICE Familiarization

A.1 Installation

Introduction: Ngspice is a mixed-level/mixed-signal circuit simulator based on three open source software
packages: Spice3f5, Cider1b1 and Xspice. Spice3 is the most famous and used circuit simulator developed
University of California at Berkeley (UCB).

We will be using the latest version, viz. NGSPICE, Ver 34 (Jan 2021). In case you have an earlier version of
NGSPICE, it should be ok, since we will be using only the basic commands.

Download and Installation details (Windows)


NGSPICE-34 can be downloaded from http://ngspice.sourceforge.net/download.html

In the above webpage, see the section <Ngspice installation (quick intro)= for the link for MS Windows (64 bit,
Windows 10) version. Expand the contents of the zip file to an arbitrary location on your computer, e.g. to D:\.

Download and Installation details (Linux version)

For installing ngspice on Linux, macOS and other OSs please see:
http://ngspice.sourceforge.net/packages.html

A.2 WEL Lab Resources on NGSPICE

WEL Lab links (for access within IITB campus):

Download the following NGSPICE resources (Tutorial Slide and SPICE files)

http://wel.ee.iitb.ac.in/teaching_labs/WEL%20Site/ee236_temp/ngspice.html

Download NGSPICE Video Tutorial for NGSPICE Linux version (see under Expt 1, Download links)

http://wel.ee.iitb.ac.in/teaching_labs/WEL%20Site/ee236_temp/labsheets_2019.html

Google drive link (for access from outside IITB campus):

WEL Lab resources on NGSPICE are copied in the following Google drive

https://drive.google.com/drive/folders/19tCwquDaB4wkwRbvcO-GF_t6GAC4S0vB?usp=sharing

Downloaded by D ([email protected])
lOMoARcPSD|52618558

A.3 Basic NGSPICE Operations

1. Windows 10 version:
Run NGSPICE (from Spice64/bin folder) by double-clicking 8ngspice.exe9. You will see the following.

2. Please see the WEL Lab resources:


NGSPICE Tutorial Video (Ngspice_tut.mp4) and PPT (Ngspice-PPT-2017.pdf)
The above two resources discuss a variety of NGSPICE simulation examples. The above resources were
made for the Linux version. However, the commands and the results are identical with the Windows
version.
A Sample NGSPICE Example:
Create a sample netlist file (8.CIR9file) using the Notepad. A simple example of resistor divider is shown
below.
Simple resistor divider
* <element-name> <nodes> <value/model>
r1 1 2 1k
r2 2 0 1k
v1 1 0 5
*analysis command
.op
.control
run
*display command
print v(1)
print v(2)
.endc
.end
Note that the first line is assumed by NGSPICE as a Title (or Comment line). All subsequent comment
lines should start with 8*9. Run the file by typing 8Ex1.cir9 in the command window. The resulting
display is shown below.

Downloaded by D ([email protected])
lOMoARcPSD|52618558

3. Familiarize yourself with the basic functions of NGSPICE, by creating and running all the examples
given in the Tutorial video. You need to be familiar with the commonly used analysis commands (.op,
.dc, .tran, .ac). You need not do the last example in the Tutorial video (Opamp integrator).
4. Experiment 1 requires the use of sine and pulse waveforms. Familiarize yourself with the correct
format for these waveforms.
5. Experiment 1 comprises the following RC and RLC circuits: RC integrator, RC differentiator, RC Low-
pass filter, RC high-pass filter, RC bandpass filter and RLC bandpass filter.

Part B : NGSPICE Simulation of RC and RLC Circuits


B.1 RC Integrator
Simulate and plot time response of the RC integrator circuit shown below for the cases indicated. Choose
R = 10 kΩ and C = 0.1 μF. Your plots should show both Vin and Vout. Ensure that Vout waveform has at least two
or three cycles of the steady state waveform.

Hint: Choose square pulse waveform with amplitudes as shown and use .tran analysis. Choose pulse width and
square waveform period as per the requirement. (T = input pulse width, and τ = RC time constant).

Format for the pulse waveform:


pulse(Low-value Pulsed-value TD TR TF PW period)
TD = time delay, TR = rise time, TF = fall time, PW = pulse width, period = pulse waveform period

Format for .tran analysis:


.tran TSTEP TSTOP

Cases: i) T = 10τ ; ii) T = 5τ ; iii) T = τ ; iv) T = 0.1 τ ; vi) T = 0.05 τ

B.2 RC Differentiator
Simulate and plot time response of the RC differentiator circuit shown below for the indicated cases. Choose R
= 10 kΩ and C = 0.1 μF. Your plots should show both Vin and Vout. Ensure that Vout waveform has at least two or
three cycles of the steady state waveform.
.
Cases: i) T = 10 τ ; ii) T = 5 τ ; iii) T = 1 τ ; iv) T = 0.5 τ ; v) T = 0.1 τ ; vi) T = 0.05 τ

Downloaded by D ([email protected])
lOMoARcPSD|52618558

B.3 RC Lowpass Filter


Simulate and plot amplitude frequency response (amplitude Bode plot) of the RC lowpass filter circuit shown
below. Choose R = 10 kΩ and C = 0.1 μF.
Hint: Choose sine waveform with amplitude 1 V. Choose .ac analysis with decade frequency variation.

Format for the .ac command:


.ac DEC ND FSTART FSTOP
DEC stands for decade variation, and ND is the number of points per decade.
FSTART is the starting frequency, and FSTOP is the final frequency.

Specify an AC source with zero dc and ac amplitude 1V(Example: vin between nodes 1,0): vin 1 0 dc 0 ac 1

B.4 RC Highpass Filter


Simulate and plot amplitude frequency response (amplitude Bode plot) of the RC highpass filter circuit shown
below. Choose R = 10 kΩ and C = 0.1 μF.

B.5 RC Bandpass Filter


Simulate and plot amplitude frequency response (amplitude Bode plot) of the RC bandpass filter circuit shown
below. Choose R = 10 kΩ and C = 0.1 μF.

Note its peak amplitude, centre frequency(f0), and the lower (fL) and the upper(fH) -3 dB points. Compare your
simulation results with theory.

Downloaded by D ([email protected])
lOMoARcPSD|52618558

B.5 RLC Bandpass Filter


Simulate and plot amplitude frequency response (amplitude Bode plot) of the RLC bandpass filter circuit
shown below. Choose R = 1 kΩ, L = 10 mH and C = 0.1 μF.

Note its peak amplitude, centre frequency(f0), and the lower (fL) and the upper(fH) -3 dB points. Compare your
simulation results with theory.

Part C – Familiarization with Lab Equipment


C.1 Digital Multimeter (DMM)
You will be using a Laboratory Table-top Digital Multimeter (DMM). This is an electronic meter used for
measuring voltages, currents and resistances. The meter display shows voltages, currents and resistances on
the LED display panel.

Measurements: First of all you need to decide the parameter to be measured. We shall use the DMM
primarily for measuring voltages and resistances. Choose the Voltage or Resistance function and the
appropriate range (based on the maximum expected magnitude) for the parameter. Choose the ranges
carefully.
Note: Resistance mode of the DMM assumes that there is no current flowing in the resistor. Take extra care
when using the resistance mode.

You may think of DMM essentially as a voltage measuring equipment. Resistances and currents are
converted into voltages by the DMM circuitry. AC voltages need to be < 400 Hz.
Input resistance of the DMM is 10 Mohms.

C.2 Digital Storage Oscilloscope (DSO) - Tektronix TDS 1002B


Oscilloscopes are versatile electronic instruments used for displaying and measuring parameters of time
varying voltage signals. They are very useful in measuring the amplitude and frequency/time period of a
signal. The instrument most commonly used is what is called a Cathode Ray Oscilloscope (CRO). CROs are
now slowly getting replaced by Digital Storage Oscilloscopes (DSO), which makes signal measurements
easier compared to a CRO.

CROs/DSOs are useful in measuring signals up to their rated bandwidth. TDS 1002B has bandwidth of
60 MHz. However, DSOs cannot measure DC/AC voltages as accurately as a DMM. ADC Resolution for the
DSO vertical signal is typically 8 bits (as compared to 12 bits or more in a DMM).

Downloaded by D ([email protected])
lOMoARcPSD|52618558

C.3 Arbitrary Function Generator


Arbitrary Function Generator (AFG) is a special function generator which can choose a variety of waveforms
(sine, square, ramp, arbitrary, etc) whose parameters, such as amplitude, frequency, offset can be adjusted.
(Refer to the AFG.pdf for more details on usage of this instrument.

Fig. 2.1 Arbitrary Function Generator Panel

C.4 CRO Probes


CRO probes are special cables with a built-in RC/LC network to compensate for the input capacitance of the
CRO. Most CRO probes have 1X and 10X modes. The 1X mode would display the signal as it is, whereas the
10X mode would attenuate the input signal by 10. DSO channel input parameters can be adjusted for the probe
setting chosen.

For high frequency signals, and also for measuring fast rising waveforms, the 10X mode should be used. It is
best not to use 1X except when the input signal is < 20 mV.

CRO probe (10X mode) and the DSO input equivalent circuit

See the CRO schematic diagram shown. The input equivalent circuit of a CRO/DSO inputs is 1 MΩ (say R2) in
parallel with a capacitor (say C2). CRO probe is essentially a 8compensated attenuator9 used for compensating
the CRO/DSO input capacitance. In the 10X mode the probe introduces a 9 MΩ resistance (say R1) in series
with the signal. The probe has an adjustable Capacitor (say C1) connected parallel to R1. If the input resistance
of the DSO is R2 (= 1 MΩ) and the input capacitance is C2, then the signal at the DSO input (i.e. appearing
across R2) would be (Vin R2/(R1+R2)), when R1 C1 = R2 C2. In order to achieve this condition, the capacitor C1 in
the CRO probe is made adjustable. DSO front panels are provided with a 1 kHz Probe CAL Pulse signal.

Note: Students often mistake the CRO probe to a useful BNC cable, and are often tempted to use it in the
1X mode, and treat it like a BNC cable. This is a wrong practice as in the 1X mode the probe introduces an
LC circuit in series with the signal (to partially compensate for C2) which distorts the signal.

Downloaded by D ([email protected])
lOMoARcPSD|52618558

Lab Report
Due on July 31 (Sat) 8pm

• Your report should be written, section by section for each of the circuits of this experiment with circuit
diagrams, plots obtained using NGSPICE and your NGSPICE programs.
• Lab reports have to be submitted individually by all of you. We expect all of you to do your Lab report
work independently. Any copying and other malpractices will attract mark penalty.
• Line 1 of your NGSPICE programs should have your Roll no., Name and the Title of the program
• All the circuit diagrams should be drawn neatly with X-circuit or other electronic software for circuit
diagrams.

Downloaded by D ([email protected])

You might also like