Unreadable SD Card

I'm using the example code shown below and when I open up the serial monitor it says:"Can't access SD card. Do not reformat. No card, wrong chip select pin, or SPI problem? SD errorCode: 0X20,0X0 " I'm using the File Player example code so I doubt its an error there

What code? What wiring? Schematic and photograph please.

There is a chance there is a problem with the code. Sadly you did not provide a lot of information.

If you are using the TMRpcm library, Make sure the pins of the SD card reader(If you are using one) are connected properly. (CS to pin 10, SCK to pin 13, MOSI to pin 11, MISO to pin 12, VCC to the +5v(If you are using +5v) and GND to ground.) As far as I know.

As for the speaker Pin, I recommend you use pin 9, just make sure the code on the chip confirms it.

One of the problems I faced is the wire powering the SD card reader(+5v) was too long, and had JUST enough resistance to block JUST enough voltage to not run the thing. Things like that happen, check silly things like that.

As for the code, if you are using the TMRpcm library, Use this code:

include "SD.h"

define SD_ChipSelectPin 10

include "TMRpcm.h"

include "SPI.h"

TMRpcm tmrpcm;

void setup() { tmrpcm.speakerPin=9; //whichever pin you are using for the speaker. Serial.begin(9600); if(!SD.begin(SD_ChipSelectPin)) { Serial.println("SD fail"); return; } tmrpcm.setVolume(6); //careful with the number, it can be too loud. tmrpcm.play("filename.wav"); //filename being the name of your wav file.


void loop() { // put your main code here, to run repeatedly:


It could also be a problem with the wav file.

If you are using the Arduino UNO Make sure the Bit resolution is 8 Bit. Change the sampling rate to 16000 Hz(I recommend you use 16000 Hz.) Change audio channels to mono. And make sure the PCM format is "PCM unsigned 8-bit".

If none of that helps it is probably a problem with the SD card :/ Hope that helped!