I'm using a 8 ohms 1 watt speaker, MicroSD card adapter, and SD card
here is one of the code I used
#include "SD.h"
#define SD_ChipSelectPin 10
#include "TMRpcm.h"
#include "SPI.h"
TMRpcm tmrpcm;
void setup()
{
tmrpcm.speakerPin=9;
Serial.begin(9600);
if(!SD.begin(SD_ChipSelectPin))
{
Serial.println("SD fail");
return;
}
tmrpcm.setVolume(6);
tmrpcm.play("test.wav");
}
void loop() {
// put your main code here, to run repeatedly:
}
SC to pin 10
SCK to pin 13
MOSI to pin 11
MISO to pin 12
VCC to 5v
GND to GND
positive speaker pin to 9
negative speaker pin to GND