Help with filter+amp+speaker

First time in the forum, sorry if I posted this in the wrong place. I’m having trouble with my amp/speaker output. It’s outputting a high pitched whine no matter what changes I make. I’ve tried it with two separate speakers, resoldered the terminals, different wires, etc. I’ve also messed around with different filter combinations than my original 1kohm/47uF, and all that happened was the volume was diminished(it’s rather quiet to begin with). Any ideas?

Edit: The circuit I have is a pro micro(16Mhz) using a PWM with fast timer 4 to drive a adafruit pam8302, which outputs to a 4ohm speaker. in between the audio connections is where I have the low pass filter. I have also added a schematic of the circuit.

Screenshot (24).png

Any ideas?

Lots but you have told us very little about what you have. Is there an Arduino involved? What is it doing? How is it wired up? What sort of amplifier do you have? How is the audio being generated? A schematic would be good.

Please read the how to use this forum sticky post to find out how to ask a question here.

Try shorting the input of the amp. If the whine does not go away you have a bad amp. If not it is in what is driving the amp. This response is to help you get started in solving your problem, not solve it for you. Good Luck & Have Fun! Gil

From the Adafruit web site

able to deliver up to 2.5 Watts into 4-8 ohm impedance speakers. Inside the miniature chip is a class D controller

So first off you speaker is outside what the amplifier will drive, a class D amplifier. This sort of amplifier uses the inductance of the speaker as part of the filtering.

Also that schematic looks very wrong. The filter components values look odd, how did you work them out.

What value of PWM are you driving, is it fixed or modulated in some way. If fixed I would expect to produce a high pitch whine.

1k and 68µF gives a time constant of 68ms, which is a cut-off frequency of 2.34Hz, well below the audio range.

I think you got your calculations wrong by 3 or 4 orders of magnitude.

Grumpy_Mike: So first off you speaker is outside what the amplifier will drive, a class D amplifier. This sort of amplifier uses the inductance of the speaker as part of the filtering.

Also that schematic looks very wrong. The filter components values look odd, how did you work them out.

What value of PWM are you driving, is it fixed or modulated in some way. If fixed I would expect to produce a high pitch whine.

I accidentally put a 3 ohm, its really 4, sorry about that. And I'm using the values given from this website:

https://www.allaboutcircuits.com/projects/how-to-build-the-brightest-led-saber-in-the-world/

but without the rotary control or strip LED (I already modified the code to account for this).

And I'm using the values given from this website:

No your not. You schematic had 68uF as a filter capacitor where as the web site had 0.68uF two orders of magnitude out.

Also that schematic is poor regarding the LED strip interface. It has no series resistor in the data line and no large capacitor across the strip’s power lines. That will also contribute to noise in the speaker.

Grumpy_Mike: No your not. You schematic had 68uF as a filter capacitor where as the web site had 0.68uF two orders of magnitude out.

Also that schematic is poor regarding the LED strip interface. It has no series resistor in the data line and no large capacitor across the strip’s power lines. That will also contribute to noise in the speaker.

I've updated the lines to use the correct values, using a .68uf. The whine is gone, but now the speaker is making a pop like the sound is too loud.

What is the power rating of the speaker? The original schematic has an 8 ohm 2W speaker.