Trouble getting sound from SD card and speaker

Hi there, I am trying to play simple wav file sounds on a speaker, coming from a micro sd card. I have tested the micro SD card and it works fine, the files are in wav format.

I am not able to play the simple beeping sounds as the speaker only pops and crackles. It pops and crackles randomly, NOT specifically while it should be playing something.

In this link is the current wiring, it may or may not be wrong for Sd card sounds:

I'm a total newb with sound, so any offer of advice is appreciated, I'm here to learn :slight_smile:

Thank you all!

It looks like that project is a synthesizer to generate sounds rather than to play WAV files. I didn't read everything, is there a DAC for getting analog?

DVDdoug:
It looks like that project is a synthesizer to generate sounds rather than to play WAV files. I didn’t read everything, is there a DAC for getting analog?

It is true that they did not use this for WAV files. This was the wiring:

I’m wondering what way I can wire this to play simple WAV files, but sound quality is not important, I just need to hear it working.

Thanks!

I'm wondering what way I can wire this to play simple WAV files,

You can not use this wiring. You need at least a filter between the Arduino and the speaker.

sound quality is not important, I just need to hear it working.

You or whoever set the assignment?

Grumpy_Mike:
You can not use this wiring. You need at least a filter between the Arduino and the speaker.
You or whoever set the assignment?

Me, for fun, I haven't had an assignment for quite some time.

OK for fun then look at this link:-

Quality crap but hey it does some sort of job.

Grumpy_Mike:
OK for fun then look at this link:-
GitHub - TMRh20/TMRpcm: Arduino library for asynchronous playback of PCM/WAV files direct from SD card. Arduino Uno,Nano,Mega etc supported

Quality crap but hey it does some sort of job.

Thanks for a reply :slight_smile: I've actually been using the TMRPCM library to try and get this working at least somewhat. Apart from the wiring I mentioned earlier, I also tried the wiring in this link (a linked project on the TMRCPM page):

I had trouble making this do anything either, but I was using a 2n2222 transistor because that's all I had on hand. Would using the BC546B NPN transistor like in the link fix this?

Thank you :slight_smile:

Using a 2N2222 transistor should have no effect on the project, you will get the same results with the transistor you have used. Have you checked that the pin out is the same?