STEP 1 / 6ESP + IOT

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…

ESP32: Guide for MicroSD Card Module using Arduino IDE - source illustration from page 1278
PROJECT#475
TRACKIoT
PARTS06
STAGES06
STEP 1 / 6 · Overview

Know the mission before touching a wire.

Understand what you are making, prepare the right tools, and make the workbench safe.

01

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
02

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.

03

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.
Ready to continue?
STEP 2 / 6 · Parts library

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.

NAMED PROJECT INVENTORY6 PART LINES
PARTTYPEQTYREADY
MESP32 development board (read: Best ESP32 development boards)MODULE1
What's this?Image, role, pros, cons, handling & specifications
ESP32: Guide for MicroSD Card Module using Arduino IDE - source illustration from page 1278MODULE LEARNING VIEW

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 here

It 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.
PMicroSD Card ModulePART1
What's this?Image, role, pros, cons, handling & specifications
ESP32: Guide for MicroSD Card Module using Arduino IDE - source illustration from page 1278PART LEARNING VIEW

MicroSD Card Module

A named project component whose exact role is defined by the source circuit and build guide.

What it does here

It 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.
PMicroSD CardPART1
What's this?Image, role, pros, cons, handling & specifications
ESP32: Guide for MicroSD Card Module using Arduino IDE - source illustration from page 1278PART LEARNING VIEW

MicroSD Card

A named project component whose exact role is defined by the source circuit and build guide.

What it does here

It 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.
PGetting ready to use the microSD CardPART1
What's this?Image, role, pros, cons, handling & specifications
ESP32: Guide for MicroSD Card Module using Arduino IDE - source illustration from page 1278PART LEARNING VIEW

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 here

It 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.
MESP32 Handling Files with a MicroSD Card ModuleMODULE1
What's this?Image, role, pros, cons, handling & specifications
ESP32: Guide for MicroSD Card Module using Arduino IDE - source illustration from page 1278MODULE LEARNING VIEW

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 here

It 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.
MESP8266 - controller board / ICMODULE1
What's this?Image, role, pros, cons, handling & specifications
ESP32: Guide for MicroSD Card Module using Arduino IDE - source illustration from page 1278MODULE LEARNING VIEW

ESP8266 - controller board / IC

A programmable controller that reads inputs, makes decisions, and drives the project's outputs.

What it does here

It 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.
Ready to continue?
STEP 4 / 6 · Source code

Confirm the hardware-only control path.

This project does not include firmware in the source. The circuit itself provides the required behaviour.

01

How to connect

  1. Match every controller label to the circuit view and source pin map.
  2. Join grounds before signal wires when separate low-voltage supplies are used.
  3. 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.

02

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.

03

How to upload code

The original design is implemented entirely in hardware, so proceed after verifying the circuit and supply.

Ready to continue?
STEP 5 / 6 · Build

Assemble, deploy, test, and troubleshoot.

Use the complete source notes in build order, then pass the final checks before calling the project finished.

ASSEMBLY

Build in functional stages

  • Power and regulation
  • Controller or processing stage
  • Inputs and sensors
  • Outputs and loads
  • Enclosure and strain relief
TEST

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
TROUBLESHOOT

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
PROJECT-SPECIFIC BUILD NOTES

Follow the documented instructions.

These notes come from this project's source and remain in their original order.

01

Project overview

Project build note

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 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.

02

Parts Required

Project build note

ESP32 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.

03

Demonstration

Project build note

Transfer 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.

Ready to continue?
PROJECT ACHIEVED

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.

ESP32 IoT Shield PCB with Dashboard for Outputs and Sensors project thumbnail featuring DOIT ESP32 DEVKIT V1 Board, x 5mm LED, resistors with 330 Ohm each
NEXT IOT ADVENTURE

ESP32 IoT Shield PCB with Dashboard for Outputs and Sensors

Ready to reuse what you learned in another project from the same track?

Start this project
Browse all 500 projects