Project Description


This projects describes about using Arduino  system with SD Card to store and retrieve the information from the SD card.





  • 1 x micro SD card
  • 1 x Ethernet shield module
  • 1 x Arduino Mega2560

To connect a micro SD card to our Arduino Mega, we will use an Ethernet shield with a micro SD slot on it. There are, however, many different shields available for other types of SD cards.

Pin   Name     Description

1     NC       not connected

2     CS       Chip Select/Slave Select (SS)

3     DI         Master Out/Slave In (MOSI)

4     VDD      Supply voltage

5     CLK      Clock (SCK)

6     VSS      Supply voltage ground

7     DO       Master In/Slave Out (MISO)

8     RSV      Reserved

If you were to try interfacing this SD card yourself, you would have to ensure that you connected the pins of the SD card to the appropriate pins of the Arduino. Since we are using a commercially-available shield, this is not an issue. All we need to do is to declare the default CS (chip select) pin of the Arduino as OUTPUT. This is pin 53 on our Arduino MEGA. On the Ethernet shield, the CS pin is pin number 4. You need to specify this in the code for the SD card to work properly.


To read a file from the SD Card,we will use the SD.h library. This code assumes that the file “ourfile.txt” has already been written to the SD card.


We will create a file, write it, and then read it from SD card.



Author:Tim Youngblood



201802,ArduinoMega 2560,Ethernet  shield module W5100,SD Card