SD Card Shield V4.0 Datasheet by Seeed Technology Co., Ltd
View All Related Products | Download PDF Datasheet
«bseeed
Please note that "Not recommended" means that it might have chance to work with the
platform board however requires extra work such as jump wires or rewriting the code. If
SD Card shield V4.0
This is the newly released SD card V4.0 shield. It provides a storage space for your
Arduino. Users can read/write SD card via Arduino’s built-in SD library. It supports SD,
SDHC and Micro SD cards. It will only occupy the SPI port of your Arduino. Comparing
to previous versions, it combines the standart SD slot and the Micro SD slot into a
standard one, the included adaptor enables using of Micro SD cards . You can stack on
other shields that work with the unused pins. Additionally, the preformed I2C and UART
port facilitates your connection with Grove modules.
Compatibility
We have produced a lot of extension board that can make your platform board more
powerful, however not every extension board is compatible with all the platform board,
here we use a table to illustrate how are those boards compatible with platform board.
Note
Please note that "Not recommended" means that it might have chance to work with the
platform board however requires extra work such as jump wires or rewriting the code. If
you are interested in digging more, welcome to contact with techsupport@seeed.cc.
“ m ’auch 31mm m
Arduinu llnu
Seezdninn Va 2
u... ...m...m
Ardlnnu In.
Snnnduinu m.
u... “mm."
1m [-0)
hm...
a»: Xena-Armani
Arduinu Lcuuirdn
Swans... Uu
bu mmuum
Arduinn m
In mmm
Arduxm Bu:
:1, 3v
m "(mm
ma
Ilium- s»
m "mm.“
mm One
In mm“
2m an.“ H V0 ya u; m n; Y“ 3.:
(m. mm m, szuse'v "nan" Sum ox m "mm“ ”at nmucmud influx: sun. uh m u»
n smug 7:; ye; m u: m M Ma
gm" 3m.“ m V“ v" V” h
an: mm m mmnm u." ”mum u: u: m )qu "mum )la m4
mu mm m m new“ .(m wuly m m Suwu mm mly mm .m m, Ila
hnc smzm v2 0 m y" m nag—ma u: n; v" vu
m 3mm no Vex v" m m m m vu
inwzmeu m m Mum: m y" m m m m vu
ma; 3mm Vex YE: )1: a; No n» u:
_ um and v2 0 m m m u; m «a V::
:v we we «a u m ya no! xecnmmd Yes m as no nu
V “on! m mm v: m m ”mm” In? "mum-1nd m 14., W w rnrmmdsd m ”wounded m m4
Isa» mum gm.“ m m m m m m m u:
no 5).erme u x In xccmgndud m "mnmm 1m "cam-d m m m mm“ Na mm )1» mg
m, SM." n m NM “(mum m "mm“ m n, m mm“ «a ma )1» m4
m. gm.“ v2 7“ a“ "cm-1mm m mama m m m mm“ HM "“7...an m nra-mdld
Click to see full
picture
Application Ideas
If you want to make some awesome projects with SD Card Shield, here are some
projects for your reference.
Here we introduce a project about LinkIt ONE using SD Card.
Music Player with LinkIt One
0000000009 000000005
SD Card ——‘—’ 00
“\U/
50 Ca a Smeld
‘ ooooooba'éooooé
This project uses Grove - Water Sensor to create a simple but effective solution to
watering plants.
Make it NOW!
More Awesome Projects by SD Card
Features
Standard SD card, SDHC card and TF card compatible
UART Grove & I2C connection compatible
Fully supported SD Library
Minimal number of SPI port
Truly stackable
Specifications
Item MinTypicalMaxUnit
Voltage3.55.05.5V
Current0.159100200mA
SupportedCardTypeSDcard(<=32GB);MicroSDcard(<=32GB);SDHCcard(<=32GB)/
Dimension68.7x53.5x19.00mm
NetWeight14.8g
Hardware Overview
Pins usage on Arduino (with SD card)
D4: SD_CS;
D11: SD_DI;
D12: SD_DO;
D13: SD_CLK.
Note
The SD card format can be FAT16 or FAT32.The size of SD card and the SDHC card more than
16GB is not supported.
Usage
The following is the installation of the SD card shield.
Hardware Installation
1. Insert your SD card into the socket, Plug the SD Card Shield onto the Arduino .
2. Connect the Arduino to PC using USB cable.
Note
When you use a Micro SD card, please insert Micro SD card into the adopter, and then insert
the Micro SD card Adopter into the socket as shown below.
02mm 1
v1: mm,
«mm cu v
sent-.3 “a
Sd‘lnlume valve
3am. nu
Jun] ,n
“M m Ans-Lu : 4
When you complete the hardware installation, it should look like this
Upload the program
1. Restart the Arduino IDE. Open "CardInfo"example via the path: File → Examples →
SD → CardInfo.
This example shows how use the utility libraries on which the SD library is based in
order to get info about your SD card.Very useful for testing a card when
You are not sure whether its working or not. There are also many other examples in
this library, like “ReadWrite”. You can always try them out.
«n- 11 um
u" (iy‘n) 200518016
m- mum» 19ml
me Chm) 1m
11.: (mi .1 a. and cm... In. .111 m. 1- mm:
moo-0H1 01mm an
autumn 14:31 15 12W:
sum-11>“ 11 22 23552
ammo—111 1c:sa,1n 111173
2012—11-n 1n» :2 595021
21112414: >12»sa m1:
mun-11% 1122 mam
3012-11—36 11 12 153537
3012-11—26 1233 5mm
2012-11-09 121816
sncmfl m 2012-11419 12:48:18 390
sncmflal. 2012-11-09 12 an 52:12
sm‘Lm 2012-11-09 12 «1! 51710
There is a brief description to above code:
First check if the card is working. If not, there will output some reasons that may
lead to this result.
In the case of the SD card normal work, it will print the SD card type.Then print the
type and size of the FAT-type volume.
Finally, get the files information such as name, date and size in bytes that found on
the card.
2. Upload the code.
3. View Results. You can see the follow image after Click the serial monitor.
4. If an error occurs, please recheck all the previous steps, and make sure the SD
card is working. If none of that fixes the problem, try replacing the SD card.
Note
Arduino default code returns SD size incorrectly if your SD is card more than 4G. The following
code can solve this issue.
ommumma-wN—x
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
/*
SD card test
This example shows how use the utility libraries on which the'
SD library is based in order to get info about your SD card.
Very useful for testing a card when you're not sure whether its working or not.
The circuit:
* SD card attached to SPI bus as follows:
** MOSI - pin 11 on Arduino Uno/Duemilanove/Diecimila
** MISO - pin 12 on Arduino Uno/Duemilanove/Diecimila
** CLK - pin 13 on Arduino Uno/Duemilanove/Diecimila
** CS - depends on your SD card shield or module.
** Pin 4 used here for consistency with other Arduino examples
created 28 Mar 2011
by Limor Fried
modified 9 Apr 2012
by Tom Igoe
*/
// include the SD library:
#include <SPI.h>
#include <SD.h>
// set up variables using the SD utility library functions:
Sd2Card card;
SdVolume volume;
SdFile root;
// change this to match your SD shield or module;
// Arduino Ethernet shield: pin 4
// Adafruit SD shields and modules: pin 10
// Sparkfun SD shield: pin 8
const int chipSelect = 4;
void setup()
{
// Open serial communications and wait for port to open:
Serial.begin(9600);
while (!Serial) {
; // wait for serial port to connect. Needed for Leonardo only
}
Serial.print("\nInitializing SD card...");
// On the Ethernet Shield, CS is pin 4. It's set as an output by default.
// Note that even if it's not used as the CS pin, the hardware SS pin
// (10 on most Arduino boards, 53 on the Mega) must be left as an output
// or the SD library functions will not work.
pinMode(10, OUTPUT); // change this to 53 on a mega
// we'll use the initialization code from the utility libraries
// since we're just testing if the card is working!
if (!card.init(SPI_HALF_SPEED, chipSelect)) {
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
Serial.println("initialization failed. Things to check:");
Serial.println("* is a card is inserted?");
Serial.println("* Is your wiring correct?");
Serial.println("* did you change the chipSelect pin to match your shield or module?");
return;
} else {
Serial.println("Wiring is correct and a card is present.");
}
// print the type of card
Serial.print("\nCard type: ");
switch (card.type()) {
case SD_CARD_TYPE_SD1:
Serial.println("SD1");
break;
case SD_CARD_TYPE_SD2:
Serial.println("SD2");
break;
case SD_CARD_TYPE_SDHC:
Serial.println("SDHC");
break;
default:
Serial.println("Unknown");
}
// Now we will try to open the 'volume'/'partition' - it should be FAT16 or FAT32
if (!volume.init(card)) {
Serial.println("Could not find FAT16/FAT32 partition.\nMake sure you've formatted the card");
return;
}
// print the type and size of the first FAT-type volume
uint64_t volumesize64;
uint32_t volumesize32;
Serial.print("\nVolume type is FAT");
Serial.println(volume.fatType(), DEC);
Serial.println();
volumesize64 = volume.blocksPerCluster(); // clusters are collections of blocks
volumesize64 *= volume.clusterCount(); // we'll have a lot of clusters
volumesize64 *= 512; // SD card blocks are always 512 bytes
Serial.print("Volume size (bytes): ");
printLLNumber(volumesize64, DEC);
Serial.println();
Serial.print("Volume size (Kbytes): ");
volumesize32 = volumesize64/1024;
Serial.println(volumesize32);
Serial.print("Volume size (Mbytes): ");
volumesize32 /= 1024;
Serial.println(volumesize32);
/*uint64_t volumesize;
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
Serial.print("\nVolume type is FAT");
Serial.println(volume.fatType(), DEC);
Serial.println();
volumesize = volume.blocksPerCluster(); // clusters are collections of blocks
volumesize *= volume.clusterCount(); // we'll have a lot of clusters
volumesize *= 512; // SD card blocks are always 512 bytes
Serial.print("Volume size (bytes): ");
Serial.println(volumesize,DEC);
Serial.print("Volume size (Kbytes): ");
volumesize /= 1024;
Serial.println(volumesize,DEC);
Serial.print("Volume size (Mbytes): ");
volumesize /= 1024;
Serial.println(volumesize,DEC);
*/
Serial.println("\nFiles found on the card (name, date and size in bytes): ");
root.openRoot(volume);
// list all files in the card with date and size
root.ls(LS_R | LS_DATE | LS_SIZE);
}
void loop(void) {
}
void printLLNumber(uint64_t n, uint8_t base)
{
unsigned char buf[16 * sizeof(long)];
unsigned int i = 0;
if (n == 0)
{
Serial.print((char)'0');
return;
}
while (n > 0)
{
buf[i++] = n % base;
n /= base;
}
for (; i > 0; i--)
Serial.print((char) (buf[i - 1] < 10 ?
'0' + buf[i - 1] :
'A' + buf[i - 1] - 10));
}
Resources
SD Card Shield v4.0 Schematic
SD Card Shield v4.0 Eagle File.zip
SD Card Shield v4.0a Eagle File.zip
SD Card Shield v4.3 Eagle file.zip
Tech Support
Please submit any technical issue into our forum or drop mail to techsupport@seeed.cc.
http://wiki.seeedstudio.com/SD_Card_shield_V4.0/5‐24‐1
Products related to this Datasheet
SD CARD SHIELD V4