# PC SOUND-CARD SCOPE INTERFACE FACILITATES DC RESTORATION

56,433

124

17

## Introduction: PC SOUND-CARD SCOPE INTERFACE FACILITATES DC RESTORATION

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.

219 15K
75 7.1K
281 24K
279 27K

## 17 Discussions

Some video of the device working?
the project is good but needs some more work

You're doing great, keep it up ^^

es necesario un video, no está muy claro la funcionalidad del esquema

dip switches 1-2-3-4 are short-circuited .1. Fig.3. I guess the entry should be 12V RET. 2.ve3. I guess the entry will be GND. In addition, two edet lm741 appears in the PCB component, but only one is used in the circuit diagram. If you explain a little ... I am an amateur electronics .... I can't wait to use this interface circuit .... Thank you very much for your labor ....dip switch 1-2-3-4 numaralı girişler, kısa devre gibi görünüyor .1. ve3. giriş 12v RET olmalıydı sanırım . 2.ve3. giriş GND olacak sanırım . Ayrıca PCB kompanent fotoğrafında iki edet lm741 görünüyar fakat devre şemasında yanlızca bir tane kullanılmış .PC817 lerin kullanıldığı devreyi biraz açıklarmısınız .VPK + ve - prop çıkışlarını nasıl kullanabiliriz ? biraz açıklarsanız çok sevinirim... Ben amatör bir elektronik severim ....bu arayüz devresini kullanmak için sabırsızlanıyorum....verdiğiniz emek için size çok teşekkür ederim ....sevgilerimle.....

Keeping the inpu to the PC Sound card within +/-2 V and with 0.1 Gain we can get +/- 20 V input range.

Hello,

How much will be the input voltage range after the improvement ?

Yes you can use 2 LM741's instead of the LM747 but you will need to make the appropriate connections.

The 741/747 need +/- 9 V supply typically.

This scheme should comfortably work for signals down to 100mV.

Best part of this scope is that it comes with internal variable gain system. I was planning to make a separate variable gain circuit with another scope instructable and I came across this instructable. A big thank you for that :-)

Hi,

1-Can I use 2 LM741 instead of single LM747 , I hope the function is same?

2- What is the min Vcc required for these amplifiers? I want to make a scope for low voltage signals(<2V).

Great Job. Very clear and helpful instructable. You are my hero!!!
I wish you had data file for this PC board, do you?

You need to click on the  " i " in the corner of the picture of the schematic and select the original high res size of the image.

Great Instructible! Another project goes on the list.

Please forgive "numptie" status here but I can't find where to download the high res image of this schematic!
Boingx says click on the "i" but I can't find the "i" to click on!