Go Down

Topic: Problem initialising SD card and breakout board with Arduino Leonardo (Read 729 times) previous topic - next topic


Hi all,

I'm having trouble initialising an SD card with an Arduino Leonardo.  I purchased an SD breakout board from my local electronics store and have connected it to the ICSP on the Leonardo.  I used the CardInfo example sketch included with the Arduino IDE and changed the chipSelect pin to D10 as recommended in this tutorial using an identical breakout board https://tronixlabs.com.au/news/tutorial-using-sd-card-breakout-boards-with-arduino/

Unfortunately the documentation provided for the breakout is fairly sparse and doesn't say anything about appropriate CS pin connections for the Leonardo.https://www.jaycar.com.au/medias/sys_master/images/9264467804190/XC4386-manualMain.pdf I tried CS to D4 and D8 as well, but still to no avail.

The pins are connected as follows:

ICSP           Module
1                MISO           
2                +5V             
3                SCK             
4                MOSI
5(Reset)      Empty
6                GND
D10            CS (also tried D4 & D8 with appropriate sketch adjustment)

The breakout has 2 ground pins, I've tried with connecting just one and with connecting both.

The SD card was formatted using SD Card Formatter 5.
Whenever I attempt to initialise, I get the usual "Initialization Failed: Things to check" message.

I've swapped out all the jumper leads to make sure it wasn't a bad lead, and the soldering on both the Leo and breakout appear sound on visual inspection.

Ultimately my intention is to connect a small 8ohm speaker to the Leo and have it play wav files.  I have chosen the Leonardo for this as the project also required the use of the USB keyboard / HID benefits of the Leonardo.

Any advice or thoughts that anyone has would be greatly appreciated.



This has come up before, but nobody has offered any clarification.

If you look at the Tronixlabs tutorial picture of the two modules, you'll see that the microSD module at the bottom has a voltage translator chip that converts the Clk, MOSI and CS lines from 5V to the 3.3V needed by the SD card.  But the full-size SD module only has inline resistors which leave the voltage at 5V on those lines, but limit the current.

You see these inline resistor versions used a lot with 5V Arduinos, and I don't understand how they could possibly work dependably.  Some cards may deal successfully with the over-voltage state, but it's hard to see how they all could.  I mean, you are applying voltage to those three lines that exceeds the absolute maximum ratings of the SD card when it is powered by 3.3V, as it should be.  (Both modules do have the 3.3V regulator, so I assume power to the SD card is correct.)

So if you read through here, you'll see lots of people with the same problem you have - for some unknown reason, it just doesn't work.  I just wish someone knowledgeable about the use of SD cards with Arduinos would explain how these goofy SD modules can work without voltage translation.  It would also be useful to know if things do work correctly if you switch from an inline-resistor module to a voltage-translator module, or whether it still just doesn't work.

Of course the other possibility is that you just have the lines connected wrong - because things are different on the Leonardo, or whatever.  I just don't know about that.  Sorry not to offer any solution, but maybe someone else will see this and bail us out.


Hi Sherman,

Thanks for your interest.  It certainly has me baffled.  Incorrect wiring is always a possibility of course, especially when there's no guidance in the module's documentation on which is the correct CS pin for Leo, but I've checked the wiring multiple times to confirm each pin is going to the correct ICSP.  Sadly it's sounding like there's no good solution.  The only alternative I can think of is to take it back and get an ethernet/SD shield instead.  Shame since it seems like significant overkill for what I require of it. 

Thanks, I appreciate your response.


Well before you give up, let's see what responses we get to my post this morning:


Can you confirm that 3.3V is getting to the SD card's Vcc pin?

Go Up