To connect a standard 5V MicroSD card module to an Arduino Uno via SPI, wire the module's VCC to the Arduino's 5V pin, GND to GND, MOSI to Pin 11, MISO to Pin 12, SCK to Pin 13, and CS to Pin 4. This configuration leverages the hardware SPI bus while keeping the default hardware SS pin (Pin 10) available or configured as an output to maintain the ATmega328P's SPI master mode.
While the physical connection requires only six jumper wires, understanding the internal signal routing—specifically the 3.3V logic level shifting and voltage regulation—is critical for reliable data logging. Below is a complete walkthrough of the wiring diagram, terminal mappings, and verification procedures.
SD Card Module Pinout and SPI Signal Mapping
The most common MicroSD adapter modules (often labeled as 'Catalex' or generic LCSC variants) feature a 6-pin male header. Physically, the pins are usually arranged in a single row with GND and VCC on the outer edges, and the SPI data lines in the center. Before tracing the circuit, we must define what the schematic symbols and acronyms represent in this context.
- VCC / VDD: The primary power input. On schematic diagrams, this is denoted by a solid horizontal line or an upward arrow.
- GND / VSS: The common ground reference, symbolized by three descending horizontal lines.
- MOSI (Master Out Slave In): Data flowing from the Arduino to the SD card.
- MISO (Master In Slave Out): Data flowing from the SD card back to the Arduino.
- SCK (Serial Clock): The clock signal generated by the Arduino to synchronize data transfer.
- CS (Chip Select) / SS: An active-low signal that enables communication with the SD card.
| Module Terminal | Arduino Uno Pin | SPI Signal | Logic Voltage | Recommended Wire Color |
|---|---|---|---|---|
| GND | GND | Common Ground | 0V | Black |
| VCC | 5V | Power Input | 5.0V | Red |
| MISO | D12 | Master In Slave Out | 3.3V / 5V | Blue |
| MOSI | D11 | Master Out Slave In | 5V to 3.3V | Green |
| SCK | D13 | Serial Clock | 5V to 3.3V | Yellow |
| CS | D4 | Chip Select | 5V to 3.3V | Orange |
For comprehensive SPI protocol timing and electrical characteristics, refer to the official Arduino SPI documentation and the SD Association technical standards.
Node-by-Node Wiring Trace: Arduino Uno to MicroSD Adapter
To truly understand the wiring diagram, we must trace the electrical path from the Arduino's source pins, through the module's conditioning circuitry, to the SD card's load terminals. This trace assumes a module equipped with a 74LVC125A level-shifting IC and an AMS1117-3.3 voltage regulator.
1. The Power and Ground Path
The trace begins at the Arduino's 5V pin, carrying approximately 5.0V DC. This travels via the red jumper wire to the module's VCC header pin. From the VCC header, the trace splits into two paths on the module's PCB:
- Regulator Input: The 5V feeds into Pin 3 (Input) of the AMS1117-3.3 SOT-223 voltage regulator. The regulator drops the voltage to a stable 3.3V at Pin 2 (Output), which routes directly to the VDD pin (Pin 4) on the MicroSD card socket.
- Level Shifter VCC: The 5V also feeds the VCC pin of the 74LVC125A logic level shifter, providing the high-side reference voltage for translating the Arduino's 5V logic down to 3.3V.
The Ground Path: The trace starts at the Arduino's GND pin, travels via the black wire to the module's GND header. This connects to the PCB's ground plane, tying together Pin 1 of the AMS1117-3.3, the GND pin of the 74LVC125A, and critically, the VSS pins (Pins 3 and 6) of the MicroSD card socket. This equipotential bonding ensures both the microcontroller and the flash memory share the exact same 0V reference.
2. The SPI Data and Clock Paths
The data lines require level shifting because the Arduino Uno (ATmega328P) operates at 5V logic, while the SD card's SPI interface strictly requires 3.3V logic. Applying 5V directly to the SD card's data pins will degrade the internal flash controller over time.
- MOSI & SCK (Arduino to SD): The Arduino outputs 5V pulses on Pin 11 (MOSI) and Pin 13 (SCK). These enter the module's header and route into the 'A' inputs of the 74LVC125A level shifter. The IC translates these down to 3.3V at the 'Y' outputs, which then trace to the CMD (Pin 2) and CLK (Pin 5) of the SD card socket.
- CS (Chip Select): Arduino Pin 4 outputs a 5V active-low signal. It passes through a separate channel of the level shifter (or a simple resistor divider on cheaper modules) to reach the CD/DAT3 pin (Pin 1) on the SD card, which acts as the Chip Select line in SPI mode.
- MISO (SD to Arduino): The SD card outputs 3.3V data on its DAT0 pin (Pin 7). This traces to the module's MISO header pin. Because the Arduino's ATmega328P recognizes any voltage above 3.0V as a logic HIGH, the 3.3V MISO signal can safely drive the Arduino's Pin 12 directly without needing to be shifted up to 5V. Most quality modules route this directly; some pass it through a unity-gain buffer.
Verifying the Wiring with a Multimeter
Before inserting an SD card or uploading code, verify your physical connections using a digital multimeter (DMM). This prevents immediate component death from miswired power rails.
Step 1: Continuity and Short Testing (Power Off)
- Disconnect the Arduino from USB and remove the SD card.
- Set your DMM to continuity mode (the diode/sound wave symbol).
- Place the black probe on the Arduino's metal USB shield (known good ground) and the red probe on the SD module's GND pin. You should read less than 0.5 ohms and hear a continuous beep.
- Check for shorts: Place probes between the module's VCC and GND pins. You should read an open circuit (OL) or a high resistance (typically >10k ohms due to the regulator's internal capacitance and bias network). If it reads near 0 ohms, you have a solder bridge or a dead regulator.
Step 2: Voltage Rail Verification (Power On)
- Plug the Arduino into USB power. Keep the SD card out of the socket for now to measure unloaded voltage.
- Set the DMM to the 20V DC range.
- Place the black probe on the module's GND pin. Place the red probe on the module's VCC pin. Expected reading: 4.8V to 5.1V.
- Move the red probe to the 3.3V output pad on the module (often a test point near the AMS1117 regulator, or you can carefully probe Pin 4 inside the SD socket). Expected reading: 3.28V to 3.32V. If this reads below 3.0V, your regulator is failing or your Arduino 5V rail is sagging.
Common Wiring Failures and Level-Shifter Edge Cases
Even with correct physical wiring, embedded systems often fail due to logical or electrical edge cases. Here are the most frequent issues encountered when wiring SD modules to Arduino boards.
The Floating CS (Chip Select) Pin Problem
If you are sharing the SPI bus with another device (like an RFM95 LoRa module or an NRF24L01 transceiver), the SD card's CS pin must be driven HIGH when not in use. If the CS line is left floating or pulled low, the SD card will continuously drive the MISO line. This causes a bus collision, corrupting data from your other SPI sensors. Always use digitalWrite(chipSelectPin, HIGH); in your setup() function before initializing other SPI devices, and ensure your wiring uses a dedicated GPIO for CS rather than relying on internal pull-ups alone.
SDHC vs. SDXC Compatibility
The standard Arduino SD.h library is built on the older SD specification. It natively supports SD and SDHC cards formatted as FAT16 or FAT32. This imposes a hard limit of 32GB. If you wire up a 64GB or 128GB SDXC card (which defaults to exFAT formatting), the Arduino will fail to initialize the card, returning an initialization failed error in the serial monitor. Always use a 16GB or 32GB MicroSDHC card formatted via the official SD Memory Card Formatter tool.
Resistor Divider vs. Active Level Shifting
Cheaper SD modules omit the 74LVC125A IC and instead use a simple resistor voltage divider (e.g., 1.8kΩ and 3.3kΩ) to drop the 5V MOSI/SCK signals to 3.3V. While this works for low-speed SPI, the parasitic capacitance of the SD card's input pins combined with the resistor values creates a low-pass filter. This rounds off the square wave edges of the SCK clock signal. If you experience intermittent write failures or CRC errors on long jumper wires, switch to a module with an active logic level shifter IC, or lower the SPI clock speed in your code using SD.begin(4, SPI_HALF_SPEED).






