MicroSD Card Module with an ESP32 DevKit V1

The Catalex microSD card module puts a push-push microSD socket on SPI with a 3.3 V regulator and a 74LVC125A level shifter, ready for 5 V and 3.3 V boards.

MicroSD Card Module, The Catalex microSD card module puts a push-push microSD socket on SPI with a 3.3 V regulator and a 74LVC125A level shifter, ready for 5 V and 3.3 V boards.
In short

On the ESP32 DevKit V1 the microSD module's VCC goes to VIN, and its SPI lines use the ESP32's VSPI pins: SCK on GPIO18, MOSI on GPIO23 and MISO on GPIO19, with CS on GPIO13. Its 74LVC125A buffer runs at 3.3 V from the module's regulator, so MISO arrives at the ESP32's own logic level.

Wiring the MicroSD Card Module to the ESP32 DevKit V1

Pin by pin.

MicroSD Card ModuleESP32 DevKit V1
VCCVIN
GNDGND
SCKGPIO18 (D18)
MOSIGPIO23 (D23)
MISOGPIO19 (D19)
CSGPIO13 (D13)
  • VCC is on VIN, which gives about 5 V only while the board is powered from USB.

What to know on the ESP32 DevKit V1

  • VCC needs about 5 V: the module's AMS1117 drops 1.1 V typical, so 3V3 on VCC leaves the card too little. VIN gives about 5 V only while the DevKit runs from USB.Advanced Monolithic Systems AMS1117 datasheet, p. 3
  • Use VSPI, not HSPI. HSPI's pins include GPIO12 and GPIO15, both strapping pins, and GPIO12 (MTDI) held high at reset selects a 1.8 V flash supply; VSPI's GPIO18, 19 and 23 avoid that.Espressif ESP32 Series Datasheet v5.3, p. 36; Espressif ESP32 Series Datasheet v5.3, p. 22; Espressif ESP32-WROOM-32 Datasheet v3.8, p. 13
  • The ESP32's SD library needs paths that start with / ("/LOG.TXT"), and FILE_WRITE there empties the file first: the sketch appends with FILE_APPEND.arduino-esp32 core, FS library (FILE_WRITE opens with "w", FILE_APPEND with "a")
  • The common module drives MISO at all times, so it cannot share GPIO19 with an RC522 or another SPI reader. Put the second device on the ESP32's other SPI bus.CircuitState Catalex module schematic

MicroSD Card Module code for the ESP32 DevKit V1

Compiled for esp32:esp32:esp32 on 2026-10-30.

No library needed
// MicroSD Card Module on ESP32 DevKit V1: wiring and a free simulation at https://www.tinkered.ai/components/microsd-module/esp32
#include <SPI.h>
#include <SD.h>

const int SD_CS = 13;

void setup() {
  Serial.begin(115200);
  if (!SD.begin(SD_CS)) {
    Serial.println("No card, or the wiring is wrong");
    while (1) delay(10);
  }
  File f = SD.open("/LOG.TXT", FILE_APPEND);
  if (f) {
    f.println(millis());
    f.close();
  }
  f = SD.open("/LOG.TXT");
  while (f && f.available()) Serial.write(f.read());
  if (f) f.close();
}

void loop() {}

MicroSD Card Module on the ESP32 DevKit V1: questions

Can I power the microSD module from the ESP32's 3V3 pin?

Not this module: its AMS1117 regulator needs about 1.1 V of headroom (AMS1117 datasheet, p. 3), so it wants 5 V on VCC. Use VIN on USB, or a 3.3 V module without a regulator.

Why does SD.open() fail on the ESP32 when it works on an Uno?

The ESP32's SD library needs a leading slash, SD.open("/LOG.TXT"). Without it, it opens nothing.

Which SPI pins does the microSD module use on the ESP32 DevKit?

The default VSPI pins: SCK GPIO18, MISO GPIO19, MOSI GPIO23 (ESP32 datasheet, p. 36). CS can be any free output; the page uses GPIO13 and passes it to SD.begin(13).

Keep going

For AI assistants

This guide as plain Markdown. /components/microsd-module/esp32.md

What will you build with it?