SD card not recognised - datalogger shield

Adafruit Ethernet, Motor, Proto, Wave, Datalogger, GPS Shields - etc!

Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.
User avatar
yellowflamingos
 
Posts: 4
Joined: Tue May 09, 2017 4:10 pm

SD card not recognised - datalogger shield

Post by yellowflamingos »

Hi

I am using the latest generation datalogger shield with a Genuino 101. The CardInfo sketch successfully ran when I first set it up but now is telling me the card isn't recognised. In the time since I first ran it and now it has been knocked around a bit because of the nature of the project, which could be causing the issue, but I don't know what to check. I have additionally needed to resolder some connections on the prototyping area, at the analog pins 2-5 and at GND and 5V, but I haven't touched digital pin 10 or any of the other header pins. When I check if there is a connection between the male header pin at 10 and the CS pad with a multimeter, it registers a connection on both sides of the pad. I believe the SD card is formatted correctly because when I insert it into my laptop I can see that it is formatted with FAT32 in Disk Utility. I've attached a photo of the board, but the quality is a bit iffy, I can try take a better one if necessary. What are the next steps I should take to troubleshoot my board?
Attachments
IMG_5216_small.jpg
IMG_5216_small.jpg (895.24 KiB) Viewed 1305 times

User avatar
adafruit_support_rick
 
Posts: 35092
Joined: Tue Mar 15, 2011 11:42 am

Re: SD card not recognised - datalogger shield

Post by adafruit_support_rick »

First thing I'd do is to try another card. We've seen lots of problems with bogus cards.

User avatar
yellowflamingos
 
Posts: 4
Joined: Tue May 09, 2017 4:10 pm

Re: SD card not recognised - datalogger shield

Post by yellowflamingos »

Thanks for the reply, but I tried that and it still doesn't work

User avatar
adafruit_support_rick
 
Posts: 35092
Joined: Tue Mar 15, 2011 11:42 am

Re: SD card not recognised - datalogger shield

Post by adafruit_support_rick »

Do you have the MOSI, MISO, and SCK jumpers soldered on the back? Are those solders good?

There really isn't much of anything that can go wrong here, apart from the soldering, the only thing between the 101 and the card is a buffer chip used for level shifting. Those really don't go bad. That's why we tend to suspect the card itself.

Can you see if any of the pins inside the card slot are bent or broken?

User avatar
yellowflamingos
 
Posts: 4
Joined: Tue May 09, 2017 4:10 pm

Re: SD card not recognised - datalogger shield

Post by yellowflamingos »

Thank you for your responses, it turns out the Genuino was the issue rather than the shield. I replaced it and it now works.

User avatar
adafruit_support_rick
 
Posts: 35092
Joined: Tue Mar 15, 2011 11:42 am

Re: SD card not recognised - datalogger shield

Post by adafruit_support_rick »

great!
Question: Did you replace it with another 101 and it worked? Or is it something to do with the 101 design?

User avatar
yellowflamingos
 
Posts: 4
Joined: Tue May 09, 2017 4:10 pm

Re: SD card not recognised - datalogger shield

Post by yellowflamingos »

I replaced it with another 101, so the design can't be at fault, it must just be that my original was broken in some way. I haven't troubleshooted (troubleshot?) it yet so I can't say what exactly the problem was.

User avatar
adafruit_support_rick
 
Posts: 35092
Joined: Tue Mar 15, 2011 11:42 am

Re: SD card not recognised - datalogger shield

Post by adafruit_support_rick »

thanks - good to know.

User avatar
tcharter
 
Posts: 1
Joined: Sat Jul 15, 2017 4:40 pm

Re: SD card not recognised - datalogger shield

Post by tcharter »

Interesting, I just ran into the same problem and switching out the Genuino fixed it. Glad I had a spare

User avatar
SprocketMan
 
Posts: 7
Joined: Sat Sep 10, 2016 4:08 pm

Re: SD card not recognised - datalogger shield

Post by SprocketMan »

