A Touch of Spice
PART 2
by Peter J. Stonard
To demonstrate how SPICE
simulation helps even modest hobby
electronics projects, let’s take a fresh
look at two very well-known analog ICs.
With LTspice running on your computer’s desktop
and last month’s article for navigation hints, we make
discoveries about IC circuits that we probably use
and know well. We expand LTspice with the concepts
of sub-circuits and macromodels.
■ FIGURE 1. Linear regulator
breadboard.
Spicing Up Some
Old Friends
Imagine building hobby circuits
without voltage regulator ICs and
op-amps. Their flexibility and low
cost make them popular and useful,
and when we require amplification of
analog signals, typically we use op-amps.
Plus, all circuits operate better from a
regulated power supply. Let’s start with
the three terminal linear regulator IC.
Even our 9V battery had limitations,
as we saw in Part 1. Most of these
can be overcome by adding a linear
regulator such as the ubiquitous 7805
device. First, we’ll do a bit of hands-on
work on the solderless breadboard
(see Figure 1).
Using the three
terminal 5V 100 mA
regulator IC (LM78L05
or one of its variants),
connect the circuit in
Figure 2. There should
be no surprises here;
the 9V battery powers
the regulator which,
in turn, outputs 5V.
Adding a load resistor
at the output does not
change the output
voltage (significantly),
but it would if we’d
54 January 2009
used a plain dropping resistor in
place of the regulator IC. To bring the
voltage down from 9V to 5V with a
single resistor would require that we
know the load current, and assume
that it is fairly constant.
I’ve added two capacitors per the
datasheet to prevent the part from self-oscillating; also a few extra resistors
(R1, R2, and R3) so you can use your
DMM to record voltage drops and
then calculate currents. This makes it
easier than breaking into the circuit
with an ammeter (or a DMM on its
current ranges) and my measured
voltages and calculated currents along
with the LTspice results are shown in
Figure 3. The downside is that the
regulation performance is degraded
(which actually helps us understand
the test data and device circuit theory).
Switching over to LTspice, we
model the same circuit either by
creating a new schematic in the editor
or downloading the file NV_SPICE_ 21.
asc from the Nuts & Volts website
( www.nutsvolts.com). You will need to
add the regulator model to your copy
of LTspice by carefully following the
steps in the sidebar Adding New
Macromodels To LTspice.
The SPICE circuit should look like
Figure 4. Notice the voltage regulator
shows up as a single block; soon we’ll
take a look inside at the IC’s transistor
level circuitry. As this is a DC simulation, we don’t need
those capacitors
required by the breadboard circuit.
We run the simulation
to find the DC
operating point first,
using the now familiar
“.op” command and
— as expected — the
regulator’s output is
5V. Loading the
regulator first with
100 ohms (100R)
and then with the
combination 25R
■ FIGURE 2.
Linear
regulator
breadboard
schematic.