Data logger shield revB: stubborn problems initialising SD c

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

Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.
Locked
User avatar
kalapodi
 
Posts: 3
Joined: Fri Sep 03, 2021 8:02 am

Data logger shield revB: stubborn problems initialising SD c

Post by kalapodi »

Hello,

been using your data logger shields (revA and now revB) for a wearable computing biomedical engineering project.

We developed our own Arduino C code and had been happily collecting data using both the revA and revB versions of the shield.

Then all of a sudden everything stopped working (SD card(s) failing to initialise), defying our team's troubleshooting efforts. We do not remember doing anything drastic before it stopped working, such as reinstalling libraries, changing PCs, cables or doing anything that could damage soldering connections.

We tried both the old revA and the new revB shields, including soldering a new shield (different libraries between the 2 versions, as recommended of course). We tried soldering headers on a brand new revB shield, using a new Arduino Mega R3 out of the box (and even a new Uno out of the box), we even tried different SD cards, different micro-SD card holders, different laptop PCs with fresh installations of the SD libary, nothing: the Arduino using the shield reports being unable to initialize it, using even the standard (plain vanilla) code provided by Adafruit (cardInfo sketch).

The overall setup works fine, the Arduino(s) accept and run several other sketches, so long the data logger shield is not implicated. Another Adafruit shield (the motor shield v2) seems to be running just fine. We have tried to simplify troubleshooting by removing all unecessary parts (i.e. running just an Arduino Uno and Mega without any other shields involved), the result is still the same, the SD card does not initialise. Using the suggested online card formatting tool (https://www.sdcard.org/downloads/formatter_4/) does not seem to make a difference either.

Can you please advise, it seems inexplicable to us that 2 different Adafruit data logger shields, with 2 different Arduinos, and in combination with multiple SD cards, microSD cards, adapters and PCs would just not work.

Do these symptoms ring a bell? Do we miss something that your engineers may be aware of? Trying a brand new data logger shield on a brand new Arduino with a brand new SD card (multiple cards, actually) should have worked, shouldn't it?

Thank you,

-Alexander

User avatar
kalapodi
 
Posts: 3
Joined: Fri Sep 03, 2021 8:02 am

Re: Data logger shield revB: stubborn problems initialising

Post by kalapodi »

P.S. We can use the RTC functionality on the shield just fine. There's just something mysteriously persistent with the SD cards.

User avatar
Marz_
 
Posts: 1
Joined: Sat Aug 28, 2021 3:41 pm

Re: Data logger shield revB: stubborn problems initialising

Post by Marz_ »

I had the same issue with several SD datalogger boards. The MISO needs a 1k pull up resistor. You can also put this first thing in setup pinMode(19, INPUT_PULLUP); . That will make it work also. That pin is for the Feather ESP32 MISO. Depending on your card you may need a different pin. I also added the below code to try several times. Edit the CS pin for your setup.
int i = 0;
while (!SD.begin(27)) {
Serial.print(".");
delay(100);
i++;
if (i > 50) {
Serial.println("Gave up waiting for SD card to mount.");
return;
}
}

User avatar
adafruit_support_mike
 
Posts: 67446
Joined: Thu Feb 11, 2010 2:51 pm

Re: Data logger shield revB: stubborn problems initialising

Post by adafruit_support_mike »

Can you read and write the SD cards with a regular computer?

User avatar
kalapodi
 
Posts: 3
Joined: Fri Sep 03, 2021 8:02 am

Re: Data logger shield revB: stubborn problems initialising

Post by kalapodi »

Hello again, and thank you for your replies.

Yes, both SD cards which we are using for testing are consistently readable using a PC.

Apparently resoldering the 6-pin 2x3 socket seemed to make a difference, the datalogger shield now runs the cardinfo sketch fine when there's only the datalogger card attached to the Arduino Mega 2560 Rev3. We also integrated into our code Marz_'s suggestion posted above (the multiple-attempt loop, thank you for that).

Now though we're facing similar issues when trying to get the full system to work: it involves an Arduino Mega 2560 R3, a motor shield, a datalogger shield, an accelerometer and a (very low power consumption) vibration motor. We're getting multiple data logging files saved in the card with each attempt, so we suspect the Arduino is unintentionally resetting itself while trying to write to the SD card (and thus produces multiple data logging files).

We've gotten this setup to work fine before, so we think this new issue is related to flimsy power supply to the hardware stack (we power the Arduino from a separate LiPo battery, not the PC USB port). We'll try to solder a 10k resistor from the MISO pin to +5V on the datalogger shield (the other Marz_ suggestion), see if that helps any.

User avatar
adafruit_support_mike
 
Posts: 67446
Joined: Thu Feb 11, 2010 2:51 pm

Re: Data logger shield revB: stubborn problems initialising

Post by adafruit_support_mike »

Post a photo showing your hardware and connections and we’ll take a look. 800x600 images usually work best.

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

Return to “Arduino Shields from Adafruit”