I bought the Adafruit ultimate gps logger shield and have the gps portion of the shield working. I would like to log some data and the logger does not appear to work. I am using a 2gb drive. Using the CardInfo.ino program and changing the chipSelect to 10 reports the following data:
Initializing SD card...Wiring is correct and a card is present.
Card type: SD2
Volume type is FAT16
Volume size (bytes): 1971159040
Volume size (Kbytes): 1924960
Volume size (Mbytes): 1879
Files found on the card (name, date and size in bytes):

Everything looks good, except there are two text files on this drive which this program is failing to recognize. One a zero-size file and another a 1k size file. When I run the createDeleteFile.ino with chipSelect set to 10, I get the following data:

Initializing SD card...initialization done.
example.txt doesn't exist.
Creating example.txt...
example.txt doesn't exist.
Removing example.txt...
example.txt doesn't exist.
I have tried removing the forward slash and preforming a conductivity check of the pins 9, 10, 11, 12, 13, 14. I have tried the SparkFun RedBoard and an Arduino uno. To format the drive I have used Trendy Co SDFormatter with the following settings: Format type: Full overwrite, Format size adjustment on. That did not work. I then tried Tuxera Inc with the formatting options Overwrite format. Same story. The CardInfo.ino program worked, but the createDeleteFile.ino did not. I have formatted an 8gb drive and the CardInfo.ino program will not work.

Any hints.
Thank you
tom

User avatar
adafruit_support_rick
 
Posts: 35092
Joined: Tue Mar 15, 2011 11:42 am

Re: SD card not recognised - datalogger shield

Post by adafruit_support_rick »

Well, your hardware is working, since the program is reporting that the SD was initialized successfully:

Code: Select all

Initializing SD card...initialization done.
What version of Arduino are you using? Are you using a Uno?

Try this - it's the same program, except it writes some data to the file before closing it. I don't know - see if it makes a difference. Otherwise, try a different SD card.

Code: Select all

