This SD Card SPI Read/Write Module lets you add removable file storage to your Arduino or other microcontroller projects using standard full-sized SD cards. The module communicates over the SPI bus and includes onboard level shifting, making it compatible with both 5V and 3.3V microcontrollers. It works with the built-in Arduino SD library — no extra libraries needed.
Unlike the smaller Micro SD module, this version accepts full-sized SD cards and features separate 3.3V and 5V power input pins, giving you flexibility when working with different microcontroller platforms. Whether you're logging sensor data, storing configuration files, or saving large datasets, this module makes it straightforward.
⚠️ Important: This module has separate 3.3V and 5V power input pins. Connect only one — either 3.3V or 5V — depending on your microcontroller's operating voltage. Connecting both simultaneously may damage the module.
💡 How It Works
The SD Card SPI module acts as a bridge between your microcontroller and a full-sized SD card. Here's what's happening under the hood:
- SPI Communication: Your microcontroller sends commands and data to the SD card over the SPI (Serial Peripheral Interface) bus using four signal lines: MOSI (data out), MISO (data in), SCK (clock), and CS (chip select).
- Dual Voltage Input: The module provides separate 3.3V and 5V power input pins. When using the 5V pin, the onboard regulator steps the voltage down to the 3.3V required by the SD card. When using the 3.3V pin, power is supplied directly to the card.
- Level Shifting: The onboard level-shifting circuitry translates the logic signals between your microcontroller's voltage level and the 3.3V levels required by the SD card, protecting the card from overvoltage damage.
- File System: The Arduino SD library handles the FAT16 or FAT32 file system on the card, allowing you to create, read, write, and delete files and directories just like you would on a computer.
⭐ Features
- Accepts standard full-sized SD cards (SD up to 2 GB, SDHC up to 32 GB)
- Dual power input pins — separate 3.3V and 5V inputs for flexible microcontroller compatibility
- Onboard level shifting for safe 5V and 3.3V logic interfacing
- Standard SPI interface (MOSI, MISO, SCK, CS)
- Compatible with the built-in Arduino SD library — no extra libraries required
- 9-pin header (active pins: GND, 3.3V, 5V, CS, SCK, MOSI, MISO, GND) on 2.54mm centers
- Spring-loaded push-push SD card slot for secure card retention
- LED power indicator and LED activity indicator
- Compact board design for easy integration into projects
📋 Specifications
| Parameter | Value |
|---|---|
| Operating Voltage | 3.3V or 5V DC (separate input pins — use only one) |
| Logic Level | 3.3V and 5V compatible (onboard level shifters) |
| Communication Interface | SPI (Serial Peripheral Interface) |
| Supported Card Types | SD (up to 2 GB), SDHC (up to 32 GB) — full-sized cards |
| Supported File Systems | FAT16, FAT32 |
| Card Slot Type | Spring-loaded push-push |
| Header Pins | 9-pin (8 active + 1 NC), 2.54mm pitch |
| Board Dimensions | Approx. 46 × 30 mm (1.81 × 1.18 inches) L × W |
| Indicators | Power LED, Activity LED |
📌 Pin Description
The module has a row of header pins on 2.54mm centers. It can be inserted into a breadboard or connected with female Dupont-style jumper wires.
| Pin | Label | Description |
|---|---|---|
| 1 | GND | Ground — must share a common ground with your microcontroller |
| 2 | 3.3V | 3.3V power input — use this pin if your microcontroller operates at 3.3V |
| 3 | 5V | 5V power input — use this pin if your microcontroller operates at 5V |
| 4 | CS | SPI Chip Select — active LOW to select this device on the SPI bus |
| 5 | MOSI | SPI Master Out, Slave In — data from microcontroller to SD card |
| 6 | SCK | SPI Clock — clock signal from microcontroller |
| 7 | MISO | SPI Master In, Slave Out — data from SD card to microcontroller |
| 8 | GND | Ground (duplicate — either GND pin can be used) |
⚠️ Important: Connect only one power pin — either 3.3V or 5V — not both. Connecting both simultaneously may damage the module. If using an Arduino Uno or Nano (5V logic), connect the 5V pin. If using an ESP32 or other 3.3V board, connect the 3.3V pin.
🔌 Wiring the SD Card Module to Arduino
📦 Parts Needed
- 1× SD Card SPI Read/Write Module (this product)
- 1× Arduino Uno, Nano, or compatible board
- 1× SD or SDHC card (full-sized, formatted as FAT16 or FAT32)
- Jumper wires
Connection Table — Arduino Uno (5V)
| Module Pin | Arduino Uno Pin |
|---|---|
| 5V | 5V |
| GND | GND |
| MISO | Pin 12 (MISO) |
| MOSI | Pin 11 (MOSI) |
| SCK | Pin 13 (SCK) |
| CS | Pin 10 (SS) |
Connection Table — ESP32 (3.3V)
| Module Pin | ESP32 Pin |
|---|---|
| 3.3V | 3.3V |
| GND | GND |
| MISO | GPIO 19 (MISO) |
| MOSI | GPIO 23 (MOSI) |
| SCK | GPIO 18 (SCK) |
| CS | GPIO 5 (SS) |
📝 Note: The CS (Chip Select) pin can be connected to any available digital pin, but you must update the pin number in your code to match. Pin 10 is the default used by the Arduino SD library. The MOSI, MISO, and SCK pins are fixed hardware SPI pins and cannot be changed on the Arduino Uno/Nano.
🔧 Preparing Your SD Card
Before using your SD card with this module, it must be formatted with a compatible file system. The Arduino SD library supports FAT16 and FAT32 formats.
Formatting Instructions
- Insert your SD card into your computer using a built-in card reader or USB card reader.
- Windows: Right-click the drive in File Explorer → Format → select FAT32 → click Start.
- Mac: Open Disk Utility → select the card → click Erase → choose MS-DOS (FAT) format.
-
Linux: Use the command
sudo mkfs.vfat -F 32 /dev/sdX1(replace sdX1 with your card's device name).
⚠️ Important: Cards larger than 32 GB (SDXC) are typically formatted as exFAT, which is not supported by the Arduino SD library. Stick with cards 32 GB or smaller, and make sure they are formatted as FAT32. For best compatibility, use cards from well-known brands (SanDisk, Samsung, Kingston).
💻 Installing the Arduino SD Library
The SD library comes pre-installed with the Arduino IDE, so in most cases you don't need to install anything extra. To verify it's available:
- Open the Arduino IDE.
- Go to Sketch → Include Library and look for "SD" in the list.
- If it's listed, you're ready to go. If not, go to Sketch → Include Library → Manage Libraries, search for "SD," and install it.
The SD library also depends on the SPI library, which is always included with the Arduino IDE.
🚀 Step 1: Test Your SD Card Connection (CardInfo)
This sketch tests whether your Arduino can communicate with the SD card. It reads and displays the card type, size, and file listing over the Serial Monitor. This is the best first sketch to run to verify your wiring is correct.
/*
* SD Card Info Test
* Envistia Mall - Product Support
*
* Tests communication with the SD card module and
* displays card type, size, and file listing.
*
* Connections (Arduino Uno, 5V):
* 5V -> Arduino 5V
* GND -> Arduino GND
* CS -> Arduino Pin 10
* MOSI -> Arduino Pin 11
* MISO -> Arduino Pin 12
* SCK -> Arduino Pin 13
*/
#include <SPI.h>
#include <SD.h>
const int chipSelect = 10;
void setup() {
Serial.begin(9600);
while (!Serial) {
; // Wait for Serial Monitor to open (needed for some boards)
}
Serial.print("Initializing SD card...");
if (!SD.begin(chipSelect)) {
Serial.println("initialization failed!");
Serial.println("Check: Is a card inserted? Is the wiring correct?");
while (1);
}
Serial.println("initialization done.");
// Print card type
Sd2Card card;
SdVolume volume;
SdFile root;
if (!card.init(SPI_HALF_SPEED, chipSelect)) {
Serial.println("Card init failed.");
return;
}
Serial.print("Card type: ");
switch (card.type()) {
case SD_CARD_TYPE_SD1: Serial.println("SD1"); break;
case SD_CARD_TYPE_SD2: Serial.println("SD2"); break;
case SD_CARD_TYPE_SDHC: Serial.println("SDHC"); break;
default: Serial.println("Unknown");
}
if (!volume.init(card)) {
Serial.println("Could not find FAT16/FAT32 partition.");
return;
}
Serial.print("Volume type is FAT");
Serial.println(volume.fatType(), DEC);
uint32_t volumesize;
volumesize = volume.blocksPerCluster() * volume.clusterCount();
volumesize /= 2; // Convert blocks to KB
Serial.print("Volume size (KB): ");
Serial.println(volumesize);
Serial.print("Volume size (MB): ");
Serial.println(volumesize / 1024);
Serial.print("Volume size (GB): ");
Serial.println((float)volumesize / 1024.0 / 1024.0);
Serial.println("\nFiles on card:");
root.openRoot(volume);
root.ls(LS_R | LS_DATE | LS_SIZE);
}
void loop() {
// Nothing to do here
}
How to Use:
- Wire the module to your Arduino as shown in the connection table above.
- Insert a FAT32-formatted SD card into the module.
- Upload this sketch to your Arduino.
- Open the Serial Monitor at 9600 baud.
- You should see the card type, volume size, and a file listing. If you see "initialization failed," double-check your wiring and card formatting.
🚀 Step 2: Read and Write Files
This sketch demonstrates how to create a file on the SD card, write data to it, and then read the data back. This is the foundation for data logging and file storage projects.
/*
* SD Card Read/Write Example
* Envistia Mall - Product Support
*
* Creates a file, writes sample data, then reads it back.
*
* Connections (Arduino Uno, 5V):
* 5V -> Arduino 5V
* GND -> Arduino GND
* CS -> Arduino Pin 10
* MOSI -> Arduino Pin 11
* MISO -> Arduino Pin 12
* SCK -> Arduino Pin 13
*/
#include <SPI.h>
#include <SD.h>
const int chipSelect = 10;
File myFile;
void setup() {
Serial.begin(9600);
while (!Serial) {
;
}
Serial.print("Initializing SD card...");
if (!SD.begin(chipSelect)) {
Serial.println("initialization failed!");
while (1);
}
Serial.println("initialization done.");
// --- WRITE to file ---
myFile = SD.open("test.txt", FILE_WRITE);
if (myFile) {
Serial.print("Writing to test.txt...");
myFile.println("Hello from Envistia Mall!");
myFile.println("SD card module is working.");
myFile.println("Line 3: You can log sensor data here.");
myFile.close();
Serial.println("done.");
} else {
Serial.println("Error opening test.txt for writing.");
}
// --- READ from file ---
myFile = SD.open("test.txt");
if (myFile) {
Serial.println("\nContents of test.txt:");
Serial.println("---------------------");
while (myFile.available()) {
Serial.write(myFile.read());
}
myFile.close();
Serial.println("---------------------");
} else {
Serial.println("Error opening test.txt for reading.");
}
}
void loop() {
// Nothing to do here
}
How to Use:
- Upload this sketch to your Arduino.
- Open the Serial Monitor at 9600 baud.
- The sketch will create a file called
test.txt, write three lines to it, then read and display the contents. - You can remove the SD card and read the file on your computer to verify.
🚀 Step 3: Simple Data Logger
This sketch reads the value from an analog pin every 2 seconds and logs it to a CSV file on the SD card with a timestamp. This is a practical starting point for sensor data logging projects.
/*
* Simple Data Logger
* Envistia Mall - Product Support
*
* Reads analog pin A0 every 2 seconds and logs the
* value to a CSV file on the SD card.
*
* Connections (Arduino Uno, 5V):
* 5V -> Arduino 5V
* GND -> Arduino GND
* CS -> Arduino Pin 10
* MOSI -> Arduino Pin 11
* MISO -> Arduino Pin 12
* SCK -> Arduino Pin 13
* Sensor output -> Arduino A0 (or leave unconnected for test)
*/
#include <SPI.h>
#include <SD.h>
const int chipSelect = 10;
const int sensorPin = A0;
unsigned long sampleNumber = 0;
void setup() {
Serial.begin(9600);
while (!Serial) {
;
}
Serial.print("Initializing SD card...");
if (!SD.begin(chipSelect)) {
Serial.println("initialization failed!");
while (1);
}
Serial.println("initialization done.");
// Write CSV header
File dataFile = SD.open("datalog.csv", FILE_WRITE);
if (dataFile) {
// Only write header if file is new (size == 0 after open)
if (dataFile.size() == 0) {
dataFile.println("Sample,Millis,AnalogValue,Voltage");
}
dataFile.close();
Serial.println("Logging to datalog.csv...");
Serial.println("Sample, Millis, Value, Voltage");
} else {
Serial.println("Error opening datalog.csv");
}
}
void loop() {
int sensorValue = analogRead(sensorPin);
float voltage = sensorValue * (5.0 / 1023.0);
unsigned long timestamp = millis();
sampleNumber++;
// Build the data string
String dataString = "";
dataString += String(sampleNumber);
dataString += ",";
dataString += String(timestamp);
dataString += ",";
dataString += String(sensorValue);
dataString += ",";
dataString += String(voltage, 2);
// Write to SD card
File dataFile = SD.open("datalog.csv", FILE_WRITE);
if (dataFile) {
dataFile.println(dataString);
dataFile.close();
Serial.println(dataString);
} else {
Serial.println("Error opening datalog.csv");
}
delay(2000); // Log every 2 seconds
}
How to Use:
- Connect a sensor to analog pin A0, or leave it unconnected to log floating values as a test.
- Upload the sketch and open the Serial Monitor at 9600 baud.
- The Arduino will log a reading every 2 seconds to
datalog.csvon the SD card. - Remove the SD card and open
datalog.csvin a spreadsheet application to view your logged data.
💡 Tip: For long-term data logging, consider adding a Real-Time Clock (RTC) module like the DS3231 to get accurate date and time stamps instead of using
millis().
🎯 Typical Applications
- Sensor data logging (temperature, humidity, pressure, GPS, etc.)
- Storing configuration files for microcontroller projects
- Audio playback projects (WAV file playback)
- Image storage for TFT display projects
- GPS track logging
- Flight data recorders for drones and RC aircraft
- Portable measurement and test instruments
- Storing web pages for Arduino-based web servers
🔌 Compatible With
- Arduino Uno, Nano, Mega, Leonardo, and other Arduino-compatible boards (5V)
- ESP32 and ESP8266 development boards (3.3V)
- STM32 microcontrollers (3.3V)
- Raspberry Pi Pico (3.3V)
- AVR, ARM, and PIC microcontrollers with SPI support
- Any microcontroller with SPI support and 3.3V or 5V logic
🛠️ Troubleshooting
| Problem | Possible Cause | Solution |
|---|---|---|
| "Initialization failed" in Serial Monitor | Wiring error, no card inserted, or card not formatted correctly | Double-check all SPI wiring. Ensure the card is fully seated in the slot. Format the card as FAT32. |
| Module not powering on (no LED) | Both 3.3V and 5V connected, or neither connected | Connect only one power pin — either 3.3V or 5V. Never connect both at the same time. |
| Card is detected but files can't be created | Card is write-protected or full | Check the write-protect switch on the side of the SD card (slide it away from "Lock"). Try a different card with free space. |
| Garbled or no data in Serial Monitor | Baud rate mismatch | Make sure the Serial Monitor baud rate matches the value in Serial.begin() (typically 9600). |
| Module works intermittently | Loose connections or insufficient power | Secure all jumper wire connections. Ensure the power pin is getting a stable voltage. Try shorter jumper wires. |
| Card works on computer but not with Arduino | Card formatted as exFAT or NTFS | Reformat the card as FAT32. Cards over 32 GB may default to exFAT. |
| Only some cards work | Card compatibility issue | Try a different brand or smaller capacity card (4 GB or 8 GB cards tend to be most reliable). |
| Data logging stops after a while | File not being closed properly, or card is full | Always call myFile.close() after writing. Check available space on the card. |
| Code won't compile | Missing library includes | Ensure both #include <SPI.h> and #include <SD.h> are at the top of your sketch. |
💡 Tip: If you're having persistent initialization failures, try reducing the SPI speed by using
SPI_HALF_SPEEDin the card initialization. Some cards and longer wiring runs work better at lower clock speeds.
⚠️ Important Notes
- Connect only one power pin — either 3.3V or 5V — depending on your microcontroller. Connecting both simultaneously may damage the module.
- Always format your SD card as FAT16 or FAT32 before use. exFAT and NTFS are not supported by the Arduino SD library.
- The Arduino SD library supports filenames in the 8.3 format only (e.g.,
DATALOG.CSV, notmy_long_filename.csv). Filenames must be 8 characters or fewer with a 3-character extension. - Always close files after writing with
myFile.close()to ensure data is saved properly. Data may be lost if the file is not closed before power is removed. - Do not remove the SD card while the Arduino is actively reading or writing — this can corrupt the file system.
- Full-sized SD cards have a physical write-protect switch on the side. Make sure it is in the unlocked position before attempting to write data.
- SDXC cards (64 GB and larger) are not supported.
- For best reliability, use name-brand SD cards (SanDisk, Samsung, Kingston) in the 4 GB – 16 GB range.
📊 SD Card Module vs. Micro SD Card Module
Envistia Mall offers both a full-sized SD card module and a Micro SD card module. Here's a quick comparison to help you choose:
| Feature | SD Card Module (this product) | Micro SD Card Module |
|---|---|---|
| Card Size | Full-sized SD card | Micro SD card |
| Power Input | Separate 3.3V and 5V pins (use one) | Single VCC pin (4.5V – 5.5V) with onboard regulator |
| Write-Protect Switch | Yes (physical switch on SD card) | No |
| Card Availability | Full-sized SD cards are less common in newer devices | Micro SD cards are widely available and inexpensive |
| Best For | Projects where you need the physical write-protect switch, or already have full-sized SD cards | Most projects — smaller form factor, widely available cards |
🏪 Where to Buy the SD Memory Card Read / Write SPI Module
This module is available at Envistia Mall.
-
SD Memory Card Storage Board Read / Write Module →
- 📦 Fast US Shipping
- 🔄 Hassle-Free Returns
- 📧 Responsive Customer Support
📚 Additional Resources
- Arduino SD Library Reference: Arduino SD Library Documentation
This guide is provided by Envistia Mall for educational and technical reference purposes. The manufacturer and Envistia LLC (dba Envistia Mall) are not responsible for any damages or losses resulting from the use of this product. Always follow proper electrical safety practices when working with electronic components. Specifications are based on manufacturer data and are subject to change without notice.