What is SD-Card? What are its applications regarding arduino?
SD stands for secure digital and combined with card it stands for secure digital card. It is a non volatile memory in a small thin integrated circuit. You can store still images, videos, files etc on it. In order to move data from one device to another using SD-card you have to remove it from one device and insert it in other. Non volatile attribute made it popular. Unlike floppy discs SD-cards are small in size have greater capacity and are not effected by external magnetic fields.
SD-cards comes in three sizes standard one followed by mini and then the micro. The standard one is biggest in size. With the passage of time the electronic devices becomes smaller in size. so the size of SD-card also reduced to fit in the new devices. For example take the example of mobile phones initially the SD-card supported by the mobile phones are micro sized. Then after 2010 mobile size reduced and the new slot for SD-cards supports only the mini sized SD-card. Another good example is of digital cameras. First digital cameras supported floppy discs. Then comes the cameras who supported SD-card. The size of SD-card at that time was standard one. After a decade cameras supporting micro sized SD-card flooded the market and finally the slot now a days is over taken by mini sized SD-card.
Like physical size the memory capacity of SD-card is also increasing year by year. Though the SD-card standard says a max 128 TB of card is possible but right now card of memory capacity 64 GB is supported by almost all the devices present in market. Digital device support for SD-card also matters. The devices in market doesn’t support the sizes greater then 64 GB though few supports greater then 64 GB but not all. Device address and data bus are not of width to support 512 GB SD-card or greater then 64. The picture below shows the SD-card memory capacity and size.
Arduio SD-Card Interfacing step by step guide
Commonality in all the Arduino SD card boards
Arduino SD card interface Library
Like all other components their is a dedicated library for SD card interface with arduino. Off-course you can write your own library for sd card or just write code from scratch in order to interface arduino with SD card. I suggest to use the library. Its well written and commented and above all its bug free. Library supports FAT-16 and FAT-32 file system on a sd card. Make sure when you are building this project only use sd card whose file system is FAT-16 or FAT-32.
If you don’t know what it means just format your sd card using your personal computer. Insert the card in sd-card slot in personal computer and then right click on the card icon select the format as FAT-16 or FAT-32 and format it. Some times the format does not change using default window formatter. The solution is to download a small free sd card for formatter software and then format your card with it.
SD card interface Pin map
SD card module pin out
Interfacing arduino uno with sd card module using arduino sd card library
Direct arduino sd card connections
Arduino SD card Coding
SD.begin(Arduino digital pin number);
File dataFile = SD.open(“myfile.txt”);
File dataFile = SD.open(“myfile.txt”, FILE_WRITE);
Reading from file
Writing to file
Random file functions
Check if file already exists
Delete a file
Create a directory or folder
Create a directory in a directory
Remove or delete a directory