9
\$\begingroup\$

Its possible to have an oscilloscope from the input of the sound card? I'm trying to log the states of a PIC32 pin (min: 0V, máx: 3.6).

Is it possible to put that value on a 3.5" jack and, on the pc, have access to the sound card input values?

\$\endgroup\$
3
  • 4
    \$\begingroup\$ What frequency do you want to monitor? The sound card will be filtered to somewhere around 20Hz-20kHz; you'll have a hard time logging anything faster than slow serial communication with it. \$\endgroup\$ Commented Aug 19, 2011 at 18:45
  • \$\begingroup\$ Never tought of that...in that case it's impossible, I need 10Mhz.If an admin see this, please close the topic \$\endgroup\$
    – rnunes
    Commented Aug 20, 2011 at 12:01
  • 3
    \$\begingroup\$ I am an admin, but I'm going to leave this question open because it's on topic and useful. You can use your sound card as an oscilloscope for low-speed signals (it's perfect for audio debugging :), and there are some good answers on this page. \$\endgroup\$ Commented Aug 20, 2011 at 13:49

5 Answers 5

4
\$\begingroup\$

Be careful, your computer isn't made for this.

Another software (with the schematics to go with it): http://xoscope.sourceforge.net/

The hardware to go with it: http://xoscope.sourceforge.net/hardware/hardware.html

\$\endgroup\$
4
\$\begingroup\$

I agree with Oli that finding a cheap analogue 20 MHz scope is a way to go. You can comfortably analyze 40 MHz if you read between the divisions. However, I often use a sound card scope for it's trigger function, the memory storage, and as a third channel to control the start/stop of your signal. 12V is acceptable input for an old 16 bit sound card in an old 386DX PC. It's also good for checking proper working of an UART or RX/TX switching in a simple serial communication protocol. I would suggest to use a desktop PC card driven and not motherboard integrated as any potential over-voltage damage would be limited to the card. I use an 16 bit card and it works fine for me. Many 32 bit cards double the sampling rate as opposed to increasing bandwidth.

\$\endgroup\$
1
  • 1
    \$\begingroup\$ Useful input about 32 bit sound cards increasing the sampling rate: Would a higher sampling bit depth be likely as well? Thanks, this gave me some ideas entirely independent of sound card oscilloscopes! \$\endgroup\$ Commented Nov 4, 2012 at 5:10
2
\$\begingroup\$

Yes. There are many applications to do this. The first one I found on Google:

http://www.zeitnitz.de/Christian/scope_en

I'm sure if you ask Google you will find many more.

\$\endgroup\$
1
  • \$\begingroup\$ No dc coupling though! \$\endgroup\$
    – MikeJ-UK
    Commented Aug 19, 2011 at 15:01
1
\$\begingroup\$

This is a subjective question, but the most powerful I've found is http://www.sillanumsoft.org/prod01.htm

\$\endgroup\$
1
  • \$\begingroup\$ If you are into software, you can also take a look at Baudline. It is mostly for frequency work but sometimes looking at a waterfall frequency spectrum is very insightful (and there is a simple time plot window as well). \$\endgroup\$
    – jpc
    Commented Aug 19, 2011 at 20:35
1
\$\begingroup\$

Yes, but be very careful with the voltage. Visual Analyser (already mentioned above) is good.

Use line in if possible, and keep voltage below ~2V depending on make of soundcard, where it clips will vary - to find out apply a known signal, preferably through a 10K pot or similar while running the software and turn up until it clips on the scope. Setting up a simple input divider and buffer opamp is a good idea if you are planning on measuring voltages over 5V or so (should be a few circuits around for this)

If you are planning on doing this regularly I would seriously consider grabbing a cheap analogue scope from eBay, people are practically giving away scopes with far better performance than you will ever get from the best sound card. With a soundcard the highest frequency you can measure will be around 48KHz (maybe 96kHz with 192KHz, or as low as 22kHz with older models) as opposed to around 20MHz with a cheap scope - bear in mind a PIC32 runs at 80MHz and can toggle pins at up to 40MHz.

\$\endgroup\$
5
  • \$\begingroup\$ You can't just apply a voltage to the microphone because it is AC coupled. You need a sine wave to test amplitude. \$\endgroup\$
    – Thomas O
    Commented Aug 19, 2011 at 16:49
  • \$\begingroup\$ Sorry, I should have been clearer - this is what I meant when I said "apply a known signal". By voltages, I mean pk-pk voltage levels of an AC waveform. \$\endgroup\$
    – Oli Glaser
    Commented Aug 19, 2011 at 17:41
  • \$\begingroup\$ @Oli - I think you're confusing the bitrate of the digitized audio stream from your microphone with the bandwidth. I've never heard of a microphone input on a generic computer that can handle 48 or 96 kHz (ultrasonic) audio signals. \$\endgroup\$ Commented Aug 20, 2011 at 13:49
  • \$\begingroup\$ No, I am well aware of the difference, Nyquist and possible filtering. Some cards go up to 192kHz, for a maximum possible (if we forget about analogue bandwidth for a second) frequency of 96kHz. Many standard cards go to 96kHz sample rate. Of course analogue bandwidth may limit things too. \$\endgroup\$
    – Oli Glaser
    Commented Aug 21, 2011 at 1:13
  • \$\begingroup\$ Just to try and clarify things a bit more, it's probably safer to expect the highest measurable frequency to be around 20kHz since this is the top of the audible range and what soundcards are designed for. However some of them seem to have very little low pass filtering (I have measured a known signal above 30kHz with my soundcard) The clearest way to put it would have been the highest theoretical frequency measurable by the ADC, disregarding analogue bandwidth. The main point was a soundcard will not be ideal for testing digital electronics like the PIC32, whether limited to 20kHz or 40kHz. \$\endgroup\$
    – Oli Glaser
    Commented Aug 21, 2011 at 3:15

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.