Beställt på vardagar före 14:00 = skickas samma dag. 30 dagars ångerrätt

Kopplingsschema och kodexempel

Så här kopplar du 3.3V Micro SD-kortmodul för ESP32 | ESP8266 till en Arduino UNO eller ESP32, med ett exempel­sketch som du kan ladda upp direkt.

MicroSD Card Read and Write Demo

This project demonstrates writing text to a microSD card and reading it back via SPI. A 4-channel logic level shifter safely translates the Arduino Uno's 5V logic signals down to 3.3V for the microSD card module. Open the Serial Monitor at 115200 baud to view the initialization status and file contents.

Kopplingsschema: 3.3V Micro SD-kortmodul för ESP32 | ESP8266 på en Arduino UNO
Kopplingsschema · Klicka för att förstora
Kopplingstabell: 3.3V Micro SD-kortmodul för ESP32 | ESP8266 på en Arduino UNO
Kopplingstabell · Klicka för att förstora
MicroSD_Card_Read_and_Write_Demo.ino · kompilerad och testad
/*
 * ==================================================================
 *  Generated by Codey.online  —  https://www.codey.online
 * ==================================================================
 *  Project   : MicroSD Card Read and Write Demo
 *  Board     : Arduino UNO (arduino:avr:uno)
 *  Parts     : Micro SD Card Adapter Module 3.3V
 *  Libraries : none (built-in)
 *
 *  Codey Online is an AI-powered browser IDE for Arduino and ESP32.
 *  Describe your project and Codey writes the code, draws the wiring
 *  diagram and uploads it to your board, straight from the browser.
 *  This code is free to use, modify and share, without warranty.
 * ==================================================================
 */

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

const int chipSelect = 10;

void setup() {
  Serial.begin(115200);
  while (!Serial) {
    ; // Wait for serial port to connect
  }

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

  if (!SD.begin(chipSelect)) {
    Serial.println(F("Initialization failed! Check connections & SD card."));
    return;
  }
  Serial.println(F("Initialization done."));

  // Write to file
  File myFile = SD.open("demo.txt", FILE_WRITE);
  if (myFile) {
    Serial.println(F("Writing to demo.txt..."));
    myFile.println(F("MicroSD card read/write test successful!"));
    myFile.close();
    Serial.println(F("Done writing."));
  } else {
    Serial.println(F("Error opening demo.txt for writing."));
  }

  // Read from file
  myFile = SD.open("demo.txt");
  if (myFile) {
    Serial.println(F("Contents of demo.txt:"));
    while (myFile.available()) {
      Serial.write(myFile.read());
    }
    myFile.close();
  } else {
    Serial.println(F("Error opening demo.txt for reading."));
  }
}

void loop() {
  // Idle
}

Wiring diagram and example code generated by Codey.online — https://www.codey.online

MicroSD Card Read and Write with ESP32

This example demonstrates how to interface a 3.3V MicroSD card module with the ESP32 using the default hardware SPI bus (VSPI). The sketch initializes the SD card, writes a test message to a file, and reads it back to display on the Serial Monitor.

Kopplingsschema: 3.3V Micro SD-kortmodul för ESP32 | ESP8266 på en ESP32 DevKit V1
Kopplingsschema · Klicka för att förstora
Kopplingstabell: 3.3V Micro SD-kortmodul för ESP32 | ESP8266 på en ESP32 DevKit V1
Kopplingstabell · Klicka för att förstora
MicroSD_Card_Read_and_Write_with_ESP32.ino · kompilerad och testad
/*
 * ==================================================================
 *  Generated by Codey.online  —  https://www.codey.online
 * ==================================================================
 *  Project   : MicroSD Card Read and Write with ESP32
 *  Board     : ESP32 DEVKIT V1 (esp32:esp32:esp32doit-devkit-v1)
 *  Parts     : Micro SD Card Adapter Module 3.3V
 *  Libraries : none (built-in)
 *
 *  Codey Online is an AI-powered browser IDE for Arduino and ESP32.
 *  Describe your project and Codey writes the code, draws the wiring
 *  diagram and uploads it to your board, straight from the browser.
 *  This code is free to use, modify and share, without warranty.
 * ==================================================================
 */

#include "FS.h"
#include "SD.h"
#include "SPI.h"

const int chipSelect = 5;

