Micro SD Card slot on Bharat Pi

Bharat-Pi-SD-Card-Slot-1-1

Bharat Pi boards have micro SD card slot and can fit any micro SD card of 16GB to 128GB. Bharat Pi uses ESP32 microcontroller, so all test programs and examples for ESP32 SD card will work on Bharat Pi.

The micro SD Card slot on Bharat Pi board works on push-lock mechanism. To insert or remove the micro SD card you can press once as show below.

Bharat Pi board with SD Card slot
Bharat Pi board with SD Card slot

Image 1: Bharat Pi board with SD Card slot

Formatting the micro SD Card

If the micro SD card is new then it need to be formatted with FAT32 system.

Format the SD card using laptop or try using an Android phone which has an supports external micro SD card. Insert the micro SD card on your Android phone and navigate to Settings -> Storage -> SD Card and select Format option.

Note:

SD formatting will erase all the contents permanently. Please make sure you take a backup of your SD card contents before formatting.

Micro SD card is now ready to test. Insert the SD card on to backside of Bharat Pi board. Follow the below steps to load an example program to test the micro SD card.

Steps to test Bharat Pi micro SD Card using Arduino IDE:

  1. Connect the board to your laptop/desktop using USB Type-C cable.
  2. Open Arduino IDE and navigate to menu option : File -> Examples -> SD -> SD Test as shown in below Image 2. Upload this SD card test program to Bharat Pi from menu option: Sketch -> Upload. (If you dont see SD” option under examples then install SparkFun SD card library as shown in Image 3.)
Arduino IDE SD Card Load Test Program

Image 2: Arduino IDE SD Card Load Test Program

Install SparkFun SD Card library in Arduino IDE

Image 3: Install SparkFun SD Card library in Arduino IDE

  1. The SD card test program will execute and creates a folder and text file. You can view the the debug log messages on serial monitor as show in below image 4.
  2. If the SD card fails to mount then it is likely that the micro SD card was not formatted properly. Follow the steps to format micro SD card as mentioned above.
SD Card test program debug log on serial monitor

Image 4: SD Card test program debug log on serial monitor

Micro SD Card slot on Bharat Pi enables edge computing and other AI/ML work flows for local data storage, filtering and training.

Let us know what you are building using SD card on Bharat Pi. If you have any challenges regarding SD card usage with ESP32 then leave a comment and we shall help you.

4 responses to “Micro SD Card slot on Bharat Pi”

  1. Jayesh Patel Avatar
    Jayesh Patel

    I want to write analog data from A0 to SD card

    1. Bharat Pi Avatar
      Bharat Pi

      You can write data to SD card by referring to this sample code on our GitHub repo. -> https://github.com/Bharat-Pi/iot-projects/tree/main/Bharat_Pi_SD_Card_Test_Program

      If you are using a new SD card then format it to FAT system before using.

  2. vu2jmn-8538 Avatar
    vu2jmn-8538

    I want to write analog data from A0 to SD card

    1. Bharat Pi Avatar
      Bharat Pi

      You can write data to SD card by referring to this sample code on our GitHub repo -> https://github.com/Bharat-Pi/iot-projects/tree/main/Bharat_Pi_SD_Card_Test_Program

      If you are using a new SD card then format it to FAT system before using.

Leave a Reply

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