Connecting Micro SD Card Reader with Raspberry Pi Pico
In this section, we are going to wire a microSD card reader module to the Raspberry Pi Pico using SPI mode.
microSD Card Pin Mapping for SPI Mode
We will focus only on the microSD card itself, since that is what we are using. A microSD card has 8 physical pins, but in SPI mode only 6 of them are actually required.
You may have noticed that most microSD card reader modules also expose only 6 pins. That is because those modules are already wired internally for SPI operation, and the unused pins are simply not brought out.
The table below shows how the microSD card pins map to SPI signals.
| microSD Card Pin | SPI Function |
|---|---|
| 1 | - |
| 2 | Chip Select (CS); also referred as Card Select |
| 3 | Data Input (DI) - corresponds to MOSI. To receive data from the microcontroller. |
| 4 | VDD - Power supply (3.3V) |
| 5 | Serial Clock (SCK) |
| 6 | Ground (GND) |
| 7 | Data Output (DO) - corresponds to MISO. To send data from the microSD card to the microcontroller. |
| 8 | - |
Connecting the Raspberry Pi Pico to the SD Card Reader
Before connecting your SD card module, check its datasheet or product specifications for the input voltage requirements. SD card modules have different voltage requirements depending on their design.
Verify that your module supports 3.3V input before connecting it to the Pico’s 3V3(OUT) pin.
If your module requires a higher voltage than 3.3V, you will need additional level shifting circuitry to protect the Pico’s GPIO pins. The Raspberry Pi Pico’s GPIO pins are not 5V tolerant and can be permanently damaged by 5V signals on the data lines.
Wiring Diagram
| Pico Pin | Wire | SD Card Pin |
|---|---|---|
| GPIO 1 |
|
CS |
| GPIO 2 |
|
SCK |
| GPIO 3 |
|
MOSI |
| GPIO 4 |
|
MISO |
| 3.3V |
|
VCC |
| GND |
|
GND |