Skip to main content
2 of 2
Grammar, inlined images, added tags, code formatting.
Nick Gammon
  • 38.7k
  • 13
  • 67
  • 125

arduino creates strange files in SD card

I'm new to Arduino and electronics. I want to make a project including SD data-logger, but I had a problem. I would appreciate if someone show me where I made a mistake.

Firstly, circuit was set up as in picture:

Hardware setup

I am using 8 Gb micro SDHC card with SD adapter. I formatted in FAT32. I can play audio files which are in appropriate format and read and the print contents of text files.

But when I want to create a new file, strange file is obtained in SD card as in pic:

Directory listing

So I reformat SD card. the code that is used while creating file is as this;

// open a new file and immediately close it:
Serial.println("Creating example.txt...");
myFile = SD.open("example.txt", FILE_WRITE);
myFile.close();

Somewhere I read SDHC card with more than 2 Gb capacity is not supported in Arduino and I bought 2 Gb SD micro with SD adaptor.

But in this case aurduino does not detect SD card. please someone help me.

dursung
  • 71
  • 1
  • 1
  • 2