Cheap DIY SD Card Breadboard Socket

188K21986

Intro: Cheap DIY SD Card Breadboard Socket

Do you have a project that needs an interface to mass storage, but don't have the resources to build a breakout board for a standard socket?

In this Instructable, you will learn how to make an SD card socket that plugs right into a breadboard for less than two dollars in parts (depending on how you get them of course). I show you how to use a simple straight pin header and modify it so you can plug in an SD card and attach it directly to a breadboard for data logging and prototyping. This is quick and easy so you don't have to wait for a socket in the mail, or build/buy the SMD breakout board for it either.

Basic soldering skills and common tools are required.

I will cover how to make vertical and right angle sockets. Either 7 or 8 pin should work. 9 pin may require some modifications, I only used 7.

STEP 1: Gather Tools and Materials

You will need:

Solder
Soldering Iron, I use 45 watt but this is more than enough
Needlenose pliers
a vise is very useful to keep from burning yourself
and at least 21 pins of straight male breakaway header pins

I got the header pins from my local electronics parts shop. Radioshack doesn't carry them as far as I know, but they can be ordered from various places around the internet for very cheap. It was 2 dollars for 40 pins at my local shop.

Here is the digikey part, it's a bit more that 2 dollars. http://search.digikey.com/scripts/DkSearch/dksus.dll?Detail&name=A26513-40-ND
Same thing from Sparkfun
http://www.sparkfun.com/commerce/product_info.php?products_id=116

These are straight male breakaway header pins.

You could theoretically use right angle as well, but I used straight pins.

STEP 2: Cut the Pins You Will Need

I only needed access to 7 of the 9 pins, so I only made a 7 pin connector. 8 pin would be fairly easy to do as well, but 9 pin may require some modification as it is a little recessed from the other 8.

Cut the header to the number of pins you will be using. You will need 3 sets of that length, for me, 3x7 pins.

Optional: one of the rows is just as a backing for the card. It would be possible to use just a couple of pins on the edges instead of a full row, but I didn't follow this route. The process would begin to be different around step 4, when you attach the second row of header to the first.

If you are doing a right angle connector, right angle header pins may lead to a cleaner result. I used straight pins on mine however and it worked well enough.

STEP 3: Bend Contact Pins

Now you have the contacts, they need to be bent to ensure perfect and reliable contact with the card.

Take one of the 3 header rows and place it in a vise, or a pair of pliers or vise grips. I held the short end of the pins to keep them from pulling out of the plastic.

Using the needle nose pliers, bend the pins just a bit at the base, so that the tip of the pin is about vertical with the edge of the plastic. See pictures for detail. Not all the pins need to be perfectly aligned. Bend them all against a table or flat surface to line them up better.

Now they need to be bent back on the tip so it is easy to insert the card. Again with the needle nose pliers, grip just a small amount and bend it back the other direction. Do this for all the pins. See picture for detail.

STEP 4: Attach Second Row Temporarily

The second row of header is actually just a backing. We are going to line up the pins so this works better, and so it is a cleaner solder job. I used a small bead of hot glue on each end to hold them together, but any method that leaves the bottom of the pins exposed will work. Then I put them in the vise again because we need to bend them a little.

Be sure the pins are facing the right direction, the bend should be on the inside of the socket.

So the solder joint is stronger and cleaner, we need to bend the bottom pins a little. This way we aren't filling so much space with solder beads. Grab both pins and squeeze just a little, so the pins are closer together. This may vary a little bit and isn't incredibly crucial that it be exact.

STEP 5: Prep for Soldering

If you have only two hands like me, you will want to make it easy to hold everything at the same time. I find that if I tin the leads, I can make a small solder joint to hold the pieces together the way I want without using one of my hands. I need to hold solder and an iron also. Tin the leads of the final row of header in addition to the double row that is the socket.

STEP 6: Attach Final Header Row

Here we get to the final part. You may choose to do vertical or right angle at this point. The only difference in in how you solder the last row on. I guess you could do some odd angle as well if you wanted.

Hold the last row exactly where you want it. Using the soldering iron, touch the tinned leads and the small amount of solder already there should hold the 2 pieces together. Finish all the other joints using more solder, and then add some solder to the first joint. Add a little more solder than necessary to ensure a strong bond, but not so much as to make a ball. These are partially structural, but you probably shouldn't be using this for anything that endures much force either.

You can remove the hot glue or whatever you used. The solder is holding the parts together just fine. It was only temporary anyways.

STEP 7: Prototype Your Circuit

And we're done. You now have an SD card socket that plugs directly onto a breadboard. What will you make now?

I made mine because I was building a data logger with my Arduino and a Memsic accelerometer, but the possibilities are endless.

Just be sure you don't short out pins 7 and 8, the socket can slide over to it, so be careful.

STEP 8: Extras

After a little discussion in the comments and elsewhere, I have taken a more permanent approach to this idea. I have found that by bending the pins in the same fashion for a single row of right angle header and attaching that to the PCB or perfboard, you have a flat, robust SD socket. This is best suited for the final version of a circuit, a one off custom circuit, or a good prototype without waiting for th final socket. I recommend bending the pins a bit more in the first step so to ensure that all are making good contact. Bending them back a little more in the second step is better as well. I did each one individually with pliers and holding the pins in visegrips this time.

Plus there aren't any pins on the backplane that could short against something! Thats never a good thing.

Thanks to frollard for the idea!

