For Projects Like Arduino Door Bell We Need Some Extra Storage & Arduino DIY SD Card Reader and Cheap SD Card Reader Module Becomes Practical Matter. It is true that we can play MP3 with Arduino without SD card, but that has limitations. It may appear silly when cheap Made in China SD card readers avaible at $1.5 but actually DIY can save space or just great to test without much resource. This is a helpful and must to read resource around SD, Micro SD cards :
1 | https://www.arduino.cc/en/Reference/SDCardNotes |
Arduino DIY SD Card Reader
This is diagram of improved version of SD card reader as well as ordinary version :
Possibly the above illustration is enough to understand many things and we need to type to make you reading a lot. But what is that LD1117A33? That LD1117A33 is a voltage regulator, you’ll get datasheet here :
---
1 2 | https://www.sparkfun.com/datasheets/Components/LD1117V33.pdf http://www.taitroncomponents.com/catalog/Datasheet/LD1117A12.pdf |
Any similar voltage regulator will work fine, unlike IC you need not to find exactly the same thing.
Creating a SD card socket is just easy. You need 2 sets to male pin header. Glue them side by side so that the SD card can be plugged within two rows of pins and card’s contacts get contact with the pin headers. This is exactly that is written in details with photographs :
1 | http://www.instructables.com/id/Cheap-DIY-SD-card-breadboard-socket/ |
Cheap SD Card Reader Module
Cheap means, we hunt the cost effective one. Unlike too common Arduino modules like TM1637, these modules, shields are easy to make you rip off exactly like Arduino sound module.
Adafruit’s Micro SD card reader is a good example :
1 | https://www.adafruit.com/product/254 |
But Adafruit’s one is far from being cheap. But datasheet, schematic available:
1 | https://learn.adafruit.com/adafruit-micro-sd-breakout-board-card-tutorial/download |
SparkFun also has similar with shifting level hardware :
1 | https://www.sparkfun.com/products/13743 |
China, Hong Kong products have no quality control and possibly you should not use a substandard cheap SD card reader with a costly SD card. Your card’s death is an important matter. We really can not see, measure much things on China’s usual design of PCB. If you use too cheap card reader, card should be cheap too.
General Matters Around SD/Micro SD Card Reader Modules
We are not going o technical matters like SPI. This is usually the wiring :
This is example test code, you’ll need monitoring at serial monitor :
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 | #include <SD.h> //Include the SD.h Code Library const int chipSelect = 4; //Select at pin 4 void setup() { Serial.begin(9600); //Start Serial Communication Info at boud rate 9600 Serial.print("14CORE SD Initializing..."); // make sure that the default chip select pin is set to // output, even if you don't use it: pinMode(10, OUTPUT); //Define as ouput // Note if the card is present and can be initialized: if (!SD.begin(chipSelect)) { Serial.println("14CORE Card failed, or not present"); //Stop do not do anything return; } Serial.println("card initialized."); } void loop() { // Make a string for assembling the data to log: String dataString = ""; // read three sensors and append to the string: for (int analogPin = 0; analogPin < 3; analogPin++) { int sensor = analogRead(analogPin); dataString += String(sensor); if (analogPin < 2) { dataString += ","; } } File dataFile = SD.open("14COREData.txt", FILE_WRITE); // Write if (dataFile) { dataFile.println(dataString); dataFile.close(); Serial.println(dataString); } else { Serial.println("Error opening 14COREData.txt Data"); // Failed to read the file } } |