Arduino Audio Player making clicking sounds

I'm following this tutorial for making an arduino uno .wav player with an lm386 amplifier. The only difference I see in my project is that I'm using a 1inch diameter speaker while the speaker in the tutorial is larger. My speaker is an 8ohm 2W speaker but the tutorial doesn't say what it uses.

When I play the wav file tmrpcm.play("song.wav");, I'm getting a rapid clicking noise. No music. When I play tone(9, 700,1000); I'm getting a very quiet tone, but not a clicking noise.

Here's a video of the tone and the clicking. I'm not sure why I hear two tones. My code is only playing 1 tone in the setup...

What could be causing the clicking noise? I'm very new to amps and speakers. So I'm not sure what could be causing this or how to trouble shoot.


More Images of my breadboard:
entire setup
amp circuit close up 2
this one shows the capacitor farads

Code

#include "SD.h"
#define SD_ChipSelectPin 4
#include "TMRpcm.h"
#include "SPI.h"

TMRpcm tmrpcm;

void setup(){
tmrpcm.speakerPin = 9;
Serial.begin(9600);
tone(9, 700,1000);
if (!SD.begin(SD_ChipSelectPin)) {
Serial.println("SD fail");
return;
}

Serial.println("about to play");
tmrpcm.setVolume(9);
tmrpcm.play("song.wav");
}

void loop(){  }

You are asking a relative complicated question without any real information. I give you credit for posting the links you did. The clicking sounds like something switching at about a 40 Hz rate. Posted are several good pictures but I do not have the time nor inkling to convert that to something more understandable like a schematic. Post a schematic, not a frizzy picture with links to technical information on the perternant components, we know capacitors and resistors unless special. Also show all power and ground connections and power sources.

1 Like

Is the SDcard fast enough? Is the sample rate of the file low enough for the lowly Uno to process?

1 Like

My project had 3 issues:

  1. tmrpcm.setVolume(9); The highest possible is 6. So 9 doesn't work.

  2. tone(9, 700,1000); interferes with the tmrpcm.play("song.wav");. So I had to comment tone() out. It made the song stop after a second. Maybe the code plays the song at the same time as the tone and so when the tone is done it tells the speaker to stop playing all together?

  3. I missed the connection of 4 and 2 to ground! Newbie mistake.

Now the amp works... well sort of. The .wav plays but it's not any louder than playing the wav without the amp. But the clicking issue is fixed.

You're showing the LM386 conn'd to +3V.
Not Good.
Which configuration are you attempting to implement?
(I suggest Fig. 12)
[url]https://www.ti.com/lit/ds/symlink/lm386.pdf[/url]

No it's connected to the 5V both in the frizzy and IRL, maybe hard to see. Will Checkout fig 12.

The Arduino output has to be capacitively coupled to the LM386, as you can see here --
[url]https://www.arduino.cc/en/Tutorial/SimpleAudioPlayer[/url]

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