Adding an SD card on a custom sheild

Hi,

I am currently in the process of designing my own Arduino (mega) shield with KiCad and I need some help adding an SD card to my layout. Often I just use an Ada-fruit SD card breakout board when I need to use an SD card but now I want to Build one into the shield I'm making. It looks like the Ada-fruit board has some extra circuitry on it and I kind of want to integrate that circuitry on to my board Just wondering if anybody has some ideas or a small schematic for connecting this SD card directly to my board?

Thanks!
Nikolai.

Why not use AdaFruit schematic?

The extra stuff results from the fact that the Mega is a 5V device, whereas SD cards are 3.3V devices. So the card has to be powered by 3.3V, and the SPI output lines coming from the Mega (CS, CLK, MOSI) have to be shifted down to 3.3V. The MISO line coming out of the card typically doesn’t require shifting up to 5V as its 3.3V level will be interpreted as high by the Mega. Also, the MISO line must go tristate when the card’s CS is not asserted, which the card knows to do, but the shifting chip may not. PaulRB’s Adafruit circuit looks pretty good to me.

Wow this forum is really helpful, Thank you guys!
Just one more question, the SD card symbol in KiCad seems to have slightly different connections to the Adafruit one.
I am not sure which pins are card detect and chip select on the picture attached. Also, what are the two floating buffers doing in the bottom left (ish) corner of the Adafruit schematic. Are they just extra buffers that were left in the 4050D chip?

A consideration if you ever plan on using more that one SPI device. The SPI circuitry is actually in the SD card. However the MISO does not tri-state when the device is not selected. I.e. the MISO remains an output even though the device is not selected. This means other devices on the same buss will not be able to transmit.

You could the below to buffer the MISO line but I think there is a better device it just doesn't come to mind.

NL17SZ126

Be sure the 3.3V supply can provide enough current for the SDcard, some take a fair amount of power,
I forget how much the standard says, but use a 0.5A regulator not a 0.1A regulator for instance to be on
the safe side - do not assume the 3.3V input to a shield can provide the current, derive it locally from 5V rail.

madbus:
what are the two floating buffers doing in the bottom left (ish) corner of the Adafruit schematic. Are they just extra buffers that were left in the 4050D chip?

Yes

Kicad may have the pinout for when the card is used in SD mode, with all four data pins in use. For SPI mode, the pinout is a bit different. This picture is what I have for the four signal lines, Vdd and Gnd. The card detect situation may vary from one holder to another. It’s pin 9 on the holders I have, and is labeled “CDN”.