3

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:

schematic

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.

9
  • you can't make a triangel wave with pwm. it is always squares. a train of squares with different lengths of 0 and 1 level
    – Juraj
    Commented Jun 25, 2018 at 11:10
  • @Juraj Fair point but I don't think the difference is material in this case, right? It fades an LED as if it were a varying DC voltage (I confess I don't really understand why this works, though).
    – helveticat
    Commented Jun 25, 2018 at 11:17
  • 1
    use a DA converter module
    – Juraj
    Commented Jun 25, 2018 at 11:45
  • 1
    @Juraj A LED can't be fooled by PWM, your eyes can. You simply stop seeing blinking past ~100Hz frequency. Commented Jun 25, 2018 at 13:36
  • 1
    @Juraj Because it's turned on half of the time. Commented Jun 25, 2018 at 13:43

1 Answer 1

1

Arduino PWM signal is about 500Hz, so it will be audible (read: noise) by itself. You could implement a low-pass filter between the PWM pin and your J-FET. A simple RC filter tuned to 5Hz would attenuate a 500Hz signal to -40dB, which probably won't be enough for high quality audio. There are filters with better rejection properties which usually require active components to build. One of the simplest of such filters is the Sallen-Key topology, which can practically double the rejection ratio using a signle active component (opamp).

Another option is to use a simple RC filter, but increase the the PWM frequency (as described here) to achieve high rejection ratio. Eventually, increasing the frequency past the audible range (about 16kHz) will ultimately resolve the noise problem, though I would still use an RC filter to keep the J-FET in linear mode. Apparently, the highest frequency you can achieve at full resolution is 62.5KHz, which is more than enough.

3
  • Thanks for this suggestion. I'll try pushing the PWM frequency up above the audio range and see what effect that has. I suspect a filter on the input won't help as the noise seems to be radiated rather than limited to the circuit itself, but it can't hurt (and is probably good design practice anyway). I'll report back -- it may be later in the week before I get a chance to try it.
    – helveticat
    Commented Jun 25, 2018 at 15:28
  • @helveticat Noise is "radiated" as long as you allow the J-FET to pick it up by leaving the gate floating. The filter will tie the gate to ground (via a capacitor), and it won't pick anything. Having the gate connected to the Arduino pin will also eliminate noise which is external to the circuit. Commented Jun 26, 2018 at 8:22
  • 1
    I had a chance to quickly try the RC network idea and got significant improvements, with both this and an LED/LDR combination replacing the JFET. Thanks for helping me out!
    – helveticat
    Commented Jun 26, 2018 at 18:12

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.