Blog

Micro SD Card Reader Module – Complete Guide

SD Card Reader Module

Micro SD Card Reader Module

SPI-Based Storage Expansion for Data Logging Projects

A microcontroller's own onboard flash memory is typically measured in kilobytes to a few megabytes and is meant for program storage, not for accumulating large amounts of sensor data over time - a microSD card reader module solves that by giving your project access to gigabytes of cheap, removable, standard-format storage over a simple SPI connection. Internally, microSD cards already speak SPI natively as one of their supported communication modes, so the reader module itself is mostly just a level-shifting and power-regulation board: it steps 5V logic and supply down to the 3.3V the card actually needs, and lets your microcontroller talk to the card using ordinary SPI read/write commands through a FAT-filesystem library. Because the resulting files are stored in a standard FAT16/FAT32 filesystem, a card filled with logged data from an Arduino project can be pulled out and read directly on a PC without any special software.

SPI
Interface
FAT16 / FAT32
Filesystem
up to 32GB (typical)
Capacity

Key features

SPI Interface

Works with the standard SPI library available on virtually every microcontroller.

Standard FAT Filesystem

Logged files can be read directly on a PC, no special software needed.

Onboard Level Shifting

Safely bridges 5V logic down to the 3.3V a microSD card requires.

Gigabyte-Scale Storage

Massively more storage than any microcontroller's onboard memory.

Removable Media

Swap cards to move data, back up logs, or expand capacity.

Low Cost

An inexpensive way to add serious data-logging capability to a project.

Technical specifications

