Jump to content


Photo

How to connect SD Card Breakout Board to Arduino Uno

SD Card Breakout Board Arduino Uno

  • Please log in to reply
4 replies to this topic

#1 atauf

atauf

    Newbie

  • Members
  • Pip
  • 3 posts

Posted 14 January 2015 - 07:33 PM

Hi,

 

I've been looking around for a way to safely connect the SD Card Breakout Board to the Uno.  Maybe it's just as simple as connecting it (I haven't even ordered it yet), but I've been looking on the Adafruit website at their tutorials and they say it's better not to use resistor dividers for the 3.3V logic, (https://learn.adafru...torial/look-out).  Also, their code is written for their SD Card Breakout Board, which uses level shifters.

 

I know that you can use the Breakout Boards with the resistor dividers, I'm just not sure what the changes will be to the code when I hook it up to the Arduino Uno.  Think you could help me out?

 

Also, do you have a datasheet for that Breakout Board?  I can't find one.

 

Thanks a lot for any help!


  • 0

#2 Nathan House

Nathan House

    Administrator

  • Administrators
  • 122 posts
  • LocationLynchburg, VA

Posted 15 January 2015 - 02:14 AM

Hi,
 
I've never used an SD card with an Arduino before and unfortunately don't have a datasheet for this breakout board, but I did a little research and here's what I found:
 
The Arduino can communicate with the SD card module via SPI (Serial Peripheral Interface Bus).
 

The SPI bus specifies four logic signals:

  • SCLK : Serial Clock (output from master).
  • MOSI : Master Output, Slave Input (output from master).
  • MISO : Master Input, Slave Output (output from slave).
  • SS : Slave Select (active low, output from master).

 

The SPI bus on the SD card breakout board operates at 3.3V and the Arduino UNO is a 5V device, so you need a level shifter in order to not damage the SD card.

 

You can use a resistor voltage divider as you mentioned, but if you do so make sure to use lower values such as 1K and 2K. The issue with using a resistor voltage divider is that the waveform will be attenuated a little, which could cause problems depending on the SD card used. Higher resistor values exacerbate the problem. With that said, the Arduino SPI bus operates at 4MHz by default, so in all likelihood a resistor voltage divider would work fine.

 

If you don't want to roll the dice with a resistor voltage divider, then you can use a level shifting IC. This breakout board would be an easy solution for you, or you could by an IC and make your own circuit on a breadboard.

 

Whichever solution you choose, the code on the Arduino will not be any different.

 

Let me know if you run into any problems and I'll do my best to help!


  • 0

#3 atauf

atauf

    Newbie

  • Members
  • Pip
  • 3 posts

Posted 28 January 2015 - 10:34 PM

Thanks for the quick response.  I ended up purchasing two of the SD Card breakout board and the Ethernet shield from your website.  Right now, I have the shield set up, but my SD reader isn't initializing.  I tried both shields, and one of the breakout boards.  Not sure what's wrong, I keep researching but no good answers.  Only thing I can think of now is the SD card (8GB MicroSD HC Toshiba), but it works when I use it in a computer.

 

....

 

 

I actually just reformatted the SD card again and I got it to work when I set up the breakout board (powered the the 3.3V from the Arduino).  Thinking that the reformatting was the issue, I just hooked up the Ethernet shield again and it still won't work.


  • 0

#4 Nathan House

Nathan House

    Administrator

  • Administrators
  • 122 posts
  • LocationLynchburg, VA

Posted 29 January 2015 - 01:24 AM

So the breakout boards are working with your card, but not the Ethernet shields?

 

What is the error you're getting?

 

What filesystem did you format the card to?

 

Are you using the shield with an UNO?


  • 0

#5 atauf

atauf

    Newbie

  • Members
  • Pip
  • 3 posts

Posted 30 January 2015 - 10:00 PM

Correct.  I just get the default error message that is built into that example sketch:

 

   "initialization failed. Things to check:"
   "is a card is inserted?"
   "Is your wiring correct?"
   "did you change the chipSelect pin to match your shield or module?"

 

My Card Settings:

 

Capacity = 7.28GB

File System: FAT32 (Default)

Allocation Unit Size: 4096 Bytes

 

 

Like I said, the breakout board is working just fine.  I'm not sure why the shield isn't working.  I wired the breakout board exactly how the sketch says it's supposed to be (which is what the shield is also supposed to be).

 

Thanks!


  • 0




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users