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
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
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
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 TOP layer is given mirrored and the BOTTOM is normal.
The component placement is shown.
Step 5: POPULATING THE PCB
1. The Bare PCB TOP
2. Bare PCB Bottom
3. PCB with IC bases and resistors
4. PCB with all components populated.
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 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
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
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
The terminal layout and DIP switch gain setting table are pasted on the cover of the enclosure.
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.