Problems with MKR SD PROTOSHIELD

Hello everyone, I'm writing here hoping not to make a mistake in the section.

As the title suggests, I'm having issues with the MKR SD Proto Shield. My hardware consists of:

  • MKR WiFi 1010
  • MKR IMU Shield
  • MKR SD Proto Shield

In particular, the problem with the Proto Shield occurred while trying this code:
(https://docs.arduino.cc/tutorials/mkr-sd-proto-shield/mkr-sd-proto-shield-data-logger)

The error is found in this line:

const int chipSelect = SDCARD_SS_PIN;

I also tried using this code:
(Arduino - CardInfo)
I modified the pin number in this line:

const int chipSelect = 4;

I tried different pin numbers (I couldn't find anything online regarding the Proto Shield), but the message on the monitor remains the same:

Initialization failed. Things to check:
  * Is a card inserted?
  * Is your wiring correct?
  * Did you change the chipSelect pin to match your shield or module?

I've tried three different SD cards, but I haven't resolved the issue. What can I check?

SDCARD_SS_PIN is defined only on MKR Zero, which has the SD holder on board.
the right CS is pin 4.
did you try it without the IMU shield?

thank you for your response. I tried without IMU, of course, but it didn't worked

I noticed that the male and female pins are not perfectly aligned, and the male part protrudes by a few millimeters.

it is normal

ok, tnx.
What i should do to solve this situation in your opinion?

What are you trying to solve? It's quite normal for there to be the gap between the pins and the socket below in a stack of boards. Or are you referring to the CS pin issue?

Im referring to the CS pin issue.
SD card is very important to my project, in fact i have to measure and save on that some data. I can't use WiFi to send those data to my PC/phone (i will be in a cave..so..)

The page is here:

The schematic indicates that pin 4 is the correct pin to use.

Did you try the original example code you linked to with the CS pin set to 4? I think the CardInfo sketch you linked to is for an UNO based setup, which may be different to your MKR setup.

Maybe time to learn how to read schematics has come x).
Anyway, I just tried to run the code.
I have also switched the position between Protoshield and Arduino, but the output is always the same..
"Initializing SD card...Card failed, or not present"
Maybe SD card isn't correctly inserted? I don't think so, but here you have a photo:

Looking at the photo, it's difficult to tell if the MicroSD card is fully inserted. It does look a bit skewed. Just make sure it's in squarely.

I've just put a MicroSD card into a socket I have here and it goes in further than yours does. However, that could simply be down to the differences in socket mechanicals.

My socket has a latching mechanism. I push the card in and there's a click. To remove the card, I push the card in again and the mechanism ejects it. However, some sockets are simple and don't have that mechanism at all.

I did find this image of a MKR MEM Shield that showed an SD card fitted:


It's a slightly different MKR board but it might help.

Correct, my module doesn't emit any click: it works by sliding

A couple of days ago, I tried inserting a friend's SD card, and it actually went in further than the one I have. Unfortunately, I didn't test the code at that time; we were only taking measurements to 3D print a case.
Now, I've asked him about the model of SD card he has, and I'll try the code with it. In the meantime, i will buy another module : Aside the MEM shield and protoshield, are there other module that i can try?

Thank you so much!

A lot depends on your access to basic tools such as a soldering iron etc. If you don't have access to these, then you are limited to whatever commercially available boards there are.

If you do have access to these tools, then you could get an SD card breakout module and solder some wires to it - the connections are on a 0.1in pitch so are easy to solder. They are very cheap as it's just the mechanical holder on a small board like this:
SD Adapter - Bare

DO NOT buy an SD breakout board with additional components on it as it is likely for use with 5V setups such as an UNO and will cause you problems.

Ok. Clear !

Firs of all i will try with my friend SD card. If his will not work too, do you think this could be appropriate?: https://www.amazon.it/adattatore-lettore-interfaccia-conversione-Arduino/dp/B07ZQ32476/ref=sr_1_16?__mk_it_IT=ÅMÅŽÕÑ&crid=2LE5QX63VJLVZ&keywords=Arduino+Sd+Card+Shield+mkr&qid=1694189634&sprefix=arduino+sd+card+shield+mkr%2Caps%2C86&sr=8-16

No, that board is for 5V systems like an UNO. You need to look for a board that has just the SD card holder on it and maybe a pre-soldered 0.1in header. There SHOULD NOT be any other components on the board.

As you posted a link to Amazon Italy, I had a quick look and here's one I saw:

It's an Adafruit breakout but seems expensive at 12.25 Euros when Adafruit sell them for 3.50 USD excl postage.

Tnx ! You saved me.
I saw in the Adafruit WebSite they ships to Italy, BUT maybe the cost of shipping added to other fees makes this product more expensive than Amazon.. Soo I will buy that on Amazon
First of all I will try to fix the ProtoShield's problem, maybe writing to the support...

I would try a different card not a different SD holder

Well i tried 3 different SD cards.. :confused:

Does your friend have any MKR hardware you can use to help diagnose the problem? Maybe they have a MKR processor board or MKR SD shield you can try.

I'm sorry, i did not see this message.
My friend hasn't MKR Hardware. I wrote to Arduino support but it wasn't helpful.
I readed this conversation https://community.element14.com/challenges-projects/design-challenges/designforacause/b/blog/posts/roadblock-with-sd-card-slot-on-mkr-sd-proto-shield. At the moment i have not tried those solution but i will update you all.

I just tried with a 32 gb SD card and it worked!
I noticed that SD library works with SD FAT16 /32 formatted, SD card (the first one, not detected) is 64gB and exFAT formatted. SO i will try with SDfat library! In case SD fat library will not work, i will use 32 gb :slight_smile:

P.S. the code worked with 32 gb SD card, and i wrote this line

const int chipSelect =4;