Supply Voltage 4.5V – 5.5V (module regulates to card's 3.3V)
Logic Level 5V-tolerant inputs via onboard level shifter
Interface SPI
Filesystem Support FAT16 / FAT32 (via library, e.g. Arduino SD)
Card Types microSD, microSDHC (typical up to 32GB)
Onboard Regulator 5V to 3.3V
Data Rate SPI-mode limited (adequate for logging)
Card Detect Physical push-in microSD slot
Package Small breakout board with microSD slot

Pinout

PinFunction
VCC / GND Power supply
MISO / MOSI / SCK SPI data lines
CS Chip select

Applications

Sensor data logging projects GPS track recording Audio/MP3 playback projects Standalone weather station logging Black-box style flight/drive recorders Firmware/config file storage for embedded projects

What's in the box

1x microSD card reader module

Downloads

Datasheet (PDF) Arduino SD Library Example Sketch
🔌
Pin Connections
1 Table
Pin Connections Table 1
BoardSensor PinConnection
SD Card ModuleVCC/GND/CS3.3-5V (check module - some are 3.3V only) / GND / board digital pin
📟
Micro SD Card Reader Module
7 Examples • C/C++ | Boards: Arduino Uno, Arduino Nano, Arduino Mega, ESP32, ESP8266, STM32, Raspberry Pi Pico
Micro SD Card Reader Module - Arduino Uno
Micro SD Card Reader Module - Arduino Nano
Micro SD Card Reader Module - Arduino Mega
Micro SD Card Reader Module - ESP32
Micro SD Card Reader Module - ESP8266
Micro SD Card Reader Module - STM32
Micro SD Card Reader Module - Raspberry Pi Pico
📄 File: micro_sd_card_reader_module_-_arduino_uno.inoArduino Uno
450 characters
1//ekostra.com
2//electronics store in egypt
3//+201008896258
4
5// CS=10 on Arduino Uno
6#include <SPI.h>
7#include <SD.h>
8
9#define SD_CS 10
10
11void setup() {
12 Serial.begin(115200);
13 if (!SD.begin(SD_CS)) {
14 Serial.println("SD card not found - check wiring!");
15 while (1) delay(10);
16 }
17
18 File f = SD.open("test.txt", FILE_WRITE);
19 if (f) {
20 f.println("Hello from Ekostra!");
21 f.close();
22 Serial.println("Written.");
23 }
24}
25
26void loop() {
27}
📄 File: micro_sd_card_reader_module_-_arduino_nano.inoArduino Nano
451 characters
1//ekostra.com
2//electronics store in egypt
3//+201008896258
4
5// CS=10 on Arduino Nano
6#include <SPI.h>
7#include <SD.h>
8
9#define SD_CS 10
10
11void setup() {
12 Serial.begin(115200);
13 if (!SD.begin(SD_CS)) {
14 Serial.println("SD card not found - check wiring!");
15 while (1) delay(10);
16 }
17
18 File f = SD.open("test.txt", FILE_WRITE);
19 if (f) {
20 f.println("Hello from Ekostra!");
21 f.close();
22 Serial.println("Written.");
23 }
24}
25
26void loop() {
27}
📄 File: micro_sd_card_reader_module_-_arduino_mega.inoArduino Mega
451 characters
1//ekostra.com
2//electronics store in egypt
3//+201008896258
4
5// CS=53 on Arduino Mega
6#include <SPI.h>
7#include <SD.h>
8
9#define SD_CS 53
10
11void setup() {
12 Serial.begin(115200);
13 if (!SD.begin(SD_CS)) {
14 Serial.println("SD card not found - check wiring!");
15 while (1) delay(10);
16 }
17
18 File f = SD.open("test.txt", FILE_WRITE);
19 if (f) {
20 f.println("Hello from Ekostra!");
21 f.close();
22 Serial.println("Written.");
23 }
24}
25
26void loop() {
27}
📄 File: micro_sd_card_reader_module_-_esp32.inoESP32
442 characters
1//ekostra.com
2//electronics store in egypt
3//+201008896258
4
5// CS=5 on ESP32
6#include <SPI.h>
7#include <SD.h>
8
9#define SD_CS 5
10
11void setup() {
12 Serial.begin(115200);
13 if (!SD.begin(SD_CS)) {
14 Serial.println("SD card not found - check wiring!");
15 while (1) delay(10);
16 }
17
18 File f = SD.open("test.txt", FILE_WRITE);
19 if (f) {
20 f.println("Hello from Ekostra!");
21 f.close();
22 Serial.println("Written.");
23 }
24}
25
26void loop() {
27}
📄 File: micro_sd_card_reader_module_-_esp8266.inoESP8266
446 characters
1//ekostra.com
2//electronics store in egypt
3//+201008896258
4
5// CS=D8 on ESP8266
6#include <SPI.h>
7#include <SD.h>
8
9#define SD_CS D8
10
11void setup() {
12 Serial.begin(115200);
13 if (!SD.begin(SD_CS)) {
14 Serial.println("SD card not found - check wiring!");
15 while (1) delay(10);
16 }
17
18 File f = SD.open("test.txt", FILE_WRITE);
19 if (f) {
20 f.println("Hello from Ekostra!");
21 f.close();
22 Serial.println("Written.");
23 }
24}
25
26void loop() {
27}
📄 File: micro_sd_card_reader_module_-_stm32.inoSTM32
446 characters
1//ekostra.com
2//electronics store in egypt
3//+201008896258
4
5// CS=PA4 on STM32
6#include <SPI.h>
7#include <SD.h>
8
9#define SD_CS PA4
10
11void setup() {
12 Serial.begin(115200);
13 if (!SD.begin(SD_CS)) {
14 Serial.println("SD card not found - check wiring!");
15 while (1) delay(10);
16 }
17
18 File f = SD.open("test.txt", FILE_WRITE);
19 if (f) {
20 f.println("Hello from Ekostra!");
21 f.close();
22 Serial.println("Written.");
23 }
24}
25
26void loop() {
27}
📄 File: micro_sd_card_reader_module_-_raspberry_pi_pico.inoRaspberry Pi Pico
456 characters
1//ekostra.com
2//electronics store in egypt
3//+201008896258
4
5// CS=17 on Raspberry Pi Pico
6#include <SPI.h>
7#include <SD.h>
8
9#define SD_CS 17
10
11void setup() {
12 Serial.begin(115200);
13 if (!SD.begin(SD_CS)) {
14 Serial.println("SD card not found - check wiring!");
15 while (1) delay(10);
16 }
17
18 File f = SD.open("test.txt", FILE_WRITE);
19 if (f) {
20 f.println("Hello from Ekostra!");
21 f.close();
22 Serial.println("Written.");
23 }
24}
25
26void loop() {
27}
SPI microSD card breakout - read/write files.
Format the card as FAT16 or FAT32 - not exFAT, which most Arduino SD libraries don't support - a full reformat with a dedicated SD formatter tool resolves the majority of ”card not detected” issues, especially on cards that previously held other data. The CS pin can be connected to any free digital pin, but if you're sharing the SPI bus with another SPI device, make sure only one device's CS is ever active low at a time or bus conflicts will corrupt both transfers. And since SPI-mode access is meaningfully slower than a card reader plugged into a PC, for high-frequency logging, buffer several readings in RAM and write them in one batch rather than opening/writing/closing the file on every single sensor sample, which is a common cause of dropped or corrupted-looking log entries.