Preview build — page text is a draft awaiting human review. Code badges come from real compiles. The flasher is real but not yet hardware-tested; the Playground is still a preview.

MicroSD card module (SPI)

MicroSD card module pinout (GND, VCC, MISO, MOSI, SCK, CS), why the common module needs 5 V on VCC, FAT32 formatting, the SD library and SPI-bus sharing fixes.

SPI

Community draft — report a mistake

CategoryCommunication
InterfaceSPI
Voltage4.5–5.5 V on the common module with regulator (3.3 V-only boards also sold)
Typical price₹60

3.3 V or 5 V? The common blue module has an AMS1117 3.3 V regulator and a 74LVC125 level shifter, so it needs 5 V on VCC — 3.3 V leaves the card under-powered. Its signal pins accept 3.3 V or 5 V logic, so ESP32, Pico and Uno all connect directly.

The module connects a standard microSD card over SPI, so a board can log months of sensor data as CSV files you open in Excel. The common blue board adds a 3.3 V regulator and a level shifter, which is why it wants 5 V on VCC while taking 3.3 V or 5 V signals.

The Arduino SD library opens, writes and reads files on FAT16/FAT32 cards. For long names, exFAT or faster speed, the SdFat library by Bill Greiman is the upgrade. Use a quality Class 10 card of 4–32 GB; cheap no-name cards are the most common cause of random failures.

Power is the hidden problem. A card can draw 100 mA in short bursts while writing; a weak USB or a long thin wire causes corrupt files. Add a 10–100 µF capacitor at the module, write in small batches, and plan for power cuts — open, append, flush, close.

Prices are indicative (Nov 2026) and vary by seller.

Pinout

PinWhat it does
GNDGround
VCC5 V into the regulator (cards draw up to about 100 mA while writing)
MISOSPI data out of the card
MOSISPI data into the card
SCKSPI clock
CSChip select (any GPIO; pass it to SD.begin(CS))

Library

SD by Arduino, SparkFun (ESP32 and Pico cores ship their own SD library)
Arduino IDE → Library Manager → search the name above. Each guide lists the exact version we compile against.

Use it with

Common errors

“Card Mount Failed” or “initialization failed!”

Format the card as FAT32 (cards up to 32 GB; larger SDXC cards come as exFAT), check VCC is 5 V, pass the right CS pin, and try a lower SPI speed: SD.begin(CS, SPI, 4000000) on ESP32.

Display or RFID stops working when the SD module is on the same SPI bus

The level shifter on many blue modules doesn’t release MISO when CS is HIGH, jamming the bus. Give the SD card its own SPI bus (ESP32 has two), or use a module without a shifter on 3.3 V boards.

Log file is empty or missing the last lines after a power cut

Data sits in a buffer until file.close() or file.flush(). Flush after every few lines, and never pull power mid-write.

↑↓ to move · Enter to open