We will focus on the actual code to interact with the SD card and not on how to do the wirings, since there are multiple approaches that can be follow

ESP32 writing file to SD card

submited by
Style Pass
2020-09-08 07:35:59

We will focus on the actual code to interact with the SD card and not on how to do the wirings, since there are multiple approaches that can be followed (using a board with a built in SD card adapter, connecting to an external adapter, etc..).

In my case, I’m using a HW-818 ESP32 board model, which can be bought at eBay for around 10 Euros (link here). This board contains a SD card socket that we can use to get started right away, without the need for additional electronics.

Nonetheless, take in consideration that there are two libraries available in the Arduino core to interact with a SD card: the SD and SD_MMC. You can read the difference about them here. For more details, you can also consult the Espressif documentation about the lower level drivers.

So, depending on your hardware configuration, you should choose the correct one. For the board I’m using, I need to include the SC_MMC library.

Leave a Comment