On the same power supply I have connected MAX7219, which is producing terrible noise to amplifier so I can hear refreshing frequencies of MAX7219. If I hook up amplifier to battery power supply the noise is gone. I've also tried to connect 220uF electrolytic capacitor to power supply input of this board, which decreased the noise but not removed completely. Shutting down MAX7219 for a moment, eliminates the noise. Still I can hear it even from far distance. Amplifier board is on small PCB. MAX7219 is on breadboard connected to Arduino. All powered from Arduino.
I understand breadboard wiring may produce some noises, but this one is too loud. Unfortunately I don't have the scope to tell the noise spectrum, but MAX7219 update frequency from datasheet is 800Hz.
This video is to show the sadness of situation. - YouTube
Switching lots of LEDs needs thorough decoupling. 0.1uF, 10uF and 220uF electrolytic perhaps. Does your MAX7219 circuit
have good decoupling?
Above all else you must keep the LED ground current path away from the ground to the audio amp - LED currents
should flow directly from the power supply to the MAX7219 to the LEDs, and not via the audio amp chip's part of
the ciruit at all.
Such current will cause IR voltages along the ground wiring which you don't want injected into the audio path.
You might need to add some filtering between its supply and the amplifier circuit with an inductor or RFC.
You have got to clean up that wiring! Nothing but antennas there for any and all RF noise.
Put more decoupling into the circuit. Every power pin, 0.1uF cap to Gnd.
Another real easy trick is to use separate power supplies for the Audio and Arduino and I would make that 220 uF capacitor a minimum of 1000 uF ... Even with separate power supplies. This is very similar to a job where I had a 14 Bit A/D driving a speaker except speaker audio was getting back into the A/D converter... The A/D drove an Audio VCO for rough target acquisition and the Audio was interfering with with the acquired signal causing weird errors about the nyquist rate of the VCO/Sampling rate multiples of 100 Hz. Separating the power supplies to "Digital" and "Analog" and some additional brute force filtering fixed the issue.
From the video it looks like you are taking the amplifier power from the LED breadboard - that's the main issue, the LED power
rails will be bouncing around all over the place and the ground wire between the power source and the LED board will be
injecting IR losses direct into the input of the amplifier.
MarkT:
From the video it looks like you are taking the amplifier power from the LED breadboard - that's the main issue, the LED power
rails will be bouncing around all over the place and the ground wire between the power source and the LED board will be
injecting IR losses direct into the input of the amplifier.
I have tried to power amplifier directly from arduino. Almost same result.