This is only a preview of the August 1995 issue of Silicon Chip. You can view 31 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 "Vifa JV-60 2-Way Bass Reflex Loudspeaker System":
Items relevant to "A Gain-Controlled Microphone Preamp":
Articles in this series:
Items relevant to "Build The Mighty-Mite Powered Loudspeaker":
Items relevant to "Computer Bits":
|
Design by ROGER KENT*
Audio Lab: a
PC-controlled audio
test instrument
Introducing Audio Lab, a PC controlled test
instrument capable of a range of DC and AC
measurements with particular emphasis on
audio applications. Audio Lab is connected to
the serial port on your computer and does not
require any internal cards.
These days, PC controlled instruments are becoming widely used,
whether it is equipment fitted with
the GPIB (HP’s General Purpose Instrument Bus) or simpler gear with a serial
communication link. Now, by special
54 Silicon Chip
arrangement with R.S.K. Electonics
Pty Ltd, of Perth, we are pleased to
present Audio Lab.
Anyone involved in the electronics
field whether as a hobby, as a design
engineer or as a technician, relies on
equip
ment to measure and test the
project being worked on. For audio
applications, an ideal workshop setup
should include facilities to monitor
frequency, resistance, capacitance,
impedance, and DC and AC voltage,
along with the capability to perform
and print frequency response plots for
the unit under test. To achieve these
results using conventional methods,
a considerable amount of test gear
would be required.
Audio Lab has been developed to
incorporate all the above features into
one PC based measuring system. Data
transfer from Audio Lab to the PC is
via an RS232 link and no power is
taken from the PC. No test equipment,
apart from a multimeter, is required to
build Audio Lab and all calibrations
are performed by using the supplied
setup software on the PC.
The accuracy is a function of its
1.26V internal voltage reference which
is better than ±2%. The frequency
generator section is a calibrated crystal
controlled module with a drift tolerance of 50ppm (parts per million).
System features
Audio Lab can measure DC and AC
voltages in nine ranges from 50mV to
100V. AC measurements are true RMS
rather than the less precise RMS indication based on a form factor of 1.11, as
for a sinewave. It can also measure DC
resistance from 2Ω to 10MΩ in eight
ranges; capacitance from less than 5pF
to 5000µF in eight ranges; and impedance from 2Ω to 10MΩ in eight ranges,
for test frequencies between 10Hz and
20kHz and frequencies between 1Hz
and 30kHz.
As a generator, Audio Lab can
deliver a sinewave at any frequency
between 0.5Hz and 30kHz in 0.5Hz
steps at any amplitude between zero
and 2V RMS, with coarse and fine adjustments available. The sinewave has
a total harmonic distortion (distortion
plus noise) of -40dB; ie, 1%.
The generator mode can also produce a logarithmic frequency sweep
from 10Hz to 20kHz or a linear sweep
with selectable start and frequency
increments. The selected frequency is
entered from the PC with the output
voltage being simultaneously monitored and displayed.
Printouts of frequency plots and
full screen displays can be made at
any time.
Audio Lab is housed in a standard
plastic instrument case with three
knobs on the front panel, a couple of
toggle switches, three RCA sockets, a
6.5mm microphone jack, two binding
post terminals and a bunch of LEDs
which display (mimic) the function
and range being monitored.
Computer system requirements for
Audio Lab are an IBM PC 286 compatible or better, with a 386DX/40
recommended as the minimum to take
full advantage of the display graphics.
Also required are a minimum RAM of
1Mb, 2Mb free on the hard drive, EGA/
VGA graphics, DOS 3.3 or later and a
Microsoft-compatible mouse.
Fig.1: this is the opening screen of the Audio Lab. From here, you can switch to
measurements for AC & DC voltage, resistance, capacitance and impedance, and
you can generate linear and logarithmic frequency sweeps.
Fig.2: this screen shows a capacitor of 1.5pF being measured at a test frequency
of 10kHz.
Fig.3: this is an impedance plot for a bass reflex loudspeaker system. The double
peaks in the low frequency region demonstrate the reflex tuning.
Audio Lab is built on four doublesided PC boards with plated-through
holes. The four PC boards and the
signal flow around them are shown
on the diagram of Fig.4.
The four boards comprise the Boot
August 1995 55
The Boot PC board accommodates an 80C31 microprocessor, RAM and EPROM,
and an RS232 serial interface for the PC.
interface built in, along with the option to take either 8K or 32K of static
RAM. Access to the full micro bus has
been implemented to enable various
daughter boards to be plugged in for a
range of applications without having
to redesign the microprocessor part
of the project.
When the first byte of data is received from the PC, the code is written
into RAM which is configured as Data
memory, the EPROM being Program
data. After the last byte of code has
been transmitted, memory usage is
switched so that the RAM becomes
Program memory and the EPROM
becomes Data memory. The program
then runs from RAM, starting at address 0000H.
An ADM232 RS232 interface is
connected to bit P3.0 of the 80C31 as
RXD with bit P3.1 as TXD, with the
processor controlling the baud rate.
By using the ADM232, correct specifi
cations for the RS232 link are achieved
and no compatibility problems when
connected to the PC’s serial port will
occur.
Contained in the EPROM is the
boot code to enable the transfer of the
full program from the PC, along with
several diagnostic programs which,
when used with the diagnostic card
and software, aid in debugging the
motherboard. The EPROM also contains a 28.8K look-up table for the
generation of sine waves.
A-D board
This is the A-D board which stacks on top and interfaces with the micro bus
from the Boot board. It features an ADC0804 analog-to-digital converter and an
AD736 true RMS converter. The on-board module is used generate sinewaves.
PC board which accommo
dates the
system microprocessor and EPROM,
the analog to digital (A-D) converter
board, the front panel board and the
power supply. Let’s deal with the Boot
board first.
80C31 microprocessor
All of the functions in Audio Lab are
controlled by an 80C31 microprocessor. This device was chosen because
of its on-board I/O ports and ease of
56 Silicon Chip
use via a serial communication link.
It has separation of program and data
memory which makes it simple to
dump code for the processor from the
PC via the serial port.
What this implies is that any upgrades or changes to the code do not
involve changing the EPROM but
simply downloading new software
from the PC.
The Boot board has its own 5V
regulator and bidirectional RS232
This board stacks on top and interfaces with the micro bus from the Boot
board. An ADC0804 analog-to-digital
converter is used to convert the selected analog information into 8-bit digital
format at a sampling rate of about
15kHz. The 1.26V voltage reference
gives an input range of 2.52 volts for
the converter. A 74HC574 8-bit latch
is used to select the different inputs,
ranges and mode options; eg, RMS/
linear, component, frequency measure, etc.
Switching between RMS and linear
modes is achieved by a 4052 analog
switch using bit D7 from the 74HC574
8-bit latch. The RMS value of the selected Input voltage is computed using
an AD736 true RMS converter. This
converter does not rely on measur
ing peak-to-peak voltages and form
factors to perform an RMS conversion
but performs the correct algorithm;
ie, square, mean and square root, to
Mounted behind the front panel, this board accommodates most of the analog
circuitry in Audio Lab. Here is where the scaling, monitor switching, mimic
decoding and buffering functions are performed. Accurate calibration is
achieved by two multiturn trimpots, to set the divide by 100 & 1000 ranges. The
“Set-up” software makes calibration simple.
calculate the RMS of any waveform,
not just sine waves.
The linear signal from the front
board is amplified and converted to a
square wave by a 4093 Schmitt trigger.
Control bit D6 gates either the interrupt
from the A-D converter, when measuring RMS or linear voltages, or the
output of the Schmitt to the interrupt
on the 80C31 processor.
The micro then either converts the
analog signal into serial format and
dumps the data to the PC or when
measuring frequency, counts the
number of cycles in one second, then
dumps the frequency via the serial
port to the PC.
The calibrated sinewave module is
on this board and data is transferred
to it from the 80C31 via control bits
from port 3.
Three multi-turn trimpots calibrate
RMS gain, linear zero and linear
gain, calibration being done using
the “Set- up” program supplied with
the project.
Connection to the power supply
board is via a 3-way connector which
supplies ±5V. These rails are derived
from separate regulators to those for
the boot board’s supply, to minimise
any interference problems between
the digital and analog sections of the
system. To simplify inter-board wiring, connections from the A-D board
and the Front board are by a 16-way
ribbon cable.
Front board
The main analog section of the
system is on this board. Here is where
the scaling, monitor switching, mim
ic decoding and buffering functions
are performed. The overall scheme,
though simple in concept, is very complex in operation and would require
a complete article to fully describe
the philosophy used when designing
the system.
In brief, the switching data, sine
wave out and analog information from
the A-D board arrives via the 16-way
IDC (insulation displacement cable)
connector. A 4051 8-input analog
switch is used to choose which of the
various inputs is selected for processing by the A-D board. The required
BOOT PCB
CPU
EPROM
RAM
SERIAL I/O
input is gated through by control bits
D2, D3 & D4 from the 74HC574 8-bit
latch. To achieve the different ranges
when “INPUT” is selected, the voltage
first passes through a digitally controlled attenuator, giving attenuation
of 10, 100 and 1000 using control bits
D0 & D1.
Accurate calibration is achieved
by two multiturn trimpots, to set the
divide by 100 & 1000 ranges. Again,
the “Set-up” software makes calibration very simple. The output from
the attenuator feeds an op amp with a
fixed gain of 20 which feeds a digitally
controlled amplifier with gains of 1,
2 & 4 using control bits D2, D3 & D4.
This selects different input resistors
and sets the corresponding gain of the
output buffer amp.
Full scale on the analog to digital
D0-D7
A TO D PCB
P3.2-P3.7
C000
A000
A TO D
SELECT RMS/LIN
SINE GENERATOR
SELECTVOLTS/
FREQUENCY
C000/A000
DECODE
INTERRUPT
C000 READ=VOLTS
C000 WRITE=SELECT
RESET
DC
INTERRUPT
SERIAL
I/O
PSU PCB
+/-5V
+/-5V
AC
SERIAL
PC
DATA
OUT
V
OUT
SINE
FRONT PCB
Fig.4: this diagram shows
the four PC boards and the
signal flow around them.
RANGE SELECT
I/P SELECT
LED MIMIC
August 1995 57
Communication with the controlling PC is via the inbuilt RS232 serial interface.
Power comes from a DC plugpack.
converter is set by the preset gain
controls on the A-D board to be 2V, so
by using combinations of attenuation
and amplification the full nine ranges
are obtained.
The digital range switching used
was the only configuration that
achieved the desired results with
adequate frequency response and accuracy, without the need for adjustable
compensation capacitors.
The Mike input is a conventional
amplifier with a variable gain of 10 to
about 100. A switch on the front panel
enables the use of either a normal or
electret microphone and the output
is selected for display by control bits
D2, D3 & D4.
Impedance plots
With the inputs described so far
and the ability to deliver known AC
voltages and frequencies, Audio Lab
can measure and plot the impedance
of any component. If a known voltage,
at a known frequency is applied across
a simple potential divider network,
with the impedance of one of the components known, then by measuring
the RMS voltage (Vx) at the junction
58 Silicon Chip
of the two components it is a simple
matter to calculate the impedance of
the unknown component. Once the
impedance is known the capacitance,
resistance or inductance can be easily
computed.
For example, to measure resistance,
if a fixed 1V RMS signal at 1kHz is
used as the reference and this signal is
applied to one end of the unknown resistance, the other end being grounded
through a known resistance of 10kΩ,
the value of the unknown resistance
can be calculated, as follows:
R = 10(1-Vx)/Vx kilohms
Similarly, for a capacitor:
C = Vx/2πF.R(Vx2 - 1)0.5
So by varying the frequency and
the known resistance, a wide range
of capacitance can be measured. Load
resistors of 1kΩ, 10kΩ & 100kΩ are
selected via control bits D0 & D1 and
the component measure output is selected by D2, D3 & D4. The 1kΩ and
10kΩ reference resistors are accurately
set using multiturn trimpots and 1%
calibration resistors.
In the result, the accuracy for impedances from 300Ω to 10MΩ was good
but below 300Ω was unacceptable.
To get round this problem, the potential divider was reversed. By using
the High/Low switch, the function is
inverted so that the test voltage feeds
the known resistance and the unknown impedance now is grounded.
Through various scaling routines, the
system is accurate for reading impedances to below 5Ω at frequencies
between 10Hz and 20kHz.
Impedance plots for loudspeakers
and crossover units can be done by
connecting the unit to be measured
across the “Component” terminals
and selecting Log sweep from 20Hz
to 20kHz with the range switch set
to low.
Further decoding of control bits
D0-D7 by analog switches is used
to provide signals to drive the 12
mimic LEDs. These provide visible
indication as to what input is being
monitored and what function is being
performed.
All the functions, ranges, etc are
selected from the PC using the graphical software which will be discussed
along with further details of the project
in next month’s issue.
*Roger Kent is the managing director of
R.S.K. Electronics Pty Ltd.
|