Pages: [1]   Go Down
Author Topic: Why does PWM creates noise?  (Read 636 times)
0 Members and 1 Guest are viewing this topic.
Florida, Winter Springs
Offline Offline
Jr. Member
**
Karma: 0
Posts: 77
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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.http://interface.khm.de/index.php/lab/experiments/arduino-realtime-audio-processing/
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.
« Last Edit: October 23, 2012, 02:46:11 pm by martin_80x » Logged

Global Moderator
Boston area, metrowest
Online Online
Brattain Member
*****
Karma: 443
Posts: 23834
Author of "Arduino for Teens". Available for Design & Build services. Now with Unlimited Eagle board sizes!
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
Logged

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.

0
Offline Offline
Shannon Member
****
Karma: 162
Posts: 10496
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
Logged

[ I won't respond to messages, use the forum please ]

Anaheim CA.
Offline Offline
Faraday Member
**
Karma: 44
Posts: 2811
...
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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
Logged

--> 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

Florida, Winter Springs
Offline Offline
Jr. Member
**
Karma: 0
Posts: 77
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
Logged

Anaheim CA.
Offline Offline
Faraday Member
**
Karma: 44
Posts: 2811
...
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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
Logged

--> 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

Global Moderator
Offline Offline
Brattain Member
*****
Karma: 452
Posts: 18694
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
Logged

Anaheim CA.
Offline Offline
Faraday Member
**
Karma: 44
Posts: 2811
...
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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
Logged

--> 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

Global Moderator
Offline Offline
Brattain Member
*****
Karma: 452
Posts: 18694
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
Logged

Pages: [1]   Go Up
Jump to: