Go Down

Topic: Why does PWM creates noise? (Read 755 times) previous topic - next topic

martin_80x

Oct 23, 2012, 09:10 pm Last Edit: Oct 23, 2012, 09:46 pm by martin_80x Reason: 1
I'm using just the audio input part of this diagram to A0 so the arduino can read the signal of my guitar and make the led strip blink.[font=Verdana]http://interface.khm.de/index.php/lab/experiments/arduino-realtime-audio-processing/[/font]
But instead of using only one audio jack input I'm using two in parallel to send part of the signal to my amplifier and some to arduino.
The problem is when I switch to a PWM sketch, noise gets to the amplifier and disappear when the value reaches zero.

CrossRoads

PWN is creating 5V rising &  falling edges 500 times a seconds - wires connected to the PWM pins act like antennas.
Need to control your emissions, put a grounded shield over wires, grounded at one end, with as little exposed wire as possible.
Designing & building electrical circuits for over 25 years. Check out the ATMega1284P based Bobuino and other '328P & '1284P creations & offerings at  www.crossroadsfencing.com/BobuinoRev17.
Arduino for Teens available at Amazon.com.

MarkT

How is this all powered? - you really need to keep the Arduino's supply separate from the LED strips (where all the current switching is), and pay attention to grounding - separate ground wires out to the audio input and the PWM output might make a difference.
[ I won't respond to messages, use the forum please ]

Docedison

Especially if both "Grounds" were connected to the most negative point on the board... because all the separate currents flow through the 'ground' and all conductors have Some" resistance... so If your high gain amp input shield were connected between the high current return (ground) wire from the LEDs it would be 'seeing' that part of the LED current as a voltage developed across the "Grounds" and it is entirely possible that the input lead is at a lower potential than the points used as ground (Multiple ground return path's)... Thus there is a voltage across the amp input. This is what in all likelihood the effect you are seeing. It is also one of the reasons why analog readings are difficult to make sometimes with an Arduino, accurately.

Bob
--> WA7EMS <--
"The solution of every problem is another problem." -Johann Wolfgang von Goethe
I do answer technical questions PM'd to me with whatever is in my clipboard

martin_80x


How is this all powered? - you really need to keep the Arduino's supply separate from the LED strips (where all the current switching is), and pay attention to grounding - separate ground wires out to the audio input and the PWM output might make a difference.

I think that's a good idea too, I had the same problem with effect pedals, most of them are connected in my main power supply station but some need to be with their own power supply because they create noise too.
Right now I have the Arduino and the strip running with the same 12V power supply.

Docedison

Normally I'd say isolate them... but unless your on board regulator (Arduino) is running hot... Just make sure of the grounds... try to use a star topology where Every Ground goes to one Common Point. Never Never daisy chain grounds or the Positive Supply runs. All wires including PC boards have Both resistance and worse inductance both of which will increase as your project changes and both of which are 1/2 of the primary offenders for producing noise. Obviously the other half is the various supply voltages however it is Very Common to think that ground is Ground. Short wiring and plenty of bypass caps... make the job work well.

Bob
--> WA7EMS <--
"The solution of every problem is another problem." -Johann Wolfgang von Goethe
I do answer technical questions PM'd to me with whatever is in my clipboard

Nick Gammon

I think you can change the prescaler so that the modulation is at a higher frequency. The noise you hear is probably harmonics from the square wave. Just shove it out of human hearing range.
http://www.gammon.com.au/electronics

Docedison

Great Idea, just move them out of the passband of your amp so they don't get amplified. Even though you can't hear it doesn't mean that the amp can't amp it and that is wasted power and a possible source of distortion if any of the amp sources has any power in that range they might mix and cause noise. 

Bob
--> WA7EMS <--
"The solution of every problem is another problem." -Johann Wolfgang von Goethe
I do answer technical questions PM'd to me with whatever is in my clipboard

Nick Gammon

Quote
Great Idea,  ...


Or not?

However audio amplifiers probably don't amplify in the megaherz range.

However that was just a suggestion. If you can eliminate the noise, all the better.
http://www.gammon.com.au/electronics

Go Up