This is only a preview of the October 1991 issue of Silicon Chip. You can view 45 of the 96 pages in the full issue, including the advertisments. For full access, purchase the issue for $10.00 or subscribe for access to the latest issues. Items relevant to "SteamSound Simulator Mk.II":
Articles in this series:
Articles in this series:
Articles in this series:
Articles in this series:
Articles in this series:
Articles in this series:
|
Build a talking
voltmeter for your PC
Fancy a talking voltmeter with an on-screen
display? This simple project mates with the
PC Voice Recorder featured in the August
1991 issue & plugs directly into the printer
port of your PC.
venient to have to take your eyes off
the circuitry to look at the voltmeter
and it's all too easy for the probes to
slip (and possibly cause damage)
while doing so.
Unlike the fancy handheld versions,
the SILICON CHIP PC Talking Voltmeter plugs into a computer. This gives
it the ability to store and later retrieve
By DARREN YATES
voltage readings over a given period
of time. And by adding the PC Voice
Talking voltmeters aren't new and
However, they are often much more Recorder board, you can use speech
there are now several handheld mod- convenient to use than conventional to relay the information to you.
els on the market that can tell you the
(mute) multimeters. This particularly
What's more, we have replaced the
current reading. These all use the lat- applies if you want to take a number American accent of the handheld
est in artificial speech technology but, of readings in quick succession or if • models with a good ol ' fashioned
unfortunately, this technology is still you have to concentrate on probe "Orstralian" one. You can even use
new enough for them to be quite placement (eg, when measuring your own accent if you wish!
pricey.
voltages on IC pins). Often, it's inconOne very useful feature of the PC
54
SILICON CHIP
Talking Voltmeter is that it can be
used to monitor a voltage over time;
eg, the voltage on an SLA battery under charge. In this mode, it can be set
to give an audible alarm if the battery
voltage rises above or falls below a
preset limit.
If you have a graphics card in your
computer, you can also print out voltage vs. time graphs. This makes the
unit ideal for checking battery performance under load, or for checking
the stability of audio amplifiers, to
give just two examples.
The accompanying panel shows all
the relevant specifications of the PC
Talking Voltmeter. It has 8-bit accurac;y, better than 0.5% linearity and
an input irnpedan.ce of lMQ. It plugs
directly into the.parallel printer port
of your computer and will measure
DC voltages ranging between ±128V
over three ranges, with an accuracy of
about 2%.
If you want the optional speech
facility as well, you simply run an
extra 2-wire connection to the PC
Voice Recorder. Alternatively, you can
delete the speech facility and simply
operate the unit as a voltmeter with
an on-screen digital display.
Block diagram
Take a look now at the block diagram of Fig.1. A part from the corn puter, the circuit uses a range switching
stage, an input buffer stage, a comparator and an 8-bit digital-to-analog
converter (DAC). Let's see how this
all works.
The input voltage is fed through
the high impedance (lMQ) range selector and thence to the protected
buffer (IC2a). The output of this buffer
is then fed to the inverting input of
the comparator (IC2b), while the noninverting input is fed from the output
of the 8-bit DAC (ICl). This DAC converts the output of the computer which
in turn responds to the output of the
comparator.
In operation, the input voltage from
the buffer is compared with a voltage
set up by the computer. At the same
time, the computer also monitors the
output of the comparator. If the comparator output switches from low to
high, then the computer-controlled
DAC output is too high.
The computer then systematically
searches for a lower value that is closer
to the mark. Even though there· are
256 possible combinations, the car-
Fig.1: block diagram of
the PC Voltmeter. The
input voltage is applied
via a voltage divider &
buffer stage IC2a to the
inverting input ofIC2b
where it is compared with
the output from an 8-bit
DAC (ICl). The DAC
converts the output from
the computer which in
turn responds to the
output of the comparator.
VOLTAGE
RANGE
VOLTAGE
INPUT
□
rect 8-bit value that matches the input
voltage can be found in just eight steps.
What we really have is an 8-bit
successive approximation analog-todigital converter (ADC). It converts
our input voltage into an 8-bit code
that the computer can recognise.
Successive approximation
Table 1 shows how successive approximation works. What we've done
here is to show you how the successive approximation technique works
on a step-by-step basis.
Say for example that our input voltage is 1.83V. Our DAC has a conversion rate such that each of the 256
steps is worth 0.01 V.
OK, let's start with row 1. Our input voltage is set to 1.83V, as we have
said. We now set the most significant
bit (MSB) of the DAC high, which
represents half scale. This sets our
DAC to 1.28V.
We now check to see if the input
voltage is in the upper or lower region
of the DAC scale. Because the DAC
output is lower than the input voltage
(1.83V), the output of the comparator
is low. This tells the computer that
the input voltage is higher than 1.28V
and so we leave the MSB high.
We now go to row 2. We know that
our voltage is in the upper half of the
scale but is it towards the middle or
the top end? We now set the next bit
high as well, which produces an output voltage from the DAC of 1. 92V (ie,
halfway between 1.28V and 2.56V).
Since this is higher than our input
voltage, the comparator output goes
high, telling the computer that this bit
must be set low.
You can follow the rest of the rows
yourself to verify that it works. The
method is to start with the MSB and
work down, checking at each step to
see whether the result is higher or
lower than the current input. It may
take you quite a bit oftirne to work the
Specifications
Voltage range ................... .....
Resolution .............................
Input impedance ....................
Accuracy ...............................
ND converter ........................
Measurement rate .................
±128V in three decade ranges
0.01 V, 0.1 V & 1V
1Mn
approx. 2%
8-bit successive approximation type
approx. 10 per second for 10MHz AT
(depends on CPU clock speed)
Computer requirements
• XT/AT/386/486 IBM PC or compatible
• CGNEGNVGA video card (for display of logged data only)
• 360Kb.floppy disc drive
• 256Kb bf memory (minimum)
• MS-DOS 3.0 or later with GWBASIC
• 1 parallel printer port
OCT0BER1991
55
,~.,~
I
Digital/analog scale: LSB
Current Bit Set
= .01 V;
Full scale
~
= 2.56V;
Input voltage
Comparator
Output
D/A Output
Step 1
MSB
1.28V
Step 2
MSB -1
1.28 + 0.64
Step 3
MSB-2
1.28 + 0.32
Step 4
MSB-3
1.28 + 0.32 + 0.16
Step 5
MSB-4
1.28 + 0.32 +0.16 + .08
Step 6
MSB-5
1.28 + 0.32 + 0.16 + .04
Step 7
MSB-6
1.28 + 0.32 + 0.16 + .04 + .02
Step 8
LSB
1.28 + 0.32 + 0.16 + .04 + .02 + .01
= 1.92V
High
MSB - 1 = 0
= 1.60V
Low
MSB - 2
=1
Low
MSB - 3
=1
= 1.84V
High
MSB - 4
=0
= 1.8V
Low
MSB - 5
=1
Low
MSB - 6
=1
= 1.76V
= 1.82V
= 1.83V
High/Low
LSB
= 0/1
= 10110111 = 1.83V
comparator to give us a result, this
becomes our error. Even so, one step
in 256 gives us an accuracy of about
0.4 % but there are other factors which
have greater influence on the accuracy, as we shall see shortly.
0.
The complete circuit diagram of the
PC Voltmeter is shown in Fig.2. It
uses just three !Cs, a couple ofregulators and a handful of other components.
Circuit diagram
The PC Voltmeter is housed in a low-cost plastic utility case & plugs into the
parallel printer port of the computer. By connecting it to the PC Voice Recorder,
you get a voltmeter that talks.
SILICON CHIP
=1
MSB
result out by hand but the computer
can do it much faster!
If you look down the decision column in Table 1, you can write out the
8-bit code by starting with the MSB
on the left and work across. In our
example the 8-bit DAC code is
10110111, with the last bit either 1 or
56
Decision
Low
Digital word from DAC
The last bit to be checked is the
least significant bit (LSB). Because
the two voltages applied to the comparator have to be different for the
= 1.83V
The heart of the circuit is !Cl, a
DAC0800LCN 8-bit D/ A converter. Its
8-bit digital input comes from the parallel port of your PC (designated port
A). By connecting pin 1 of !Cl to
ground, we can feed the TTL outputs
from the computer directly into !Cl
and be assured of logic compatibility.
Our reference voltage is set by two
signal diodes, Dl and D2. This will
give us a voltage which is close to
about 1.3V. By now, some of you may
be cringing about the accuracy of this
reference but, before you give the idea
away, we should point out that any
error that occurs due to this source is
corrected by the software.
We built the prototype using components that came straight from the
shelf and our PC voltmeter compared
favourably with our Fluke multimeter. Obviously, it doesn't have the
same resolution but the difference
between the readings was only about
50mV on the 12.8V range!
That said, this project is not designed to replace the multimeter - far
from it! In fact, a digital multimeter
will be very useful for checking out
the final accuracy.
!Cl is powered by ±5V supply rails,
which we'll talk more about later. Its
output takes the form of a differential
current flow from pins 2 and 4. These
outputs are fed to op amp IC2c, which
is connected as a current to voltage
converter as well as a subtracter.
The resulting output from pin 7 of
IC2c is a voltage which can take any
,_._ _ _ _ _ _ _ _ _ _ _....__ _ _ _ _ _ _ _ _....__ _ +5V
VOLTMETER
INPUT
680k
1%
-_g.
4.7k
220k
1%
100k
!.12.BV
S1
180k
1%
1128V
-5V
.,.
02
IN914
+5V
01
1N914
PARALLEL PRINTER PORT
0825 CONNECTOR
(2) 00
(3) 01
(4) 02
4.7k
4.7k
14
.,.
.~
13
12
4
11
I
10
GNO
2
IC1
OACOBOOLCN
(5) 03
4.7k
(6) 04
GNO
I
(19) GNO~
0.1+
15
4.7k
.,.
PCVOICE
T O.,.
~
-5V
.,.
~f
3
A
VIEWED FROM
BELOW
OUT
t=-"-'--1--- ♦SV
+
100
25VWI
(9) 07
(10) ACK
ELJc
~K
OUT
REG1
IN
16
(8) 06
B
IN
03
1N4004
,..
.,.
(7) 05
.. ffi
5
8
D5 .,.
1N4004
IC3
555
12VDC
PLUG-PACK
-i
.,.
0.1
.
01I
.,.
PC TALKING VOLTMETER
Fig.2: all the elements depicted in the block diagram can be directly related to the main circuit shown here. ICl,
an 8-bit DIA converter, is the heart of the circuit. It accepts an 8-bit digital input from the computer & generates a
differential output which is fed to IC2c, IC2c in turn drives the non-inverting input of comparator IC2b.
value (in 10mV steps) between plus
and minus the reference voltage; ie,
between ±1.3V. This voltage is fed
into the non-inverting input (pin 10)
of IC2b, which acts as our decision
comparator. The inverting input is
derived from the input isolating buffer
(IC2a), which is another TL074 op
amp.
Input divider
The input voltage is fed into the
buffer via a voltage divider with three
positions: divide-by-100, divide-by10 and divide-by-1. To make sure that
the input voltage range of the buffer is
not grossly exceeded, a lO0kQ resistor is connected in series with the
input. In addition, diodes D7 and DB
ensure that the input voltage to IC2a
can not rise more than 0.6V above the
supply rails.
IC2a is wired as a buffer stage and
provides an extremely high input impedance (>10 12 ohms). This means
that the input impedance is determined· by the voltage divider resistance (ie, lMQ). The output from IC2a
appears at pin 1 and is fed directly
into the inverting input (pin 9) of
decision comparator IC2b.
The decision comparator works like
this. When the voltage applied to its
non-inverting input from the DAC
(and thus from the computer) is greater
than the voltage on its inverting input, the output at pin 8 goes high.
This lights LED 1 and turns on transistor Ql which then pulls the -ACK
line of the printer port to ground.
This -ACK line is checked by the
computer during each cycle of the
conversion process. It tells the computer whether the curreni. digital count
is higher or lower than the input volt·
age, as described previously.
Power for the circuit is derived from
a 12VDC plugpack supply, the same
as for the PC Voice Recorder. This
drives a 7805 3-terminal regulator via
polarity protection diode D3 to derive
a +5V supply rail. In addition, a -5V
rail is derived using IC3 and a -5V
regulator.
IC3 is a 555 timer which is connected for astable operation. It produces a 750Hz squarewave at its pin 3
output and this drives a diode pump
(D4 & D5) which is wired to produce a
negative voltage (-9V approx.) at the
anode of D5. This voltage is then fed
to a 7905 regulator to derive the -5V
supply rail.
That's all we have space for this
month. Next month, we will conclude
with the constructional details. SC
OCTOBER 1991
57
|