My board is designed to output audio and control servos, and I've just found that when driving a medium sized servo I get a lot of static on my audio output every time it changes direction, and some static when it's just turning as well. Even with a tiny servo, I can hear static if I'm preventing it from turning.
I thought the servos would have a reverse protection diode built in as well as some capacitors to reduce noise since noise on the data lines could potentially result in crashed airplanes, but if they're in there, they don't seem to be doing a very good job.
I also don't seem to have done a very good job at isolating my audio from this sort of noise in my circuit. I did make sure to have only one entry and exit point for the current into the audio portion of the circuit, and it's on the other side of the board from the servo ports, and the power source is between the two, so I thought that would be sufficient to avoid this issue, but apparently my efforts were either insufficient, or the noise is being radiated from the servo line and the audio line is picking it up or something. But I suspect it's direct transfer on the board itself.
You can see the layout of my board here. The servo is attached to port 9. So the current for the servo either flows in from the top of the board from the mosfet on the top right, or under the microcontroller and past the switch, I'm not sure. The audio portion is in the lower right, and there is a fairly straight line for the positive plane to the mosfet, but the ground plane current has to go around the LED pins:
http://shawnswift.com/arduino/mighty-layout.png This was as good as I could get it, and as far as noise from other sources goes, like a vibration motor I've got attached via a mosfet and with a protection diode... That works just fine. I don't hear any noise at all from it. And I'm switching it on and off rapidly. It's just these darn servos, which are plugged into the same ports that are the issue.
Is it perhaps just the servos are inadequately noise protected? I mean I hardly did anything for my vibration motor other than that diode. Might there be some way to modify a servo cable to reduce the noise? Put a choke on it for example?