Close

SD Card Reader Testing

A project log for Digital Holga

Conversion of a Holga 120S to digital format with SD card output.

AnthonyAnthony 05/18/2015 at 03:430 Comments

At the start of this project I had picked up this SD card reader off EBay. For the cost, it can't be beat, as otherwise you can end up paying 5x the price for something comparable from SparkFun. The real important point with SD modules is all the 'interesting stuff' happens in the software, and more or less the hardware portion is simply breaking out the pins from the card.

However, as this is not a card from any 'official' supplier, I wasn't sure yet if it would work with the standard Arduino SD/SPI libraries.

Instead of finding out at the end there would need to be a lot more hardware/software work done to complete the image file output portion, I decided to test it out tonight.


First Test: Limor Fried / Tom Igoe's 'Card Test'

This simple sketch will both check your wiring elements (i.e. you've connected MOSI, MISO, and SCK correctly, or that is they are responding as expected) but will also detect what type of card is present, the total volume size and file system type, as well as reading out a root directory of any files present on the card.

It passed this test quickly and without troubles. Just make sure to reconfigure the pin numbers in the sketch for the SPI (Serial Peripheral Interface) pins you will actually be using on your particular board.

Second Test: David A. Mellis / Tom Igoe's 'SD Read/Write'

Another simple sketch, though this time after checking whether an SD card is present it tries to open (or, if not present then create) a new file, writes data to that file, closes it, opens it up again and then displays the context out on the serial monitor. Again, passed no problems.

One final bit of good news. All tests were performed on the 3.3V input pin of this particular card reader, so in addition we won't need a 'step-up' converter to 5v to otherwise readily incorporate it into this project.

In the end, most of the SD related work will be dealing with any speed bottlenecks when writing image data to a file and implementing buffers accordingly, as well as ensuring the proper image format is preserved in the file format at write time.

Discussions