Interfacing an SD Card with Raspberry Pi Pico

Published: (December 24, 2025 at 01:30 PM EST)
2 min read
Source: Dev.to

Source: Dev.to

Introduction

External storage instantly upgrades a microcontroller project from a demo to something useful. An SD card provides gigabytes of non‑volatile storage with very little effort, making it ideal for logging sensor data, saving configuration files, or storing timestamps.

In this guide you’ll build a Raspberry Pi Pico SD‑card module and make it interactive through the Serial Monitor. You’ll be able to create files, write custom text, read data back, and delete files in real time—perfect for understanding how embedded systems handle external storage. The project is beginner‑friendly and serves as a solid foundation before moving on to more advanced data‑logging builds.

Components

ComponentQuantity
Raspberry Pi Pico1
SD Card Module (SPI, 3.3 V)1
microSD Card (FAT32)1
Breadboard & Jumper WiresAs needed
USB Cable1

Wiring (Pico ↔ SD Card Module)

Pico PinSD Card Pin
3V3VCC
GNDGND
GP19MOSI
GP16MISO
GP18SCK
GP17CS

These connections use SPI0, which works out‑of‑the‑box with the Arduino‑Pico core.

Preparing the SD Card

  1. Ensure the card is formatted as FAT32.
  2. Remove all existing partitions.
  3. Create a single primary partition (MBR).
  4. Format the partition as FAT32.

Note: For cards larger than 32 GB, use tools such as Rufus or GUIFormat to force FAT32 formatting.

Common Mistakes

IssueSymptomFix
exFAT format“SD init FAILED”Reformat to FAT32
GPT partitionCard not detectedConvert to MBR
Loose cardNo responseRe‑insert firmly

Frequently Asked Questions

  • Why doesn’t my 64 GB SD card work?
    Most 64 GB cards are formatted as exFAT or use GPT. Reformat to FAT32 with an MBR partition.

  • Can I share SPI with other sensors?
    Yes, as long as each device has its own chip‑select (CS) line and you manage the bus correctly in software.

  • Should I power the module with 5 V?
    No. The module should be powered from the Pico’s 3.3 V rail to avoid level‑shifting issues.

  • What is the maximum supported SD card size?
    The Pico’s SPI driver supports cards up to 2 TB, provided they are formatted as FAT32 with an MBR.

Further Reading

For a more in‑depth tutorial, see the [Raspberry Pi Pico SD Card Module guide].

Back to Blog

Related posts

Read more »