ESP Logo
 Elliott Sound Products Project 154 

PC Oscilloscope Interface

© April 2015, Rod Elliott

Introduction

There are quite a few examples of PC based oscilloscopes on the Net, and also quite a few interface circuits.  Some of the interfaces are very basic, and others quite complex.  There are a few that have a reasonable chance of success, but most have very little protection for the input circuit.  If anyone was silly enough to connect their interface to a high voltage source (such as a valve amplifier as an extreme example), it's almost certain that the input opamp will be destroyed.  Even worse is when the 'interface' is simply a fixed attenuator and feeds the attenuated signal to the sound card input - again with no protection.

This simple project is designed to provide an industry standard input impedance of 1M ohm in parallel with 20pF, and the circuit capacitances (plus a small amount of stray capacitance) will ensure that the standard 20pF is maintained.  This allows the use of frequency compensated x10 or x100 probes if required.  Protection of the sound card is paramount, especially since many people will use a laptop or tablet.  The sound card is part of the main board (even in most desktop PCs), so if it's damaged there is usually no economical repair process.  Nothing can protect something against every possible catastrophe, but it makes sense to ensure that the sound card won't be damaged with the most common misadventures.  The circuit described can also be used with most external (USB) sound cards as well.  The input attenuator allows for input voltages up to 100V RMS to be displayed without the need for attenuator probes.

note Note Carefully   This interface unit must never be connected to the mains, or to any equipment that does not use a fully isolated power supply.  To do so may cause serious injury or death, and/ or may cause irreparable damage to the interface itself, and/ or the PC or tablet to which it is connected.  Never exceed the maximum input voltage (100V RMS) from any source.  Do not use the interface with valve equipment.

While it's unfortunate that most PC sound cards only have response up to 20kHz, for many general tests this is enough.  However, it's not sufficient to allow you to see high frequency oscillation (whether continuous or parasitic), and this limits the usefulness of any sound card based oscilloscope.  I consider a 'real' oscilloscope to be an indispensable tool, and bandwidth of at least 20MHz is essential for tracking down problems that cannot be found by other means.

Please ensure that you read the disclaimer at the end of this page before starting work on your new interface.  I know it works, but I will not accept responsibility if you manage to blow up your sound card or computer!


Project Description

The circuit is quite straightforward.  The choice of opamp is fairly critical because a single 9V battery is only equivalent to ±4.5V and this is not enough for many devices.  You can use a LM358 is a fairly low-performance dual opamp, but since it's only used as a buffer it will be fine in this role.  You could use an OPA2134 (dual), which is a good choice if you are happy to pay the extra, but current drain is higher than many other opamps so the battery won't last very long.  The preferred option (as shown) is the CA3140, a single opamp which is ideal because it's reasonably priced, and it has extremely high input impedance.  An opamp with FET inputs is beneficial to ensure that the opamp's input impedance doesn't compromise the overall input impedance, but it's not essential.

The LM358 dual opamp is a very economical choice, and these work happily from low voltages.  Distortion and noise aren't wonderful, but it's a very cheap way to build the interface.  The response won't be quite as good as with a pair of CA3140s or an OPA2134, but it's still likely to be far better than the sound card.  I've also tested the buffer (and protection) stage using an NE5532, which is a very good opamp that's fine with only 9V total supply, but it draws more current than the CA3140 or LM358 so your battery will be drained more quickly.  I also considered the use of 5V opamps, but then you need to include a voltage regulator as well.  Since most are surface mount, this is not usually an option for DIY constructors and Veroboard (or similar) can't be used easily.

The input attenuator is optional, and you can use a 1M pot if you prefer.  Bear in mind that if a high level signal is applied and the pot is at close to its maximum setting it may be damaged.  It's difficult to calibrate a PC based oscilloscope because the actual line-in sensitivity is often an unknown, and most of the PC oscilloscope software programs aren't calibrated in any way.  Some do make an attempt, but you will need a calibration signal so that it can be set up properly.  If you use a pot, it can't be frequency compensated and response may be affected when the pot is close to half its resistance - especially with high impedance sources.  You also can't use x10 or x100 oscilloscope probes because they can't be compensated properly.  You can include a 15-18pF cap in parallel with the pot which might work with some probes.

