I built a .WAV file player using a Nano, an SD card reader and a LM386 200 gain audio amplifier module:

(from this page: https://quartzcomponents.com/blogs/electronics-projects/arduino-music-player-with-amplify-audio-using-lm386)
I did not include the 2 buttons as my code plays the single .WAV file automatically.
I use +5V from the Nano to power the card reader and LM386 module.The speaker is 8ohms, 1watt.
The LM386 module is this one:
The volume on this is very low. If you are more than a meter away it is barely audible. Turning the potentiometer on the module only has the effect of either shutting the sound off completely or keeping it at the same low level. There were 5 modules in a pack when I bought them and they all do the same thing.
I am using the TMRpcs library to play the audio file:
#include <SD.h> // need to include the SD library
//#define SD_ChipSelectPin 53 //example uses hardware SS pin 53 on Mega2560
#define SD_ChipSelectPin 10 //using digital pin 4 on arduino nano 328, can use other pins
#include <TMRpcm.h> // also need to include this library...
#include <SPI.h>
TMRpcm audio; // create an object for use in this sketch
unsigned long time = 0;
void setup(){
audio.speakerPin = 9; //5,6,11 or 46 on Mega, 9 on Uno, Nano, etc
//Complimentary Output or Dual Speakers:
//pinMode(10,OUTPUT); Pin pairs: 9,10 Mega: 5-2,6-7,11-12,46-45
Serial.begin(9600);
if (!SD.begin(SD_ChipSelectPin)) { // see if the card is present and can be initialized:
Serial.println("SD fail");
return; // don't do anything more if not
}
else{
Serial.println("SD ok");
audio.volume(1);
audio.setVolume(4);
audio.quality(1);
}
audio.play("mmash.wav"); //the sound file "music" will play each time the arduino powers up, or is reset
}
void loop(){
//blink the LED manually to demonstrate music playback is independant of main loop
if(audio.isPlaying() && millis() - time > 50 ) {
digitalWrite(13,!digitalRead(13));
time = millis();
}else
if(millis() - time > 500){
digitalWrite(13,!digitalRead(13));
time = millis();
}
if(Serial.available()){
switch(Serial.read()){
case 'd': audio.play("music"); break;
case 'P': audio.play("temple"); break;
case 't': audio.play("catfish"); break;
case 'p': audio.pause(); break;
case '?': if(audio.isPlaying()){ Serial.println("A wav file is being played");} break;
case 'S': audio.stopPlayback(); break;
case '=': audio.volume(1); break;
case '-': audio.volume(0); break;
case '0': audio.quality(0); break;
case '1': audio.quality(1); break;
default: break;
}
}
}
Things I have tried:
- Powering the LM386 module separately
(WITH THIS POWER SUPPLY for those who keep missing this section)

+5V (same result)
+9V (no sound except static)
+12V (no sound except static)
-
Change the value for "setVolume" in code:
(static or no sound at all at any value except 4) -
Built a standalone LM386 200 gain audio amp powered by +5V:
(same result - low volume)
I guess I don't know enough about any of this to know how loud the thing should be. Maybe this is as loud as it gets? (but why no change in volume on the pot?..)
My only comparison is for this is that I once built a Simon-type game with a Nano, and, in my early electronics ignorance (now I have a-little-bit-later-but-still-early electronics ignorance), connected the 8-ohm speaker directly to one of the Nano GPIO pins. I know now you aren't supposed to do that... (although it has worked for 3 years without damaging the Nano or the speaker), but more importantly it is VERY loud without an amplifier. I would have thought using the LM386 module would make this be even louder. (I did connect the speaker one time directly to the Nano just to compare and the level is the same...low). The only real difference between the 2 projects is the source of the sounds. In the game, the Nano create the bleeps and bloops internally using "tone" , while this one the signal is being pulled off of an SD card.
Any ideas how loud this should be or how to make it louder?
Cheers

