Forgot your password?
typodupeerror
Hardware

Building a Cheap Oscilloscope Using Your PC? 247

Posted by Cliff
from the but-where-would-you-plug-in-the-probes dept.
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.
This discussion has been archived. No new comments can be posted.

Building a Cheap Oscilloscope Using Your PC?

Comments Filter:
  • by SilentTristero (99253) on Friday December 07, 2001 @07:02PM (#2673400)
    I've done this with some of the freeware Windows scope programs out there (I'm a former VLSI hardware designer), but even at 96kHz the latency vs. buffer size issue gets to be a problem when probing around in a circuit. It's marginally acceptable for tuning up tape deck heads and so on, but don't try it for any serious design or repair work.

    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)

    by PhiberKut (9428) on Friday December 07, 2001 @07:04PM (#2673412) Homepage
    Winamp has excellent visualizations. Use the soundcard as the input, then customize winamp...use visu. plugins.
  • How cheap? (Score:4, Insightful)

    by Jeffrey Baker (6191) on Friday December 07, 2001 @07:17PM (#2673510)
    How cheap are we talking about here? You can get a Tektronix 465 with a probe for $200 or less and this is a nice featureful scope. There's a reason the 465 was in production for decades. It's many times better than some sound card hack.
  • And for just under $400! Uh, but at that price, why not just buy a stand-alone 'scope?

  • O-Scope 'n the PC (Score:3, Insightful)

    by ackthpt (218170) on Friday December 07, 2001 @07:23PM (#2673555) Homepage Journal
    Hopefully someone can set you up with a way to do it, but what I've seen is often worse than buying a good used one at a Hamfest. You should get in touch with ARRL folks in your neck of the woods and find out when and where Hamfests take place. Granted, you may have to shell if you want a good storage scope, but some decent scopes can be found. My dad has a soft spot for Tektronix scopes.
  • by Matt_Bennett (79107) on Friday December 07, 2001 @07:28PM (#2673590) Homepage Journal
    I know you want to use your PC, but try to get a real live scope- you'll probably spend less money and get a better measurement device. A sound card would be barely good enough for doing audio measurements, but you run into the problem of an impedance that is too low, with too low a bandwidth. Yeah, you may only want to look at audio frequencies, but realistically, you want a scope with 3-10 times the bandwidth of the highest frequency you'll be looking at.

    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)

    by eXtro (258933) on Friday December 07, 2001 @07:35PM (#2673635) Homepage
    I picked up a decent analog oscilliscope for 200 bucks. It's got 35 MHz bandwidth which is plenty for most things you can do in a home lab. This seems like a better option than the 350 dollar PC card that has 10 MHz analog bandwidth mentioned elsewhere.
  • by Dr. Awktagon (233360) on Friday December 07, 2001 @08:22PM (#2673905) Homepage

    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)

    by jrockway (229604) <jon-nospam@jrock.us> on Saturday December 08, 2001 @12:07AM (#2674605) Homepage Journal
    Okay, I've looked into some IC's to get this thing to work.

    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!)
  • by Sigfried_Blip (526923) on Saturday December 08, 2001 @03:52AM (#2675091) Homepage
    Try the linux program called baudline [baudline.com], with a typical cheapo sound card, it's analog input to screen draw latency is less than 1/60 of a second. That is far from slow.
  • by markmoss (301064) on Saturday December 08, 2001 @10:56AM (#2675388)
    I'd amend that statement a bit -- by the time you get decent results by building your own, you will have acquired valuable and rare skills in analog design and construction. And you will have had to buy or borrow a real oscilloscope in order to find out what's wrong with the one you built! I'm a test engineer. I make functional test fixtures that apply stimulus to a board and check the output signals from it. Getting DC analog signals from the board to the A/D converter accurately is harder than it looks. Audio frequencies are harder. Scopes should work at well above audio frequencies, and that gets very hairy -- every wire is also an antenna, capacitor, and inductor, all at the same time.

    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.

Faith may be defined briefly as an illogical belief in the occurence of the improbable. - H. L. Mencken

Working...