HELP Square wave not a square wave

Thread Starter

theartofdrifting

Joined Aug 20, 2011
3
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!
 

wayneh

Joined Sep 9, 2010
17,495
...we constructed a oscillator circuit to make an LED flash and we had to control the flashing frequency.
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?
 

Thread Starter

theartofdrifting

Joined Aug 20, 2011
3
We used the 555 timer, and constructed an astable multivibrator circuit functioning as a square wave generator.
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.




Why does it look like this?
 

Kermit2

Joined Feb 5, 2010
4,162
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.
 

iONic

Joined Nov 16, 2007
1,662
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.
 

wayneh

Joined Sep 9, 2010
17,495
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.
 

MrChips

Joined Oct 2, 2009
30,618
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.

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.
 

Adjuster

Joined Dec 26, 2010
2,148
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.
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.
 

Thread Starter

theartofdrifting

Joined Aug 20, 2011
3
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.
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.
 

Adjuster

Joined Dec 26, 2010
2,148
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.
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.
 

wayneh

Joined Sep 9, 2010
17,495
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
 

BurninBri

Joined Aug 16, 2011
30
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!)
 

JingleJoe

Joined Jul 23, 2011
186
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.
 

Adjuster

Joined Dec 26, 2010
2,148
I like what this guy has to say about oscilloscopes.
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?
 

CraigHB

Joined Aug 12, 2011
127
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.
 
Top