I've also included a pinout of an SD card by request. Here's the deal with the pins. An SD card has two modes, SD and SPI. Specifics on these can easily be found on wikipedia's SD card page. For the Arduino, however, only the SPI mode can be used. The SPI mode only uses pins 1-7, leaving off the small one and the recessed one (8 and 9). SD mode rearranges some pins and uses all of them.

Here is the pinout for SPI mode:

..._._._._._._._._._.
../...1.2.3.4.5.6.7.8|
/..9........................_|

1 - Chip Select*
2 - Data Input*
3 - Ground
4 - 3V3
5 - Clock*
6 - Ground
7 - Data Output*
8 - NC
9 - NC

*these are 3.3V logic lines. All but 7 are inputs to the card, and so must be brought down to 3.3V from 5V when using the Arduino Duemillenove. 7 is an output, and the Arduino can recognize 3.3V as high, so no voltage converter is necessary here.

Wikipedia has some great info on SD cards,
http://en.wikipedia.org/wiki/Secure_Digital_card
and pinouts.ru has a good writeup on the pinout,
http://pinouts.ru/Memory/sdcard_pinout.shtml

80 Comments

can i use this as a substitute for SD Card Reader Module? or are they the same?
It's a great idea, very nice. I tried it with my Arduino Uno R3 - Power input from 3,3V all pins without resistors. I tried put 100ohm resistors inspired with these instructions without result.
It works without resistors. This helped: https://www.instructables.com/id/Micro-SD-Card-Tutorial/ from SD pin 7 to D12 of UNO and SDpin 2 to D11 else all the same. Then open File\Examples\SD\ReadWrite and test it, If is all OK program writng to SD and reading record from it. Many Thanks. :)
This video is proof, that it works: https://drive.google.com/open?id=1V4tkJlkkBy_WWvHk...
Worked here too!
SD --->UNO
1--->4
2--->11
3--->Gnd
4--->3.3v
5--->13
6--->Gnd
7--->12
8--->
9--->
How can I use it to read dead Micro SD card soldering directly the contacts? Can I use it?

can i also use this to play music? and also can i randomly select a file to be used?

hey man I really like your tutorial and want to do make this for a project im doing.
I have 2 questions tho.
1. My project uses an arduino UNO and I need save data on a usb or sd card (I've got both). What library is the best library that will work with your configuration. I know there's an SD card library but will it work your configuration?

2. In your tutorial you said the arduino uses SPI mode with 7 pins.
I am using an Freetronics Ethernet shield and a Sparkfun SM5100B Cellular Shield & wifly RN-XV module.

They use pins:
Ethernet + wifly - (13,12,9,10) + (9,8)
Sparkfun SM5100B Cellular Shield - either pair (1,2)OR(2,3): Might be able to change this with sofware serial, doubt it tho.
+1 pin for keypad

Is it possible I can connect the 3Vs to arduino 3V and all grounds to arduino ground (analog OR digital) and somehow change the other pins from 1&2 to 3&4 software serial?

1 - Chip Select* ---SOFTWARE SERIAL TO --- 3
2 - Data Input* ----- SOFTWARE SERIAL TO -- 4
3 - Ground --- TO---- Arduino Grnd
4 - 3V3 ----TO---- Arduino 3V
5 - Clock* --- Leave this as it is ---
6 - Ground ----- To --- Arduino Ground
7 - Data Output* --- Leave this as it is ----------

you can use SPI whit many devices at once. Just use CS/chip select to select whit spi slave is active at the moment.

The SD Card really needs all input signals to be level shifted. It is a 3V tolerant device. Use a hex buffer to do this. That can be powered by the 3V supply of the arduino, as can the card. The output (MISO) doesn't need to go through the buffer.

As for the pinouts, the SPI pins must be the same as the arduino specifies, which I believe the ethernet shield uses too. BUT SPI is designed to work with multiple devices at the same time using the CS pin (Chip select). You can put this pin wherever you want, just be sure to specify the right one in the library you are using.

As for the library, any Arduino SD Library should work. I have heard of problems with cards larger than about 2GB though. Double check with the library first.

Good luck.

Hi,

I need to read an SD card connected to Arduino via USB, I have usb reader to do so, but whenever the card is connected to the arduino, the USB doesn't connect to the PC, can u help me with the pins i need to cheange and how please.

Thanks

Thank you. I've got a 16Gb and 512Mb i think. I'll check the library out.
Hi I had a look this SD Card shield from cooking,
http://www.cooking-hacks.com/index.php/sd-card-shield-v2-1.html

I love how it can attached to the In circuit serial programmer. Is there anyway we can implement the SD CARD Breakboard socket to work with ICSP on my arduino UNO?

I understand it's a big personally i've never used the in circuit serial programmer.
The ICSP connector just uses the same pins for programming as the SPI bus, which we use to connect to the SD card here. They are connected in both places. You could connect this the same way just by looking at the pinout of the ICSP header.
thanks for all your comments so far. you're a legend
Had this adapter around and decided to make this header. Turns out I don't need all 9 pins but it's possible.
If you solder this to sd to micro sd adapter than you have micro sd socket
Is it possible to use this to read pictures and video from my SD card. The casing for it snapped off and I can't get it to read when trying to insert the internal naked sd board into my pc adapter. I am wondering if this circuit would allow me to read all the contents off of it (pics and videos)?
That sounds like it may be a delicate operation. Depending on the thickness of the raw chip and the condition of the contacts you may be able to connect it with this method.

If you don't care about using it afterwards, you might be able to solder to the pins and connect those to a usb card reader. I can't think of any better options.
More Comments