/*
  SD card basic file example

 This example shows how to create and destroy an SD card file
 The circuit:
 * SD card attached to SPI bus as follows:
 ** MOSI - pin 11
 ** MISO - pin 12
 ** CLK - pin 13
 ** CS - pin 4 (for MKRZero SD: SDCARD_SS_PIN)

 created   Nov 2010
 by David A. Mellis
 modified 9 Apr 2012
 by Tom Igoe

 This example code is in the public domain.

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

File myFile;

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


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

  if (!SD.begin(10)) {
    Serial.println("initialization failed!");
    return;
  }
  Serial.println("initialization done.");

  if (SD.exists("example.txt")) {
    Serial.println("example.txt exists.");
  } else {
    Serial.println("example.txt doesn't exist.");
  }

  // open a new file and immediately close it:
  Serial.println("Creating example.txt...");
  myFile = SD.open("example.txt", FILE_WRITE);
  char message[] = "this is some data";
  myFile.write(message, strlen(message));
  myFile.close();

  // Check to see if the file exists:
  if (SD.exists("example.txt")) {
    Serial.println("example.txt exists.");
  } else {
    Serial.println("example.txt doesn't exist.");
  }

  // delete the file:
  Serial.println("Removing example.txt...");
  SD.remove("example.txt");

  if (SD.exists("example.txt")) {
    Serial.println("example.txt exists.");
  } else {
    Serial.println("example.txt doesn't exist.");
  }
}

void loop() {
  // nothing happens after setup finishes.
}



User avatar
SprocketMan
 
Posts: 7
Joined: Sat Sep 10, 2016 4:08 pm

Re: SD card not recognised - datalogger shield

Post by SprocketMan »

The pertinent lines from the program you recommended
myFile = SD.open("example.txt", FILE_WRITE);
char message[] = "this is some data";
myFile.write(message, strlen(message));
myFile.close();

results in the following messages
Initializing SD card...initialization done.
example.txt doesn't exist.
Creating example.txt...
example.txt doesn't exist.
Removing example.txt...
example.txt doesn't exist.

I found another program called ReadWrite.ino with the following pertinent lines
myFile = SD.open("test.txt", FILE_WRITE);
if (myFile) {
Serial.print("Writing to test.txt...");
myFile.println("testing 1, 2, 3.");
// close the file:
myFile.close();
Serial.println("done.");
} else {
// if the file didn't open, print an error:
Serial.println("error opening test.txt");
}

Resulting with the following messages
Initializing SD card...initialization done.
error opening test.txt
error opening test.txt
The board model of the ARDUINO is UNO R3.
The two cards I am using are:
2GB MicroSD
8GB MicroSD with the following extra information “Strontium NITRO 400X HC I”: Used in my video camera. I find it odd that this SD does throws an initialization error.

My next video card is a 16GB micro with the following extra information “Transcend Premium 400X HC I”. Using this card results in the following information from the cardInfo program.
Initializing SD card...Wiring is correct and a card is present.

Card type: SDHC
Could not find FAT16/FAT32 partition.
Make sure you've formatted the card
The first two cards I have used the formatting tools as previously described. The last card has 14.1GB used, that is videofiles, and 789MB free.

All three SD cards, inserted into my windows computer, report having FAT32 partitions. However, the cardInfo program reports the smallest card, 2GB, to have a FAT16 partition.

User avatar
adafruit_support_rick
 
Posts: 35092
Joined: Tue Mar 15, 2011 11:42 am

Re: SD card not recognised - datalogger shield

Post by adafruit_support_rick »

Can you just format one of them in the regular windows file explorer? There's something going on with your formatting.

User avatar
SprocketMan
 
Posts: 7
Joined: Sat Sep 10, 2016 4:08 pm

Re: SD card not recognised - datalogger shield

Post by SprocketMan »

Testing with a 2 GB SD card and a 8 GB SD card
Format cards and uncheck the quick format box
2 GB:FAT - Default
8 GB:FAT32 - Default
After formatting, windows report the following properties
Generic SD/MMC USB Device

cardInfo reports the following

2GB:
Initializing SD card...Wiring is correct and a card is present.
Card type: SD2
Volume type is FAT16
Volume size (bytes): 1973059584
Volume size (Kbytes): 1926816
Volume size (Mbytes): 1881
Files found on the card (name, date and size in bytes):

8GB:
Initializing SD card...Wiring is correct and a card is present.
Card type: SDHC
Could not find FAT16/FAT32 partition.
Make sure you've formatted the card

createDeleteFile reports the following

2GB:
Initializing SD card...initialization done.
example.txt doesn't exist.
Creating example.txt...
example.txt exists.
Removing example.txt...
example.txt doesn't exist.

8GB:
Initializing SD card...initialization failed!

ReadWrite reports the following

2GB:
Initializing SD card...initialization done.
error opening test.txt
error opening test.txt

8GB:
Initializing SD card...initialization failed!

The program you provided reports

2GB:
Initializing SD card...initialization done.
example.txt doesn't exist.
Creating example.txt...
example.txt exists.
Removing example.txt...
example.txt doesn't exist.

8GB:
Initializing SD card...initialization failed!

Using only the 2GB SD card and

Commenting out the “Removing example.txt” in the createDeleteFile results in the following
Initializing SD card...initialization done.
example.txt doesn't exist.
Creating example.txt...
example.txt exists.
Looking at the SD card with windows reveals an empty SD card.

Commenting out the “Removing example.txt” in the program you provided results in the following
Initializing SD card...initialization done.
example.txt doesn't exist.
Creating example.txt...
example.txt exists.
Looking at the SD card with windows reveals an empty SD card.

Notes:
There is a limit to the size of the SD card that can be used. The 2GB file works but the 8SB files does not.
The ReadWrite program uses the variable myFile to see if the file has been created and open. The other two programs uses the function SD.exists(“example.txt”) to check for file creation and open.

User avatar
adafruit_support_rick
 
Posts: 35092
Joined: Tue Mar 15, 2011 11:42 am

Re: SD card not recognised - datalogger shield

Post by adafruit_support_rick »

Well, the system itself works. I think there's something wrong with your 8GB card.

Locked
Please be positive and constructive with your questions and comments.

Return to “Arduino Shields from Adafruit”