SD card module (full size, SPI) with ESP32
Supply 3.3-5 V
Bus SPI
Pins and ESP32 wiring
| Pin | Role | ESP32 pin | Notes |
|---|---|---|---|
| GND | Ground | GND | |
| 3V3 | Power | 3V3 | Use 3V3 or 5V, not both |
| 5V | Not wired to the ESP32 | — | Alternative 5 V input through the on-board regulator |
| CS | SPI chip select | D5 | |
| MOSI | SPI MOSI | D23 | |
| SCK | SPI clock | D18 | |
| MISO | SPI MISO | D19 | |
| GND2 | Ground | GND |
Suggested wiring for the 30-pin ESP32 DevKit, avoiding flash, input-only and strapping pins. BoardPilot checks it for you as you wire.
Good to know
- The SD library reads FAT16 and FAT32 cards. Cards formatted as exFAT (most over 32 GB) are not found. (Arduino SD library reference, Supported file systems: FAT16 and FAT32)
Sources
- SD Association Physical Layer Simplified Specification, SPI mode; card supply 2.7 to 3.6 V
- LC Studio SD card module, Header GND, 3.3V, 5V, CS, MOSI, SCK, MISO, GND
Try it in 3D in BoardPilot
SD card module (full size, SPI) on other boards: wiring and code
Arduino Mega 2560 R3 Arduino Nano Arduino Uno R3 WeAct Black Pill STM32F411CE ESP32-C3-DevKitM-1 ESP32-S3-DevKitC-1 Nordic nRF52840 DK NUCLEO-F401RE Raspberry Pi Pico 2 Raspberry Pi Pico W Raspberry Pi Pico Teensy 4.1
Learn the basics
Lesson: UART, I2C and SPI SPI Chip select (CS)
Related parts
CC1101 sub-GHz radio moduleENC28J60 Ethernet moduleLoRa SX1278 (Ai-Thinker Ra-02)Micro SD card module (SPI)nRF24L01 socket adapter (5 V to 3.3 V)nRF24L01+ 2.4 GHz radio
Part data: CC BY 4.0, free to reuse with credit to BoardPilot.