|
Sound card based multimeter
Contents
Preface
PC sound card, standard component of practically all current personal computers,
consists, in minimum, of two parts:
Those parts are usually doubled as all sound cards are two channels - e. g. stereo devices. They may contain other parts, but from the point of view of analog to digital (A/D) signal processing they may not be as important. Mixer is device joining analog signals from different signal sources into one which is delivered to A/D conversion. Important feature of current mixers is full software control of gain and level of all channels. A/D converter is usually high precision 16-bit analog to digital converter with maximum sampling rate 44.1 kHz, or 48 kHz. All (4 ;-) sound cards we've tested and analyzed have the same feature - all their line-in inputs (and others too) are insulated from DC input by condenser. The reason is, clearly, to set zero level of processed sound signal stable and close to zero. This is, however, a strong limitation for other use, for example for DC measurements. The situation, fortunately, is not so bad as it seems...
Results of SB analysis
We've analyzed, with a good magnifying glass and ohmmeter, LINE IN inputs of
four different sound cards - three from Creative Labs, one from Manli:
Inputs of SB16, Audio PCI5000, AWE-64 and CMI8738SX, respectively, are on the Fig. 1.
Fig. 1: SB16, Audio PCI5000, AWE-64 and CMI8738SX LINE IN inputs. As it can be seen, three inputs are very simple. Input of AWE-64 is a bit more complicated. It contains standard FET operating amplifier, but not condenser at the input. The condenser is at the output, however... All four sound cards have DC default level at mixer input significantly high. The values displayed don't reflect reality. It was found, that it is close to 2.5V. Direct connection of external DC is not applicable. Is there a solution?
Possibility of DC input solutionThere exists well known application of operating amplifier - differential amplifier. It's schematics (Fig. 2) is quite simple.
Fig. 2: Differential amplifier. The output is joined with inputs by the formula:
The analysis of the formula shows, that at the output there can be defined DC level even in the case that U2 will be zero - provided appropriate signal will be delivered as U1. A brief inspection of Fig. 1 shows, that AWE-64 already has operational amplifier. Good new! It is candidate No. 1. Assumed changes will be negligible.
Result
What is needed:
Fig. 3: AWE-64 input modification. It works fine. With the device we did a few measurements. It was found that the maximum sensitivity is approximately +/- 100 mV. Based on +/- 5 V power it can be assumed that maximum input DC signal will be approximately +/- 2.5 V. Higher voltages must be decreased by hardware divider.
With operational amplifier on small PCB we checked SB16 and CMI8738SX too.
The final version had been made with CMI8738SX Manli sound card. Only reason
for selection was that it was cheapest and is currently available. Additional
to Fig. 3 the schematics contais -5V chip, as sound card has none. The solution is not limited to AWE-64 and comparables. It seems any sound card can be modified provided small PCB with operational amplifier will be added. At the begining AWE-64 was chosen only due to fact it already has the (pre)amplifier. However for the final solution it was not suitable - in between mother board of home computer changed and ISA slot gone...
The final solutionTo test, and even to use the device, one need some useful program. As a first choice we decided to get Konstantin Zeldovich's Winscope. It is complete, sophisticated and ... free. However, its use for more serious job is not very easy as it doesn't contain calibration feature and, what's most important, it doesn't allow AC/DC V/A measurements with numeric output. To meet our needs we developed original program. It is two channel:
To make it a real multimeter we equipped the device with manual range switch. Its construction is very simple:
Fig. 4: Manual range switch (one channel only). The resistors used are standard ones, e. g. no special selection is needed - calibration will ensure the final accuracy. Resistor 1M is standard 0.25 W resistor, resistor 11M is old 0.5W one from stock. It may be difficult nowadays, far from vacuum tubes era, to get one. But who has stock... Anyway, it can be any in the range 5 - 15M, serial combination of smaller resistors too... Resistor 0.1Ohm is a small piece of some resistive wire of unknown origin (maybe from car power controller?) from the same stock. No special components were used. Dual switch was constructed in small metal box with input bushings. It is connected with LINE IN input by standard shielded stereo cable. Switch takes very little space at the table, PC sits near the table, so no change in the organization in the room was needed. It was created program to use all information available. It is quite complex one. As it can be seen from Fig. 5, it is dual beam oscilloscope-like device combined with AC/DC multimeter, frequency meter and VU-meter.
Fig. 5: Soundscope main screen.
The row above the scope screen contains (from left to right):
The scope window has:
The row below the scope screen contains (from left to right):
The multimeter window contains two larger and two smaller displays - larger
one displays voltage or current or raw data depending of calibration status
and raw data button. The smaller ones display frequencies in Hz. Right low corner is occupied by control buttons:
Program was created using Borland Delphi 6. No shareware or commercial libraries
or components were used. To control mixer it was used excellent free mixer
component developed by Vit Kovalcik. To display numeric values nice it was
into Microsoft Windows installed LED display font - NI7SEG.TTF found somewhere
on the Internet. AC amplitude measurements are achieved by software rectifying - the value displayed is close to effective value of the AC signal. Frequency measurement is achieved by periods count measurement. As the measurement is kvanted by 1/44 100 s, it is also measure of the frequency display accuracy. The smallest measurable frequency is around 20Hz.
VU-meters display maximum amplitude of the signal, regardless positive or negative,
in one sample buffer, e. g. its display refreshes with the frequency 10.7
per second.
Triggering is derived from channel A or B. There is no possibility
to have triggered both channels. Triggering level can be set. Trigger level
is not dependent on display zero level. Currently only positive levels can be
set.
Successful use of the program expects proper sound card setup. It is accessible
via Control panel -> Sounds and Multimedia -> Audio -> Recording setup. For
more details check Microsoft Windows help. Hardware modification described in this article, provided properly set, does not influence sound card standard features in any way. The modified card can be still used by standard way. Since the soundscope can be used as non calibrated, it's not its goal. To use multimeter functions it is necessary to calibrate all ranges. Before calibration is started, it is suggested to measure linearity and sensitivity of the LINE IN input. It can be easily done using voltage calibration circuit described below. To calibrate soundscope properly it is needed:
Calibration is four step process. It consists from three identical steps to
calibrate voltage ranges and one step to calibrate current range. The first of all is zero level calibration. It requires disconnect any external voltages from inputs and shortening both with ground.
To calibrate voltage ranges one is expected to use circuit according Fig.7.
Use of regulated power source is very convenient, anyway the calibration can
be sufficiently done using batteries as power source. In this case small lamp
should be used to limit current. Current range is calibrated with the help of circuit on Fig. 8. It should be noted, that ground bushing is not used. This is possible only if the power source has ground insulated from common ground. If it is not available, battery with lamp should be used.
Fig. 7: Voltage calibration circuit.
Fig. 8: Current calibration circuit.
Calibration checks optimality of the results. It is expected, that raw value
of each range will be in interval 8000 - 24000. If this is not achieved, program
shows message. Calibration can continue, it is not suggested, however. Calibration, if successful, ends with writing into system registry. It means no INI or configuration file is created. Calibration data can be found as values of the key: HKEY_CURRENT_USER\Software\pHSoft\SoundScope On program window there is button "Raw" to disable calibration temporary. To delete calibration permanently registry key mentioned above should be deleted using regedit.
Notes for constructionThere are no special components used, except 11M resistor in switch. However silicon diodes at the input should be fast ones and should have very high resistivity. 1k resistor conducting signal to them and LINE IN should be as small as possible - its function is to be fuse. It should burn to prevent the input from overloading. Diodes should bear the "burning" current, of course.For soldering at the sound card microsolder is needed. Transformer solder must be avoided. A good lens or glasses and a certainty in hand may be needed too... Be careful when disconnecting input pins from ground (provided sound card has preamplifier already). SMD chips are quite fragile! We glued small piece of universal PCB carrying additional components close to the LINE IN input. All joins we did with insulated thin copper wires. The overall view of the experimental prototype can be seen on Fig. 9.
Fig. 9: Prototype view.
Features summary
**) 1s captured WAV file has size 176kB, 1 hour captured WAV file has size 635MB!!, an attempt to capture 9999min WAV file will fill your hard drive for sure...
This is |