Arduino Pro 3.3V unable to connect SD Card Module

Hi Everyone

I recently bought a Sparkfun Pro 3.3V board to perform some battery testing experiments. I also bought a standard SD card module to log all my readings but after spending almost 2 days I still could not figure out the issue.

The error message I get is regarding initialization (“unable to initialize”).

I used the following pin configurations for my board

Pin Configurations on Arduino Pro

VCC - 5V

GND - GND

SS - Pin 10

MOSI - Pin 11

MISO - Pin 12

SCK - Pin 13

I even tried to switch to 3.3V and 5V supply on board but everything remains the same.

To test it further, I used exactly the same module on my old arduino Mega (pin configurations below) and it worked absolutely fine, it had no issues in detecting/reading/writing the sd card

Pin configurations on Arduino Mega

VCC - 5V

GND - GND

MISO - 50

MOSI - 51

SCK - 52

SS - 53

The test with Mega board concluded that SD card module is OK, as well as the card itself and it is properly formatted. That leads me to the conclusion that there is something wrong with my Arduino pro (but having done/verifying the wiring and connections almost over 50 times, I gave up).

Can anyone help me with it?

Thanks in advance

Could you post the relevant part of the sketch with the pin assignments and library instantiation code? That might help to diagnose the problem. Also, do you have another SPI device on hand that you could use, with the same Arduino Pro pin assignments, to see if that works?

What SD card module are you using?

Thanks for the reply TS-Chris and SV-Zanshin, I would try to update the information that you asked for.

  • Currently, I only have this single Sparkfun Arduino Pro (3.3V board)

    I have another Arduino Mega board for testing (though it has completely different Pin Assignments, but the module works on that just fine


  • The SD card module that I am using does not have any manufacturer’s labelling on it, so I am a little unsure about its make and model but here is the link I bought it from, I hope it will give you some information on the product.

    https://my.cytron.io/p-5v-compatible-mi … vcQAvD_BwE

    The schematic is attached below

    Here is the code that I am running for my set up

    #include <SD.h>
    #include <SPI.h>
    
    File myFile;
    int pinCS=10;
    
    
    void setup() {
    Serial.begin(9600);
    pinMode(pinCS, OUTPUT);
    digitalWrite(pinCS, HIGH);
    pinMode(LED_BUILTIN, OUTPUT);
    //SD card initialization
    if(SD.begin())
    {
      Serial.println("SD card is ready to use");
      digitalWrite(LED_BUILTIN, HIGH);   // turn the LED on (HIGH is the voltage level)
       
    }
    else
    {
      Serial.println("Unable to initialize SD Card");
      return;
    }
    
    //Creating/Opening FIle
    
    myFile = SD.open("test.txt", FILE_WRITE);
    
    //If file is opened properly, then start writing to it.
    if(myFile){
      Serial.println("Writing Data to file");
      for (int i=0; i<1000; i++)
      {
        myFile.println(i);
      digitalWrite(LED_BUILTIN, HIGH);   // turn the LED on (HIGH is the voltage level)
      delay(100);  
      }
      myFile.close();
      digitalWrite(LED_BUILTIN, LOW);   // turn the LED on (HIGH is the voltage level)
      delay(100);  
      Serial.println("Done writing to file");
    }
    else{
      Serial.println("Could not open File Test.txt");
    }
    
    // Now to read from the file
    myFile = SD.open("test.txt");
    if (myFile){
      Serial.println("This is the output from the file stored on SD Card");
      while (myFile.available()){
        Serial.write(myFile.read());
        
      }
      myFile.close();
    }
    else{
      Serial.println("Error OPening the file");
    }
    }
    void loop() {
    // nothing happens after setup
    }
    

    Can you load and run the SD-Library example program “CardInfo”? You can do this using the Arduino IDE – File → Examples → SD → CardInfo and change the CS from 4 to 10. What is the output when you compile and upload and run that program?

    My guess is that your SD adapter has a logic level converter built in that is able to handle 5 volt I/O but not 3.3 volt I/O. That would explain why it works on the Mega but not your 3.3 volt Arduino Pro. It would probably work fine on an Uno or a 5 volt Arduino Pro if you tried those though. (We have a similar problem with our level shifting SD breakout where it doesn’t work on a 3.3 volt micro controller.)

    Since you’re already using a 3.3 volt system and SD cards are 3.3 volts, a simple breakout that doesn’t have any level shifting should work. You could directly connect [BOB-00544 to a 3.3 volt Arduino Pro or you could even solder pins directly to a SD to micro SD adapter like in the picture below if you want to give it a quick try without buying any additional parts.

    https://punchthrough.github.io/bean-doc … D-card.jpg](https://www.sparkfun.com/products/544)