# SD card module “initialization failed” on Arduino and ESP32

> Fix SD card initialization failed on Arduino and ESP32: wiring, chip select pin, 3.3 V logic, card format and power.

Canonical: https://roboticsengineering.in/fix/sd-card-init-failed-arduino/ | Published: 2026-11-03 | Updated: 2026-11-04

**The board could not start SPI communication with the card.** Wiring, the chip select pin and the card format cause most failures.

## What the message means

The SD library sends commands over SPI. If the card does not answer, begin() returns false and the sketch prints initialization failed.

## Fix it in this order

1. Check the four SPI wires: MOSI, MISO, SCK and CS, plus power and ground.
2. Use the chip select pin that your sketch passes to SD.begin().
3. Format the card as FAT32 with a card that is 32 GB or less if you have trouble.
4. Check the supply voltage. Many cheap modules need 5 V for the regulator and use 3.3 V logic.
5. Use short wires. Long jumper leads cause SPI errors.
6. Try another card. Some cards are not SPI friendly.

## Why it happens

The SD library talks to the card over the SPI bus, using the same signal lines as other SPI devices plus a chip select. The card has to answer a start-up sequence before begin() succeeds. If the wiring is loose, the chip select does not match the pin in the sketch, or the card is not powering up, the card never answers and begin() returns false.

The card also needs stable power. Many SD modules have their own regulator and logic-level handling, so the voltage the module expects matters. Long jumper leads and weak power can make the start-up fail intermittently. A card with a damaged or unusual format may also refuse to start, even when the wiring is correct.

## If you see this, do this

| You see | Do this |
| --- | --- |
| Fails at begin() | Wiring or the CS pin. |
| Worked then stopped | Check the card contacts and power. |

## Confirm the fix

1. Print the value returned by SD.begin(chipSelectPin). A false result confirms the initialisation failed, and a true result means the wiring works.
2. Test the card in a computer card reader. If the card will not mount there, the card is at fault, not the Arduino.
3. Check the wiring with a multimeter for continuity on each of the four SPI lines and the chip select, end to end, with power off.

**Common mistake:** Most readers assume that a card that works in a computer will always work on an Arduino module, when the problem is often the wiring, the chip select pin or the module voltage.

## Related

[ESP32 pinout for robotics](https://roboticsengineering.in/esp32-pinout-for-robotics/), [Serial Monitor shows nothing](https://roboticsengineering.in/fix/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.
