TL;DR: My Arduino is injecting a lot of noise into an analogue audio circuit, even when not physically connected.
I'm experimenting with using an Arduino as a low-frequency oscillator in audio circuits (modular synths, guitar effects etc). I'm using an Arduino Uno powered with a USB + mains plug.
As a test I set up a simple circuit -- I don't believe the circuit matters much in this case but I'm including it here anyway:
simulate this circuit – Schematic created using CircuitLab
The Arduino is set up with one PWM pin supplying 0-5v, varying in a triangle wave (i.e. ramping slowly up, then slowly down again). This is connected to the JFET, which acts as a variable resistor. I have tested the analogue part of the circuit manually and it works as expected.
With the Arduino connected, however, the circuit produces a very loud "squishing" noise that swamps the audio signal passing through it, not unlike someone tuning an old short-wave radio. The noise "squishes" in time to the oscillation of the voltage. It's not unlike the sound in this video associated with the PC power supply: https://youtu.be/lXPJvSU8MwI?t=10m52s.
This happens even if I physically disconnect the PWM pin from the circuit -- the closer its wire is to the circuit, the louder the noise, but it's clearly audible even when they're separated by are a foot or more of air.
Things I've tried:
- Tying the Arduino ground to the analogue circuit ground, and also keeping them separate.
- Adding power filtering caps to both circuits.
- Putting the Arduino in an aluminium box, grounded to either its own ground or the analogue circuit's, or both.
- Powering the Arduino from my laptop instead of plugged directly into the mains.
The analogue circuit is on breadboard right now so some noise is expected, but this is far outside anything I've experienced before even with very badly-behaved circuits.
I'm FAR from knowledgeable about Arduino so my hope is that I'm doing something stupid and easily fixed. I would happily accept an answer that proposes an entirely different way to achieve the desired result.