Cirkit Designer Logo
Cirkit Designer
Your all-in-one circuit design IDE
Home / 
Component Documentation

How to Use Waveshare MicroSD module: Examples, Pinouts, and Specs

Image of Waveshare MicroSD module
Cirkit Designer LogoDesign with Waveshare MicroSD module in Cirkit Designer

Introduction

The Waveshare MicroSD Module (Part ID: Waveshare 3947) is a compact and efficient solution for interfacing with MicroSD cards. It enables seamless data storage and retrieval in embedded systems, making it ideal for applications requiring external memory. The module is designed to work with a wide range of microcontrollers and development boards, including Arduino, Raspberry Pi, and STM32.

Explore Projects Built with Waveshare MicroSD module

Use Cirkit Designer to design, explore, and prototype these projects online. Some projects support real-time simulation. Click "Open Project" to start designing instantly!
ESP32-Based SD Card Data Logger
Image of Data Logging: A project utilizing Waveshare MicroSD module in a practical application
This circuit connects an ESP32 Wroom Dev Kit microcontroller to a Micro SD Card Module for data storage purposes. The ESP32 is configured to communicate with the SD card using the SPI protocol, as indicated by the connections of MOSI, MISO, SCK, and CS pins. A separate Vcc component provides power to the SD card module.
Cirkit Designer LogoOpen Project in Cirkit Designer
ESP32 and Micro SD Card Module Data Logger
Image of MandIFInalWiring: A project utilizing Waveshare MicroSD module in a practical application
This circuit connects an ESP32 Wroom microcontroller to a Micro SD Card Module, enabling the ESP32 to read from and write to the SD card. The connections include SPI communication lines (CS, SCK, MOSI, MISO) and power lines (VCC, GND).
Cirkit Designer LogoOpen Project in Cirkit Designer
ESP32 and SD Card Module Data Logger with Wi-Fi Connectivity
Image of ESP-32 SD Circuit Diagram : A project utilizing Waveshare MicroSD module in a practical application
This circuit connects an ESP32 Wroom Dev Kit to an SD card module, enabling the ESP32 to read from and write to the SD card. The ESP32 provides power to the SD card module and communicates with it using SPI protocol through GPIO pins 23 (MOSI), 19 (MISO), 18 (SCK), and 5 (CS).
Cirkit Designer LogoOpen Project in Cirkit Designer
Heltec LoRa V2 with SD Card Data Logging
Image of LoRa SD: A project utilizing Waveshare MicroSD module in a practical application
This circuit connects an SD card module to a Heltec LoRa V2 microcontroller for data storage and retrieval. The SD module is interfaced with the microcontroller via SPI communication, utilizing the CS, SCK, MOSI, and MISO pins. Power is supplied to the SD module from the microcontroller's 5V output, and both modules share a common ground.
Cirkit Designer LogoOpen Project in Cirkit Designer

Explore Projects Built with Waveshare MicroSD module

Use Cirkit Designer to design, explore, and prototype these projects online. Some projects support real-time simulation. Click "Open Project" to start designing instantly!
Image of Data Logging: A project utilizing Waveshare MicroSD module in a practical application
ESP32-Based SD Card Data Logger
This circuit connects an ESP32 Wroom Dev Kit microcontroller to a Micro SD Card Module for data storage purposes. The ESP32 is configured to communicate with the SD card using the SPI protocol, as indicated by the connections of MOSI, MISO, SCK, and CS pins. A separate Vcc component provides power to the SD card module.
Cirkit Designer LogoOpen Project in Cirkit Designer
Image of MandIFInalWiring: A project utilizing Waveshare MicroSD module in a practical application
ESP32 and Micro SD Card Module Data Logger
This circuit connects an ESP32 Wroom microcontroller to a Micro SD Card Module, enabling the ESP32 to read from and write to the SD card. The connections include SPI communication lines (CS, SCK, MOSI, MISO) and power lines (VCC, GND).
Cirkit Designer LogoOpen Project in Cirkit Designer
Image of ESP-32 SD Circuit Diagram : A project utilizing Waveshare MicroSD module in a practical application
ESP32 and SD Card Module Data Logger with Wi-Fi Connectivity
This circuit connects an ESP32 Wroom Dev Kit to an SD card module, enabling the ESP32 to read from and write to the SD card. The ESP32 provides power to the SD card module and communicates with it using SPI protocol through GPIO pins 23 (MOSI), 19 (MISO), 18 (SCK), and 5 (CS).
Cirkit Designer LogoOpen Project in Cirkit Designer
Image of LoRa SD: A project utilizing Waveshare MicroSD module in a practical application
Heltec LoRa V2 with SD Card Data Logging
This circuit connects an SD card module to a Heltec LoRa V2 microcontroller for data storage and retrieval. The SD module is interfaced with the microcontroller via SPI communication, utilizing the CS, SCK, MOSI, and MISO pins. Power is supplied to the SD module from the microcontroller's 5V output, and both modules share a common ground.
Cirkit Designer LogoOpen Project in Cirkit Designer

Common Applications and Use Cases

  • Data logging (e.g., temperature, humidity, or sensor data)
  • File storage for multimedia applications
  • Bootloading operating systems or firmware
  • Storing configuration files for embedded systems
  • Portable data transfer between devices

Technical Specifications

The Waveshare MicroSD Module is built for reliability and ease of use. Below are its key technical details:

Key Technical Details

Parameter Specification
Operating Voltage 3.3V or 5V
Communication Protocol SPI (Serial Peripheral Interface)
Supported Card Types MicroSD, MicroSDHC
Operating Temperature -25°C to 85°C
Dimensions 42mm x 24mm
Mounting Type PCB Mount

Pin Configuration and Descriptions

The module has a 6-pin interface for easy connection to microcontrollers. Below is the pinout:

Pin Name Pin Number Description
VCC 1 Power supply input (3.3V or 5V)
GND 2 Ground
MISO 3 Master In Slave Out (SPI data output)
MOSI 4 Master Out Slave In (SPI data input)
SCK 5 Serial Clock (SPI clock signal)
CS 6 Chip Select (SPI enable signal)

Usage Instructions

How to Use the Component in a Circuit

  1. Power the Module: Connect the VCC pin to a 3.3V or 5V power source and the GND pin to ground.
  2. Connect SPI Pins: Interface the MISO, MOSI, SCK, and CS pins to the corresponding SPI pins on your microcontroller.
  3. Insert MicroSD Card: Ensure the MicroSD card is properly formatted (e.g., FAT32) and securely inserted into the module.
  4. Initialize in Code: Use an appropriate library (e.g., SD library for Arduino) to initialize and communicate with the MicroSD card.

Important Considerations and Best Practices

  • Voltage Compatibility: The module supports both 3.3V and 5V logic levels, making it compatible with most microcontrollers.
  • Card Formatting: Always format the MicroSD card to FAT16 or FAT32 before use to ensure compatibility.
  • SPI Speed: Configure the SPI clock speed appropriately. A lower speed may be required for reliable communication with some MicroSD cards.
  • Avoid Hot-Swapping: Do not insert or remove the MicroSD card while the module is powered to prevent data corruption or hardware damage.

Example Code for Arduino UNO

Below is an example of how to use the Waveshare MicroSD Module with an Arduino UNO:

#include <SPI.h>
#include <SD.h>

// Define the Chip Select (CS) pin for the SD module
const int chipSelect = 10;

void setup() {
  // Initialize serial communication for debugging
  Serial.begin(9600);
  while (!Serial) {
    ; // Wait for the serial port to connect (for native USB boards)
  }

  Serial.println("Initializing SD card...");

  // Initialize the SD card
  if (!SD.begin(chipSelect)) {
    Serial.println("SD card initialization failed!");
    return;
  }
  Serial.println("SD card initialized successfully.");

  // Create or open a file on the SD card
  File dataFile = SD.open("example.txt", FILE_WRITE);

  // Check if the file opened successfully
  if (dataFile) {
    dataFile.println("Hello, Waveshare MicroSD Module!");
    dataFile.close(); // Close the file to save changes
    Serial.println("Data written to example.txt");
  } else {
    Serial.println("Error opening example.txt");
  }
}

void loop() {
  // Nothing to do here
}

Troubleshooting and FAQs

Common Issues and Solutions

  1. SD Card Initialization Fails

    • Cause: Incorrect wiring or incompatible MicroSD card.
    • Solution: Double-check the wiring and ensure the MicroSD card is formatted to FAT16 or FAT32.
  2. Data Corruption

    • Cause: Removing the MicroSD card while the module is powered.
    • Solution: Always power down the module before removing the card.
  3. File Not Found

    • Cause: Incorrect file path or name.
    • Solution: Ensure the file name matches exactly, including case sensitivity.
  4. Slow Data Transfer

    • Cause: SPI clock speed too low.
    • Solution: Increase the SPI clock speed, but ensure it is within the MicroSD card's specifications.

FAQs

Q: Can I use this module with a Raspberry Pi?
A: Yes, the module is compatible with Raspberry Pi. Use the SPI interface and configure it in the Raspberry Pi's settings.

Q: What is the maximum capacity of MicroSD card supported?
A: The module supports MicroSD and MicroSDHC cards, typically up to 32GB. Larger cards may work if formatted to FAT32, but compatibility is not guaranteed.

Q: Is the module hot-swappable?
A: No, it is not recommended to insert or remove the MicroSD card while the module is powered to avoid data corruption or hardware damage.

Q: Can I use multiple MicroSD modules on the same SPI bus?
A: Yes, you can use multiple modules by assigning a unique Chip Select (CS) pin to each module.

This concludes the documentation for the Waveshare MicroSD Module (Part ID: Waveshare 3947).