ESP32: Guide for MicroSD Card Module using Arduino IDE
You will learn how to read files from and write files to the microSD card by following the instructions in this guide, which demonstrates how to use a microSD card with the ESP32. We will…

Know the mission before touching a wire.
Understand what you are making, prepare the right tools, and make the workbench safe.
Project details
ESP32: Guide for MicroSD Card Module using Arduino IDE is a iot project. You will learn how to read files from and write files to the microSD card by following the instructions in this guide, which demonstrates how to use a microSD card with the ESP32. We will…
- Source pages
- 1278-1284
- Named parts
- 6
- Build goal
- Working, tested prototype
Tools you need
- Digital multimeter
- Wire stripper and side cutters
- Soldering iron with a fine tip
- Current-limited bench supply
- Computer with a data-capable USB cable
Use eye protection, good lighting, and a clean insulated surface throughout the build.
Safety precautions
- Disconnect every power source before changing a connection.
- Check component polarity, pinout, and supply voltage twice.
- Use a current limit for the first power-up.
- Keep liquids, loose metal, and uninsulated wires away from the bench.
Gather, identify, and understand every part.
Use the standardized inventory, then open What's this? to learn each part's role, advantages, limitations, handling, and specifications.
What's this?Image, role, pros, cons, handling & specifications

ESP32 development board (read: Best ESP32 development boards)
A programmable controller that reads inputs, makes decisions, and drives the project's outputs.
What it does hereIt is the control centre and must use the documented board, pin map, supply, and logic level.
Buy / compare this part ↗Advantages
- Reprogrammable and reusable
- Large learning ecosystem
- Complex behaviour remains changeable
Limitations
- GPIO voltage and current are limited
- Some pins affect boot or communication
- Loads normally need a driver
Handling
- Disconnect power before rewiring
- Avoid static discharge
- Never power motors, relays, or pumps directly from GPIO
Specifications to verify
- Use the exact model, value, package, and rating listed for ESP32 development board (read: Best ESP32 development boards); similar-looking parts are not always interchangeable.
- Confirm operating voltage, logic level, pinout, memory, USB interface, and maximum GPIO current.
What's this?Image, role, pros, cons, handling & specifications

MicroSD Card Module
A named project component whose exact role is defined by the source circuit and build guide.
What it does hereIt performs a documented electrical, control, interface, or construction function in this project.
Buy / compare this part ↗Advantages
- Selected for this project
- Can be checked independently
- Supports modular troubleshooting
Limitations
- Substitutes may differ
- Generic names can hide variants
- Pinouts and ratings vary
Handling
- Compare the received part with the source
- Keep it labelled
- Do not force connectors or adjusters
Specifications to verify
- Use the exact model, value, package, and rating listed for MicroSD Card Module; similar-looking parts are not always interchangeable.
- Confirm dimensions, ratings, connection method, polarity, and environmental limits.
What's this?Image, role, pros, cons, handling & specifications

MicroSD Card
A named project component whose exact role is defined by the source circuit and build guide.
What it does hereIt performs a documented electrical, control, interface, or construction function in this project.
Buy / compare this part ↗Advantages
- Selected for this project
- Can be checked independently
- Supports modular troubleshooting
Limitations
- Substitutes may differ
- Generic names can hide variants
- Pinouts and ratings vary
Handling
- Compare the received part with the source
- Keep it labelled
- Do not force connectors or adjusters
Specifications to verify
- Use the exact model, value, package, and rating listed for MicroSD Card; similar-looking parts are not always interchangeable.
- Confirm dimensions, ratings, connection method, polarity, and environmental limits.
What's this?Image, role, pros, cons, handling & specifications

Getting ready to use the microSD Card
A named project component whose exact role is defined by the source circuit and build guide.
What it does hereIt performs a documented electrical, control, interface, or construction function in this project.
Buy / compare this part ↗Advantages
- Selected for this project
- Can be checked independently
- Supports modular troubleshooting
Limitations
- Substitutes may differ
- Generic names can hide variants
- Pinouts and ratings vary
Handling
- Compare the received part with the source
- Keep it labelled
- Do not force connectors or adjusters
Specifications to verify
- Use the exact model, value, package, and rating listed for Getting ready to use the microSD Card; similar-looking parts are not always interchangeable.
- Confirm dimensions, ratings, connection method, polarity, and environmental limits.
What's this?Image, role, pros, cons, handling & specifications

ESP32 Handling Files with a MicroSD Card Module
A programmable controller that reads inputs, makes decisions, and drives the project's outputs.
What it does hereIt is the control centre and must use the documented board, pin map, supply, and logic level.
Buy / compare this part ↗Advantages
- Reprogrammable and reusable
- Large learning ecosystem
- Complex behaviour remains changeable
Limitations
- GPIO voltage and current are limited
- Some pins affect boot or communication
- Loads normally need a driver
Handling
- Disconnect power before rewiring
- Avoid static discharge
- Never power motors, relays, or pumps directly from GPIO
Specifications to verify
- Use the exact model, value, package, and rating listed for ESP32 Handling Files with a MicroSD Card Module; similar-looking parts are not always interchangeable.
- Confirm operating voltage, logic level, pinout, memory, USB interface, and maximum GPIO current.
What's this?Image, role, pros, cons, handling & specifications

