{"id":21528254,"url":"https://github.com/hrassi/sd_card_esp32_micropython","last_synced_at":"2025-07-13T11:42:43.546Z","repository":{"id":261934191,"uuid":"885761130","full_name":"hrassi/SD_Card_esp32_micropython","owner":"hrassi","description":"Connecting SDcard to ESP32 Micropython SPI interface","archived":false,"fork":false,"pushed_at":"2024-11-09T10:35:16.000Z","size":9,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-01-24T06:09:39.319Z","etag":null,"topics":["esp32-sdcard-micropython","sdcard"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/hrassi.png","metadata":{"files":{"readme":"readme.txt","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-11-09T10:26:35.000Z","updated_at":"2024-11-09T10:53:51.000Z","dependencies_parsed_at":"2024-11-09T11:38:33.068Z","dependency_job_id":null,"html_url":"https://github.com/hrassi/SD_Card_esp32_micropython","commit_stats":null,"previous_names":["hrassi/sd_card_esp32_micropython"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hrassi%2FSD_Card_esp32_micropython","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hrassi%2FSD_Card_esp32_micropython/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hrassi%2FSD_Card_esp32_micropython/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hrassi%2FSD_Card_esp32_micropython/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/hrassi","download_url":"https://codeload.github.com/hrassi/SD_Card_esp32_micropython/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244091762,"owners_count":20396667,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["esp32-sdcard-micropython","sdcard"],"created_at":"2024-11-24T01:52:23.716Z","updated_at":"2025-03-17T18:44:47.608Z","avatar_url":"https://github.com/hrassi.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"SD Card module provides “micro-SD card socket”, for inserting \nthe memory card and then provides SPI interface \npins (MOSI = GPIO23, MISO = GPIO19, SCLK = GPIO18 and CS = GPIO5),\nfor connecting it into ESP32 board.\n\nSD Card module converts the +5VDC supply into 3.3VDC using AM1117,\n\n3.3VDC regulator and converts the 5VDC logic Pins into 3.3VDC \nlogic pins by using “74ABT125PW, Quad Buffer Tri state logic \nconverter”.\n\nThe micro-SD card adapter should be powered and operated with 5VDC.\nthe microSD card needs 3.3v \n\nThis experiment uses an 64GB micro-SD card and it must be formatted \n(FAT32) \n\nStep 5: Python Program – SD Card Interface Module\n\n Python Program – SD Card Interface Module\nOpen the ESP32 as drive, and then copy the library sdcard.py \ninto root directory.\n\n \n\nMicroPython implements a Unix-like Virtual File System (VFS) layer.\nAll mounted filesystems are combined into a single virtual filesystem, \nstarting at the root /. Filesystems are mounted into directories in this\nstructure, and at startup the working directory is changed to where\nthe primary filesystem is mounted.\n\nThe main advantage of the FAT filesystem is that it can be accessed \nover USB MSC on supported boards without any additional drivers required\non the host PC.\n\nDownload and store the MicroPython “sdcard.py” library into ESP32.\n\nThe file open functionality open(), can take following arguments \nfor write, read and append a file.\n\nw -- Open a file for writing the ASCII text. \n     If a file is already existing, then it rewrites the file.\n\nr -- Open a file for reading the ASCII text.\n\na -- Open a file for appending the ASCII text at the end.\n\nwb -- Open a file for writing binary data.\n\nrb -- Open a file for reading binary data.\n\nMicroPython SPl, sdcard and os libraries are used for constructing \nthe experiment.\n\n\n\nDuring startup, the SPI bus and SD card is initialized.\n\nInitially a “sample.txt” file is created / opened with FILE_WRITE option.\n\n\n # Demonstrates ESP32 interface to MicroSD Card Adapter\n # Create a text file \n # Open text file, read and print the content on debug port\n   \n * The ESP32 pin connections for MicroSD Card Adapter SPI\n \n # MicroSD Card Adapter Power Pins\n * MicroSD VCC pin to ESP32 +5V\n * MicroSD GND pin to ESP32 GND\n \n # MicroSD SPI Pins\n * MicroSD MISO pin to ESP32 GPIO19\n * MicroSD MOSI pin to ESP32 GPIO23\n * MicroSD SCK pin to ESP32 GPIO18\n * MicroSD CS pin to ESP32 GPIO5\n \n\n Conclusion:\n\nThe experiment is successfully executed with ESP32, SD Card Module, and 64 GB micro-SD card\n\nA “sample.txt” file is created, written  and then readback / printed the text via debug port.\n\n\n\n\n\n\n\n\n\n\n\n\n\nhttps://youtu.be/08MXeM0Qb8Y?si=XZb9iozrt-WRAOat\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhrassi%2Fsd_card_esp32_micropython","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhrassi%2Fsd_card_esp32_micropython","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhrassi%2Fsd_card_esp32_micropython/lists"}