I bought from here: https://www.amazon.com/HiLetgo-Adater-Interface-Conversion-Arduino/dp/B07BJ2P6X6. I have used the canonical code setup and wiring that many people use e.g. from Arduino Micro SD Card Module Tutorial - How SD Card Module Works and How to use it with Arduino. All the SPI pins are correctly connected, the code is standard initialization, and I am using 5 V.
I check on my card daily and the fact that it’s so random when it chooses to work or not is annoying.
For 3 of the days, I’ve had it work with no problems. All of the logs were fine. A couple of other days have appropriate logs as well though not at the volume that I have been expecting, not sure why. But recently, the card just FAILS TO INITIALIZE and thus no logs.
#include <SD.h>
#define chipSelect 10
void setup() {
pinMode(chipSelect, OUTPUT);
digitalWrite(chipSelect, HIGH);
Serial.begin(9600);
s.begin(9600);
Serial.println("did this initialize??");
if (!SD.begin(chipSelect))
{
Serial.println("SD initialization failed.");
}
Serial.println("SD initialization done.");
}
I've tried storing placeholder files on the card so that the module sees that there is storage and thus a card present (a solution I found online that helped when I had initialization errors before).
I am careful to eject my SD card from the computer every time. Every time I take it out I make sure to unplug power first. When I’m done I put the sd card back, then turn on power again.
It’s just so frustrating so if anyone has suggestions that would be great. Tomorrow, I will try to do a step down from 5 V to 3.3 V for each of the pins to see if it does anything. I am annoyed that I even have to do this because these modules are supposed to work for both voltages.
If anyone has experience with this module let me know. I've cycled through 4 of them (all used for different amounts of time so I doubt the reason is that they go bad quickly) and 2 SD cards and continue to have the problem.