HELP Square wave not a square wave

Discussion in 'The Projects Forum' started by theartofdrifting, Aug 20, 2011.

  1. theartofdrifting

    Thread Starter New Member

    Aug 20, 2011
    3
    0
    Hi I'm a yr 12 student and currently doing a physics assignment; we constructed a oscillator circuit to make an LED flash and we had to control the flashing frequency. Pretty standard, but my problem is with the graphs I obtained. We used the program Audacity to graph the output, I expected a square wave, but some other thing came out - looks kind of like the charge discharge cycles of the capacitor except when it is charging (ON), it is the discharge curve and vice versa for the off cycle. What type of wave is this and why is it being generated?

    Thank you!
     
  2. wayneh

    Expert

    Sep 9, 2010
    12,088
    3,027
    Welcome to the AAC forum.

    Are we to guess what your circuit was? It's simply not possible to help you without a LOT more detail. Are you talking about software only, or is there a real device here?
     
  3. theartofdrifting

    Thread Starter New Member

    Aug 20, 2011
    3
    0
    We used the 555 timer, and constructed an astable multivibrator circuit functioning as a square wave generator. [​IMG]The timing was controlled by 3 components, and can be expressed with the formula f= 1.45/(R1+2R2)C. We varied R2 from 10k - 500k.

    We connected the circuit to the computer in parallel to the LED so that it would not affect the circuit and we could measure the voltage change across the LED (which was at the output). The circuit was connected with a jack to the microphone input (with an added resistance so to keep the soundcard safe). Then we turned our circuit on, and used the audio program audacity to measure the timing of the period and the on and off cycles of our circuit for different R2 values. The graph came out like this.


    [​IMG]

    Why does it look like this?
     
  4. Kermit2

    AAC Fanatic!

    Feb 5, 2010
    3,766
    928
    That looks like it might be graphing a current waveform vs. a voltage waveform. A drawing of the layout of the connections on the output along with component values would let us evaluate the situation more exactly. Include the type and method of connection to the sound card as well.
     
  5. iONic

    AAC Fanatic!

    Nov 16, 2007
    1,420
    68
    Make sure your supply voltage is indeed 5V as the minimum for the 555 is 4.5V. You could increase it for the simulation.
    If you keep the voltage at 5V add a 150 ohm resistor to pin 3 in series with a LED to ground. Increase the timing cap from .1uF to 100uF. Then try the circuit. you should see it blink on and off about .5sec each. It should not appear to fade in and out. Then repeat the sim and post what you get. The circuit looks good otherwise.
     
  6. wayneh

    Expert

    Sep 9, 2010
    12,088
    3,027
    Excellent comeback post by the OP! Congrats, you're already far ahead of most noobs here.

    At that low Hz, I'm not sure the sound card can reliably measure what is nearly a DC voltage.
     
  7. MrChips

    Moderator

    Oct 2, 2009
    12,415
    3,354

    My guess is that the sound card is AC coupled. There is a capacitor in series making it a high pass filter and therefore the frequency response does not go down to DC.
     
  8. Adjuster

    Well-Known Member

    Dec 26, 2010
    2,147
    300
    Yes, I think that would be a very likely explanation. A sound card does not require to respond much below the lowest bass audio frequencies, perhaps around 20Hz. It is generally an advantage for it to ignore DC content, to avoid the possibility of DC offsets on any signal source affecting the signal handling.
     
  9. theartofdrifting

    Thread Starter New Member

    Aug 20, 2011
    3
    0
    The supply voltage was a 9V battery. The circuit did not fade in or fade out. It blinks. My question is, if it doesn't fade in and fade out, why is it not a square wave?

    I do not know much about sound cards

    But programs like Audacity measure change in voltage right?

    The voltage it was measuring was the change in voltage across the LED at the output.

    Reading the graph, the voltage is changing, plunging suddenly upwards and downwards with exponential/logarithmic curves after the sharp increase/decrease. The sharp increase/decrease is the signal turning it on and off I assume. But if the voltage drops so suddenly after the initial signal, why does the LED stay on? The LED is terraced in its movements. The voltage is not. And assuming the middle line is 0V, how is it that the LED is still on?

    NOTE
    (The LED is on from peak to trough and off from trough to peak) The values for the components are R1= 150kΩ R2= 150kΩ C=4.7μF. And the complete period of one cycle was about 1.25 seconds.
     
  10. Adjuster

    Well-Known Member

    Dec 26, 2010
    2,147
    300
    In my opinion, the fact that the LED stays lit for longer than the recorded voltage stays on is strong evidence that the recording system is unable to give an accurate representation of what is happening.

    A program like Audacity can only work within the limits of the hardware that it is associated with, and sound cards are not designed to respond to frequencies much lower than human beings can hear. Your lamp is flashing pretty slowly, about once a second, which is way below audio frequency.
     
  11. wayneh

    Expert

    Sep 9, 2010
    12,088
    3,027
    Just turn it up to 50Hz or more and see how it looks. Should be much better. At low Hz, you're watching the voltage across the AC coupling system, which might be as simple as a capacitor. That's an anomaly of your equipment, not a measure of the real voltage of your circuit output
     
  12. BurninBri

    New Member

    Aug 16, 2011
    27
    3
    Just type:
    "Sound Card AC-Coupled" into Google and you should get all your answers there.

    I kind of liked this one:
    http://www.zeitnitz.de/Christian/scope_en

    Basically, Wayne and others here were right on with the AC-coupling (a capacitor is in series with your measurement, so you CANNOT MEASURE DC the way you think you can with your soundcard!)
     
  13. JingleJoe

    Member

    Jul 23, 2011
    185
    10
    Idealy one would use an oscilloscope on a DC setting to veiw this waveform, I've got some really nice old o-scopes (valve based) and I never paid more than £15 for them, they're dodgy but they work so that may be an option.
     
  14. CraigHB

    Member

    Aug 12, 2011
    127
    15
    I like what this guy has to say about oscilloscopes.
     
  15. Adjuster

    Well-Known Member

    Dec 26, 2010
    2,147
    300
    He exaggerates a bit, but basically you get what you pay for. Perhaps reasonably effective PC-based scopes will become available at some point, but probably not very cheaply.

    I do not agree at all with his speaking his piece while driving a car! Clearly his mind is more on the intricacies of measuring instruments than on his driving. I wonder what happens if one of the cops in his area sees this?
     
  16. CraigHB

    Member

    Aug 12, 2011
    127
    15
    The main thing he says of value is that you can get 2nd hand analog scopes dirt cheap, even free. I bought my first scope years ago off eBay for like $40, less than the cost of a new DMM.
     
Loading...