Shop OBEX P1 Docs P2 Docs Learn Events
Sound Card based Oscilloscope???? — Parallax Forums

Sound Card based Oscilloscope????

glasoglaso Posts: 38
edited 2005-04-02 15:39 in General Discussion
Did anyone have tried one of those softwares that emulates an oscilloscope and receive the signals from the mic input of a sound card?

What I need for the probes?

What is the maximum voltage that the sound card could support?

·

Comments

  • Steve JoblinSteve Joblin Posts: 784
    edited 2005-03-22 21:13
    Funny timing.... I just found out about and downloaded Winscope last night!· It is kind of cool.· It worked without probes because my laptop has a built in mic.· I am a bit nervous to hook up probes to it.· I have very new laptop and I don't want to blow my sound card.· It is easy enough though.· Just use a standard microphone jack and plug it in.· The ends of the two wires are the leads.· I would love to know if anyone else has used it for simple projects.
  • glasoglaso Posts: 38
    edited 2005-03-22 21:25
    I will give it a try with a voltage divider and a known signal from the basic stamp. I will adjust the pot of the voltage divider to 0v and will start increasing it untill I have a clear signal in my screen. I will use this sistem os reading the signals with the minimum voltage until I have some better information about the maximum input voltage of the sound card.
  • Chris SavageChris Savage Parallax Engineering Posts: 14,406
    edited 2005-03-23 03:49
    Be careful!· Standard line-level audio signals are usually no more than 1V Peak, and in some newer car audio systems 2V.· 5 Volts from the stamp may damage the sound card.



    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Chris Savage

    Parallax Tech Support
    csavage@parallax.com
  • glasoglaso Posts: 38
    edited 2005-03-23 14:03
    Yestarday I tried one of those sound card based oscilloscope softwares, and it worked great. I connected the signal from the stamp to the PC through a 100k pot, connected as a voltage divider. Then with the pot in the minimum, (0v) I started rising it until I had a clear signal in my screen with peaks of about 0.3v

    It was very easy and a good alternative for those who need an oscilloscope for some basic operations which doesn't justify a real oscilloscope.

    Post Edited (glaso) : 3/23/2005 2:08:18 PM GMT
  • Steve JoblinSteve Joblin Posts: 784
    edited 2005-03-23 20:00
    Glaso - Thanks for the feedback on its usefulness, however, given Chris's comment, I think I will stay away.
  • glasoglaso Posts: 38
    edited 2005-03-23 21:49
    To be sure I installed an old sound card (as a second sound card) in
    my computer, but I think tha with the necessary precautions you will
    have no problems
  • LoopyBytelooseLoopyByteloose Posts: 12,537
    edited 2005-03-28 10:56
    Hey guys, this is a job for opto-isolators.

    If you really are concerned about your computer and the input works with the software - just·use an opto-isolator to supply a controlled and limited input to your computer.

    Then, if you mistakenly hook up a circuit that is either the wrong impedance or polarity - you can merely replace the little DIP that you damaged.· Your computer will be well protected.

    So, the real question is how to properly match the impedance of the mic input with the output from the opto-isolator and how you choose to power the little IC.· I suggest using a 9volt battery with a 5volt regulator would give you a completely portable power supply [noparse][[/noparse]but somewhat short battery life at 800ma/hr].

    Who can figure out the input impedance to match?


    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    G. Herzog in Taiwan
  • LoopyBytelooseLoopyByteloose Posts: 12,537
    edited 2005-03-29 08:15
    Just a follow-up on using WINSCOPE.
    It is a very nice program, but it has some limitations
    I see that the sampling rate is either 5ms or 50ms.

    If I recall right, that rate has to be 4 times higher than the actual frequency you want to observe.

    So at 5ms, you have a sample rate of 200,000 Hz. If you divide by four - you get a 50,000 Hz limit. This is okay for audio outputs and audiophile work.

    And it is okay for observing some of the slower microcontroller outputs. AND VERY·GOOD TO TEST FOR SMOKED ICs.

    But, eventually you may desire to move up. Often, the problem in microcontroller seems not to be at the pulse's frequency, but the creation of noise that is at a higher frequency. This noise confuses the processor with spurious inputs.

    As far as the input impedance to the sound card, I guess that if you limit the microphone input to less than one volt and you maintain a linear input, you will get a usable calibrated input. It seems that it is similar to an op amp [noparse][[/noparse]has extremely high impedance].

    As with all scopes, calibration is important. With a five volt regulated power supply to the opto-isolator, you will need some kind of voltage divider circuit on the output and it needs to give you a good number as well as a pretty picture.
    Also, since the opto-isolator is driven by an LED, you likely need to have an opamp provide power to the LED.· There are some that work at 5volts.· The opamp provides the high impedance and can take your from a microvolt signal and enable the LED to transfer it at something like 1.2volts

    I may try to build something and set it up to use normal oscilloscope probes. It seems to be getting complicated

    After all is said and done, you may want to immediately move up to a scope adapter and better software. Parallax has one of the more reasonably priced ones. And, it may work with WINSCOPE or other generic scope software.· They do provide their own software with it, so that may not be an issue.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    G. Herzog in Taiwan

    Post Edited (Kramer) : 3/29/2005 8:26:23 AM GMT
  • Paul BakerPaul Baker Posts: 6,351
    edited 2005-03-29 17:07
    Nyquist theorem states sampling frequency of a digital signal must be twice the highest frequency measured, in a nutshell this is to capture the "on and off" portion of the measured signal regardless of the phi (phase shift between the sample time and the signal's zero cross point). For analog signals its a more complicated matter, you will experience aliasing and beating of the signal long before your frequency hits N/2. A 5ms sample rate is 200 Hz which means you can measure a 100 Hz digital signal accurately in Winscope.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
  • LoopyBytelooseLoopyByteloose Posts: 12,537
    edited 2005-03-30 16:16
    Thanks, the Nyquist theorem gets mentioned quite a bit. I couldn't recall the name

    The problems of aliasing and beating entered into the discussion that presented a factor of 4 to me as important for the sampling rate limit. I was note aware that a factor of 2 might be acceptible in some applications and particularly sampling for a scope.

    But, it seems that my math was off by a factor of 1000 according to you. Since the WINSCOPE claims to be useful for audio applications, I presumed that a 50,000 HZ limit was in the ball park. You really cannot do much with a 100Hz - just watch the AC cycle on your power supply or observe an IC for possible damage

    Are we working with micro-seconds or milla-seconds? If it works with 100,000Hz - all the better. This appears to be a case of a nasty abbriviation.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    G. Herzog in Taiwan
  • Paul BakerPaul Baker Posts: 6,351
    edited 2005-03-30 17:11
    5ms = .005 s -> 1/.005 = 200Hz [noparse]:)[/noparse] Im just using the 5ms stat you gave, if it is 5us sample period then it would be 200kHz.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
  • LoopyBytelooseLoopyByteloose Posts: 12,537
    edited 2005-03-31 16:35
    And I just passed on the '5ms' that the website gave me. But I suspect it really is 5us. It seems that as we use the web more and more, people are forgeting how to write precise information. I try really hard to correctly edit everything I put out and still have mistakes. Others either just don't know or don't care.

    No one in their right mind would make a 100hz oscilloscope.·

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    G. Herzog in Taiwan
  • LoopyBytelooseLoopyByteloose Posts: 12,537
    edited 2005-04-02 15:39
    I took another look at the WINSCOPE. The input samples are rated at 5ms or 50ms. This is the length of the sample buffer, not the sampling rate (that is done by the hardware inside your PC). So the frequency response is as good as your audio card divided by 2 for that Nyquist function. One site says 20,000 hz. That is no where near Parallax's scope, but decent for beginners without bucks.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    G. Herzog in Taiwan
Sign In or Register to comment.