Dismiss Notice
Join Physics Forums Today!
The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

Generating electrical signals with my sound card?

  1. Jan 28, 2006 #1
    Ok, admit to absolute naivety in this subject, so please excuse any glaring errors and ignorance in this question :)

    I have a device which according the specs emits a 0.5 Hz square wave that is bipolar and assymetric. The current ranges from 0 - 1000 mA.

    Figuring that this was a safe enough current to play around with, I connected it to the mic-in on my soundcard (I don't have a line-in). As expected, I could hear a clicking sound every second. In a sound editing program, I see a relatively straight line at 0 with short spikes in 1 second intervals to either +1 or -1 (not exactly the square wave I was expecting, what do I call this?) (see attachment below)

    Ok now here comes the real ignorance part: I was hoping that by playing back this sound file and connecting to the line-out, I could get the same effects as the original device. This doesn't happen. Why? :) (I have some ideas but I'd rather not voice them :) - it sounds exactly the same though).

    For starters, I have err.. one of those screwdrivers witht he LED inside of it (what do you call these? :)), and used it to complete the circuit. In both cases, with no output the light remains on. With the original device, once I raise the current sufficiently the light is either on or off each second. From the PC, there is no effect.

    What do I have to do/build/use to make this work?

    Thanks alot!

    Attached Files:

    Last edited: Jan 28, 2006
  2. jcsd
  3. Jan 28, 2006 #2


    User Avatar
    Science Advisor

    Your sound card is not designed to drive high current, it can maybe supply 20mA or whatever a set of headphones/speakers would need. What you'd need is an amplifier with a gain of 1 but with the ability to supply up to your 1A of current. A bigger audio amplifier should be able to handle this without too much of an issue.

    You're referring to a test light (screwdriver with light bulb) and these are ok if you need to test an old car's wiring, a car made before the 1980s. But test lights are really not a very good way to test electronics, they use a large amount of current and can damage circuits. A digital voltmeter is a much better choice, their high internal resistance presents a load that won't affect circuits and or allow any current to flow.
  4. Jan 28, 2006 #3


    User Avatar
    Staff Emeritus
    Science Advisor
    Gold Member

    Your output is the derivative of a square wave. This would be due to the nature of you sound cards input circuitry. Typically audio circirts do not do good square waves.
  5. Jan 28, 2006 #4


    User Avatar
    Staff Emeritus
    Science Advisor
    Gold Member

    The biggest problem is that your sound card's input is "capactively coupled," meaning the sampling circuitry is connected to the outside world through a capacitor. This prevents the transmission of DC, and only permits the transmission of AC signals. This is done to remove any possible DC component of a powered microphone so it doesn't saturate (or damage) the rest of the circuitry.

    In the context of sound, the DC component is unwanted and inaudible anyway: it corresponds to a frequency of 0 Hz.

    You're not going to be able to use a sound card to "scope" DC signals.

    - Warren
  6. Jan 29, 2006 #5
    Hi Guys,

    Thanks for all the help. I still have some more questions :)

    Ok so using my sound card's input as a scope or even "recording device" for electrical signals is out. Let's focus on using it to generate signals. Say I generate a perfectly square wave using a sound editor.

    If I rig this up to a test light (sorry it's all I have with me right now) I would expect the same results as the original device (light on, light off, at 1 second intervals), but I seem to be getting something resembling the first recording I made: the light is mostly constant but pulses to brighter and back or off and back at 1 second intervals (this is while using a low powered amp).

    So, am I out of luck here? When Integral said that "audio circuits don't make good square waves" - I'm guessing this is for output aswell? I noticed that if I plugged in the original device through the amp, the test light behaved the same way.

    So the main question is: Is it impossible using audio equipment to generate a constant current (if that's the right word) of either a positive or negative polarity? It can't seem to maintain the signal (?) and it spikes rather than holding it at a constant.

    And, secondary question: is there any way around this? (some kind of circuit or something that I can build so I can still use my PC to generate the waves?)
  7. Jan 29, 2006 #6
    Oops! I seemed to have confused microamps and milliamps in my original post; sorry! The original unit seems to run at up to 1000 uA. So if my sound card runs at 20mA, this means I can still generate a signal with atleast the required current if not the right wave?

    That's the more important question... the less important ones for those of you with the extra time, and if my terminology is right. Is the amplitude of the soundwave the current of the electrical signal? Does anyone know the average voltage output of sound cards? Thank you!
  8. Jan 29, 2006 #7


    User Avatar
    Staff Emeritus
    Science Advisor
    Gold Member

    I wouldn't doubt it a bit if the soundcard's output is also capacitively coupled.

    - Warren
  9. Jan 29, 2006 #8


    User Avatar
    Science Advisor

    The soundcard is likely has a low-frequency bandlimit - it might go as low as 20Hz but it might be higher than that and the capacitor sized for this frequency.

    You can use a soundcard for some signal measurements, look up winscope online and its a pretty nice little interface. But just like how the soundcard might not be viable above 20KHz (or maybe lower like 10KHz) the bandwidth is going to have a limit on the bottom end as well. Different cards behave differently.

    If all you need is pulses, you could always just simply pulse the signal coming out. The light bulb will work fine with an AC source, they work just fine doing that all day. Maybe try pulsing a sine wave of 50Hz or slightly higher and it should be fast enough to not see any pulsing.

    That, or you could build an amplifier and use a pin on the parallel port (TTL level) to signal on/off at nearly any frequency below the ECP or whatever high frequency limit your hardware would have.
    Last edited: Jan 29, 2006
Know someone interested in this topic? Share this thread via Reddit, Google+, Twitter, or Facebook

Have something to add?

Similar Discussions: Generating electrical signals with my sound card?
  1. Sound generator (Replies: 2)

  2. Sound Card Line-In (Replies: 1)

  3. Electric Signals (Replies: 16)