Building a Cheap Oscilloscope Using Your PC? 247
JohnMadison asks: "As a engineering student, I have a lot of projects, but not much test equipment at home. I was wondering if anybody has advice on using my PC as an oscilloscope. I've downloaded a couple of shareware programs that use the sound card for input, but they weren't really useful. I am looking for a good way to make a cheap, yet decent scope. Any sugestions?" While something like this would be an interesting hack, I'm at a loss as to what you would use for probes. The submitter mentions using the sound card as an input, but would that be the best solution? If you were going to make a custom add-on to the PC to do this, what would it need? Does such an add-on already exist? Interestingly enough, this fits in well with an earlier article we did.
Latency is a problem (Score:5, Insightful)
The other problem is of course sound card inputs are AC, you really want DC coupling. And high impedance.
Bottom line: you're better off with a scope board from the back pages of one of the magazines.
easy - winamp (Score:0, Insightful)
How cheap? (Score:4, Insightful)
Re:Ask Slashdot FAQ: 1. Ask Google First (Score:3, Insightful)
O-Scope 'n the PC (Score:3, Insightful)
Get a real, used scope. (Score:5, Insightful)
You don't specify what frequencies you want to work with, but for any sort of digital work I wouldn't suggest that you use *anything* less than a 30 MHz bandwidth analog scope. With that, you'll see a lot of rounding on a 10MHz signal, but you'll be able to see something. Digital scopes are very nice, if they have a decent sample rate. To get the equivalent performance of a 30 MHz analog scope in a digital scope, the digital scope must have at least a 30MHz bandwidth and 100MHz sampling rate (or a good equivalent time setting).
Bandwidth is *very* important. Oscillations can and will happen, and if it is a high frequency parasitic oscillation, a low bandwidth scope will fool you into thinking there is nothing there. You will spend many, many hours trying to debug such a circuit, because your tools will lie.
If you look around (hamfests, ebay) you should be able to find a working old tektronix boat-anchor for between $100 and $200. I've seen plenty of kits available, but they all cost more and have less performance. Since you don't say that you want to build the scope as a learning experience, you want it as a tool. The scope should be your third piece of electronic test equipment, after a multitester and a logic probe. These tools are fundamental. Get something good, whose performance you can trust, that you won't need to debug.
Hit eBay.com (Score:2, Insightful)
Re:Need better inputs! (Score:5, Insightful)
Game ports don't actually have ADC's on them. The standard design is to discharge a capacitor, then charge it through the resitance of the joystick pot, and time how long it takes to get to a specific voltage. This is related to the resistance. So, you can't use the game port for measuring voltages directly.
Erm, that's single-slope integration, that's an ADC! Many voltmeters for instance use a variation called dual-slope integration that charges a cap for a fixed time and then times the discharge back to zero. How else can a digital device measure voltage "directly"?
Re:Idea (Score:2, Insightful)
First, you need to convert analog to digital. I found what looks to be a decent A/D converter (12 bits, so with 0-+5V input, you get resolution of ~.001V) at DigiKey [digikey.com]. This also has a "MicroWire" interface which is what the USB controller speaks.
Then, you'll need some way to talk to the USB bus, where the National Semiconductor USBN604 would work. I have no idea how to program this thing, but after reading the docs I know how to get a circut working between this and the A/D converter (I think).
On the analog lines, you'll want a (big) transistor to transpose the input voltage on a regulated 5v line. You might want a bargraph display on this 5v line, and a potentiometer to adjust input to fit a nice range.
I imagine that it would easy to create a frequency generator using a D/A converter connected to the USB chip. Here the IC would output 5v, so you'd want to connect an external power source and drive that with some transistors (+ and ground). You might want some sort of buffer to do constant waves; thus saving USB bandwidth.
Okay, those are pretty much my ideas for now. Time to do more research and draw some diagrams with xfig. I'll probably post some stuff on my site [imsa.edu] shortly. (How helpful, huh... now I'm obligated!)
Re:Latency is NOT a problem (Score:2, Insightful)
Re:If you have to ask Slashdot you aren't qualifie (Score:4, Insightful)
I might have plunged into a project like this when I was a kid and didn't know what I was getting into. I'd probably be a hell of a lot better analog designer if I had. But god, it's a big project. If you still want to go ahead, best of luck. If you actually get it working, you might as well go ahead and get the BSEE degree. Good analog designers are scarce and high-paid.
Some intermediate possibilities:
Scopes that use the PC as the display device, for instance this [ttp] from JDR Micro. It's a box with the signal conditioning and A/D circuits of a low-end digital scope, but connects to a PC parallel port for displaying the signals captured. The advantages of this, compared to a standalone scope, are that you save a few hundred dollars for the scope display and control panel, and you've got the full power of the PC for analysis of the datapoints captured.
Scope card in the PC: I'm not aware of any low-end cards now on the market. The problem with this arrangement is that the PC is full of high frequency radiated signals, so shielding a scope card from that is quite an accomplishment. It can be done, but not by amateurs, or even by non-specialized EE's like me. It does have considerable advantages, as mentioned above, plus it can DMA to the PC's memory and so be able to record for longer.
Use a Data Acquisition (DAQ) card as a scope. I've done that at audio frequencies, using National Instruments MIO cards. I'd be dubious about higher frequencies, because the signal reaching the A/D converter would be quite different from the signal you were probing. (I used Labview to program it. It lets you set up a simple system fast, and there are library functions to capture data to an array, and then display it on a scope-like window. But for the test programs I was doing, after a long learning curve, I decided that for any complex program, graphical programming is inherently less efficient than typing the code as text. Labwindows/CVI is better: you create the user interface windows by plopping icons into the window, which is nice, then type in code sort of like Visual Basic. CVI is very expensive, as compared to Visual Basic and C++ development systems which work pretty much the same, except you've got to put some work into interfacing to the card. If a nice pre-written interface to the DAQ cards is worth several thousand $, then get CVI... Labview is a little less expensive; whether it is appropriate depends on how far you need to go beyond the library functions.)
Finally, whatever you do, spend about $100 for good probes. The best scope is only as good as the probe that brings in the signal.