The interface is AC coupled, and no attempt is made to allow DC coupling because sound cards are invariably AC coupled anyway.  The first line of defence is C1, which will ideally be an X2-Class AC rated 400V capacitor, or a 630V DC cap can also be used.  A 100nF cap in conjunction with the 1Meg input impedance gives a low frequency cutoff of 1.59Hz, which is well below the -3dB frequency of any sound card.  One channel is shown below - the other is identical, and uses another CA3140 opamp.

note Please Note:  Do not substitute the input capacitors (C1L/R).  The value and type is specified to protect the interface (and your sound card) from high voltages that may destroy either or both circuits, and in extreme cases could even cause irreparable damage to your PC, and/ or place you in danger of serious electric shock.  Likewise, never connect the ground clip to any voltage other than ground (earth/ zero volts, etc.).

R4(L&R) is very much a compromise.  Being a relatively high value, its thermal noise degrades the signal and the high value increases the DC offset of the circuit.  However, it provides a very good safety factor because the current into the opamp's input stage protection diodes (D1 and D2) is limited.  Even with a 100V RMS input signal and with the range switch 'accidentally' set for maximum sensitivity, the current through R4 is only 1mA RMS (±1.4mA peak).  Dissipation in R4 is only 100mW under these conditions, and the opamp and your sound card will survive.  If this resistor was not present, severe damage could be caused.  If you need extended bandwidth (from a sound card with 196kHz sampling for example), you may need to reduce the value.  To protect the electronics, use the highest value that still provides acceptable frequency response.

Figure 1
Figure 1 - PC Oscilloscope Interface Circuit (Left Channel)

The attenuator shown is compensated, but even without the capacitors it will most likely be fine considering that the upper limit is normally only 20kHz.  Note that you will not be able to use compensated oscilloscope probes if you omit the capacitors.  The second channel uses the other half of U1.  The protection diodes at the opamp's input need to be low capacitance, and care is needed to ensure that there is the smallest amount of stray capacitance possible.  This means no long wires and no shielded cable, even though the latter would seem to be essential because of the high impedances.  Instead, the entire unit should be housed in an earthed metal enclosure, with the earth connection being via the leads from the interface to the sound card.  (A connection to mains safety earth is not required.)

