SD card not communicating with arduino

Hey guys I am working on a simple project but this SD card won't communicate with the arduino. I tried and checked my wiring and code multiple times, i have not found any mistakes yet the serial monitor prints SD fail every time. I use Arduino Uno R3 + WiFi and SD card module from geeetech.com.
This is my code:

#include "SD.h"
#define SD_ChipSelectPin 10
#include "SPI.h"

void setup()
{

Serial.begin(9600);
if (!SD.begin(SD_ChipSelectPin))
{
Serial.println("SD fail");
return;
}
}

void loop()
{
// put your main code here, to run repeatedly:
}

The image linked below is my wiring except the resistor.
Also this is my first post so if I have anything that could be improved just let me know.
Thank you for all your answers.

I don't know which version of the SD library you are using, but I've never included SPI.h as well.

Could you take a moment to read the sticky post at the top of this section about how to use the forum?

Do you think the SPI library is causing it?

What happens when you remove the line #include "SPI.h"?

Still prints SD fail

Just a thought, but what happens if you change setup() to:

void setup()
{

  Serial.begin(9600);
  if (!SD.begin())
  {
    Serial.println("SD fail");
    return;
  }
}

The SD library docs say that it defaults to using pin 10.

If that doesn't work, try setting the CS pin to output before SD.begin:

  pinMode(SD_ChipSelectPin, OUTPUT);

I'd suggest running one of the examples from the SD library, such as CardInfo, and see if that works. If it doesn't, then either the CS pin is wrong, or your wiring is wrong. Your wiring picture is too low-res for me to see what's going on.

This topic was automatically closed 120 days after the last reply. New replies are no longer allowed.