I'm using this circuit to connect the SD Card to Arduino with this code:
#include <SD.h>
#define SD_ChipSelectPin 4
#include <TMRpcm.h>
#include <SPI.h>
TMRpcm tmrpcm; // create an object for use in this sketch
void setup()
{
tmrpcm.speakerPin = 9;
//tmrpcm.soundBuff = 500;
Serial.begin(19200);
if (!SD.begin(SD_ChipSelectPin))
{
Serial.println("SD fail");
return; // don't do anything more if not
}
tmrpcm.setVolume(6);
Serial.println("Let's Go");
tmrpcm.play("pipssd.wav"); //the sound file "music" will play each time the arduino powers up, or is reset
}
void loop()
{
if(Serial.available())
{
if(Serial.read() == 'p')
{ //send the letter p over the serial monitor to start playback
Serial.println("ok");
tmrpcm.play("pipssd.wav");
}
}
}
When I connected the circuit and uploaded the code, the ON light reduced and stopped.
There is not a connection issue, so I think the Arduino UNO got fried.
I have not connected a speaker to it, because i had not yet received the amplifier module.
I had not connected the speaker because I did not have the LM386 module which I was supposed to connect to the speakers [Figured this out the hard way after burning one Arduino Uno board ]. But on using a new UNO R3 board, the light is still getting switched off.
Yes, So what basically happened was, that time the Micro SD Card reader was working, but when I connected the speaker [10w, 4 OHM] directly to the Arduino UNO R3, the UNO R3 was ruined and wouldn't start.
After that I used a new UNO R3 board with a new Micro SD Card reader, but then I started having this issue.
To this board I had not connected the speakers as I did not have the LM-386 amplifier and didn't want to ruin the new board also...
I really don't know how, but now the SD Card reader is working, and with the speaker too...
I did the same connections again with the old SD card reader and it worked...
Thanks for your help and time really appreciate it.