Overview
The Micro SD / TF card adapter module gives any 3.3V or 5V microcontroller (Arduino, ESP32, Raspberry Pi Pico, STM32) a full SPI interface to a standard microSD card — perfect for data logging, sensor recording, audio playback, image storage, and any project that needs more than the few kilobytes of EEPROM on a typical MCU. The onboard 74LVC125A level-shifter IC bidirectionally translates the SPI signals between 5V logic and the 3.3V logic the SD card expects, so the same module works equally well with an Arduino UNO at 5V or an ESP32 at 3.3V without any external level conversion.
An onboard AMS1117-3.3 regulator drops 5V down to the 3.3V the SD card needs. Plug a microSD card formatted as FAT16 or FAT32 into the spring-loaded slot, wire 4 SPI signals (CS, SCK, MOSI, MISO) plus power and ground, and the standard Arduino SD.h library handles the rest. Read and write speeds top out around 1-2 MB/s on most MCUs — plenty for logging temperature data, weather-station readings, GPS tracks, audio WAV files, or small image buffers.
This is one of the most useful modules to have on a maker bench: any project that needs persistent storage, file-based config, or off-board data dumps.
At a Glance
Specifications
| Parameter | Value |
| Operating Voltage | 4.5V - 5.5V (regulated to 3.3V on board) or 3.3V direct |
| Operating Current | ~50 mA active (peak ~150 mA on writes) |
| Card Slot | Push-push spring-loaded microSD socket |
| Supported Cards | microSD up to 32 GB, FAT16/FAT32 (large SDXC may need exFAT support) |
| SPI Modes | Mode 0 (CPOL=0, CPHA=0) |
| Max SPI Clock | ~25 MHz (most MCUs run 4-8 MHz reliably) |
| Level Shifter IC | 74LVC125A quad bus buffer with 3-state output |
| Voltage Regulator | AMS1117-3.3, 800 mA |
| Dimensions | ~42 x 25 x 9 mm |
| Operating Temperature | -25°C to +85°C |
Pinout Diagram
Wiring Guide
Arduino UNO / Mega 2560
| Module | Arduino UNO | Arduino Mega |
|---|---|---|
| VCC | 5V | 5V |
| GND | GND | GND |
| CS | D10 (or any digital) | D53 (or any digital) |
| SCK | D13 | D52 |
| MOSI | D11 | D51 |
| MISO | D12 | D50 |
ESP32 / ESP8266 (3.3V Logic)
The 74LVC125A handles voltage translation, so the module's 5V VCC pin can be connected to either 5V or 3.3V. For ESP boards, supplying 3.3V directly is fine.
| Module | ESP32 (default VSPI) | NodeMCU ESP8266 |
|---|---|---|
| VCC | 3V3 | 3V3 |
| GND | GND | GND |
| CS | GPIO5 | D8 (GPIO15) |
| SCK | GPIO18 | D5 (GPIO14) |
| MOSI | GPIO23 | D7 (GPIO13) |
| MISO | GPIO19 | D6 (GPIO12) |
Raspberry Pi Pico (MicroPython)
| Module | Pi Pico Pin |
|---|---|
| VCC | 3V3 (Pin 36) |
| GND | GND (Pin 38) |
| CS | GP5 (Pin 7) |
| SCK | GP2 (Pin 4) |
| MOSI | GP3 (Pin 5) |
| MISO | GP4 (Pin 6) |
Code Examples
Arduino: Log Sensor Data Every Second
#include <SPI.h>
#include <SD.h>
const int chipSelect = 10;
void setup() {
Serial.begin(9600);
while (!Serial);
Serial.print("Initializing SD card...");
if (!SD.begin(chipSelect)) {
Serial.println("Card failed, or not present");
while (1);
}
Serial.println("card initialized.");
File dataFile = SD.open("datalog.txt", FILE_WRITE);
if (dataFile) {
dataFile.println("--- New Session ---");
dataFile.close();
}
}
void loop() {
int sensor = analogRead(A0);
File dataFile = SD.open("datalog.txt", FILE_WRITE);
if (dataFile) {
dataFile.print("ms=");
dataFile.print(millis());
dataFile.print(",sensor=");
dataFile.println(sensor);
dataFile.close();
Serial.print("logged: ");
Serial.println(sensor);
}
delay(1000);
}
ESP32 (Arduino): Read & Write a File
#include <SPI.h>
#include <SD.h>
#define CS_PIN 5
void setup() {
Serial.begin(115200);
if (!SD.begin(CS_PIN)) {
Serial.println("Card Mount Failed");
return;
}
Serial.println("SD ready");
File f = SD.open("/hello.txt", FILE_WRITE);
f.println("Hello from ESP32!");
f.close();
f = SD.open("/hello.txt");
while (f.available()) Serial.write(f.read());
f.close();
}
void loop() {}
Raspberry Pi Pico (MicroPython)
import machine, sdcard, uos
spi = machine.SPI(0, baudrate=1000000,
sck=machine.Pin(2), mosi=machine.Pin(3), miso=machine.Pin(4))
cs = machine.Pin(5, machine.Pin.OUT)
sd = sdcard.SDCard(spi, cs)
uos.mount(sd, '/sd')
with open('/sd/test.txt', 'w') as f:
f.write('Hello from Pico!')
with open('/sd/test.txt') as f:
print(f.read())
Frequently Asked Questions
SD.begin(CS, SD_SCK_MHZ(4)) — cheap cards can't keep up at 25 MHz.file.close() or file.flush() before power loss, the FAT directory entry may not be updated and your data is lost. Always close files cleanly. For critical logging, flush after each write (or every N writes) to ensure data is lost. Always close files cleanly. For critical logging, flush after each write (or every N writes) to ensure data is committed to the card.