Format the card as FAT32, check the chip-select pin in your code, and check the module is powered from the voltage it expects.
What the message means
The library talks to the card over SPI. A card in the wrong format, a wrong CS pin or a weak supply all give the same failure message.
Fix it in this order
- Format the card as FAT32. Large cards in other formats are not read by basic libraries.
- Check the CS pin number in SD.begin(pin) against your wiring.
- Wire SCK, MOSI and MISO to the SPI pins of your board, not to random pins.
- Check the supply the module needs. Many cheap modules want 5 V for the card regulator.
- Try another card, preferably a smaller and older one.
- Keep the wires short, and add a delay after power-up before calling begin.
Why it happens
The library talks to the card over SPI and the failure message is the same for several different causes. The card may be in a format the library does not read, the chip-select pin in the code may differ from the one you wired, or the supply may be too weak to start the card.
Basic libraries read FAT formats, so a large card formatted another way may fail. Check the voltage your module expects too, since some modules take 5 V and include a level shifter and others do not.
If you see this, do this
| You see | Do this |
|---|---|
| Works with one card only | Card format or card quality. |
| Fails on every card | Wiring or power. |
Related
Uno power limit, serial monitor shows nothing.
Last reviewed: November 2026. These are the usual causes and the order that finds them fastest. Test on your own board; clones and cables differ.
Why this happens
An SD card starts in its native mode and must be switched to SPI mode. The library does this by holding chip select high, sending at least 74 clock pulses, then lowering chip select and sending the reset command. It expects a reply that says the card is idle. If no valid reply arrives, begin() returns false. The message is the same for every cause: no reply at all, a reply that is garbled, or a card the library does not understand.
Format is part of this. Basic Arduino SD libraries handle FAT16 and FAT32. Cards larger than 32 GB are usually formatted exFAT out of the box, which these libraries may not read. The SD Association formatter is a safer way to format than the operating system tool. SD cards also run at 3.3 V. Many breakout modules include a regulator and level shifters, but some cheap ones lack the shifters, and a 5 V signal into a 3.3 V card reduces life or fails.
How to confirm the cause
- Run the CardInfo example that ships with the SD library. It shows whether the card answers and what type it is, which narrows the problem.
- Check the SPI pins for your board. Uno uses MOSI 11, MISO 12 and SCK 13, and the classic ESP32 default SPI uses MOSI 23, MISO 19 and SCK 18 with CS at 5 in common examples. Compare these with your wiring.
- Measure the 3.3 V at the card socket with a multimeter during the begin() call. A dip points to a weak supply.
- Try a second, smaller card, such as 2 to 16 GB. If it works, the first card’s format or type is the issue.
- Check that no other SPI device on the same bus has a floating chip select pin, which can drive the shared MISO line.
Worked example
A minimal test that prints only the result of begin(). The chip select pin is an example; set it to match your wiring.
#include <SPI.h>
#include <SD.h>
const int CS_PIN = 10; // ESP32 VSPI example: 5
void setup() {
Serial.begin(115200);
delay(500); // let the card power up
if (!SD.begin(CS_PIN)) { Serial.println("init failed"); return; }
Serial.println("card OK");
}
void loop() {}Common mistakes
- Using a quick format and leaving the card in exFAT.
- Pulling the card out and putting it in while powered, which can corrupt it and glitch the supply.
- Using long breadboard jumpers on the SPI clock line.
- Setting the wrong CS pin in the code while the module uses another.
- Having an Ethernet shield and an SD module on the same SPI bus, without keeping the other chip select high.
If this did not fix it
- Check the supply current. Wi-Fi or a motor starting at the same moment can drop the 3.3 V line below what the card needs.
- Check that the card is genuine. Counterfeit cards reporting a large size often fail in SPI mode.
- Check that the module has pull-ups and a regulator as expected; some low-cost clones omit parts.