SD card reader will not write to disk, and seems to be corrupting them!

I'm attempting to write data from an Arduino Pro Mini (3.3v 8MHz) to a Catalex SD Card module with no luck.

Currently, I'm simply using the Datalogger sketch from the SD.h library. I keep getting the following error messages:

Initializing SD card...Card failed, or not present
error opening datalog.txt
error opening datalog.txt
error opening datalog.txt
error opening datalog.txt
error opening datalog.txt

Here is the Datalogger sketch from the SD.h library

#include <SPI.h>
#include <SD.h>

const int chipSelect = 4;

void setup() {
  // Open serial communications and wait for port to open:
  while (!Serial) {
    ; // wait for serial port to connect. Needed for native USB port only

  Serial.print("Initializing SD card...");

  // see if the card is present and can be initialized:
  if (!SD.begin(chipSelect)) {
    Serial.println("Card failed, or not present");
    // don't do anything more:
  Serial.println("card initialized.");

void loop() {
  // make a string for assembling the data to log:
  String dataString = "";

  // read three sensors and append to the string:
  for (int analogPin = 0; analogPin < 3; analogPin++) {
    int sensor = analogRead(analogPin);
    dataString += String(sensor);
    if (analogPin < 2) {
      dataString += ",";

  // open the file. note that only one file can be open at a time,
  // so you have to close this one before opening another.
  File dataFile ="datalog.txt", FILE_WRITE);

  // if the file is available, write to it:
  if (dataFile) {
    // print to the serial port too:
  // if the file isn't open, pop up an error:
  else {
    Serial.println("error opening datalog.txt");

Here are the only clues I have:

  • Oddly, either the sketch or the module eventually corrupts the card (or puts them into a weird read-only mode where formatting on the PC fails!
  • If the "datalog.txt" file exists on the SD card, it will appear to write (e.g., the serial monitor prints the analog reads) but the data never shows up on the SD card. But the next time it tries to write in the loop, it goes right back to error messages

Here is what I've tried so far

  • Pre-checking, Checking, post-checking, then rechecking, the wiring to make sure all the SPI connections are correct. Then I checked it again for good measure. (MOSI -> 11, MISO -> 12, SCK -> 13, CS -> 4, VCC -> VCC, GND -> GND)
  • I am sure to set pin 10 to OUTPUT (and also tried setting it HIGH during setup)
  • I've tried example sketches from the SdFat library as well with the same issue
  • I re-checked the wiring.
  • Desparately clicking and unclicking the SD Card to make sure it went in straight
  • I've tried 5 different SD Cards (SanDisk Micro SD 512MB)
  • I've tried 2 different SD Card modules and am encountering the same problems

I'm not even really sure what to try at this point! I'll be over here rechecking the wiring until responses come in...

Try a different example sketch.

The adapter does only 5 V conversion and holds the card over the SPI contacts. The device is the card itself. And the card is 3.3 V device. Why do you use a 5 V adapter for SD card if your board is at 3.3 V?