The attenuator should match most oscilloscope probes if the compensation caps are included.  These caps must be measured accurately because they form a significant part of the attenuator network, and even a small error will cause frequency response variations.  Measure the caps to at least 1% if possible, and they should be NP0/G0G ceramic types (C3 can be a 1.2nF polyester in parallel with a 150pF ceramic.  Although most NP0 ceramic caps are only rated for 50V, I have tested them at 500V and saw no leakage or damage.  Feel free to use a 3kV type for C2 if you prefer (and if you can get them easily).  The 'Range' switch will most likely be a 3-position rotary switch.  VR1L will be a 10 turn miniature trimpot and is used only for calibration.

The positions marked 'Gnd' and Loop Back' are optional, and were suggested by a reader.  You may find them useful, but whether you use them or not depends on your needs.  The loop-back connection may or may not work with your sound card.


Calibrator

If you plan to use oscilloscope probes, the input connectors will need to be standard chassis mount BNC types, as these are standard on all oscilloscopes and probe sets.  Output connectors will usually be a 3.5mm stereo mini-jack (same as used for the line input on the sound card).

When wiring the mini jack socket, the tip is Channel 1 (Left), the ring is Channel 2 (Right) and the sleeve is earth/ ground.  If you plan to use something other than a standard PC or tablet, verify the channel assignments before you wire everything up.

Figure 2
Figure 2 - Optional 1kHz Calibrator

To be able to use standard x10 or x100 oscilloscope probes, you will need the calibrator so the probes can be compensated properly.  The output is a 1kHz squarewave, and the frequency is set using VR1.  If the amplitude can be calibrated using a 'real' oscilloscope then you can calibrate the output voltage with VR2 and take measurements of actual levels.  The switch is included so the squarewave can be switched off when not needed.  It will be in the same box as everything else and uses half of U2, so the channel circuits will pick up noise from the oscillator that will interfere if you are measuring low level signals.

The output level should be set for exactly 2V peak-peak (which is 1V RMS for a squarewave), using VR2.  Both trimpots will be miniature 10 turn types.  The zener diode clamp circuit is included so the level doesn't vary as the battery discharges.  To calibrate x10 (or x100) probes you carefully adjust the compensation trimmer in the probe until the waveform is perfectly square.  Detailed instructions are usually supplied with the probes.


opampThe pinouts for dual and single opamps are shown here for reference.  These are industry standard, and very few devices use anything different.  If you decide to use an obscure device then you will have to verify the pinouts to ensure that they are connected properly.  Single opamps often provide other functions to the pins that are not assigned in the drawing.

I never use or recommend any quad opamps, because only a limited number of devices use that arrangement, and they can be a real nuisance to wire on Veroboard or other prototyping boards.


Power Supply

The interface opamp(s) will normally be powered from a single 9V battery, but you will need two of them if you want to use a TL072 opamp.  Although a TL072 opamp might work with a single 9V battery, these devices are not designed for operation at ±4.5V and need at least ±5V to ensure normal operation.  The other alternative is to use an external 12V supply, but this isn't always convenient and switchmode supplies (the most common these days) will add some noise that may cause problems with the display.

Figure 3
Figure 3 - Interface Power Supply Circuit

The supply shown above will suit most requirements.  When using the single 9V battery circuit as shown, the battery can be replaced by an external supply of anything between 6V and 24V DC.  Note that the external supply output must be fully floating, with no connection to anything else.  An external supply must not be used when the battery is connected, as the battery may explode.

If you use two 9V batteries with the centre tap used as earth (ground), the on/off switch must be double-pole so that both batteries can be disconnected.  In this case, the opamp can be omitted as the battery centre tap will be the earth point.  The 220uF electrolytic caps should be retained to ensure the supply remains low impedance as the battery internal resistance increases towards the end of life.


Construction

Construction is not critical, and no PCB is offered or planned for this project.  The opamps are most easily wired using Veroboard or similar.  The attenuators should be wired directly onto the Range switches.  The input protection resistor (R4) and diodes (D1 and D2) must be wired as close to the opamp inputs as possible to minimise stray capacitance.

The power supply and calibration oscillator can be assembled on a separate piece of Veroboard, although they can be on the same piece as the buffers if desired because the oscillator will be disabled when not in use.  None of the wiring for these two sections is critical.

To prevent noise pickup and hum, the entire circuit should be in a metal (or metal lined) enclosure.  The input BNC connectors and calibration 'GND' terminals should be the only direct connection to the case.  If you use a plastic case, the metal lining can be aluminium foil, carefully stuck onto the inside of the case with spray adhesive.  Make sure that you provide a good electrical connection between the two sections if the case has a separate lid.

The terminals for the oscillator output can be almost anything you like.  Most oscilloscopes provide metal loops for the calibration and earth connections, so you can use heavy gauge tinned copper wire to make loops.  Make sure that the calibration output doesn't short to the case or lining, and that the ground terminal is securely connected to the system ground/ earth/ case as appropriate.

When the unit is first connected to your sound card, ensure that the pots VR1L and VR1R are set to minimum output.  Apply a signal of 1V RMS to the input, set the attenuators to the 1V range, then advance the trimpots to get the maximum undistorted level into the sound card.  The sensitivity of the oscilloscope software should be adjusted so you can see the level when the signal just starts to clip (the top and bottom of the sinewave will be cut off).  This is the maximum level the sound card can handle - reduce the output with the pot until there is no clipping.

If you have an external USB sound card (or intend to buy one for the purpose), you may be able to fit it into a new case along with the circuits shown here.  It might be possible to power the circuits from the 5V supply that you can get from the USB connection, but the opamps will not be very happy with a single 5V supply.  The LM358 opamps are supposed to be suitable for 5V operation but I tested that and the maximum input level before clipping is only 900mV.  You can get rail-to-rail opamps that are designed specifically for 5V operation, so this is an option you can explore if you wish.  Bear in mind that most are SMD and will be hard to work with.

Also note that the circuit shown won't work on a single 5V supply without modification.  As described, the floating 9V supply (±4.5V) allows the buffer amps to work with no coupling caps at the input or output, but they need to be added for a 'unipolar' 5V supply.  Considering the application, inherent simplicity and ease of construction as shown, the cost of a 9V battery is a small price to pay.  You can expect the current drain to be less than 5mA for the complete circuit, including the squarewave oscillator.

With a current draw of 5mA, a standard alkaline 9V battery should last in excess of 100 hours if used constantly (they are typically rated for about 580mA/hours at a 3mA discharge rate).  With intermittent use of perhaps 1 hour a day (which is still rather unlikely), that means you should have to change the battery about every 4 months or so.  For most people and with more typical usage, the battery will probably last for a year or more.


Conclusion

This circuit makes no pretence of being the ultimate PC oscilloscope interface, but it's reasonably simple to build and should be fairly inexpensive.  It also has good input protection, something that's sadly lacking in some of the circuits you'll find.  With the ability to view waveforms of up to 100V RMS, you'll be able to examine the output of most power amplifiers without having to build an external attenuator.  By including a compensated attenuator, it's possible to use x10 or x100 compensated oscilloscope probes, because the input impedance is fixed at 1 megohm with about 20pF of input capacitance (including 'stray' capacitance from the input connector and internal wiring).

Unfortunately calibration is likely to be difficult because of the software drivers used with most sound cards.  The gain of the sound card is often variable (although buried perhaps 15 menus deep in a most obscure manner in many cases).  You will need to experiment to find the right setting for your sound card, which ideally will be set for unity gain.  Depending on the oscilloscope software you use, you may have a good range of adjustment from the software.

I'm not going to make any specific recommendations for PC Oscilloscope programs.  There are several available, and you will need to decide for yourself which one suits your needs.  There seem to be a couple that are free, and others that require a (small) payment to use them.  Beware of some of the rogue sites you'll come across while searching, which may include crapware with the download.  A web search for "pc oscilloscope software" (without the quotes) will get you started, but there's a lot of dross so you will have to search carefully.

Beware of the multitude of 'hardware' circuits.  Most have very limited, completely useless or altogether absent protection circuits, which may make it very easy to damage your sound card.  It is certainly possible to make a circuit that's much simpler than the one shown here, but don't expect it to provide much functionality or hardware protection.  Some others will be ok, but only if you need to measure things operating from +5V supplies and nothing else, otherwise you are in danger of blowing up the sound card (and possibly the rest of the computer as well).

DISCLAIMER:   While every care has been taken to ensure that the circuit shown will function as described and provide reasonable protection against accidental damage, ESP takes no responsibility for any damage howsoever caused by the use or misuse of the material described here.  It is the user's responsibility absolutely to ensure that the interface is properly constructed in a workmanlike manner, is safe to use, and is never connected to any signal source that may cause damage or destruction of the operator, the interface, the sound card to which it is connected, or the PC or other device used to support the sound card.


 

HomeMain Index ProjectsProjects Index
Copyright Notice.This article, including but not limited to all text and diagrams, is the intellectual property of Rod Elliott, and is © 2015.  Reproduction or re-publication by any means whatsoever, whether electronic, mechanical or electro-mechanical, is strictly prohibited under International Copyright laws.  The author grants the reader the right to use this information for personal use only, and further allow that one (1) copy may be made for reference while constructing the project.  Commercial use is prohibited without express written authorisation from Rod Elliott.
Page Published and Copyright © Rod Elliott, April 2015