3

I am trying to collect data from the arduino into a SD card for the first time, so I bought the adapter at my local electronics/arduino shop. However, I could not find an explanation as to what each pin does, and the other adapters that I have seen online have different pins, so I am not sure what to do with the pins (except for the obvious ones, GND and VCC) enter image description here

The order of pins is as follows: CD, DO, GND, SCK, VCC, DI, CS.

Could you help me figure out what they mean and where to plug them into my arduino?

3
  • 4
    for Uno use an 5 V SD card adapter. this is only for 3.3 V
    – Juraj
    Commented Sep 18, 2019 at 14:05
  • 3
    You should read the documentation.
    – TomServo
    Commented Sep 19, 2019 at 1:01
  • 2
    See instructables.com/id/… for a useful starting point
    – rolinger
    Commented Sep 19, 2019 at 12:55

4 Answers 4

9

This is called the SPI interface (See Serial Peripheral Interface, Wikipedia. The pin names typically used for SPI are:

  • GND : Power Ground
  • VCC : Power input
  • CS : Chipselect
  • SCK/SCLK (SD-Clock): SPI Clock
  • MOSI (SD-DI, DI) : SPI Master out Slave in
  • MISO (SD-DO, DO) : SPI Master in Slave out
  • CD: Card Detect (see comment of rollinger below (thanks).

On an Arduino Uno the SPI pins are:

  • CS – digital 10; this can be in principle any pin
  • SCK – digital 13
  • MOSI – digital 11
  • MISO – digital 12
2
  • 1
    I'd expect CD to be card detect, switch signalling when a card has been inserted- e.g. see instructables.com/id/… for hookup of a similar / same board
    – rolinger
    Commented Sep 19, 2019 at 12:54
  • 1
    @rollinger Thanks ... and yes, that sounds more plausible than my search on google, so I updated my question. Thanks/credits to you. Commented Sep 19, 2019 at 12:57
5
  • CS = Chip select
  • DI = Data In (MOSI)
  • VCC
  • SCK = Serial Clock
  • GND
  • DO = Data Out (MISO)
  • CD (not sure what it stands for, but this pin isn't used when connecting to an Arduino. I think it's used for faster transfers.)

Note that SD card run at 3.3Volt, not 5V. Also the input pins of the SD can't handle 5Volt signals. So you need to convert the 5V signals coming out of the UNO to 3.3V before connecting to the SD card.

3
  • Oh that is actually a problem for me, because I wanted to run it from the arduino! How can I convert it? Would a voltage divider be good enough? Commented Sep 18, 2019 at 12:58
  • It appears you can, but you'd have to run at a lower speed, so it doesn't work out of the box with the standard libraries. But nothing a few lines of code can't fix.
    – Gerben
    Commented Sep 18, 2019 at 13:28
  • 3
    Could CD stand for Card Detect? changing state depending on whether a card is physically in the slot. Commented Sep 18, 2019 at 15:18
3

CD could be one of two things:

a) a simple mechanical switch on the socket, usually used for Card Detect. Measure from the pin to Gnd and see if contact is open/closed when a card is plugged in.

b) the fifth IO pin to a uSD card. See the chart on the middle of this data sheet

https://www.molex.com/pdm_docs/sd/472192021_sd.pdf

You will see there are 4 data lines for parallel operation (Dat0, Dat1, Dat2, and CD/Dat3), and the Clock and Command (CMD) pin. Arduino uses serial operation over the SPI bus tho, so in this case CD is likely card detect from what appears to be a mechanical lever switch at the bottom of the socket.

This drawing shows how the pins are used http://www.dotmana.com/weblog/wp-content/uploads/izQKT.png

2

Your question's been well answered, but I just wanna point out, when you get the library code that lets you access the SD card, there will probably be instructions on what pins to wire up where. That's nearly always the case. Particularly since this one uses the SPI pins.

There's also loads of instruction websites that would take you through it. The cheap Chinese stuff is nearly always copies of designs from the West, as seen on popular websites. So the instructions usually apply. Arduino is bloody great! Good luck in your adventure.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.