Decoupling of soundcard oscilloscope

eggie

Member
I really could do with a logic analyser and oscilloscope but cannot justify the cost of buying one for the limited electronic work I do (kitchen table top hobbyist). Having read plenty of the blogs it seems that a good starter is a soundcard scope. I appreciate that these are not serious pieces of equipment and there are very mixed feelings about their usefulness but for what I want (occasional analysis of circuits) these are probably sufficient.

The purpose to this post is to ask for some advice on the linking of the circuits to the soundcard. With the soundcard only accepting 1-2v and this being integral with my laptop the last thing I want to do is cook it accidentally with 5v or more. I would rather have nothing than have any risk of that. Therefore can anyone offer any advice on whether an optocoupler would cause too much distortion to prevent its use. I appreciate that the capacitors in the soundcard cause problems but will the optocoupler cause such additional distortion to render the apparatus useless?

Is there any other way of guaranteeing that the voltage does not exceed the limits – or is just down to potential dividers and making sure you do not accidently get it wrong?

I have searched for a blog on the subject in this forum and additionally cannot find anything on the internet apart from the potential divider.

Thanks in anticipation.

eggie
 

Reloadron

Senior Member
I don't believe an opto-coupler type device is what you are after. Rather you want to build a basic scope probe resistive divider. You also want to remember the signal into just about all sound cards is AC coupled meaning the signal in is coupled through a capacitor blocking any DC level offsets. A Google of oscilloscope probe circuits will bring up many hits on how to build yourself a probe. A big part of the trick is knowing the sound card impedance but that can be worked around. Anyway, all you really want and need is a simple resistive divider and half the divider is your sound card input.

Just My Take
Ron
 

Dippy

Moderator
I would have thought an optocoupler could do the job for logic stuff...with caveats and maybe not on it's own.
If you make the 'supply' voltage to output side within your desired range then it will switch that minus the outputswitch voltage drop.

You haven't indicated the max/min speed/frequency??
There are a million optocouplers around; some fast, some not so fast, some just LED input, some logic buffered i/o.

Two potential issues.
1. You may need to buffer the drive side of the opto if your source is feeble or high-impedance as the LED load may upset things.
2. I have never used a sound-card 'scope. Are all (yours) sound cards AC coupled? If so, you may get not-exactly-squared waves in some cases.

Other options; zener protection or op-amp based input. The former may distort things out of square.
It depends on your requirements and expectations.
 

hippy

Technical Support
Staff member
With the soundcard only accepting 1-2v and this being integral with my laptop the last thing I want to do is cook it accidentally with 5v or more. I would rather have nothing than have any risk of that.
There's a middle way between nothing and risk of losing everything - That's to get another PC or laptop whose demise won't be the end of the world when its sitting there with smoke pouring out of it :)

It's side-stepping the problem that there can rarely be zero risk ( only lowered risk ) by making the risk almost entirely inconsequential. Use a desktop and if the sound card does transport itself into an alternative reality then hopefully only that will have been destroyed which is often an ultra-low cost replacement. If everything is destroyed it can go to landfill with few tears and little despair.
 

Reloadron

Senior Member
This link shows a pretty basic resistive divider network. I guess if there is a real concern about overvoltage to the sound card input placing a few diodes in series between the signal high paths and common would clamp the voltage if it went above about 1.4 volts. That or maybe use zener diodes in the mix. The last time I used an opto-coupler in a similar application they were only pretty linear for a small range.

Ron
 

inglewoodpete

Senior Member
To throw in my 20c worth (that's about UK 14p)....

I built an oscilloscope attenuator and preamp from an old Electronics Australia magazine design (before they went bust). The preamp (op amp) ran off a 5v supply, so limiting the voltage offered to the sound card to about 3v peak-to-peak. There was never a hint of damaging the sound card. Alternatively, you could add a voltage divider after the preamp to limit the input voltage to what you consider to be 'safer' levels.

On square waves and frequency response, I used two different sound cards before I bought a mid-range digital/USB scope and the difference was quite significant.

The bog-standard sound card had limited bass response and the frequency response rolled off badly below about 50Hz. The high end was limited by the 44100 samples/second rate. Square waves were displayed quite well, considering it was just a sound card.

More expensive cards sample at 96kbits/second and higher. I wouldn't buy a fancy sound card, though. If you have that sort of cash, look at getting a low end USB oscilloscope. Or wait until Wolfgang's become available.
 
Last edited:

MFB

Senior Member
Depending on the speed that you need, it may be possible to use an PICAXE to drive the serial port (or via a USB-serial adapter) of your PC. Then run something like StampPlot Pro (free download) to produce a real-time display of up to 10 analog and several digital channels. Not only a cheap solution for developing control and instrumentation circuitry but the PICAXE input protection should also save your PC from damage.
 

nick12ab

Senior Member
Depending on the speed that you need, it may be possible to use an PICAXE to drive the serial port (or via a USB-serial adapter) of your PC. Then run something like StampPlot Pro (free download) to produce a real-time display of up to 10 analog and several digital channels. Not only a cheap solution for developing control and instrumentation circuitry but the PICAXE input protection should also save your PC from damage.
Suitable for relatively low frequencies only but fast enough. I think I'll try this.
 

eggie

Member
Thanks to everyone.

You have given me some excellent suggestions to follow up and will now spend some further time on the internet. I have been following Wolfgang's project with great interest but I have a requirement for something to fill a gap until he finishes his working.
 

John West

Senior Member
My two cents worth on the subject of opto-couplers:
There are many different sorts of such couplers, both analog and digital. One type is designed specifically for analog isolation and small signal transmission, and some of them have been designed to have very high linearity. One of that type would do the job for you, if it is fast enough. It's all a matter of searching out an opto with the right specs.

I like the idea of using an opto as it physically isolates the PC from any unusual voltages or offsets that might occur if things are not hooked up properly, meaning it helps protect against the sort of major hookup mistakes we all make sooner or later.
 
Last edited:

MFB

Senior Member
nick12ab, You could start by trying this code to give a multichannel analog and digital display. The main advantage of this approach over a sound card is that you have dc coupling that can handle digital inputs.




'CONFIGURE 14M FOR 5 ANALOG AND 3 DIGITAL INPUTS
'WORKS OK WITH STAMPPLOT 'NO FRILLS' SETUP

let dirsc = %000 'reconfigure C0-3 as inputs

start:
b0=pins 'Read digital inputs 1-3
readadc 0, b1 'Analog input, leg 7
readadc 1, b2 ' ,, ,, ,, 10
readadc 2, b3 ' ,, ,, ,, 9
readadc 3, b4 ' ,, ,, ,, 8
readadc 4, b5 ' ,, ,, ,, 3
serout 2, N1200, (#b1,",",#b2,",",#b3,",",#b4,",",#b5,cr) 'send analog
serout 2, N1200, ("%",#bit3,",",#bit2,",",#bit1,cr) 'send digital
pause 1000
goto start
 
Top