void setup() {
  Serial.begin(115200);
  while (!Serial) { delay(10); }

  Serial.println("\n--- MicroSD Card Demo ---");

  // Initialize SD card on default VSPI pins (CS = GPIO 5)
  if (!SD.begin(chipSelect)) {
    Serial.println("Card Mount Failed! Check wiring and make sure card is FAT32 formatted.");
    return;
  }

  uint8_t cardType = SD.cardType();
  if (cardType == CARD_NONE) {
    Serial.println("No SD card attached.");
    return;
  }

  Serial.print("SD Card Type: ");
  if (cardType == CARD_MMC) {
    Serial.println("MMC");
  } else if (cardType == CARD_SD) {
    Serial.println("SDSC");
  } else if (cardType == CARD_SDHC) {
    Serial.println("SDHC");
  } else {
    Serial.println("UNKNOWN");
  }

  uint64_t cardSize = SD.cardSize() / (1024 * 1024);
  Serial.printf("SD Card Size: %lluMB\n", cardSize);

  // Write to a test file
  Serial.println("Writing to test.txt...");
  File file = SD.open("/test.txt", FILE_WRITE);
  if (file) {
    file.println("Hello from ESP32!");
    file.println("MicroSD read/write test successful.");
    file.close();
    Serial.println("Write complete.");
  } else {
    Serial.println("Failed to open file for writing.");
    return;
  }

  // Read back the test file
  Serial.println("Reading from test.txt:");
  file = SD.open("/test.txt");
  if (file) {
    while (file.available()) {
      Serial.write(file.read());
    }
    file.close();
  } else {
    Serial.println("Failed to open file for reading.");
  }
}

void loop() {
  // Nothing to repeat in this test
  delay(1000);
}

Wiring diagram and example code generated by Codey.online — https://www.codey.online

Produktsäkerhet
Tillverkare
OTRONIC
Meerweg 76A, 2121 VC BENNEBROEK, Nederland
support@otronic.nl
Ansvarig i EU
OTRONIC
Meerweg 76A, 2121 VC BENNEBROEK, Nederland
support@otronic.nl
Säkerhetsinformation
Läs produktinformationen och eventuell manual före användning. Elektroniska moduler och delar är avsedda för personer med teknisk kunskap; förvara dem utom räckhåll för barn. Använd endast angiven spänning och anslut eller koppla inte loss något medan kretsen är spänningssatt. Lämna uttjänt elektronik och batterier till en insamlingsplats; släng dem inte i hushållsavfallet.

3.3V Micro SD-kortmodul för ESP32 | ESP8266

Enkel MicroSD-kortläsarmodul. Tack vare att den arbetar på 3.3V är den väl lämpad för till exempel ESP32 eller ESP8266. Modulen är försedd med nödvändiga 10K pull-up-motstånd på datalinjerna.

Specifikationer:
– Driftspänning: 3.3V
- Typ av micro SD-slot: Push-Pull
– Gränssnitt: SPI
– Operating voltage (logic level): 3.3V

Pin headers redan förlödade.

Mått
Längd: 2cm
Bredd: 1,8cm
Höjd: 1,1cm

  • 3.3V drift
  • SPI-gränssnitt
  • Förlött
  • 2 x 1,8 x 1,1 cm

Varför välja denna produkt?

  • Lämplig för ESP32 – Fungerar på 3,3 V, bra för ESP32.
  • Lämplig för ESP8266 – Fungerar på 3,3 V, bra för ESP8266.
  • 10K pull-up-motstånd – Utrustad med pull-up-motstånd på datalinjerna.
  • Pinheaders förlödda – Redo för anslutning direkt.
Specifikationer
Bredd1,8cm
Driftspänning3.3V
Längd2 cm
Höjd1,1 cm
Typ av micro SD-kortplatsPush-Pull

Köps ofta tillsammans

Totalt: 72 kr

Recensioner

★★★★★ 5,0/5 3 recensioner
  • ★★★★★Harke BosgraafVerifierat köp

    gör det jag köpte den för.

  • ★★★★★Arie van der KloosterVerifierat köp

    Enkelt och bra.

  • ★★★★★Paul liekensVerifierat köp

    Fungerar bra

Skriv ett omdöme
Ditt omdöme

Frakt & returer

Frakt

  • Paket med spårning85 kr5 arbetsdagar
  • Paket med spårning104 kr5 arbetsdagar
  • Paket med spårning124 kr5 arbetsdagar
  • Paket med spårning130 kr5 arbetsdagar
Allt om frakt

Returer

Inte nöjd? Du har 30 dagars ångerrätt efter leverans för att returnera produkten.

Allt om returer