Introduction: PC SOUND-CARD SCOPE INTERFACE FACILITATES DC RESTORATION

About: I am a retired Electronic Systems Engineer now pursuing my hobbies full time. I share what I do especially with the world wide student community.

To start with I must appreciate acknowledge and thank ‘Christian Zeitnitz’ for the fantastic Sound-card Oscilloscope & signal generator software available at his website  on which this Instructable is based.

While working with the PC sound-card oscilloscope and signal generator I found the following limitations:

1.   A low Input Impedance of the order 10 Kilo Ohms
2.   Input voltage range limited to 2.8 V p-p
3.   AC coupling of the I/O signals
4.   Output voltage limited to 2V p-p
5.   Sampling rate limited to 44kbps

Not much can be done about the sampling rate as it is a limitation of the sound card but the scope interface presented here attempts to improve the other factors.

Most significant is the addition of circuitry to estimate the positive and negative peak DC values of the signal and use this to offset the waveforms providing a realistic DC-coupled scope display.

Let me illustrate this with an two Examples

Step 1: 555 Timer Example

Waveform before correction

The 555 Timer IC when operated as an astable oscillator from 5V provides a square wave of 0-5V and the waveform at the timing capacitor varies from 1/3 to 2/3 of 5V.

The first screen shot shows the timer IC 555  AC coupled waveforms as captured by the PC sound-card. It can be seen that the zero settles at the average value. (The input has been scaled by 1:10 to remain within the input voltage limits.)

The square wave shows a peak value of 171mV instead of 5V and the capacitor waveform appears to be centered at 0V with a peak value of 66.59mV.

The interface circuit provides two peak-hold circuits which provide the positive and negative peak DC value of the input waveforms. Using a multimeter to measure these values gave 468mV and 283mV as the positive peak values for the square and capacitor waveforms respectively.

We can compute that the square wave needs to be offset by 468mV -171mV = 297mV and the capacitor waveform by 283mV - 66mV = 217mV.

Waveform after DC restoration

The second  figure shows the waveforms after entering the offset values 297mV and 217mV into the offset boxes for CH1 and Ch2.

After DC restoration the square wave varies from 0 to 455mV and the capacitor waveform from 1/3 to 2/3 of 5V.

This would be the display we would see on a scope with DC coupling.

Step 2: BEFORE AND AFTER FOR a RECTIFIED SINE WAVE

A 3V p-p 1kHz sine wave is fed through a silicon diode to a resistive load. 

The first figure shows that the sin wave is centered around zero as it has an average value of zero, but the rectified wave settles with flattened portion of the waveform corresponding to the negative cycle below the zero line at -327mV.

By applying the same technique, that is measuring the peak value of the rectified wave and applying the corresponding offset we get the waveform in the next figure.

After DC restoration the negative cycles show a value closer to zero volts.

Step 3: CONSTRUCTION OF THE SCOPE INTERFACE

Circuit Diagram,  Description, Front panel & BOM

IC 747 U1 forms the input interface to the PC sound-card. The operational amplifiers are in the non-inverting configuration to provide high impedance and the gain can be set to 0.1, 1 or 10 using the DIP switch.

The peak detector circuits using U2 as a comparator and Optical isolators ISO1 and ISO2 form the “novel feature” of this circuit. When the input signal is high U2 output is positive driving ISO1 ON, the signal charges capacitor C2 to the peak value of the input signal as seen at the sound card input. The capacitor cannot discharge if the input goes below the peak value as the output transistor is reverse biased. Slow decay of the stored peak value is permitted through R8.

The negative peak is captured in a similar manner by ISO2.

IC U3 forms a gain X 5 stage for the sound card output

The second figure gives the front panel layout and gain selection table.

The Bill of Materials is provided.

Step 4: PCB AND COMPONENT PLACEMENT

The .jpg images give the 1:1 PCB layout in A4 size suitable for fabrication using the toner transfer method.

The TOP layer is given mirrored and the BOTTOM is normal.

The component placement is shown.

Step 5: POPULATING THE PCB

The images give in sequence:

1.  The Bare PCB TOP

2.  Bare PCB Bottom

3. PCB with IC bases and resistors

4. PCB with all components populated.

Note:

The DIP switch is planned for the bottom side and will be placed later.

As the holes are not plated through the components need to be soldered on both sides wherever required.

There is one via, do not miss this.

One connection has been missed in the routing this needs to be connected using a jumper. (Sorry for the bad image)

Step 6: THE ENCLOSURE

I had an old plastic container to which an aluminum bottom plate has been added.

I planned the positioning of the front panel connectors and switches a slot for the DIP switch on top and for the 9-Pin D connector at the rear.

The images show the enclosure fabrication in steps.

Step 7: CONFORMAL COATING AND ASSEMBLY

Interconnecting wire is soldered to the board with extra length so that the board can be coated with lacquer before assembly.

The front panel layout is provided again.

The wiring is carried out as per the circuit diagram and additional details given in the component placement diagram. The +/- 12V supply is routed through the Power ON switch and an LED indicator added to the +12V line.

Step 8: PC INTERCONNECT CABLE

The sound card line input and speaker out are wired to the 9Pin D-Connector using 3-mm stereo jacks from old sets of earphones. Three wires are added for the External DC supply +/- 12V.

A length of 3meters is chosen for convenience. No shielding was carried out.

Cables with clips are also wired for the input and jacks for the output. (See this in the final figure)

Step 9: INTERFACE IN ACTION & SUMMARY

See the interface in action with the input clips connected to the IC 555 timer circuit which is on a breadboard.

The terminal layout and DIP switch gain setting table are pasted on the cover of the enclosure.


SUMMARY:

The PC Sound-card Interface presented improves the I/O characteristics and illustrates a method of DC restoration of the AC coupled waveforms using a novel peak-hold circuit. The resulting waveforms are a realistic representation of those obtained by a DC coupled oscilloscope.

This offset correction can also be carried out offline on the .csv format data provided by the software using MS EXCEL.