There are other shields with SD (or microSD) card slots in addition to other features. Most can work just fine as a card reader for this project. Some may have a display or buttons, but our example software doesn’t support these (nor will thicker shields fit inside the mint tin).
With a different enclosure and some custom code, you might be able to add a file selection user interface…or you might not. Memory is exceedingly tight, and we can’t really say whether adding a UI is even practical…it’s something we’ve not explored yet. For now it’s very basic.
Breakout boards for SD/microSD could also work, but we recommend using the shield…the prototyping area provides a solid point of contact for wires and parts we’ll be adding later.
Notice how the solder joints in the photo above are shiny, smooth and concave. The Adafruit Guide to Excellent Soldering illustrates proper soldering technique. “Cold” solder joints (cloudy and balled up on the surface, not flowing smoothly between pin and board) will cause the shield to work unreliably or not at all.
Installing the battery on the shield is optional. This project doesn’t require use of the realtime clock, so it’s okay to leave it out. If you’re planning to dismantle and use the shield in other future projects, or have an idea how you might use the clock in your light painting, go ahead and install the battery. It’ll last for years.
This task does not require massive storage. It’s a great opportunity to recycle those “tiny” old SD cards cluttering a drawer. You don’t need to buy anything exotic or high-end.
Plug the card into a USB SD card reader (or SD slot if your computer has one) and format it as a FAT filesystem. This has caused some trouble in the past, but more recent releases of both Windows and Mac OS X produce a card that the Arduino can read. If you encounter issues in the next steps, try formatting the card in a digital camera, or download the SD Association’s official SD card formatter application.
Toss a few small files or folders on the card for testing the next step, then eject the card.
Launch the Arduino IDE. From the File menu, select: File→Examples→SD→CardInfo
This example is part of the standard Arduino SD library; we’ll get into SdFatlib later.
You will need to make a small change to this code. Locate this line:
Also from the Tools menu, select the Serial Port corresponding to the Arduino USB connection, then click the Upload button (the circle with a right-facing arrow). In a moment, it should report “Done uploading,” and the red LED on the SD shield will light briefly.
Now open the Serial Monitor (the magnifying glass icon at the top-right of the Arduino editor window) and set the baud rate to 9600.
If this succeeds, you’ll see a listing of all the files and folders on the card (if any — but at the very least, it will report the card type and size).
If this reports an error, it’s usually one of three problems:
- The chipSelect pin number is not set correctly in the software (should be 10).
- The SD card format is not strictly following the specification. If this was formatted in your computer, try formatting the card in a digital camera instead, or use the aforementioned SD formatter application.
- A soldering problem with the shield. If you post a clear photo in the Adafruit Customer Support Forums, we’ll look it over for any gremlins.