ESP8266 - controller board / IC
A programmable controller that reads inputs, makes decisions, and drives the project's outputs.
What it does hereIt is the control centre and must use the documented board, pin map, supply, and logic level.
Buy / compare this part ↗Advantages
- Reprogrammable and reusable
- Large learning ecosystem
- Complex behaviour remains changeable
Limitations
- GPIO voltage and current are limited
- Some pins affect boot or communication
- Loads normally need a driver
Handling
- Disconnect power before rewiring
- Avoid static discharge
- Never power motors, relays, or pumps directly from GPIO
Specifications to verify
- Use the exact model, value, package, and rating listed for ESP8266 - controller board / IC; similar-looking parts are not always interchangeable.
- Confirm operating voltage, logic level, pinout, memory, USB interface, and maximum GPIO current.
Connect one verified path at a time.
Explore the named components and standardized signal flow, then use Source Check to verify exact physical pins, values, and topology before applying power.
Trace this circuit.
ESP32: Guide for MicroSD Card Module using Arduino IDE: interactive parts, standardized terminals, responsive anchored wires, student explanations, and the original circuit reference in one shared system.
Trace before wiring
Follow power, ground, inputs, processing, and outputs in that order. Never guess a pin from package shape alone.
Connect with power off
Make short, labelled connections and share a common ground only where the schematic requires it.
Inspect every joint
Check continuity, polarity, adjacent shorts, and loose connections before the first power-up.
Open all source diagrams and build views 9 visuals









Confirm the hardware-only control path.
This project does not include firmware in the source. The circuit itself provides the required behaviour.
How to connect
- Match every controller label to the circuit view and source pin map.
- Join grounds before signal wires when separate low-voltage supplies are used.
- Keep motors, relays, pumps, and other loads on a suitable driver and external supply.
Common mistakes
Reversed VCC/GND, board-label versus GPIO-number confusion, missing common ground, and charge-only USB cables.
Troubleshoot
Disconnect loads, continuity-test one path at a time, then test with a current limit.
Software preparation
No IDE, board package, library, or firmware upload is required for this project.
If you add a programmable controller as an extension, document its pin map separately.
How to upload code
The original design is implemented entirely in hardware, so proceed after verifying the circuit and supply.
Assemble, deploy, test, and troubleshoot.
Use the complete source notes in build order, then pass the final checks before calling the project finished.
Build in functional stages
- Power and regulation
- Controller or processing stage
- Inputs and sensors
- Outputs and loads
- Enclosure and strain relief
Power up safely
- Inspect unpowered continuity first
- Apply the lowest safe current limit
- Measure supply rails before signals
- Add one load at a time
- Record expected and actual results
Work from simple to complex
- Confirm power, ground, polarity, and orientation
- Compare each pin with the source
- Test inputs separately from outputs
- Replace only one variable at a time
- Power off before every correction
Follow the documented instructions.
These notes come from this project's source and remain in their original order.
Project overview
Project build noteYou will learn how to read files from and write files to the microSD card by following the instructions in this guide, which demonstrates how to use a microSD card with the ESP32. We will be making use of a microSD card module in order to interface the microSD card with the ESP32 board (SPI communication protocol). When it comes to data logging or storing files that are too large to fit in the filesystem, using a microSD card in conjunction with the ESP32 is particularly helpful (SPIFFS). The Arduino core will be utilized in the process of programming the ESP32. MicroSD Card Module
There is more than one type of microSD card module that is compatible with the ESP32. The microSD card module that is shown in the following figure is the one that we are utilizing; it communicates via the SPI communication protocol. You are free to utilize any alternative microSD card module that possesses an SPI interface. In addition to being compatible with Arduino and ESP8266 NodeMCU boards, this microSD card module is also compatible with various types of microcontrollers. MicroSD Card Module Pinout – SPI The SPI communication protocol is used for communication within the microSD card module. You can connect it to the ESP32 by making use of the SPI pins that are pre-installed.
Parts Required
Project build noteESP32 development board (read: Best ESP32 development boards)
MicroSD Card Module MicroSD Card Jumper Wires Breadboard Getting ready to use the microSD Card Make sure that your microSD card is formatted using the FAT32 file system before continuing with the guide. You can format your microSD card by following the instructions that are provided below, or you can use a software application such as SD Card Formatter (compatible with Windows and Mac OS). 1. Place the microSD card inside of your computer's card reader. To format the SD card, navigate to "My Computer" and right-click on the card. Choose Format in the manner depicted in the figure below. 2.A new window shows up. Choose FAT32, then press Start to begin the formatting procedure, and then adhere to the directions that appear on the screen.
ESP32 Handling Files with a MicroSD Card Module There are two distinct libraries available for use with the ESP32 (both of which are included together as part of the Arduino core for the ESP32): the SDD MMC.h library and the SD library. If you make use of the SD library, you will be operating with the SPI controller. Using the SDD MMC library means that you are controlling the ESP32 using the SD/SDIO/MMC controlled.
Demonstration
Project build noteTransfer the preceding sketch to the ESP32 board you are using. After that, launch the Serial Monitor and push the RST button that is located on the
ESP32 board. If the initialization is successful, the Serial Monitor will display messages that are quite similar to these. Example: ESP32 Data Logging to microSD Card For projects involving data logging, using a microSD card is one of the most helpful options. As an illustration, we will walk you through the process of saving sensor readings from a BME280 sensor along with timestamps (epoch time). Example: ESP32 Web Server with Files from microSD Card
On a microSD card, you'll be able to store the files necessary to construct a web server using an ESP32 (HTML, CSS, JavaScript, and image files). If the files are too large to fit on the ESP32 filesystem, this can be helpful; but, depending on the nature of your project, it may also be more convenient. Note: Do not move any directories to the microSD card; only the files should be copied over. You should now be able to read and write files to and from a microSD card using the ESP32 after following the steps in this guide. You've also picked up the skills necessary to use it for data logging projects or store files to use in web server projects that you're developing.
You built ESP32: Guide for MicroSD Card Module using Arduino IDE.
You followed the full workflow from understanding the mission to testing the finished project. That is a real engineering achievement - well done.
Browse all 500 projects