I wrote a program that just does an analogRead on pin 0 and sends it over serial to processing which graphs it. Its pretty much the graphing example. I am giving it data (music) from my computers 3.5 mm jack and I'm getting some pretty cool graphs. For some reason when its not hooked to anything I am getting a very consistent wave pattern being graphed. This means that there is noise on that pin for some reason but I have no idea what to do about it. Any suggestions?
This means that there is noise on that pin for some reason but I have no idea what to do about it. Any suggestions?
That's how electronics works, no input = noise pickup.
You could try a 10K pull down resistor.
Thanks that helped a lot. Works like a charm when there is something playing but when i press pause it like ramps down over a few thousand readings, its pretty much straight and id say the slope is about 1/2 until it gets to zero
Yes that is what it will do. Do you want it to stop half way? Then put another 10k pulling up to 5v.
I am getting a very consistent wave pattern being graphed
Can you tell the frequency of that wave? 50/60Hz?
When the input pin is not pulled up or down to a voltage, it literally acts as an antenna and hence your noise.
If the noise is quite consistent perhaps a filter could be of use? This would have the added advantage of reducing noise on your input signal when connected to your data - all need is some prior knowledge of the frequencies you are putting in then filter out everything else. Voice for example, is usually considered as 20Hz to 20kHz.
Hope this helps.
Filters are of little use because the pickup is so high impedance. Any filter will act as a lower impedance to the analogue input and thus cure the problem irrespective of what ever frequency you make the filter. It will only endue blocking wanted signals.
Can you tell the frequency of that wave? 50/60Hz?
That sounds about right. Its hard to tell because its just a visual graph without a scale or anything buyt compared to a 20 to 20000 hz sweep im guessing thats about right.
If I also had a pull up resistor would that allow it to graph both positive values because it would be indexed to the middle of the scale (around 500)? For like graphing the actual audio wave and stuff. Usually it just cuts out the bottom of the wave and shows the top part
If you AC couple in then yes. That means use a capacitor to connect the audio to the input.
Might like to note that AC coupling capacitor + Pull Down/Up resistors = Filter.... Previously dismissed by yourself.
No it doesn't unless you use a stupidly small capacitor. Strictly a DC blocking circuit is a filter but you would not consider it as such. The point I said is that any filter is going to involve low impedance connections and that is what we are fighting here.