Audio noise with LM386 module

I have an arduino MKR Zero board and with an SD card I would like to play a song. What I hear is a lot of noise and the song is faint and very distorted. Does anyone have an idea what could be causing this? Below you can find a schematic of what I have built.

My LM386 module

Thanks in advance!

Can you post pictures of the actual setup too, please?

I don't know the MKR Zero. Feeding 5 volt to its Vin looks highly questionable to me.
What type is that 9 volt battery? A fire alarm battery? In that case, throw it away and use better stuff. If not, please post a picture.

it’s fine it is 3.3v board

Here's a picture of my setup. Although I'm afraid you can't get much out of it because of the jumper cables that are mixed up, that's why I've made that schema.

@Railroader According to the documentation, the VIN port is allowed to receive 5v regulated, the
IO ports maximum 3.3V.

This module requires a lot of current and that is not available with your connection. COnnect it DIRECTLY to the 9 volt supply.

Your board looks different, is this genuine MKR ZERO?

I have tried that, to power the module with 9v, but that didn’t make any difference.

Yes, I have ordered it on the official Arduino store, so I’m sure that it is not a fake

You need 5v, not 4.8.
Then, as others have said, connect your power for your amp directly to your power supply.
Finally, while it should run for a little while on a 9v battery, it doesn't have much in the way of amps to drive everything. You should get 2 18650s and run them in parallel into your power supply. Then trim the pot to get 5v.

lm386 min voltage is 4V, but there are chips that rated 5V min. I wonder if you are under powering it. Also try an electrolytic capacitor a few uF between DAC and amp input, minus towards the amp.

Okey. But still, kick that 9 volt battery out the project. Its life will be short even only powering the controller. Forget powering the speaker that way.

The gain is WAY too high (although you can knock it down with the pot). Any noise will be over-amplified too. The song shouldn't be faint...

You're getting 3.3V out of the microcontroller and about 5V out of the audio amplifier so you need a gain of less than 2. You DO need current/power gain... The microcontroller can't directly drive an 8-Ohm speaker. But, you don't need much voltage gain.

If you have some powered computer speakers, try those instead of the LM386 and speaker. That will also help to isolate the problem.

Similarly, you can test the LM386 & speaker by connecting it to your computer or phone (or CD player or TV, etc.). But, the gain is STILL too high!

Hi Doug! I tried putting a 10k resistor in front of the IN port of the LM386 and that didn't help. There is still too much noise. Is there a way to filter that out?

If you have nothing connected to the input of the amplifier, and just short input pin to gnd pin, what do you get out of the speaker?

I agree with @DVDdoug the gain is too high.

Have you tried adjusting the trimpot on the amplifier board?

Tom... :smiley: :+1: :coffee: :australia:

If you look at this datasheet, it shows how to set the gain.

Can I also suggest you place a 0.1uF capacitor across the Vcc and gnd pins of the amplifier.

Tom... :smiley: :+1: :coffee: :australia:

Since you have not posted the code, it is impossible to answer sensibly. :roll_eyes:

This topic was automatically closed 120 days after the last reply. New replies are no longer allowed.