Arduino: Interfacing SD card with ESP 32

In our previous blog we have seen how to setup arduino for ESP 32 and ran GetChipID example, in this blog we will see how to run the SD_Test example.

Connecting ESP DevKit to SD Card Breakout board

 

ESP32_SD_Card_connections
ESP32_SD_Card_connections

if you have a SD card breakout board you can directly connect it respective connections on ESP32 dev board like MISO to MISO,SCK to SCK etc.. (The Breakout board might have a VCC pin, Connect 3v3 to that pin)

Connecting SD card to ESP32 DevKit
Connecting SD card to ESP32 DevKit

You can find the program in Examples -> SD(esp32) -> SD_Test

open the serial console after loading the code, the program will print basic information about the SD card and it will write and read a file as well

ESP 32 Arduino SD Test
ESP 32 Arduino SD Test

Followings are results when executed the testFileIO function with different buffer sizes

1 byte buffer
  • 1048576 bytes read for 14522 ms
  • 2048 bytes written for 33 ms
  • 2048 bytes read for 28 ms
128 byte buffer
  • 262144 bytes read for 869 ms
  • 262144 bytes written for 1714 ms
512 byte buffer
  • 1048576 bytes read for 3432 ms
  • 1048576 bytes written for 7155 ms
4096 byte buffer
  • 8388608 bytes read for 27322 ms
  • 8388608 bytes written for 29227 ms
2 Comments

Add a Comment

Your email address will not be published. Required fields are marked *